GBA Video: Don't attempt to copy invalid registers when switching renderer

This commit is contained in:
Vicki Pfau 2021-03-31 21:57:03 -07:00
parent e587a12ddf
commit 50cc28dab5
2 changed files with 5 additions and 1 deletions

View File

@ -8,6 +8,7 @@ Other fixes:
- GBA: Fix crash when ROM loading fails
- GBA e-Reader: Fix bitmap short strip scanning
- GBA Video: Fix mode 5 frame 1 caching (fixes mgba.io/i/2075)
- GBA Video: Don't attempt to copy invalid registers when switching renderer
Misc:
- Core: Truncate preloading ROMs that slightly exceed max size (fixes mgba.io/i/2093)
- GBA: Default-enable VBA bug compat for Ruby and Emerald ROM hacks

View File

@ -130,7 +130,10 @@ void GBAVideoAssociateRenderer(struct GBAVideo* video, struct GBAVideoRenderer*
renderer->writeVideoRegister(renderer, REG_DISPCNT, video->p->memory.io[REG_DISPCNT >> 1]);
renderer->writeVideoRegister(renderer, REG_GREENSWP, video->p->memory.io[REG_GREENSWP >> 1]);
int address;
for (address = REG_BG0CNT; address < REG_SOUND1CNT_LO; address += 2) {
for (address = REG_BG0CNT; address < 0x56; address += 2) {
if (address == 0x4E) {
continue;
}
renderer->writeVideoRegister(renderer, address, video->p->memory.io[address >> 1]);
}
}