ppu: guest callbacks receive r3 through r10 - #86
Open
canersaka wants to merge 1 commit into
Open
Conversation
Expand the shared guest-caller hook and both OPD dispatch helpers from r3-r6 to the full r3-r10 register argument window. Update every in-tree caller and runner, and preserve sceNpTrophy's fifth callback argument instead of forcing r7 to zero.
canersaka
marked this pull request as ready for review
July 25, 2026 05:57
sp00nznet
added a commit
that referenced
this pull request
Aug 15, 2026
#86 widened ppu_guest_call / the g_ps3_guest_caller hook from r3-r6 to r3-r10 and updated every call site that existed on its base. Two sites added later by the integration chain were not on that base and were left at five arguments: runtime/ppu/ppu_hle.cpp:407 ppu_guest_call(iopd, desc, 1, 8, 0x398) lbp/main.cpp:174 harness_guest_caller + its local typedef/extern The lbp one is the worse of the two: it re-declared ps3_guest_caller_fn locally with five parameters and installed a five-parameter function as the hook, so a nine-argument call through g_ps3_guest_caller was an ABI mismatch rather than a compile error. Neither showed up in the #91 verification because ppu_hle.cpp and lbp/main.cpp are per-title files, not part of the ps3recomp_runtime library or the sync_stress target. Found by building the Rubber Ducky port against master. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The guest-call bridge only accepted seven integer arguments, r3 through r9, even though the 64-bit PowerPC ABI has eight volatile argument registers through r10. Every wrapper and callback adapter inherited that truncation. A callback with an eighth register argument silently received zero or stale state, and the trophy callback path made the loss visible by explicitly discarding its fifth callback argument before entering the guest.
This extends the shared dispatcher and its wrappers to carry r3 through r10, then updates the existing call sites mechanically. Shorter callbacks still pass zero in unused positions. The trophy adapter now forwards the argument it previously discarded; there is no per-title special case.
Verified: ps3recomp_runtime builds clean with all twelve call sites updated, and the PPU dispatcher translation unit compiles independently with the new signature. The diff is signature propagation plus the one trophy forwarding correction; no callback selection or return-value behavior changes.