From 9061620e582edc37b85a913cb297a1b451578fb0 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sat, 29 Sep 2018 10:05:43 -0700 Subject: [PATCH] Wii: Fix drawing caching regression (fixes #1185) --- CHANGES | 1 + src/platform/wii/main.c | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index 3da905129..83f32d434 100644 --- a/CHANGES +++ b/CHANGES @@ -107,6 +107,7 @@ Bugfixes: - PSP2: Fix audio crackling when buffer is full - 3DS: Fix unused screens not clearing (fixes mgba.io/i/1184) - GBA Video: Fix caching with background toggling (fixes mgba.io/i/1118) + - Wii: Fix drawing caching regression (fixes mgba.io/i/1185) Misc: - mGUI: Add SGB border configuration option diff --git a/src/platform/wii/main.c b/src/platform/wii/main.c index 1885f5c37..f1df0c86c 100644 --- a/src/platform/wii/main.c +++ b/src/platform/wii/main.c @@ -195,18 +195,18 @@ static void reconfigureScreen(struct mGUIRunner* runner) { break; } - free(framebuffer[0]); - free(framebuffer[1]); - VIDEO_SetBlack(true); VIDEO_Configure(vmode); + free(framebuffer[0]); + free(framebuffer[1]); + framebuffer[0] = SYS_AllocateFramebuffer(vmode); framebuffer[1] = SYS_AllocateFramebuffer(vmode); - VIDEO_ClearFrameBuffer(vmode, framebuffer[0], COLOR_BLACK); - VIDEO_ClearFrameBuffer(vmode, framebuffer[1], COLOR_BLACK); + VIDEO_ClearFrameBuffer(vmode, MEM_K0_TO_K1(framebuffer[0]), COLOR_BLACK); + VIDEO_ClearFrameBuffer(vmode, MEM_K0_TO_K1(framebuffer[1]), COLOR_BLACK); - VIDEO_SetNextFramebuffer(framebuffer[whichFb]); + VIDEO_SetNextFramebuffer(MEM_K0_TO_K1(framebuffer[whichFb])); VIDEO_Flush(); VIDEO_WaitVSync(); if (vmode->viTVMode & VI_NON_INTERLACE) { @@ -595,7 +595,7 @@ static void _drawStart(void) { static void _drawEnd(void) { GX_CopyDisp(framebuffer[whichFb], GX_TRUE); GX_DrawDone(); - VIDEO_SetNextFramebuffer(framebuffer[whichFb]); + VIDEO_SetNextFramebuffer(MEM_K0_TO_K1(framebuffer[whichFb])); VIDEO_Flush(); whichFb = !whichFb;