mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-26 02:11:36 -04:00
2767018b46
Root cause: BIOS pad handler polls I_STAT bit 7 waiting for SIO ACK IRQ. sio_tick() was only called from psx_check_interrupts and SIO register accesses, but I_STAT reads go through memory.c which never called sio_tick(). The IRQ countdown was stuck during the polling loop, causing the BIOS to time out and report "no pad found" (0xFF). Additionally, sio_tick() in psx_check_interrupts fired the IRQ too early — during BIOS delay loops BEFORE I_STAT bit 7 was cleared — so the BIOS cleared it and never saw it re-appear. Fixes: - memory.c: Call sio_tick() on I_STAT reads (32/16/8-bit paths) - interrupts.c: Remove sio_tick() from psx_check_interrupts - debug_server.c: Don't clear input override on TCP disconnect (was wiping override before next VBlank could read it) - debug_server.c: sio_state reports real pad_buttons via getter - sio.c/sio.h: Add sio_get_pad_buttons() for debug server - seeds: Add 20 new seeds for shell input and CARD driver functions Result: Pad buffer at 0x80083E30 shows status=0x00 (pad found), type=0x41 (digital), buttons reflect keyboard/override state. Only 5 COP2/GTE dispatch misses remain (Phase 5). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>