Commit Graph
11 Commits
Author SHA1 Message Date
Henrik RydgårdandClaude Opus 5.5 0e7a48907b scePower: Keep the game's own CPU clock, and apply locked clock changes live
The game's requested CPU frequency wasn't stored anywhere, only the effective
CoreTiming clock. So a state saved with a locked clock kept that speed when
loaded with the lock off, and turning the lock off in-game left the CPU at
the locked speed until the game set its clock again (most only do at boot).
Changing the lock in-game didn't take effect either, until a reboot or a
state load.

Now RealcpuFreq is tracked and saved next to the PLL and bus, the setters
record the game's request even under a lock, and one function applies
either the lock or the game's clocks. It runs at init, on state load, and at
vblank whenever the setting has changed. Older states guess the game's clock
from the saved effective one, capped at the game's PLL.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-17 00:00:00 +02:00
Henrik RydgårdandClaude Opus 5.5 9fa53c8337 HLE: Add sceKernelSetParamSfo and sceMePowerControlAvcPower
The VSH's sceVshBridge_Driver calls both when launching a game, and some
firmware versions give up on the launch unless they succeed (5.xx for the
first, 2.00 for the second). Neither has anything to do here: our HLE
LoadExec reads the PBP itself, and there's no AVC decoder to power.

Added under the NIDs whose names are known: sceKernelSetParamSfo's old,
5.xx and 6.60 NIDs (from DC-M33's NID resolver, Adrenaline's NID table and
uOFW), and sceMePowerControlAvcPower's old and 6.60 NIDs (jpcsp's
psplibdoc, uOFW). Appended at the end of SysMemForKernel, and
sceMePower_driver registered last.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 20:33:34 +02:00
Henrik RydgårdandClaude Opus 5.5 7a675b42d5 Model the movie blit by texture format, location and width; scale costs with the clock
Measured on a PSP (pspautotests gpu/timing/blittiming), a full-screen blit
from an unswizzled texture costs what the texture fetch costs: 16-bit formats
half of 32-bit, VRAM a fifth of RAM, and rectangles wider than ~128 texels
~7.5x as much as narrow strips, from texture cache thrashing. Framebuffer
format, filtering and blending don't matter. Ys I & II draws its movie as one
full-width sprite from a 565 texture in RAM, which takes 33ms - that, not the
decode, is what holds it to 30 fps.

All of the ME and GE costs speed up with the clock (2/3 as long at 333/166),
since the whole system runs from the one PLL.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 16:40:11 -06:00
Henrik RydgårdandClaude Sonnet 5 43dccd5903 HLE: implement assorted stubs and minor functionality
This is stuff encountered in the VSH boot research.

sceRtc_driver, scePower_driver, sceImpose_driver, ThreadManForKernel funcs,
sceRtcGetAlarmTick, sceHprm_driver/sceHprmReadLatch

sceVshBridge_Driver imports sceKernelResumeDispatchThread, SuspendDispatchThread,
and NotifyCallback from ThreadManForKernel, but they were only registered under
ThreadManForUser. Added sceKernelGetUserLevel and sceKernelIsUserModeThread (new).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GZq8ZtJmFY7bkX5FVkr3P9
2026-08-19 18:38:03 +02:00
Henrik Rydgård b22e27a537 Compat: Enforce "RequireDefaultCPUClock" by disabling overclocking for these games
Instead of just warning.

Fixes #12811
2023-12-07 14:06:41 +01:00
Unknown W. Brackets 6db0f5106c Power: expose volatile memory lock/unlock funcs. 2021-01-18 10:37:12 -08:00
Unknown W. Brackets 2a6457b6ab Cut down on h files including PointerWrap.
This makes changes to it a bit faster to build.
2013-02-04 08:26:59 -08:00
Unknown W. Brackets cd1d4367bf Save state of a bunch of small modules. 2012-12-28 13:55:28 -08:00
Henrik Rydgard 387552f564 Misc fixes (accept .prx, work on power callbacks, bugs) 2012-11-10 10:15:11 +01:00
Henrik Rydgard 64cc573703 Switch to "GPL 2.0 or later" for various reasons. I wrote most of the code I imported from Dolphin (which is GPL2-but-not-later), so it should be OK. 2012-11-04 23:24:00 +01:00
Henrik Rydgard 4f7ad15758 Add snapshot of the whole source code. 2012-11-01 16:19:01 +01:00