From 05403d3a56883b8acee642c5b85e801281ed66d1 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Fri, 27 Mar 2020 17:36:55 +0300 Subject: [PATCH] Fix the Joypad interrupt. Fixes #237 --- Core/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/memory.c b/Core/memory.c index d3d9aaa..148c986 100644 --- a/Core/memory.c +++ b/Core/memory.c @@ -780,7 +780,7 @@ static void write_high_memory(GB_gameboy_t *gb, uint16_t addr, uint8_t value) } else if ((gb->io_registers[GB_IO_JOYP] & 0x30) != (value & 0x30)) { GB_sgb_write(gb, value); - gb->io_registers[GB_IO_JOYP] = value & 0xF0; + gb->io_registers[GB_IO_JOYP] = (value & 0xF0) | (gb->io_registers[GB_IO_JOYP] & 0x0F); GB_update_joyp(gb); } return;