File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -778,6 +778,19 @@ GameDefaultConfigOverride GameDefaultConfigOverride::instance;
778778
779779class EnableLevelSelect : public Hook
780780{
781+ inline static SafetyHookMid midhook = {};
782+ static void destination (SafetyHookContext& ctx)
783+ {
784+ // Game checked SwitchNow(0x10) which checks for X/horn press
785+ // but because of how we force level-select to show, that will display sumo sign-in screen instead...
786+ // we'll add an extra SwitchNow(0x100) check here to check for LS press as well
787+
788+ if (Game::SwitchNow (0x100 ))
789+ ctx.eax = 1 ;
790+ if (GetAsyncKeyState (VK_SHIFT))
791+ ctx.eax = 1 ;
792+ }
793+
781794public:
782795 std::string_view description () override
783796 {
@@ -793,9 +806,11 @@ class EnableLevelSelect : public Hook
793806 {
794807 // Change the param for "GetMenuForId" call from 0 to 0x1B
795808 constexpr int SumoFrontEnd__eventStep1_GetMenuForIdCall_Param = 0x45756 + 1 ;
809+ constexpr int SumoLevelSelect__update_SwitchNowResult_Addr = 0xE7838 ;
796810 Memory::VP::Patch (Module::exe_ptr (SumoFrontEnd__eventStep1_GetMenuForIdCall_Param), uint8_t (0x1B ));
797811
798- return true ;
812+ midhook = safetyhook::create_mid (Module::exe_ptr (SumoLevelSelect__update_SwitchNowResult_Addr), destination);
813+ return !!midhook;
799814 }
800815
801816 static EnableLevelSelect instance;
You can’t perform that action at this time.
0 commit comments