From 8a7f8c67fce5b760320c0758662d7528cf979bd9 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sun, 28 Jun 2020 15:42:10 -0700 Subject: [PATCH] GBA Video: Fix invalid read in mode 4 mosaic --- CHANGES | 1 + src/gba/renderers/software-bg.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 2815b229c..d145b1ca4 100644 --- a/CHANGES +++ b/CHANGES @@ -22,6 +22,7 @@ Emulation fixes: - GBA SIO: Fix copying Normal mode transfer values - GBA Video: Latch scanline at end of Hblank (fixes mgba.io/i/1319) - GBA Video: Fix Hblank timing + - GBA Video: Fix invalid read in mode 4 mosaic - SM83: Emulate HALT bug Other fixes: - All: Improve export headers (fixes mgba.io/i/1738) diff --git a/src/gba/renderers/software-bg.c b/src/gba/renderers/software-bg.c index db4b33e71..742e126b5 100644 --- a/src/gba/renderers/software-bg.c +++ b/src/gba/renderers/software-bg.c @@ -128,7 +128,7 @@ void GBAVideoSoftwareRendererDrawBackgroundMode3(struct GBAVideoSoftwareRenderer void GBAVideoSoftwareRendererDrawBackgroundMode4(struct GBAVideoSoftwareRenderer* renderer, struct GBAVideoSoftwareBackground* background, int inY) { BACKGROUND_BITMAP_INIT; - uint16_t color = renderer->normalPalette[0]; + uint16_t color = 0; uint32_t offset = 0; if (GBARegisterDISPCNTIsFrameSelect(renderer->dispcnt)) { offset = 0xA000;