Repository navigation
fix: wrap VIF MPG uploads within VU micro memory - #437
Open
Tzeentchnet wants to merge 1 commit into
Open
Tzeentchnet wants to merge 1 commit into
Tzeentchnet wants to merge 1 commit into
Conversation
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
Rationale
MPG addresses and payloads operate within fixed-size VU micro memory (4 KiB for VU0 and 16 KiB for VU1). The current interpreter truncates uploads at the end of either region and ignores VIF1 destinations outside the first 16 KiB instead of applying the address mask. A truncated packet can also partially update memory when its first segment reaches the end of the buffer.
The updated behavior matches PCSX2's VIF implementation: destination addresses are masked to the target VU's micro-memory size, and crossing uploads are split between the end and beginning of that memory.
Testing
Added focused VIF0 and VIF1 coverage for:
0x0200(VIF0) and0x0800(VIF1) aliasing address zero;Windows Release builds:
ps2x_tests— 448 passed, 0 failed.ps2x_tests— 448 passed, 0 failed.