From 3fbc2c5716f22165d85281eb019d3dbd27665184 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Wed, 15 Feb 2017 19:04:53 +0200 Subject: [PATCH] DI should not be delayed. --- Core/z80_cpu.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Core/z80_cpu.c b/Core/z80_cpu.c index 4f1fab9..06f52ba 100644 --- a/Core/z80_cpu.c +++ b/Core/z80_cpu.c @@ -1061,15 +1061,10 @@ static void ld_a_da16(GB_gameboy_t *gb, uint8_t opcode) static void di(GB_gameboy_t *gb, uint8_t opcode) { + /* DI is NOT delayed, not even on a CGB. Mooneye's di_timing-GS test fails on a CGB + for different reasons.*/ GB_advance_cycles(gb, 4); - - /* di is delayed in CGB */ - if (!gb->is_cgb) { - gb->ime = false; - } - else if (gb->ime) { - gb->ime_toggle = true; - } + gb->ime = false; } static void ei(GB_gameboy_t *gb, uint8_t opcode)