diff --git a/Core/memory.c b/Core/memory.c index 5a0daf2bc..b6690ed58 100644 --- a/Core/memory.c +++ b/Core/memory.c @@ -1399,7 +1399,9 @@ static void write_high_memory(GB_gameboy_t *gb, uint16_t addr, uint8_t value) gb->wy_triggered = true; } case GB_IO_WX: + gb->io_registers[addr & 0xFF] = value; GB_update_wx_glitch(gb); + break; case GB_IO_IF: case GB_IO_SCX: case GB_IO_SCY: diff --git a/Core/sm83_cpu.c b/Core/sm83_cpu.c index 44638a28c..d64a93828 100644 --- a/Core/sm83_cpu.c +++ b/Core/sm83_cpu.c @@ -431,9 +431,7 @@ static void stop(GB_gameboy_t *gb, uint8_t opcode) gb->speed_switch_freeze = 1; } - if (interrupt_pending) { - } - else { + if (!interrupt_pending) { gb->speed_switch_halt_countdown = 0x20008; gb->speed_switch_freeze = 5; }