mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-26 02:11:36 -04:00
a3f57ec570
The shell CD-init (ROM 0x1DF50) sets kernel flag [0xA000DFFC]=1 when the CD controller version high byte (Test sub-cmd 0x20) is >= 0x95; the boot CD-open (0xBFC0D570) then issues a ReadTOC gated on that flag. We returned the PSone-era 0x97 0x01 0x10 0xC2 (copied from beetle, which hardcodes it) — wrong for the SCPH-1001 BIOS, whose 1994 sub-CPU reports 0x94 0x09 0x19 0xC0. With the correct value the flag stays clear, the spurious frame-890 ReadTOC is gone, and the boot command stream matches the oracle exactly. Found via self-stop trap + fntrace-all + gdb watchpoint on [0xDFFC] + capstone tracing the flag setter and its version check. Also adds a symmetric self-stop trap to psx-beetle's CD-command hook so the oracle can be frozen at the same boot point for state diffs. Honest status: this closes the boot-flow divergence but the game still wedges downstream in its OWN CD-init retry (GetStat/Init loop from game pc 0x63A14); that is a separate issue, documented in docs/kula-world-findings.md round 6. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BdjxoRB1f9VQsNzZayCgGS