GB IO: Unused MMIO bits read high

This commit is contained in:
Jeffrey Pfau 2016-01-20 21:58:36 -08:00
parent e284a059a2
commit 73e3532277
1 changed files with 2 additions and 2 deletions

View File

@ -63,7 +63,7 @@ void GBIOWrite(struct GB* gb, unsigned address, uint8_t value) {
value = GBTimerUpdateTAC(&gb->timer, value);
break;
case REG_IF:
gb->memory.io[REG_IF] = value;
gb->memory.io[REG_IF] = value | 0xE0;
GBUpdateIRQs(gb);
return;
case REG_LCDC:
@ -109,7 +109,7 @@ static uint8_t _readKeys(struct GB* gb) {
// ???
break;
}
return (gb->memory.io[REG_JOYP] | 0xF) ^ (keys & 0xF);
return 0xC0 | (gb->memory.io[REG_JOYP] | 0xF) ^ (keys & 0xF);
}
uint8_t GBIORead(struct GB* gb, unsigned address) {