From 89094950f85e201be12ccef3bed8657a927002b2 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Sat, 7 Apr 2018 16:45:31 +0300 Subject: [PATCH] Correct emulation of mapping both button sets. Fixes #60 --- Core/joypad.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Core/joypad.c b/Core/joypad.c index 15885d3..8b7a8da 100644 --- a/Core/joypad.c +++ b/Core/joypad.c @@ -39,10 +39,8 @@ void GB_update_joyp(GB_gameboy_t *gb) break; case 0: - /* Todo: verifiy this is correct */ for (uint8_t i = 0; i < 4; i++) { - gb->io_registers[GB_IO_JOYP] |= (!gb->keys[i]) << i; - gb->io_registers[GB_IO_JOYP] |= (!gb->keys[i + 4]) << i; + gb->io_registers[GB_IO_JOYP] |= (!(gb->keys[i] || gb->keys[i + 4])) << i; } break;