Fix black screen on the TV when coldbooting and opening the environment selection screen

This commit is contained in:
Maschell 2022-01-01 15:49:01 +01:00
parent 2e61281d0a
commit 9b86283cfd

View File

@ -1,5 +1,6 @@
#include <cstring> #include <cstring>
#include <gx2/state.h>
#include <elfio/elfio.hpp> #include <elfio/elfio.hpp>
#include <proc_ui/procui.h> #include <proc_ui/procui.h>
#include <sysapp/launch.h> #include <sysapp/launch.h>
@ -254,6 +255,7 @@ std::string EnvironmentSelectionScreen(const std::map<std::string, std::string>
if (!screenBuffer) { if (!screenBuffer) {
OSFatal("Fail to allocate screenBuffer"); OSFatal("Fail to allocate screenBuffer");
} }
memset(screenBuffer, 0, tvBufferSize + drcBufferSize);
OSScreenSetBufferEx(SCREEN_TV, screenBuffer); OSScreenSetBufferEx(SCREEN_TV, screenBuffer);
OSScreenSetBufferEx(SCREEN_DRC, screenBuffer + tvBufferSize); OSScreenSetBufferEx(SCREEN_DRC, screenBuffer + tvBufferSize);
@ -351,11 +353,8 @@ std::string EnvironmentSelectionScreen(const std::map<std::string, std::string>
DrawUtils::deinitFont(); DrawUtils::deinitFont();
if (OSGetTitleID() == _SYSGetSystemApplicationTitleId(SYSTEM_APP_ID_MII_MAKER)) { // Call GX2Init to shut down OSScreen
// When we're in the Mii Maker "OSScreenShutdown" will cause a black screen. GX2Init(nullptr);
} else {
OSScreenShutdown();
}
free(screenBuffer); free(screenBuffer);