Don't run the ProcUI setup if payload.rpx failes and the payload.elf was loaded via H&S

This commit is contained in:
Maschell 2020-10-19 00:15:44 +02:00
parent 84e3764447
commit 8b01f5ca75

View File

@ -69,6 +69,9 @@ extern "C" int _start(int argc, char **argv) {
WHBLogUdpInit();
int res = 0;
// If we load from our CustomRPXLoader the argv is set with "safe.rpx"
// in this case we don't want to do any ProcUi stuff on error, only on success
bool doProcUI = (argc != 1 || std::string(argv[0]) != "safe.rpx");
uint32_t ApplicationMemoryEnd;
@ -100,12 +103,13 @@ extern "C" int _start(int argc, char **argv) {
ICInvalidateRange((void *) 0x00800000, 0x00800000);
DEBUG_FUNCTION_LINE("New entrypoint: %08X", moduleData->getEntrypoint());
((int (*)(int, char **)) moduleData->getEntrypoint())(argc, argv);
doProcUI = true;
} else {
DEBUG_FUNCTION_LINE("Failed to load module");
}
if (doProcUI) {
SYSLaunchMenu();
ProcUIInit(OSSavesDone_ReadyToRelease);
DEBUG_FUNCTION_LINE("In ProcUI loop");
while (CheckRunning()) {
@ -113,6 +117,7 @@ extern "C" int _start(int argc, char **argv) {
OSSleepTicks(OSMillisecondsToTicks(100));
}
ProcUIShutdown();
}
__fini_wut();
return 0;