Skip to content

Commit

Permalink
DSPHLE/AX: Set state to WaitingForCmdListSize when switching uCodes
Browse files Browse the repository at this point in the history
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.)
  • Loading branch information
Pokechu22 committed Aug 17, 2022
1 parent b6a18b0 commit f9e1933
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Source/Core/Core/HW/DSPHLE/UCodes/AX.cpp
Expand Up @@ -701,6 +701,10 @@ void AXUCode::HandleMail(u32 mail)

case MAIL_NEW_UCODE:
m_upload_setup_in_progress = true;
// Relevant when this uCode is resumed after switching.
// The resume mail is sent via the NeedsResumeMail() check above
// (and the flag corresponding to it is set by PrepareBootUCode).
m_mail_state = MailState::WaitingForCmdListSize;
break;

case MAIL_RESET:
Expand Down

0 comments on commit f9e1933

Please sign in to comment.