Implement a batch of the VSH's unresolved imports (and document three we must not)

Mostly small stubs:

- sceImpose: GetParam/SetParam/Changes/SetStatus, plus the 6.60 alias of
  sceImposeGetBatteryIconStatus. Also fixes that function's first output - it
  is a plain "is it charging" boolean, not a BATTICON_ value. We wrote
  PSP_IMPOSE_BATTICON_NONE (0x80000000) there, which games ignore but which the
  VSH reads as "no battery" and draws the empty-battery indicator for. These
  are the bulk of the traffic: the VSH calls sceImposeChanges once a frame, so
  this alone removes ~10000 trapped calls from a boot.
- SysMemForKernel: sceKernelSetRebootKernel, sceKernelSetUmdCacheOn.
- scePower_driver: scePowerSetWakeupCondition.
- sceHprm_driver, sceUsb: one NID-named call each, as in JPCSP.

Three groups are deliberately left unresolved, with comments explaining why,
because resolving them lets real flash0 drivers walk into hardware we do not
emulate and the boot dies where it used to reach the shell:

- ThreadManForKernel mutex/fpl NIDs: the NAND and ID storage drivers use these
  to init, then poll the NAND controller at 0xbd101300 forever.
- InterruptManagerForKernel intr registration: 31 calls, then a stall in GE
  list execution with no plugin module ever started.

73 unresolved import hits over 37 distinct module/NID pairs remain in a VSH
boot, mostly sceSysEventForKernel, sceSuspendForKernel and the various
*_driver modules that need real hardware behind them.

The sceImpose savestate section goes to v2 for the two new state variables.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GZq8ZtJmFY7bkX5FVkr3P9
This commit is contained in:
Henrik RydgårdandClaude Opus 5 committed 2026-08-24 10:58:35 +02:00
1 parent 4667f5e2da
commit f449fa6ab2
7 files changed
+143 -3

No files matched your search

+8 -1
View File
@@ -205,7 +205,7 @@ static int scePowerIsLowBattery() {
}
static int scePowerIsSuspendRequired() {
return hleLogInfo(Log::HLE, 0);
return hleLogDebug(Log::HLE, 0);
}
static int scePowerCancelRequest(u32 something) {
@@ -660,8 +660,15 @@ static int scePower_driver_5F5006D2() {
return hleLogDebug(Log::HLE, 0, "UNTESTED");
}
// Configures which events would wake the console from suspend. We never suspend, so there's
// nothing to arm - but the VSH calls it during startup and wants a success back.
static int scePowerSetWakeupCondition(u32 condition) {
return hleLogWarning(Log::sceMisc, 0, "UNIMPL");
}
const HLEFunction scePower_driver[] = {
{0X5F5006D2, &WrapI_V<scePower_driver_5F5006D2>, "scePower_driver_5F5006D2", 'i', "" },
{0XBA566CD0, &WrapI_U<scePowerSetWakeupCondition>, "scePowerSetWakeupCondition", 'i', "x" },
};
void Register_scePower_driver() {