From 55de2a74cff54b29d271fb2f9063a0463adff4ff Mon Sep 17 00:00:00 2001 From: RocketRobz Date: Mon, 8 Apr 2024 16:40:04 -0600 Subject: [PATCH] R4 theme: Fix screen tearing when opening TWLMenu++ Settings --- romsel_r4theme/arm9/source/graphics/graphics.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/romsel_r4theme/arm9/source/graphics/graphics.cpp b/romsel_r4theme/arm9/source/graphics/graphics.cpp index ddd78efc12..fe88f937b0 100644 --- a/romsel_r4theme/arm9/source/graphics/graphics.cpp +++ b/romsel_r4theme/arm9/source/graphics/graphics.cpp @@ -547,13 +547,6 @@ static void loadPng(const bool top, const int startMenu, const std::string filen void vBlankHandler() { - if (doubleBuffer) { - extern bool startMenu; - dmaCopyHalfWordsAsynch(0, topImage[startMenu][secondBuffer], (u16*)BG_GFX_SUB+(256*32), 0x18000); - dmaCopyHalfWordsAsynch(1, bottomImage[startMenu][secondBuffer], BG_GFX, 0x18000); - secondBuffer = !secondBuffer; - } - glBegin2D(); { if (fadeType == true) { @@ -624,6 +617,13 @@ void vBlankHandler() glEnd2D(); GFX_FLUSH = 0; + if (doubleBuffer) { + extern bool startMenu; + dmaCopyHalfWordsAsynch(0, topImage[startMenu][secondBuffer], (u16*)BG_GFX_SUB+(256*32), 0x18000); + dmaCopyHalfWordsAsynch(1, bottomImage[startMenu][secondBuffer], BG_GFX, 0x18000); + secondBuffer = !secondBuffer; + } + frameDelay = 0; frameDelayEven = !frameDelayEven; renderFrame = false;