Skip to content

Commit

Permalink
[GB] Emulate read-only bits for STAT register
Browse files Browse the repository at this point in the history
  • Loading branch information
shonumi committed Aug 26, 2015
1 parent f94dfc4 commit 29186c8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/dmg/mmu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,15 @@ void DMG_MMU::write_u8(u16 address, u8 value)
}
}

//STAT
else if(address == REG_STAT)
{
u8 read_only_bits = (memory_map[REG_STAT] & 0x7);

memory_map[address] = (value & ~0x7);
memory_map[address] |= read_only_bits;
}

//Scroll Y
else if(address == REG_SY)
{
Expand Down

0 comments on commit 29186c8

Please sign in to comment.