diff --git a/runtime/src/cdrom.c b/runtime/src/cdrom.c index f7af055a..c9ea0ebb 100644 --- a/runtime/src/cdrom.c +++ b/runtime/src/cdrom.c @@ -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) { diff --git a/runtime/src/interrupts.c b/runtime/src/interrupts.c index b307fb18..3b7ecd17 100644 --- a/runtime/src/interrupts.c +++ b/runtime/src/interrupts.c @@ -29,6 +29,7 @@ #include "sio.h" #include "timers.h" #include "gpu.h" +#include "cdrom.h" #include "cpu_state.h" #include #include @@ -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 */ } }