Skip to content

Commit

Permalink
docs and version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
AngheloAlf committed Feb 1, 2024
1 parent 738f957 commit ae531a9
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# splat Release Notes

### 0.21.7

* New attribute for symbols: `allow_duplicated`
* Allows to lift the duplicated symbol restriction for the specified symbols, allowing to have specific symbols that are not checked for shared vrams or names but keeping the check for everything else.

### 0.21.6

* Fix `bss_contains_common` option not being passed to "auto all" inserted sections.
Expand Down
13 changes: 13 additions & 0 deletions docs/Adding-Symbols.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,16 @@ This attribute overrides the global `allow_data_addends` option.
```ini
aspMainTextStart = 0x80084760; // dont_allow_addend:True
```

### `allow_duplicated`

Tells splat that a symbol is allowed to have its vram/name duplicated with another symbol.

This attribute has to be specified on all symbols that share the same vram or name.

**Example**
```ini
obj_fallCA1_tex_rgb_ia8 = 0x06013118; // allow_duplicated:True
// ...
obj_fallCA1_tex_rgb_ia8 = 0x060140A8; // allow_duplicated:True
```
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "splat64"
# Should be synced with src/splat/__init__.py
version = "0.21.6"
version = "0.21.7"
description = "A binary splitting tool to assist with decompilation and modding projects"
readme = "README.md"
license = {file = "LICENSE"}
Expand Down
10 changes: 5 additions & 5 deletions src/splat/util/symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def get_seg_for_rom(rom: int) -> Optional["Segment"]:
if not sym.allow_duplicated or not seen_symbols[sym.name].allow_duplicated:
log.parsing_error_preamble(path, line_num, line)
log.error(
f"Duplicate symbol detected! {sym.name} has already been defined at vram 0x{seen_symbols[sym.name].vram_start:X}"
f"Duplicate symbol detected! {sym.name} has already been defined at vram 0x{seen_symbols[sym.name].vram_start:08X}"
)

if addr in all_symbols_dict:
Expand All @@ -265,7 +265,7 @@ def get_seg_for_rom(rom: int) -> Optional["Segment"]:
if not sym.allow_duplicated or not item.allow_duplicated:
log.parsing_error_preamble(path, line_num, line)
log.error(
f"Duplicate symbol detected! {sym.name} clashes with {item.name} defined at vram 0x{addr:X}.\n If this is intended, specify either a segment or a rom address for this symbol"
f"Duplicate symbol detected! {sym.name} clashes with {item.name} defined at vram 0x{addr:08X}.\n If this is intended, specify either a segment or a rom address for this symbol"
)

seen_symbols[sym.name] = sym
Expand Down Expand Up @@ -370,13 +370,13 @@ def initialize_spim_context(all_segments: "List[Segment]") -> None:
for ovl_segment in overlay_segments:
assert (
ovl_segment.vramStart <= ovl_segment.vramEnd
), f"{ovl_segment.vramStart:X} {ovl_segment.vramEnd:X}"
), f"{ovl_segment.vramStart:08X} {ovl_segment.vramEnd:08X}"
if (
ovl_segment.vramEnd > global_vram_start
and global_vram_end > ovl_segment.vramStart
):
log.write(
f"Warning: the vram range ([0x{ovl_segment.vramStart:X}, 0x{ovl_segment.vramEnd:X}]) of the non-global segment at rom address 0x{ovl_segment.vromStart:X} overlaps with the global vram range ([0x{global_vram_start:X}, 0x{global_vram_end:X}])",
f"Warning: the vram range ([0x{ovl_segment.vramStart:08X}, 0x{ovl_segment.vramEnd:08X}]) of the non-global segment at rom address 0x{ovl_segment.vromStart:X} overlaps with the global vram range ([0x{global_vram_start:08X}, 0x{global_vram_end:08X}])",
status="warn",
)

Expand Down Expand Up @@ -600,7 +600,7 @@ def format_name(self, format: str) -> str:
if "$ROM" in ret:
if not isinstance(self.rom, int):
log.error(
f"Attempting to rom-name a symbol with no ROM address: {self.vram_start:X} typed {self.type}"
f"Attempting to rom-name a symbol with no ROM address: {self.vram_start:08X} typed {self.type}"
)
ret = ret.replace("$ROM", f"{self.rom:X}")

Expand Down

0 comments on commit ae531a9

Please sign in to comment.