DSPHLE: Properly reflect initial halt state in mail handler #10785
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.
DSPHLE::Initializesets the halt and init bits to true (i.e. m_dsp_control.Hex starts as 0x804), which is reasonable behavior (this is the state the DSP will be in when starting a game from the IPL, as after__OSStopAudioSystemthe control register is 0x804).However,
CMailHandler::m_halteddefaults to false, and we only callCMailHandler::SetHaltedinDSPHLE::DSP_WriteControlRegisterwhenm_dsp_control.DSPHaltchanges, so sinceDSPHaltdefaults to true, if the first thing that happens is writing true toDSPHalt,we won't properly halt the mail handler.Now, we call
CMailHandler::SetHaltedon startup. This fixes Datel titles when the IPL is skipped with DSP HLE (though this configuration only works once https://bugs.dolphin-emu.org/issues/8223 is fixed by #10746).For reference, here's
__OSStopAudioSystemfrom Super Mario Sunshine:And here are some relevant code snippets from around Dolphin (including in DSPLLE):
dolphin/Source/Core/Core/HW/DSPHLE/MailHandler.h
Lines 45 to 46 in b30e1c5
dolphin/Source/Core/Core/HW/DSPHLE/DSPHLE.cpp
Lines 28 to 30 in b30e1c5
dolphin/Source/Core/Core/HW/DSPHLE/DSPHLE.cpp
Lines 191 to 200 in b30e1c5
dolphin/Source/Core/Core/HW/DSPLLE/DSPLLE.cpp
Lines 137 to 145 in b30e1c5
dolphin/Source/Core/Core/DSP/DSPCore.cpp
Line 164 in b30e1c5
The relevant mistake was in #10761, for reference.