GBA Memory: Fix VCOUNT being writable
Jeffrey Pfau jeffrey@endrift.com
Sun, 30 Oct 2016 02:52:20 -0700
2 files changed,
6 insertions(+),
1 deletions(-)
M
CHANGES
→
CHANGES
@@ -21,6 +21,7 @@ - GB MBC: Fix initializing MBC when no ROM is loaded
- VFS: Fix resizing memory chunks when not needed - GB Memory: Fix patching ROM bank 0 - GB: Fix audio not being deinitialized + - GBA Memory: Fix VCOUNT being writable Misc: - SDL: Remove scancode key input - GBA Video: Clean up unused timers
M
src/gba/io.c
→
src/gba/io.c
@@ -336,7 +336,7 @@ gba->memory.io[REG_BG3PD >> 1] = 0x100;
} void GBAIOWrite(struct GBA* gba, uint32_t address, uint16_t value) { - if (address < REG_SOUND1CNT_LO && address != REG_DISPSTAT) { + if (address < REG_SOUND1CNT_LO && (address > REG_VCOUNT || address == REG_DISPCNT)) { value = gba->video.renderer->writeVideoRegister(gba->video.renderer, address, value); } else { switch (address) {@@ -344,6 +344,10 @@ // Video
case REG_DISPSTAT: value &= 0xFFF8; GBAVideoWriteDISPSTAT(&gba->video, value); + return; + + case REG_VCOUNT: + mLOG(GBA_IO, GAME_ERROR, "Write to read-only I/O register: %03X", address); return; // Audio