Fix black screen on the TV when coldbooting and opening the autoboot menu

This commit is contained in:
Maschell 2022-01-01 15:48:17 +01:00
parent 05cc2a99c7
commit c93d45fb38

View File

@ -2,6 +2,8 @@
#include <cstdio> #include <cstdio>
#include <cstring> #include <cstring>
#include <string> #include <string>
#include <gx2/state.h>
#include <coreinit/debug.h>
#include <coreinit/thread.h> #include <coreinit/thread.h>
#include <coreinit/foreground.h> #include <coreinit/foreground.h>
#include <coreinit/screen.h> #include <coreinit/screen.h>
@ -390,6 +392,9 @@ int32_t handleMenuScreen(int32_t autobootOptionInput) {
uint32_t drcBufferSize = OSScreenGetBufferSizeEx(SCREEN_DRC); uint32_t drcBufferSize = OSScreenGetBufferSizeEx(SCREEN_DRC);
auto *screenBuffer = (uint8_t *) memalign(0x100, tvBufferSize + drcBufferSize); auto *screenBuffer = (uint8_t *) memalign(0x100, tvBufferSize + drcBufferSize);
if (screenBuffer == nullptr) {
OSFatal("Failed to allocate screenBuffer");
}
OSScreenSetBufferEx(SCREEN_TV, screenBuffer); OSScreenSetBufferEx(SCREEN_TV, screenBuffer);
OSScreenSetBufferEx(SCREEN_DRC, screenBuffer + tvBufferSize); OSScreenSetBufferEx(SCREEN_DRC, screenBuffer + tvBufferSize);
@ -474,11 +479,8 @@ int32_t handleMenuScreen(int32_t autobootOptionInput) {
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);