From f6782850bd522d6778766b61c9e02abcd0e0abc4 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Wed, 24 Jun 2020 18:09:07 -0700 Subject: [PATCH] GBA BIOS: Fix reloading video registers after reset (fixes #1808) --- CHANGES | 1 + src/gba/bios.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGES b/CHANGES index 8700b8167..26f2dcf37 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,7 @@ Emulation fixes: - GB Memory: Fix OAM DMA from top 8 kB - GB MBC: Fix MBC1 RAM enable bit selection - GB MBC: Fix MBC2 bit selection + - GBA BIOS: Fix reloading video registers after reset (fixes mgba.io/i/1808) Other fixes: - All: Correct format strings for some numbers on Windows (fixes mgba.io/i/1794) - GB Core: Fix extracting SRAM when none is present diff --git a/src/gba/bios.c b/src/gba/bios.c index 3045fb46c..0a7982ad5 100644 --- a/src/gba/bios.c +++ b/src/gba/bios.c @@ -179,6 +179,11 @@ static void _RegisterRamReset(struct GBA* gba) { } if (registers & 0x9C) { gba->video.renderer->reset(gba->video.renderer); + gba->video.renderer->writeVideoRegister(gba->video.renderer, REG_DISPCNT, gba->memory.io[REG_DISPCNT >> 1]); + int i; + for (i = REG_BG0CNT; i < REG_SOUND1CNT_LO; i += 2) { + gba->video.renderer->writeVideoRegister(gba->video.renderer, i, gba->memory.io[i >> 1]); + } } }