mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-26 02:11:36 -04:00
fix: wire cdrom_tick into vblank interval, fire IRQ on command completion
Two CDROM issues preventing BIOS from progressing past Sony logo: 1. cdrom_tick() was never called — delayed CDROM responses (GetStatus, Init, Pause) never completed because pending.delay was never decremented. Wired into psx_check_interrupts vblank interval. 2. exec_command() called set_irq() but not fire_cdrom_irq() for immediate responses (GetStat, SetLoc, Demute, etc.). The CDROM IRQ flag was set internally but i_stat bit 2 was never raised, so the BIOS exception handler never delivered CDROM events. BIOS still stalls at same draw count — next bug in chain is EvCB event delivery (TestEvent returns 0 because VBlank events aren't being written to the event control block table). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -286,6 +286,10 @@ static void exec_command(uint8_t cmd) {
|
||||
}
|
||||
|
||||
param_count = 0;
|
||||
|
||||
/* Fire the CDROM IRQ for the immediate response.
|
||||
* Delayed responses (pending) fire from process_pending(). */
|
||||
fire_cdrom_irq();
|
||||
}
|
||||
|
||||
static void process_pending(void) {
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "sio.h"
|
||||
#include "timers.h"
|
||||
#include "gpu.h"
|
||||
#include "cdrom.h"
|
||||
#include "cpu_state.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -102,6 +103,7 @@ void psx_check_interrupts(CPUState* cpu) {
|
||||
i_stat |= (1 << IRQ_VBLANK);
|
||||
gpu_vblank_tick(); /* Toggle LCF (GPUSTAT bit 31) */
|
||||
timers_tick(33868); /* ~1 NTSC frame worth of cycles */
|
||||
cdrom_tick(); /* Process pending CDROM responses */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user