all repos — mgba @ 9e518fb27a9aa6c324fe4fd3ec66181471569450

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

9e518fb27a9aa6c324fe4fd3ec66181471569450

parent

c8e0bf5769761e6a53413b4e25228e5bbe18a2e8

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

jump to
M CHANGESCHANGES

@@ -13,6 +13,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: - PSP2: Improved controller rumble - GB, GBA: Prevent loading null ROMs
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