From df3ee0e2be38095bbfc2385d430fa82542c64334 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Wed, 9 Dec 2015 21:22:35 -0800 Subject: [PATCH] GBA Video: Fix OAM and palette initialization --- CHANGES | 1 + src/gba/video.c | 9 ++------- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index 28adc582c..6dfc8eeaf 100644 --- a/CHANGES +++ b/CHANGES @@ -39,6 +39,7 @@ Bugfixes: - ARM7: Implement undefined STRH/LDRH/LDRSH/LDRSB versions - ARM7: Fix bank switching with LDR[B]T/STR[B]T - Qt: Fix crash when closing multiplayer windows + - GBA Video: Fix OAM and palette initialization Misc: - Qt: Window size command line options are now supported - Qt: Increase usability of key mapper diff --git a/src/gba/video.c b/src/gba/video.c index 505ef4fa5..5d3f8cce0 100644 --- a/src/gba/video.c +++ b/src/gba/video.c @@ -88,13 +88,8 @@ void GBAVideoReset(struct GBAVideo* video) { video->vram = anonymousMemoryMap(SIZE_VRAM); video->renderer->vram = video->vram; - int i; - for (i = 0; i < 128; ++i) { - STORE_16(0x0200, i * 8 + 0, video->oam.raw); - STORE_16(0x0000, i * 8 + 2, video->oam.raw); - STORE_16(0x0000, i * 8 + 4, video->oam.raw); - STORE_16(0x0000, i * 8 + 6, video->oam.raw); - } + memset(video->palette, 0, sizeof(video->palette)); + memset(video->oam.raw, 0, sizeof(video->oam.raw)); video->renderer->deinit(video->renderer); video->renderer->init(video->renderer);