mirror of
https://github.com/wiiu-env/HBLInstallerWrapper.git
synced 2024-11-16 11:39:15 +01:00
Add some error handling, fix opening the wii u menu. Default load into wii u menu instead of HBL
This commit is contained in:
parent
1223bbc29d
commit
2daa9d437f
@ -49,6 +49,38 @@ bool getQuickBoot() {
|
||||
// load app launch param
|
||||
CCRSysCaffeineGetAppLaunchParam(&data);
|
||||
|
||||
// get launch info for id
|
||||
nn::sl::LaunchInfo info;
|
||||
auto result = database->GetLaunchInfoById(&info, data.titleId);
|
||||
|
||||
delete database;
|
||||
delete fileStream;
|
||||
|
||||
FSDelClient(fsClient, FS_ERROR_FLAG_NONE);
|
||||
|
||||
nn::sl::Finalize();
|
||||
|
||||
if(!result.IsSuccess()) {
|
||||
DEBUG_FUNCTION_LINE("GetLaunchInfoById failed.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if( info.titleId == 0x0005001010040000L ||
|
||||
info.titleId == 0x0005001010040100L ||
|
||||
info.titleId == 0x0005001010040200L) {
|
||||
DEBUG_FUNCTION_LINE("Skip quick booting into the Wii U Menu");
|
||||
return false;
|
||||
}
|
||||
if(!SYSCheckTitleExists(info.titleId)) {
|
||||
DEBUG_FUNCTION_LINE("Title %016lLX doesn't exist", info.titleId);
|
||||
return false;
|
||||
}
|
||||
|
||||
MCPTitleListType titleInfo;
|
||||
int32_t handle = MCP_Open();
|
||||
auto err = MCP_GetTitleInfo(handle, info.titleId, &titleInfo);
|
||||
MCP_Close(handle);
|
||||
if(err == 0) {
|
||||
nn::act::Initialize();
|
||||
for(int i = 0; i < 13; i++){
|
||||
char uuid[16];
|
||||
@ -63,31 +95,14 @@ bool getQuickBoot() {
|
||||
}
|
||||
nn::act::Finalize();
|
||||
|
||||
// get launch info for id
|
||||
nn::sl::LaunchInfo info;
|
||||
database->GetLaunchInfoById(&info, data.titleId);
|
||||
|
||||
// info.titleId
|
||||
OSReport("Quick boot into: %016llX\n", info.titleId);
|
||||
|
||||
delete database;
|
||||
delete fileStream;
|
||||
|
||||
FSDelClient(fsClient, FS_ERROR_FLAG_NONE);
|
||||
|
||||
nn::sl::Finalize();
|
||||
|
||||
MCPTitleListType titleInfo;
|
||||
int32_t handle = MCP_Open();
|
||||
MCP_GetTitleInfo(handle, info.titleId, &titleInfo);
|
||||
MCP_Close(handle);
|
||||
ACPAssignTitlePatch(&titleInfo);
|
||||
_SYSLaunchTitleWithStdArgsInNoSplash(info.titleId, nullptr);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
} else {
|
||||
OSReport("No quick boot\n");
|
||||
DEBUG_FUNCTION_LINE("No quick boot");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -120,8 +135,19 @@ int main(int argc, char **argv) {
|
||||
|
||||
InstallHBL();
|
||||
|
||||
if(!getQuickBoot()) {
|
||||
bootHomebrewLauncher();
|
||||
if(getQuickBoot()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
nn::act::Initialize();
|
||||
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);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user