Skip to content

Preserve BSS ranges when N64 discovery splits a segment - #3

Merged
RetroGameDeveloper merged 2 commits into
mainfrom
codex/n64-bss-import
Oct 23, 2026
Merged

RetroGameDeveloper merged 2 commits into
mainfrom
codex/n64-bss-import

Conversation

@RetroGameDeveloper

@RetroGameDeveloper RetroGameDeveloper commented Oct 23, 2026 •

Copy link
Copy Markdown

Summary

Preserve an explicit BSS address range when additional N64 code segments split the original parent segment's ROM-backed data.

Splat computes a parent VRAM end from its ROM length plus bss_size. Inserting discovered segments shortens the original ROM range, which could move that computed end below its unchanged explicit BSS start and stop import. Preserve the original parent end and translate the parent extent into the actual BSS size during standalone export.

Verification

  • Synthetic regression uses splat's segment parser to verify the original BSS start/end, canonical exported BSS size, and repeated-discovery stability.
  • Combined N64/RNC/export tests: 23 passed, 1 skipped (unavailable toolchain).
  • ruff check src tests projects passed.
  • Private ROM import that previously failed now succeeds. No proprietary game code, binaries, disassembly, or identifying fixtures included.

Private full-rebuild verification exposed a second export issue: startup assembly retained a known function alias after discovery named that function by address. Preserve those original symbol-file aliases in the standalone linker, without inventing addresses or relaxing the byte comparison. The export regression checks the saved alias address.

Full private cartridge verification passed after both repairs: all-assembly export (zero C selections) reproduces the complete normalized 12 MiB input byte for byte. Generated artifacts remain outside the repository.

@RetroGameDeveloper
RetroGameDeveloper merged commit f4702cb into main Oct 23, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant