From ef8f3aff66b1217d8f99c1d3215d5f487f2d1c7f Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Sat, 11 Feb 2023 21:56:03 +0200 Subject: [PATCH] A bit more correct --- Core/memory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/memory.c b/Core/memory.c index 441c869..292efd7 100644 --- a/Core/memory.c +++ b/Core/memory.c @@ -1546,8 +1546,8 @@ static void write_high_memory(GB_gameboy_t *gb, uint16_t addr, uint8_t value) if (delay && gb->model == GB_MODEL_MGB) { delay -= 16; } - if (delay) { - gb->joyp_switching_delay = MAX(gb->joyp_switching_delay, delay); + gb->joyp_switching_delay = MAX(gb->joyp_switching_delay, delay); + if (gb->joyp_switching_delay) { value &= gb->io_registers[GB_IO_JOYP]; gb->joypad_is_stable = false; }