iR5900: Reset manual protection counters on emulation reset #12259
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.
Description of Changes
Resets the manual protection counters on emulator reset
Rationale behind Changes
This counters are used to avoid excessive recompilation of blocks that share a page with data see;
pcsx2/pcsx2/x86/ix86-32/iR5900.cpp
Lines 2041 to 2049 in bf8693a
For some currently unknown reason, the initial value of these counters has an observable impact on TAS playback (at least with Jak X)
As these arrays weren't previously cleared, the sequential playback of the same TAS file will playback differently.
Ideally, we would investigate why this has an effect on TAS playback (especially given that these values are not stored in savestates), but I believe these arrays should be reset regardless.
Suggested Testing Steps
This might impact the performance on the second game launched in a PCSX2 session (or a relaunch of the same game)
For TAS playback testing, the following steps is what I've been testing with
Enable Pause on Start and Disable MTVU
Start a game, start input recording (from boot), then unpause
The second tutorial in Jak X is sensitive to this issue
Once recorded, close and reopen the emulator to get a clean state
Start a game, select the recording to play, then unpause
At the end of the recording, stop it and shutdown emulation
Relaunch the game, reselect the recording and unpause
Observe if any differences occur in playback between the 1st and 2nd run.