mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-26 02:11:36 -04:00
f47310bede
Tomba2's attract loop-back runs a BIOS bzero + read sweep over a wild
0xDF80xxxx (KSEG2) pointer. Three unfaithful behaviors surfaced, each a
fatal-halt in sequence (f9705/f10002):
1. Flat 'addr & 0x1FFFFFFF' decode routed KSEG2 onto LIVE registers —
the sweep zeroed the SIO/memctrl I/O block byte-by-byte. Real
hardware maps nothing in KSEG2 beyond cache control; Beetle
(cpu.cpp addr_mask[6..7]=0xFFFFFFFF) leaves it unmapped. All six
CPU accessors now no-op KSEG2 (counted: g_kseg2_ignored_*).
2. Memory-control block (0x1F801000..0x103C) and RAM_SIZE (0x1F801060)
had 32-bit-only handlers; byte/halfword lanes now RMW faithfully.
3. Unmapped registers INSIDE the I/O window (0x1F8010F8, SIO1 bytes,
etc.) fatal'd on access; real hardware open-buses them and Beetle
returns 0/ignores. The MMIO window tails and dma_read/write_masked
unknown offsets are now counted open-bus (g_io_openbus_*); the
always-on MMIO rings keep every such access observable.
Validated: attract runs 60fps past both fatal points through multiple
demo cycles. Known next: the attract loop-back logo REPLAY soft-locks
(guest-side; boot-time logo plays fine) — first reachable with this fix.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>