From f4c5cf20bc2b0643548cc918333738bac2b9c5de Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Fri, 16 Sep 2016 13:27:32 +0300 Subject: [PATCH] Cleanup of ret_cc --- Core/z80_cpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Core/z80_cpu.c b/Core/z80_cpu.c index e6733b8..cf72e9b 100644 --- a/Core/z80_cpu.c +++ b/Core/z80_cpu.c @@ -731,7 +731,8 @@ static void halt(GB_gameboy_t *gb, uint8_t opcode) static void ret_cc(GB_gameboy_t *gb, uint8_t opcode) { /* Todo: Verify timing */ - if (condition_code(gb, GB_read_memory(gb, gb->pc++))) { + gb->pc++; + if (condition_code(gb, opcode)) { GB_debugger_ret_hook(gb); GB_advance_cycles(gb, 8); gb->pc = GB_read_memory(gb, gb->registers[GB_REGISTER_SP]);