Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,18 @@ Global option for the rodata string guesser. 0 disables the guesser completely.

Global option for the data string guesser. 0 disables the guesser completely.

### create_data_pads

Tells the disassembler whether to create dummy and unreferenced data symbols after symbols with a non-zero user-declared size.

### create_rodata_pads

Tells the disassembler whether to create dummy and unreferenced rodata symbols after symbols with a non-zero user-declared size.

### create_bss_pads

Tells the disassembler whether to create dummy and unreferenced bss/sbss symbols after symbols with a non-zero user-declared size.

### allow_data_addends

Global option for allowing data symbols using addends on symbol references. It can be overriden per symbol
Expand Down
15 changes: 15 additions & 0 deletions src/splat/disassembler/spimdisasm_disassembler.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,21 @@ def configure(self):
options.opts.data_string_guesser_level
)

if options.opts.create_data_pads is not None:
spimdisasm.common.GlobalConfig.CREATE_DATA_PADS = (
options.opts.create_data_pads
)

if options.opts.create_rodata_pads is not None:
spimdisasm.common.GlobalConfig.CREATE_RODATA_PADS = (
options.opts.create_rodata_pads
)

if options.opts.create_bss_pads is not None:
spimdisasm.common.GlobalConfig.CREATE_BSS_PADS = (
options.opts.create_bss_pads
)

rabbitizer.config.regNames_userFpcCsr = False
rabbitizer.config.regNames_vr4300Cop0NamedRegisters = False

Expand Down
9 changes: 9 additions & 0 deletions src/splat/util/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,12 @@ class SplatOpts:
rodata_string_guesser_level: Optional[int]
# Global option for the data string guesser. 0 disables the guesser completely.
data_string_guesser_level: Optional[int]
# Tells the disassembler whether to create dummy and unreferenced data symbols after another symbol with non-zero user-declared size.
create_data_pads: Optional[bool]
# Tells the disassembler whether to create dummy and unreferenced rodata symbols after another symbol with non-zero user-declared size.
create_rodata_pads: Optional[bool]
# Tells the disassembler whether to create dummy and unreferenced bss/sbss symbols after another symbol with non-zero user-declared size.
create_bss_pads: Optional[bool]
# Global option for allowing data symbols using addends on symbol references. It can be overriden per symbol
allow_data_addends: bool
# Tells the disassembler to try disassembling functions with unknown instructions instead of falling back to disassembling as raw data
Expand Down Expand Up @@ -618,6 +624,9 @@ def parse_include_asm_macro_style() -> Literal["default", "maspsx_hack"]:
data_string_guesser_level=p.parse_optional_opt(
"data_string_guesser_level", int
),
create_data_pads=p.parse_optional_opt("create_data_pads", bool),
create_rodata_pads=p.parse_optional_opt("create_rodata_pads", bool),
create_bss_pads=p.parse_optional_opt("create_bss_pads", bool),
allow_data_addends=p.parse_opt("allow_data_addends", bool, True),
header_encoding=p.parse_opt("header_encoding", str, "ASCII"),
gfx_ucode=p.parse_opt_within(
Expand Down
Loading