From f9e19331115a5c4dad3611ddd24ca3bffbc73a00 Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Wed, 17 Aug 2022 12:03:06 -0700 Subject: [PATCH] DSPHLE/AX: Set state to WaitingForCmdListSize when switching uCodes 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.) --- Source/Core/Core/HW/DSPHLE/UCodes/AX.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/Core/Core/HW/DSPHLE/UCodes/AX.cpp b/Source/Core/Core/HW/DSPHLE/UCodes/AX.cpp index 796436c5fa59..dcdad5fb5e40 100644 --- a/Source/Core/Core/HW/DSPHLE/UCodes/AX.cpp +++ b/Source/Core/Core/HW/DSPHLE/UCodes/AX.cpp @@ -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: