You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(hle): parameterize SoundDriver RPC service SID and subcommands per game
Move the hardcoded SoundDriver service SID(s) and subcommand (fno) numbers out
of ps2_iop.h and into the per-game PS2SoundDriverCompatLayout struct, so a title
whose sound driver registers a different SID or different subcommand numbers can
be served without editing deps. Upstream already parameterized the per-game
addresses; this extends the layout to the SID and fno numbers too.
- PS2SoundDriverCompatLayout gains commandSid/stateSid + a servesSid() helper,
the submit/getStatus/getAddrTable/streamOpen/channelConfig/stop fno fields,
benignStatusValue (default 0xffffff9b), and the stream/channel/stop address
fields.
- handleSoundDriverRpcServiceImpl snapshots the layout under g_rpc_mutex,
returns false without touching guest memory when unconfigured
(commandSid == stateSid == 0), gates on servesSid, then dispatches by matching
rpcNum against the layout's fno fields (each nonzero-guarded) -- submit /
getStatus / getAddrTable (existing semantics, re-keyed) plus new streamOpen /
channelConfig / stop writes. Unknown fno on a served SID writes
benignStatusValue to recv[0] and falls through (returns false) so LIBSD/game
handlers still run.
- Remove the IOP_SID_SNDDRV_* / IOP_RPC_SNDDRV_* placeholder constants and their
references in the debug panel. IOP_SID_LIBSD is kept (LIBSD fast path).
- Migrate the RE:CVX (slus_201.84) override, which relied on the deleted
state-SID path (sid=1, fno 0x12/0x13) to provision the sound-driver
status/addr-table pool: applyRecvxSoundDriverCompat now sets stateSid=1,
getStatusFno=0x12, getAddrTableFno=0x13. Without this the handler's
unconfigured guard returns false, statusAddr is never provisioned, and the
sceSifGetOtherData checksum backfill (fires only when srcAddr==statusAddr)
silently stops. The old submit path used placeholder SID 0 / fno 0 (a non-real
service) and is left unconfigured. LotR override audited: uses only
completionCallbacks (a separate, non-SID-gated path) and needs no migration.
0-sentinel limitation: 0 is the "unused" value for every SID/fno field, so a
service whose SID is literally 0 or a subcommand whose fno is literally 0 cannot
be expressed. Deliberate tradeoff -- real SIF-RPC services are nonzero, and the
deleted placeholder constants that were 0 were never live services.
Tests: migrate the existing snddrv-state RPC unit tests to register a layout;
add regression tests covering every subcommand semantic, the benign unknown-fno
fall-through, the inert unconfigured layout, two games routing independently
through the single global layout slot, and a real-path test provisioning the
layout solely via applyMatching("slus_201.84") and driving the actual
SifCallRpc(getStatus) -> sceSifGetOtherData backfill (fails if the override
migration is reverted).
ps2x_tests: 299 passed, 0 failed.
0 commit comments