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
DSPHLE: Eliminate global state in GBA and AX uCode + accuracy improvements #10768
Conversation
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.
LGTM. Untested
|
Ah, I forgot to mention that I did test this using the GameCube Preview Disc. |
|
LGTM, fine to merge once the merge conflict is resolved. |
|
Note that #10753 (comment) should be resolved before this is merged. |
549104e
to
244c9e5
Compare
|
Gah, I just noticed that the AX uCode has similar static state - I tried checking for this, but I must have missed it. dolphin/Source/Core/Core/HW/DSPHLE/UCodes/AX.cpp Lines 659 to 665 in c8e7162
I'm going to fix that in this PR as well to avoid bumping the savestate version twice. |
244c9e5
to
c689e4b
Compare
c689e4b
to
9220088
Compare
9259ac8
to
c7872b7
Compare
c7872b7
to
fb48afd
Compare
|
What's the status here, I assume this is done? I kinda lost track of it after the stuff in #10753. |
|
Yep, this is done and ready for review. |
086531a
to
91b95ae
Compare
7916d01
to
212970e
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.
Very cool to have the global state done away with. Just one minor nit, but this looks completely fine otherwise
(Apart from AXUCode, which is inherited by AXWiiUCode.)
The accuracy improvements are: * The request mail must be 0xabba0000 exactly; both the low and high parts are checked * The address is masked with 0x0fffffff * Before, the global state meant that after the GBA uCode had been used once, it would accept 0xcdd1 commands immediately. Now, it only accepts them after execution has finished.
This also increases accuracy as to when specific mail is allowed, and correctly handles masking of the 0xCDD1 mails.
CARDUCode, GBAUCode, and INITUCode previously didn't have an implementation of it. In practice it's unlikely that this caused an issue, since these uCodes are only active for a few frames at most, but now that GBAUCode doesn't have global state, we can implement it there. I also implemented it for CARDUCode, although our CARDUCode implementation does not have all states handled yet - this is simply future-proofing so that when the card uCode is properly implemented, the save state version does not need to be bumped. INITUCode does not have any state to save, though.
212970e
to
bf70026
Compare
The accuracy improvements are:
This is somewhat based on my WIP HLE version of the Card uCode, which the GBA uCode has some similarities with. I briefly checked the accuracy changes above, but I haven't done a thorough read-through of the GBA uCode myself.
This PR also bundles #10753.