Commit Graph
167 Commits
Author SHA1 Message Date
Henrik RydgårdandClaude Opus 5 f449fa6ab2 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
2026-08-24 10:58:35 +02:00
Henrik Rydgård ed5c05fb28 VSH boot: load real kd/ kernel driver modules
Extends LoadAndStartVshKernelModules() to load the 11 real kd/*.prx
kernel drivers for --vsh (dmacman, systimer, memlmd_01g,
loadexec_01g, lowio, idstorage, syscon, rtc, wlan, wlanfirm_01g, utility),
ahead of the existing 4 VSH-specific modules.
Only active when g_runningVSH, no effect on normal game boot.

Improve implementations of sceKernelSm1ReferOperations and sceKernelIsIntrContext.

Add some more MMIO stubs (GPIO, SYSCON).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GZq8ZtJmFY7bkX5FVkr3P9
(cherry picked from commit 7f3168b7df85e47438900016c9ee7d7ef01a0a28)
2026-08-24 10:58:35 +02:00
Henrik Rydgård 9f90512ef6 Make instruction cache invalidation (for us, jit cache invalidation) clearer 2026-08-16 16:59:52 +02:00
Henrik Rydgård 3bd41376da More memory cleanup 2026-08-11 20:12:10 +02:00
Henrik Rydgård 68ec34ad54 Build and warning fixes 2026-08-03 19:11:07 +02:00
Henrik Rydgård e892c4e446 Implement the length check. 2026-04-14 12:55:29 -06:00
Henrik Rydgård f7a7eeaf74 Rough implementation of sysclib_snprintf (kernel function, useful for plugins)
Requested by danssmnt on Discord
2026-04-14 12:48:44 -06:00
Henrik Rydgård 4144839154 Add stub for sysclib_snprintf 2026-04-13 10:04:02 -06:00
Henrik Rydgård 31ad682e86 Kernel sysclib: Reduce logspam. This is useful for plugin developers. 2026-04-09 13:09:12 -06:00
Henrik Rydgård 5f7a937466 Rename ValidSize to ClampValidSizeAt 2025-12-30 20:31:07 +01:00
Henrik Rydgård 4e25f44eef Rename some module-related functions to include HLE where appropriate 2025-03-31 11:17:50 +02:00
Henrik Rydgård 0f840e6240 Move JPEG error codes to the big enum, some include cleanup 2025-03-21 20:44:46 +01:00
Henrik Rydgård 962bd8239d Remove more excessive error reporting. 2025-03-02 02:28:45 +01:00
Henrik Rydgård 28b2c7f540 HLE log rename part 1: Remove duplicate log functions. Return type should be determined by metadata. 2025-01-29 09:45:39 +01:00
Henrik Rydgård 3ce72f87d3 Another batch of log cleanup 2025-01-28 09:31:38 +01:00
Henrik Rydgård 26547e2629 More fixes 2025-01-20 12:20:21 +01:00
Henrik Rydgård 2523690584 Flip around so sceDelayResult is always outermost. Start using HLECall. 2025-01-20 12:20:18 +01:00
Henrik Rydgård 42f8b49531 Unbreak Tekken 6, logging fix 2025-01-20 10:23:40 +01:00
Henrik Rydgård ff8b51e6b7 Some logging cleanup in kernel 2025-01-19 14:54:09 +01:00
Henrik Rydgård c8f7f84627 Add an assert in intr handler 2024-10-25 21:36:05 +02:00
Herman Semenov 3c66f149d3 [Common/Core/Windows] Removed excess check pointer before delete or free() 2024-09-17 11:34:42 +02:00
Henrik Rydgård e01ca5b057 Logging API change (refactor) (#19324)
* Rename LogType to Log

* Explicitly use the Log:: enum when logging. Allows for autocomplete when editing.

* Mac/ARM64 buildfix

* Do the same with the hle result log macros

* Rename the log names to mixed case while at it.

* iOS buildfix

* Qt buildfix attempt, ARM32 buildfix
2024-07-14 14:42:59 +02:00
Henrik Rydgård 5e3abe3def IRInterpreter compiler: Reject all vec2ops where the prefix is unknown
Fixes #19164

May help #19172
2024-05-22 23:19:14 +02:00
Henrik Rydgård 0b91aa50ee Improve memory safety, add bugfix to little-used sysclib functions 2024-05-05 14:19:49 +02:00
Henrik Rydgård d769c3223c Fix camera mirroring color issue, fix warning 2024-05-05 11:20:29 +02:00
Henrik Rydgård e631be3607 Make a simpler CMakeLists.txt for zstd 2024-05-04 10:48:54 +02:00
Katharine Chui b570cacd90 add Memory::IsValidNullTerminatedString 2024-05-01 22:58:01 +08:00
Katharine Chui 49cd9c76d9 sysclib_sprintf psp memory bound checking instead of length limits 2024-05-01 20:23:47 +08:00
Katharine Chui fa0eaebfb5 cleanup 2024-05-01 17:32:13 +08:00
Katharine Chui 7ff48f97c3 implement sysclib_sprintf 2024-05-01 01:43:24 +08:00
Unknown W. Brackets 810d8c0890 Debugger: Use dedicated func to notify mem copy. 2023-09-24 19:07:36 -07:00
Henrik Rydgård dc74778dea Do the last ones too 2023-02-09 10:27:29 +01:00
Henrik Rydgård c52db636ce Optimize tag formatting 2023-02-09 10:22:46 +01:00
Henrik Rydgård 027edd6f59 Cleanup and warning fix in the new sysclib functions 2023-01-13 10:45:30 +01:00
Henrik Rydgård 97bef89486 Some cleanup when fixing a warning 2023-01-13 10:42:03 +01:00
Henrik Rydgård d71c6a0e95 Add some quick memory safety to the functions from #16095 2023-01-12 11:21:38 +01:00
Henrik Rydgård 8a66498359 Merge pull request #16095 from sum2012/sysclib_minor
Add some Sysclib 's nids
2023-01-12 11:14:53 +01:00
Henrik Rydgård edaa5246d1 Merge pull request #16771 from hrydgard/more-getpointer-cleanup
Core: A bit more GetPointer cleanup.
2023-01-10 14:36:08 +01:00
Henrik Rydgård e1a48d74c4 A bit more GetPointer cleanup.
Probably not worth it for performance reasons, but some semantic cleanup
is good, especially the accidental GetPointer -> writable casts without
using GetPointerWrite.

Using Unchecked on already checked pointers, or when we'd crash anyway
if it returned nullptr, is good for clarity.
2023-01-10 12:13:47 +01:00
sum2012 eacdfe5246 Fix 2022-11-02 15:57:26 +08:00
sum2012 63606634bb Add InterruptManagerForKernel
Find in #16297
2022-10-31 20:17:12 +08:00
Unknown W. Brackets c4bf2cb5c0 jit: Ignore zero byte icache invalidates.
These were getting marked pending and were clearing all cache, causing
performance concerns in for example LittleBigPlanet.
2022-10-15 18:27:52 -07:00
sum2012 497bad3312 oop 2022-09-25 12:04:33 +08:00
sum2012 5c7485b815 Change int to size_t 2022-09-25 10:18:16 +08:00
sum2012 d084b5cf96 strtol and toupper use native
and buildfix for ubuntu
Thanks unknownbrackets
2022-09-25 08:31:46 +08:00
sum2012 d17c87dc78 oop 2022-09-24 22:49:11 +08:00
sum2012 e42a970ee3 Add some sysclib's nids
Find in prxshot.prx
2022-09-24 22:40:19 +08:00
Unknown W. Brackets ccd4e92184 Kernel: Use PSPPointer for status objects.
Code makes more sense when reading ->size rather than offset 0.
2022-09-03 10:44:12 -07:00
Henrik Rydgård ecb84987ef Remove allocation from the heaviest MemBlockInfo path (BlockTransfer). Required some refactoring. 2022-09-01 11:59:35 +02:00
Henrik Rydgård e6403d7157 Split GetPointer into two versions, to help with const correctness 2022-07-24 13:26:19 +02:00