all repos — mgba @ a6cd5f44dbd25e8420d3f0643a2b3bbd607d99bb

mGBA Game Boy Advance Emulator

GBA Memory: Fix VCOUNT being writable
Jeffrey Pfau jeffrey@endrift.com
Sun, 30 Oct 2016 02:52:20 -0700
commit

a6cd5f44dbd25e8420d3f0643a2b3bbd607d99bb

parent

40c6304cf045fe977eb0aaf3e7aa696fe588f000

2 files changed, 6 insertions(+), 1 deletions(-)

jump to
M CHANGESCHANGES

@@ -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.csrc/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