Skip to content

ProjectRedDoor 0.2.0

Choose a tag to compare

@github-actions github-actions released this 30 Nov 19:09
· 9 commits to main since this release

ProjectRedDoor 0.2.0 — the stage plays

Fixed: entering the first stage ended it instantly. The object gate 0x0BF4B6, running as recompiled code,
rejected the player object: the actor was installed with the delayed handler 0x0BE43C instead of 0x0BE400, its
one-frame countdown expired and the game showed INSERT COIN TO CONTINUE with a 20 s timer. The gate now runs in the
interpreter. Coin, start, character select, the mission-1 cutscene and the stage all work, the player walks and shoots,
and the mission timer runs.

Why it took so long, and what changed because of it. --native-verify compares only the calls that run natively
and treated a translation's return -1 as "nothing to compare". 0x0BF4B6 is reached four times in a thousand
frames, always with a different object state, so the one call that mattered was never compared and the routine was
admitted as clean. Now:

  • the verifier and tools/merge_profiles.py mark a routine dirty when its translation bails on more than 2 % of its
    calls, and profiles carry calls/bails so the merge applies the same rule;
  • debug aids added along the way: RD_WTRACE (every Work RAM write with its game clock and writer), RD_PCTRACE_FRAME
    (ordered entry trace inside one frame), RD_CALLTRACE, RD_PRESS_GAME (press windows on the game's own frame
    counter), RD_TRACE_IRQ, RD_TRACE_ENTRY, RD_MMIO_TRACE, RD_VERIFY_ALL / RD_VERIFY_FROM.

Known open defect: about 1600 frames into the first stage the CPU stops kicking the watchdog and the board
reboots (native only; the interpreter does not). The attract sequence then restarts. Next on the list.

ProjectRedDoor 0.1.0 — first release: Elevator Action Returns

ProjectRedDoor starts as a separate project, built on ReplicantGaiden's host/machine layer and on the Elevator Action
Returns decompilation in Taitof3Decomp.

Recompiled game code

  • The game's own program, translated to C, is hooked at 1540 ROM entry points: 1507 plain routines and 33 segments
    (task resumptions that stop at a TRAP, a tail jump or an RTE and report their exit PC).
  • A routine runs as native C only if --native-verify matched it against the Musashi interpreter on every recorded call
    (registers, all eight RAM regions and the MMIO write stream). Everything else — undecompiled paths, routines that
    differ, routines whose continuation cannot be reconstructed — rolls back its writes and runs in the interpreter.
  • New continuation rule for this game: a translation resumes through the stack (RTS) or at the PC it reports in r->pc;
    neither means "revert and interpret", instead of guessing a PC. Segments and IRQ prologues that only the ROM's own
    control flow knows how to continue no longer corrupt the CPU state.

Machine and video

  • ROM set retargeted to elvactr (Ver 2.2O 1995/02/20), matched by CRC32, so renamed files and merged sets load.
  • F3 playfield configuration for this game (f3_config: extend 1, 232 lines from line 24, sprite lag 2): four 64×32
    playfields of 0x2000 bytes, no alternate-tilemap select. The renderer takes the layout as an input
    (playfield_extend), so the Darius Gaiden 8×32×32 layout still works unchanged.
  • Boots through the board's own start-up: 128 KiB RAM test, settings rebuild, 93C46 settings check, video init.

Verification

  • The 93C46 is the emulated board's device for both paths: routines that carry their own EEPROM model see the board's
    pins and ready line, which is what makes the settings check pass natively as it does interpreted.
  • Trial runs apply the memory the game reads back inside one call (sound DPRAM, video control words, EEPROM pins) and
    restore it afterwards, so a native trial takes the same branches as the interpreter.
  • --native-report now reports the share of emulated cycles that ran as recompiled code.

Packaging

  • Same four targets as ReplicantGaiden: Linux x86_64, Linux arm64, Windows x64 (static MinGW runtime), macOS universal,
    plus a PortMaster zip built against glibc 2.17.
  • src/native/native_profile.tsv (addresses, status and cycle costs; no ROM content) ships so the first run already
    uses the verified subset.

Known limits

  • No frame-exact comparison against MAME for this game yet (the renderer's raster path was validated on ReplicantGaiden).
  • No handheld testing on real devices yet.
  • See docs/NATIVE_TABLE.md for the routines that stay interpreted, and why.