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
ProcessorInterface: Reset both GPFifo and Fifo on PI_FIFO_RESET #10883
Conversation
I'm not sure what the XMM0 check was supposed to be, but the 0xCC008000 one is for the fifo and is handled elsewhere now (look for `optimizeGatherPipe`).
52d1129
to
e7e5893
Compare
e7e5893
to
5bbdf7a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good. Tested and initially Monster Lab came up with a fifo error that crashed Dolphin (portable mode, fresh install, so dual core was active) after that I tested again (multiple times) in both single/dual core and saw no issues. I imagine that single scenario was a timing fluke caused by dual core. I tested booting a number of other Wii titles. Can't recall where I've seen fifo errors crop up but the titles I tested were fine. Overall LGTM
|
This PR should only affect games that use |
|
One other example of where this comes up: the default libogc crash handler calls With this PR, things behave correctly. (Also, the unknown opcode only happens if you don't have an SD card inserted and it crashes. Presumably any homebrew that crashes could run into a similar issue.) |
See #10454. Fixes https://bugs.dolphin-emu.org/issues/12981. Only the last commit has behavior differences; the rest are refactoring.
Before #10454, writing 1 to PI_FIFO_RESET would do nothing (this logging is from a modified build):
After, it would clear the FIFO used by the GPU execution (from Fifo.cpp), but not the 32-byte fifo written to directly (from GPFifo.cpp):
When enough data was written into the GP fifo, this would result in an unknown opcode error since
33isn't a valid graphics command.Now, the GP fifo is also cleared:
I still don't clear the CommandProcessor version of it (which is an intermediary between
GPFifo.cppandFifo.cpp) as that has hardware registers that are exposed to games.This change seems a bit dubious overall, as I feel like a hardware register wouldn't modify state internal to the CPU. The 750cl manual is vague about this too; it does say that "A mtspr to the WPAR establishes the gather address and resets the state of the facility, discarding any data in the buffer." (section 2.1.2.12/page 78), but doesn't say this in section 9.4.2 (page 327). There's also the
HID2[WPE]bit, which enables/disables this functionality; the manual says "It is not expected that the HID2[WPE] bit is changed after it is initially configured. Once enabled, it is a programming error to dynamically disable this facility, as it can interfere with active write gathering operations." (section 2.1.2.4/page 66), but also says "The write gather pipe facility can be disabled by setting HID2[WPE] = 0. Before disabling the write gather pipe, the WPAR[BNE] bit should be tested to insure that all outstanding transfers from the buffer to the bus have completed." (section 9.4.2/page 328). However,GXAbortFramedoes not modify either of these (they do get modified, but only well after the unknown opcode occurs), so something must happen that prevents this issue from occurring on real hardware. In any case, this fixes a regression in Dolphin.