WUMSLoader/source/main.cpp

41 lines
1020 B
C++
Raw Normal View History

#include "../wumsloader/src/globals.h"
#include "kernel.h"
#include "utils/logger.h"
2020-12-01 13:06:40 +01:00
#include <nn/act/client_cpp.h>
2022-02-04 21:44:03 +01:00
#include <sysapp/launch.h>
2020-04-28 14:43:07 +02:00
2022-01-23 22:15:28 +01:00
extern "C" void __fini();
2020-05-17 19:05:51 +02:00
int main(int argc, char **argv) {
initLogging();
2020-04-28 14:43:07 +02:00
std::string basePath = "fs:/vol/external01/wiiu";
if (argc >= 1) {
basePath = argv[0];
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warray-bounds"
#pragma GCC diagnostic ignored "-Wstringop-overflow="
strncpy(ENVRIONMENT_STRING, basePath.c_str(), ENVIRONMENT_PATH_LENGTH - 1);
#pragma GCC diagnostic pop
2020-04-28 14:43:07 +02:00
DEBUG_FUNCTION_LINE("Setup wumsloader");
SetupWUMSLoader();
2020-04-28 14:43:07 +02:00
nn::act::Initialize();
2022-02-04 21:44:03 +01:00
nn::act::SlotNo slot = nn::act::GetSlotNo();
nn::act::SlotNo defaultSlot = nn::act::GetDefaultAccount();
nn::act::Finalize();
if (defaultSlot) { //normal menu boot
SYSLaunchMenu();
} else { //show mii select
_SYSLaunchMenuWithCheckingAccount(slot);
}
2022-01-23 22:15:28 +01:00
deinitLogging();
2022-01-23 22:15:28 +01:00
__fini();
2020-04-28 14:43:07 +02:00
return 0;
}