video/gcm: fix cellGcmGetTiledPitchSize ABI and flip/vblank handler dispatch - #29
Open
sp00nznet wants to merge 1 commit into
Open
video/gcm: fix cellGcmGetTiledPitchSize ABI and flip/vblank handler dispatch#29sp00nznet wants to merge 1 commit into
sp00nznet wants to merge 1 commit into
Conversation
…ispatch
Two GCM bugs that prevented the title's RSX command stream from being
issued correctly.
1. cellGcmGetTiledPitchSize had the wrong ABI. The real export is
uint32_t cellGcmGetTiledPitchSize(uint32_t size) -- one argument, the
aligned tiled pitch returned in r3. The previous 2-arg form treated r4
as an out-pointer and wrote the pitch through it. At the title's call
site r4 still held the caller's CellVideoOutResolution* (left over from
the preceding cellVideoOutGetResolution), so the write clobbered
width/height with the pitch value -- width became 0 and every
downstream tile / display-buffer setup computed from garbage.
2. Flip/vblank handler callbacks were dispatched by re-resolving the
handler OPD at tick time. The title's handler OPDs (0x530D70/78/80)
have their code word clobbered in guest memory by a later lifted store,
so re-resolving yields the TOC base instead of the real entry. Capture
the resolved {code,toc} at registration time and dispatch through the
new ppu_guest_call_ct() (call-by-resolved-code/toc), which runs the
real lifted handler regardless of the later OPD corruption.
Co-Authored-By: Claude Opus 4.8 (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.
Summary
Two GCM/RSX bugs found while bringing up You Don't Know Jack (BLUS30569) under the recompiler. Both prevented the title's RSX command stream from being issued correctly. With these fixes the title's own recompiled code reaches the FIFO and issues real
NV4097_CLEAR_SURFACEcommands (visible clears on screen via the D3D12 backend).1.
cellGcmGetTiledPitchSizehad the wrong ABIThe real export is
uint32_t cellGcmGetTiledPitchSize(uint32_t size)— one argument, with the aligned tiled pitch returned inr3. The previous 2-arg form treatedr4as an out-pointer and wrote the pitch through it.At the title's call site
r4still held the caller'sCellVideoOutResolution*(left over from the precedingcellVideoOutGetResolution), so the write clobberedwidth/heightwith the pitch value.widthbecame0, and every downstream tile / display-buffer setup computed from garbage.2. Flip/vblank handler callbacks dispatched through a clobbered OPD
Handlers were dispatched by re-resolving the handler OPD at tick time. The title's handler OPDs (
0x530D70/78/80) have their code word clobbered in guest memory by a later lifted store, so re-resolving yields the TOC base instead of the real entry point.Fix: capture the resolved
{code, toc}at registration time and dispatch through a newppu_guest_call_ct()(call-by-resolved-code/toc) in the PPU loader, which runs the real lifted handler regardless of the later OPD corruption.Testing
ps3recomp_runtimebuilds clean (Release).ydkj_boot.exelinks clean end-to-end against the newcellGcmGetTiledPitchSizesignature.CLEAR_SURFACEfrom its own recompiled code.🤖 Generated with Claude Code