From 6529ea36f4d4e1406715cf3a4f69de3e1f2a939d Mon Sep 17 00:00:00 2001 From: Maschell Date: Thu, 26 Nov 2020 21:14:37 +0100 Subject: [PATCH] Display user selection if no default user is set. --- src/imports.h | 5 +++++ src/main.cpp | 16 +++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/imports.h b/src/imports.h index d375a95..dc392a5 100644 --- a/src/imports.h +++ b/src/imports.h @@ -229,6 +229,10 @@ IMPORT(ACConnect); IMPORT(ACClose); IMPORT(ACGetAssignedAddress); IMPORT(ACGetAssignedSubnet); +IMPORT(Initialize__Q2_2nn3actFv); +IMPORT(GetSlotNo__Q2_2nn3actFv); +IMPORT(GetDefaultAccount__Q2_2nn3actFv); +IMPORT(Finalize__Q2_2nn3actFv); IMPORT_END(); /* proc_ui */ @@ -266,6 +270,7 @@ IMPORT_BEGIN(sysapp); IMPORT(SYSRelaunchTitle); IMPORT(_SYSGetSystemApplicationTitleId); IMPORT(SYSLaunchMenu); +IMPORT(_SYSLaunchMenuWithCheckingAccount); IMPORT_END(); diff --git a/src/main.cpp b/src/main.cpp index ab4ee17..d60950f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include "ElfUtils.h" #include "module/ModuleData.h" @@ -64,6 +65,8 @@ bool CheckRunning() { extern "C" void __init_wut(); extern "C" void __fini_wut(); +extern "C" void _SYSLaunchMenuWithCheckingAccount(nn::act::SlotNo slot); + extern "C" int _start(int argc, char **argv) { doKernelSetup(); InitFunctionPointers(); @@ -121,7 +124,18 @@ extern "C" int _start(int argc, char **argv) { } if (doProcUI) { - SYSLaunchMenu(); + 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); + } ProcUIInit(OSSavesDone_ReadyToRelease); DEBUG_FUNCTION_LINE("In ProcUI loop"); while (CheckRunning()) {