Correct emulation of mapping both button sets. Fixes #60

This commit is contained in:
Lior Halphon 2018-04-07 16:45:31 +03:00
parent 5be2b3db29
commit 89094950f8
1 changed files with 1 additions and 3 deletions

View File

@ -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;