GBA Video: Fix I/O registers when switching renderer (fixes #1967)

This commit is contained in:
Vicki Pfau 2020-12-05 18:34:49 -08:00
parent b7947a0a6e
commit 6a7e80c969
1 changed files with 7 additions and 0 deletions

View File

@ -126,6 +126,13 @@ void GBAVideoAssociateRenderer(struct GBAVideo* video, struct GBAVideoRenderer*
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) {