diff --git a/Core/HLE/sceImpose.cpp b/Core/HLE/sceImpose.cpp index 0a62a25523..3faec2b55d 100644 --- a/Core/HLE/sceImpose.cpp +++ b/Core/HLE/sceImpose.cpp @@ -20,6 +20,8 @@ #include "Core/HLE/HLE.h" #include "Core/HLE/FunctionWrappers.h" #include "Core/HLE/ErrorCodes.h" +#include "Core/HLE/PopsBoot.h" +#include "Core/HLE/sceCtrl.h" #include "Core/HLE/sceImpose.h" #include "Core/HLE/sceUtility.h" #include "Core/MIPS/MIPS.h" @@ -124,6 +126,14 @@ static u32 sceImposeGetBacklightOffTime() { return hleLogDebug(Log::sceUtility, backlightOffTime); } +// Whether HOME is held, when impose leaves HOME to the application. impose.prx's init does that +// for POPS (and application type 0x400), so for a game it's always 0. The PS1 emulator polls it for +// its menu. +static u32 sceImpose_9BA61B49() { + const bool held = PopsBootActive() && (__CtrlPeekButtons() & CTRL_HOME) != 0; + return hleLogVerbose(Log::sceUtility, held ? 1 : 0); +} + // OSD stuff? home button? const HLEFunction sceImpose[] = { {0X36AA6E91, &WrapU_UU, "sceImposeSetLanguageMode", 'i', "ii"}, @@ -139,7 +149,7 @@ const HLEFunction sceImpose[] = { {0XFCD44963, nullptr, "sceImpose_FCD44963", '?', "" }, {0XA9884B00, nullptr, "sceImpose_A9884B00", '?', "" }, {0XBB3F5DEC, nullptr, "sceImpose_BB3F5DEC", '?', "" }, - {0X9BA61B49, nullptr, "sceImpose_9BA61B49", '?', "" }, // jpcsp: isHomeButtonPressed() -> bool + {0X9BA61B49, &WrapU_V, "sceImpose_9BA61B49", 'x', "" }, {0XFF1A2F07, nullptr, "sceImpose_FF1A2F07", '?', "" }, };