GBA Video: Fix I/O registers when switching renderer (fixes #1967)
Vicki Pfau vi@endrift.com
Sat, 05 Dec 2020 18:34:49 -0800
1 files changed,
7 insertions(+),
0 deletions(-)
jump to
M
src/gba/video.c
→
src/gba/video.c
@@ -126,6 +126,13 @@ renderer->palette = video->palette;
renderer->vram = video->vram; renderer->oam = &video->oam; video->renderer->init(video->renderer); + video->renderer->reset(video->renderer); + 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) { + renderer->writeVideoRegister(renderer, address, video->p->memory.io[address >> 1]); + } } void _midHblank(struct mTiming* timing, void* context, uint32_t cyclesLate) {