-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pcsx2: DI execution is delayed by one instruction #3172
Conversation
Nice! |
by PSI and Dobiestation, through testing :P and I think the information was looked up from old sony newsgroups |
This is a awsome fix! You forgot to mention the Incredibles games but it's not that important as it is the same engine as those 2 spongebob games. |
They do have a boot patch too, if it fixes those games too I can remove it as well. |
Well, code that uses DI is timing critical. This fix could be pretty big ;p |
As I've already told Ref, none of my other games have shown regressions. Everything is working fine so far :). He did mention on Discord that it shouldn't affect anything that didn't already have a big patch :P |
f41d476
to
bf79f2c
Compare
I suppose a good follow up would be to check IOP as well :) |
I'll give an in-depth explanation on what's going on. These games rely on a bug in the EE kernel. Just before it starts executing a game, the kernel tries to disable interrupts with the following code:
However, DI is not atomic. That means it does not complete after the instruction has executed, which means that the MFC0 will be executed before DI completes. That is to say... MFC0 will read the old value of the master interrupt enable, which is set to 1. The DI completes before MTC0 is executed, but MTC0 will overwrite the master interrupt enable as a result. The tl;dr here is that the DI has no effect because the kernel doesn't properly wait for interrupts to be disabled. All these games check if interrupts are enabled when they start booting by reading the master interrupt enable bit. If interrupts are disabled, they will crash or hang in various ways - Jak X calls the Exit syscall, Namco 50 hangs on a black screen, Heavy Iron games hang on loading screens. There is no reason for them to do this other than to mess with emulators. Clearly it worked, given how long PCSX2 has needed patches to deal with the more popular games, and how the less popular games were simply doomed to never work. |
Fixes booting issues in the following games: Jak X, Namco 50th anniversary, Spongebob the Movie, Spongebob Battle for Bikini Bottom, The Incredibles, The Incredibles rize of the underminer, Soukou kihei armodyne, Garfield Saving Arlene, Tales of Fandom Vol. 2. The games will no longer require a patch to boot.
Jak X, Spongebob Squarepants( The movie and Battle for Bikini Bottom), namCollection - Namco 50th Anniversary, Disney-Pixar's The Incredibles, Incredibles, The - Rise of the Underminer.
bf79f2c
to
f795068
Compare
Core: Fixes booting issues in the following games:
Jak X, Namco 50th anniversary, Spongebob the Movie, Spongebob Battle for Bikini Bottom,
The Incredibles, The Incredibles rize of the underminer, Soukou kihei armodyne, Garfield Saving Arlene, Tales of Fandom Vol. 2.
The games will no longer require a patch to boot.
Gamedb: remove gamefix patches for DI execution fixes. Jak X, Spongebob Squarepants( The movie and Battle for Bikini Bottom), namCollection - Namco 50th Anniversary, Soukou kihei armodyne, garfield saving arlene.
Credits go to Refraction, fix was backported from Dobiestation, original contributors Refraction and PSI