From 0dc30f081a3cad084c6e086a08f6849b14485c40 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Sat, 17 Mar 2018 23:21:14 +0200 Subject: [PATCH] CGB halt interrupt timing --- Core/z80_cpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/z80_cpu.c b/Core/z80_cpu.c index 0b582c4..dc93ffa 100644 --- a/Core/z80_cpu.c +++ b/Core/z80_cpu.c @@ -1367,14 +1367,14 @@ void GB_cpu_run(GB_gameboy_t *gb) return; } - if (gb->halted) { + if (gb->halted && !gb->is_cgb) { GB_advance_cycles(gb, 2); } uint8_t interrupt_queue = gb->interrupt_enable & gb->io_registers[GB_IO_IF] & 0x1F; if (gb->halted) { - GB_advance_cycles(gb, 2); + GB_advance_cycles(gb, gb->is_cgb? 4 : 2); } bool effecitve_ime = gb->ime;