From 9b86283cfd026598e202296127d052443a10cf00 Mon Sep 17 00:00:00 2001 From: Maschell Date: Sat, 1 Jan 2022 15:49:01 +0100 Subject: [PATCH] Fix black screen on the TV when coldbooting and opening the environment selection screen --- source/main.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/source/main.cpp b/source/main.cpp index f2d0fc6..31876fd 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -1,5 +1,6 @@ #include +#include #include #include #include @@ -95,7 +96,7 @@ int main(int argc, char **argv) { if (IOS_Open((char *) ("/dev/iosuhax"), static_cast(0)) >= 0) { auto checkTiramisuHBL = fopen("fs:/vol/external01/wiiu/environments/tiramisu/modules/setup/50_hbl_installer.rpx", "r"); - if(checkTiramisuHBL != nullptr){ + if (checkTiramisuHBL != nullptr) { fclose(checkTiramisuHBL); OSFatal("Don't run the EnvironmentLoader twice.\n\nIf you want to open the Homebrew Launcher, launch the Mii Maker\ninstead."); } else { @@ -254,6 +255,7 @@ std::string EnvironmentSelectionScreen(const std::map if (!screenBuffer) { OSFatal("Fail to allocate screenBuffer"); } + memset(screenBuffer, 0, tvBufferSize + drcBufferSize); OSScreenSetBufferEx(SCREEN_TV, screenBuffer); OSScreenSetBufferEx(SCREEN_DRC, screenBuffer + tvBufferSize); @@ -351,11 +353,8 @@ std::string EnvironmentSelectionScreen(const std::map DrawUtils::deinitFont(); - if (OSGetTitleID() == _SYSGetSystemApplicationTitleId(SYSTEM_APP_ID_MII_MAKER)) { - // When we're in the Mii Maker "OSScreenShutdown" will cause a black screen. - } else { - OSScreenShutdown(); - } + // Call GX2Init to shut down OSScreen + GX2Init(nullptr); free(screenBuffer);