DSPHLE/AX: Set state to WaitingForCmdListSize when switching uCodes #10991
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.
Fixes https://bugs.dolphin-emu.org/issues/13017. With uCode switching, the existing instance of AXUCode is re-activated when GBAUCode is done, but if the state remains as WaitingForNextTask, it won't be able to do anything. Instead, it needs to be in WaitingForCmdListSize.
(When the AX uCode is resumed, startpc is set to 0x0030, at least for 0x07f88145; this is the same location as MAIL_RESUME jumps to, so DSP_RESUME should be sent when the resuming happens; that's already handled by AXUCode::Update.)
The Zelda uCode already handled this, as it already tracked states prior to #10768:
dolphin/Source/Core/Core/HW/DSPHLE/UCodes/Zelda.cpp
Lines 208 to 214 in 86d760b
I don't actually have a game that uses uCode switching with the GBA uCode (the only game I have that uses the GBA uCode is the Preview Disc, as both Doubutsu no Mori e+ and Pokémon Channel use the CPU for GBA encryption. I instead tested this using my experimental CARD uCode implementation, which had the same issue (since both the GBA uCode and CARD uCode use uCode switching). (I actually have Rogue Squadron III, which apparently supports GBAs; I haven't tested that yet.)