GBA Memory: Fix VCOUNT being writable

This commit is contained in:
Jeffrey Pfau 2016-10-30 02:52:20 -07:00
parent c8e0bf5769
commit 9e518fb27a
2 changed files with 6 additions and 1 deletions

View File

@ -13,6 +13,7 @@ Bugfixes:
- VFS: Fix resizing memory chunks when not needed - VFS: Fix resizing memory chunks when not needed
- GB Memory: Fix patching ROM bank 0 - GB Memory: Fix patching ROM bank 0
- GB: Fix audio not being deinitialized - GB: Fix audio not being deinitialized
- GBA Memory: Fix VCOUNT being writable
Misc: Misc:
- PSP2: Improved controller rumble - PSP2: Improved controller rumble
- GB, GBA: Prevent loading null ROMs - GB, GBA: Prevent loading null ROMs

View File

@ -336,7 +336,7 @@ void GBAIOInit(struct GBA* gba) {
} }
void GBAIOWrite(struct GBA* gba, uint32_t address, uint16_t value) { 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); value = gba->video.renderer->writeVideoRegister(gba->video.renderer, address, value);
} else { } else {
switch (address) { switch (address) {
@ -346,6 +346,10 @@ void GBAIOWrite(struct GBA* gba, uint32_t address, uint16_t value) {
GBAVideoWriteDISPSTAT(&gba->video, value); GBAVideoWriteDISPSTAT(&gba->video, value);
return; return;
case REG_VCOUNT:
mLOG(GBA_IO, GAME_ERROR, "Write to read-only I/O register: %03X", address);
return;
// Audio // Audio
case REG_SOUND1CNT_LO: case REG_SOUND1CNT_LO:
GBAAudioWriteSOUND1CNT_LO(&gba->audio, value); GBAAudioWriteSOUND1CNT_LO(&gba->audio, value);