diff --git a/docs/Adding-Symbols.md b/docs/Adding-Symbols.md index e511108e..38e77ed1 100644 --- a/docs/Adding-Symbols.md +++ b/docs/Adding-Symbols.md @@ -196,6 +196,20 @@ obj_fallCA1_tex_rgb_ia8 = 0x06013118; // allow_duplicated:True obj_fallCA1_tex_rgb_ia8 = 0x060140A8; // allow_duplicated:True ``` +### `use_non_matching_label` + +Tells spimdisasm to add the non matching label to a symbol. + +This can be used to keep handwritten assembly extracted by splat without counting against the total matching progress. + +Defaults to `True`. + +**Example:** + +```ini +dummy_func = 0x80200060; // use_non_matching_label:False +``` + ### `filename` Allows specifying a different filename than the default (the symbol's name) when writing the symbol to its own file. diff --git a/pyproject.toml b/pyproject.toml index 9c4d794e..3daf8e9a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ dependencies = [ [project.optional-dependencies] mips = [ - "spimdisasm>=1.39.0,<2.0.0", # This value should be keep in sync with the version listed on disassembler/spimdisasm_disassembler.py + "spimdisasm>=1.40.0,<2.0.0", # This value should be keep in sync with the version listed on disassembler/spimdisasm_disassembler.py "rabbitizer>=1.12.0,<2.0.0", "pygfxd>=1.0.5", "n64img>=0.3.3", diff --git a/requirements.txt b/requirements.txt index a2413cd2..2d471d6f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ tqdm==4.67.1 intervaltree==3.1.0 colorama==0.4.6 # This value should be keep in sync with the version listed on disassembler/spimdisasm_disassembler.py and pyproject.toml -spimdisasm>=1.39.0 +spimdisasm>=1.40.0 rabbitizer>=1.10.0 pygfxd>=1.0.5 n64img>=0.1.4 diff --git a/src/splat/disassembler/spimdisasm_disassembler.py b/src/splat/disassembler/spimdisasm_disassembler.py index a9c60592..cf2406a3 100644 --- a/src/splat/disassembler/spimdisasm_disassembler.py +++ b/src/splat/disassembler/spimdisasm_disassembler.py @@ -7,7 +7,7 @@ class SpimdisasmDisassembler(disassembler.Disassembler): # This value should be kept in sync with the version listed on requirements.txt and pyproject.toml - SPIMDISASM_MIN = (1, 39, 0) + SPIMDISASM_MIN = (1, 40, 0) def configure(self): # Configure spimdisasm diff --git a/src/splat/util/symbols.py b/src/splat/util/symbols.py index a5cc8a24..cc38bb10 100644 --- a/src/splat/util/symbols.py +++ b/src/splat/util/symbols.py @@ -268,6 +268,8 @@ def get_seg_for_rom(rom: int) -> Optional["Segment"]: if attr_name == "allow_duplicated": sym.allow_duplicated = True continue + if attr_name == "use_non_matching_label": + sym.use_non_matching_label = tf_val if ignore_sym: if sym.given_size is None or sym.given_size == 0: @@ -546,6 +548,8 @@ def add_symbol_to_spim_segment( context_sym.visibility = sym.given_visibility if sym.given_align: context_sym.setAlignment(sym.given_align) + if sym.use_non_matching_label is not None: + context_sym.useNonMatchingLabel = sym.use_non_matching_label return context_sym @@ -596,6 +600,8 @@ def add_symbol_to_spim_section( context_sym.visibility = sym.given_visibility if sym.given_align: context_sym.setAlignment(sym.given_align) + if sym.use_non_matching_label is not None: + context_sym.useNonMatchingLabel = sym.use_non_matching_label return context_sym @@ -702,6 +708,8 @@ class Symbol: given_align: Optional[int] = None + use_non_matching_label: Optional[bool] = None + _generated_default_name: Optional[str] = None _last_type: Optional[str] = None