Repository navigation
fix(gs): route GIF A+D 0x58 PMODE writes to the privileged register file - #401
Open
LeandroSSB wants to merge 1 commit into
Open
LeandroSSB wants to merge 1 commit into
LeandroSSB wants to merge 1 commit into
Conversation
The GS privileged display registers 0x59-0x5c (DISPFB1/DISPLAY1/DISPFB2/ DISPLAY2) and 0x5f (BGCOLOR) were applied from A+D writes, but 0x58 (PMODE) fell through the switch and was silently discarded. Games that build their display env as GIF packets (libgraph PutDispEnv-style) enable CRT1 through exactly that id, so the register file kept pmode=0 and the presentation request decoded enableCrt1=0 no matter what the game wrote. Guarded by a suite test that pushes the full env (0x58 PMODE, 0x59 DISPFB1, 0x5a DISPLAY1, 0x5b DISPFB2, 0x5c DISPLAY2) through writeRegister and checks each lands in the privileged register file. Suite: 460/460 (459 + 1 new) from the repo root. Co-Authored-By: Claude Code <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.
Root cause
The GS register funnel (
writeRegisterUnlocked) applies A+D ids0x59-0x5c(DISPFB1/DISPLAY1/DISPFB2/DISPLAY2) and0x5f(BGCOLOR) to the privileged register bank — but0x58(PMODE) had no case and was silently dropped.Games that build the display environment as a GIF packet (
sceGsPutDispEnv/ libgraph style) enable CRT1 exactly through that id. Without the casepmodestays 0, presentation resolvesenableCrt1 = 0, and the frontend never presents — regardless of DISPFB/DISPLAY being correct.Fix
case 0x58:in the funnel, beside the existing0x59-0x5c:m_privRegs->pmode = value.Test
ps2_gs_tests: pushes the full display environment through A+D (0x058..0x05c) and verifies each field in the privileged bank (the pre-existing ids act as guards for the new case).Specification behavior (GS privileged registers, PMODE @
0x12000000via A+D id0x58).Related: #185 writes PMODE from
sceGsResetGraphdirectly — a different route; the packet path through the GIF funnel is what this PR covers.🤖 Generated with Claude Code
Suite evidence
Fresh configure+build of
ps2x_testson this branch (VS 2022, Release): 447/447 passed, 0 failed.