Avoid WUMS loading when we just did a iosu reload

This commit is contained in:
Maschell 2024-05-08 11:16:53 +02:00
parent af367030b7
commit ea08593967
2 changed files with 11 additions and 0 deletions

View File

@ -78,7 +78,17 @@ void SaveLoadedRPLsInGlobalInformation(module_information_t *globalInformation,
} }
} }
extern "C" uint32_t OSGetBootPMFlags(void);
void doStart(int argc, char **argv) { void doStart(int argc, char **argv) {
uint32_t bootFlags = OSGetBootPMFlags();
/*
* Bit 13 - OS relaunch (OSForceFullRelaunch()).
See more https://wiiubrew.org/wiki/Boot1#PowerFlags */
if ((bootFlags & 0x00002000) != 0 && argc == WUMS_LOADER_SETUP_MAGIC_WORD) {
OSReport("OSForceFullRelaunch detected, skipping WUMS\n", bootFlags);
return;
}
init_wut(); init_wut();
initLogging(); initLogging();

View File

@ -43,6 +43,7 @@ IMPORT(__os_snprintf);
IMPORT(MEMCheckHeap); IMPORT(MEMCheckHeap);
IMPORT(MEMGetBaseHeapHandle); IMPORT(MEMGetBaseHeapHandle);
IMPORT(MEMCheckExpHeap); IMPORT(MEMCheckExpHeap);
IMPORT(OSGetBootPMFlags);
IMPORT(FSTimeToCalendarTime); IMPORT(FSTimeToCalendarTime);
IMPORT(FSInit); IMPORT(FSInit);