Skip to content

Support RNC-packed N64 code and verify original-cartridge exports - #2

Merged
RetroGameDeveloper merged 3 commits into
mainfrom
codex/rom-import-workflow
Oct 23, 2026
Merged

RetroGameDeveloper merged 3 commits into
mainfrom
codex/rom-import-workflow

Conversation

@RetroGameDeveloper

@RetroGameDeveloper RetroGameDeveloper commented Oct 23, 2026 •

Copy link
Copy Markdown

Summary

  • Decode bounded RNC method-1 containers with both CRC16 checks, and discover packed N64 program blocks without importing ordinary assets as code.
  • Reconstruct packed code from linked output using a verified compression template; compare both the expanded analysis image and the original normalized cartridge.
  • Reject incompatible template edits and unsupported expanded-image reconstruction instead of reporting an analysis-only export as an original-cartridge match.
  • Make generated linker symbols valid when a segment's hexadecimal name starts with a digit.
  • Document private expanded/original inputs and distinguish assembly fallbacks from C progress.

Verification

  • 18 synthetic RNC/code-discovery tests pass, including literal boundaries, overlapping copies, checksum failures, limits, changed-literal reconstruction, incompatible edits, and preservation of rebuilt prefix bytes.
  • Existing homemade N64 export/rebuild test passes, including a numeric segment name regression.
  • uv run ruff check src tests projects passes.
  • Local private-ROM analysis: independent decoder outputs agree, fresh automatic import discovers the packed program, and several hundred functions pass the unchanged linked-byte judge. No cartridge bytes, recovered source, disassembly, game names, or compiler binaries are included.

Full local cartridge verification passed: the exported tree selected 419 C functions and reconstructed the original normalized cartridge byte for byte, including the packed program. Remaining functions were assembly; this does not imply a complete decompilation. The generated-address regression also verifies that arbitrary unresolved names still fail to link.

@RetroGameDeveloper
RetroGameDeveloper marked this pull request as ready for review October 23, 2026 17:03
@RetroGameDeveloper
RetroGameDeveloper merged commit 2025fd3 into main Oct 23, 2026
4 checks passed
@RetroGameDeveloper
RetroGameDeveloper deleted the codex/rom-import-workflow branch October 23, 2026 19:56
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