all repos — mgba @ 6a7e80c969740a73dcc0b7b41786bf71844aedea

mGBA Game Boy Advance Emulator

GBA Video: Fix I/O registers when switching renderer (fixes #1967)
Vicki Pfau vi@endrift.com
Sat, 05 Dec 2020 18:34:49 -0800
commit

6a7e80c969740a73dcc0b7b41786bf71844aedea

parent

b7947a0a6ec46a18efb1248612f32634b30c3f8d

1 files changed, 7 insertions(+), 0 deletions(-)

jump to
M src/gba/video.csrc/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) {