Commit Graph
5 Commits
Author SHA1 Message Date
Henrik RydgårdandClaude Opus 5.5 321020a852 HLE: Resolve firmware 6.30-6.39's kernel NIDs through an alias table
Sony renumbered the kernel NIDs between firmware versions, so a module
from 6.3x imports the functions we implement under 6.60's NIDs by other
ones. Rather than a second table entry per function, an alias table maps
the older NID to the implemented one, and GetHLEFuncIndexByNib() falls
back on it. Savestates store the table index, which this doesn't touch.

The 6.30-6.39 entries cover what popsman.prx imports (the same NIDs in
all of them). They come from matching the call sites in popsman.prx's
6.39 and 6.60 builds, whose code is the same, and agree with matching
the exporting modules' code where that's unchanged.

6.30/6.31's popsman.prx also takes the semaphore the main CPU and the ME
share through sysreg calls, which 6.60's does inline: implemented here as
lowio.prx does them.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-21 13:15:30 +02:00
Henrik RydgårdandClaude Opus 5.5 6936d22b38 HLE: sceSysreg_driver's 6.60 NIDs that the POPS manager uses
popsman.prx starts the Media Engine and sets up audio through them. The
ME reset, bus clock and AVC reset are the calls the older NIDs already
have. The others set bits of registers lowio.prx 6.61 writes for them
(0x50 bit 15+n, 0x58 bit 16+n, 0x60 bit 18, 0x78 bits 7+n and 11), and
C36775AD (called with 0, 1 before audio is set up) isn't read yet. The
system register device now keeps every register it doesn't model.

Under --vsh these stand in for lowio.prx's own, which write the same
registers.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-21 12:50:45 +02:00
Henrik RydgårdandClaude Opus 5.5 3daff12923 HLE: sceKernelUnregisterSysEventHandler
snes9xTYL's ME builds take the "SceMeRpc" handler out of the list.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-21 12:06:11 +02:00
Henrik RydgårdandClaude Opus 5.5 25c6f15e56 ME: Sony's ME image, the SceMeRpc sysevent handler, the VME's status
What the firmware sets up for the ME at boot, which mcidclan's custom-core
libraries rely on, at kernel init when the ME is emulated:

- Sony's ME image at 0x88300000, as me_wrapper loads it: meimg.img on a
  PSP-1000, me_t2img.img on later models, from the installed firmware's
  flash0:/kd/resource, decrypted and KL4E-decompressed (only the first of
  its two streams, the code). Custom-core calls functions in it, picking
  per-model address tables by the word at 0x18. Without the firmware it's
  logged and left out.
- A "SceMeRpc" sysevent handler record, which sceKernelReferSysEventHandler
  (new, sceSysEventForKernel) returns, and custom-core takes over.

Also the VME's control registers (0xBCC00000), kept, with the status at
0x10 reading as done: custom-core's ME startup writes 1 there and waits.

mcidclan's custom-core poc, hw-mutex, gu-shared-list and exceptions
samples now run.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-21 12:06:11 +02:00
Henrik RydgårdandClaude Opus 5.5 8af7643efa ME: sceSysreg_driver's ME reset and clock calls, MMIO copies in sysclib
The calls homebrew starts the ME with (1.50's NIDs, and 3.71's for the
ME's reset and bus clock) set or clear a bit of the reset or bus clock
register the way the firmware's driver does, returning whether it was
set. Only those NIDs, so a later firmware's lowio.prx keeps its own
exports under --vsh.

Kernel modules copy their ME code to the boot page with SysclibForKernel's
memcpy, which now goes through MMIO for hardware addresses like the
replaced memcpy already did (MMIO::Copy, shared).

pspsdk's mebasic, MElib's test, PSP Bunny, snes9xTYL and ProTrekkr's test
now start their ME.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-21 12:06:11 +02:00