add DSP halt/unhalt when switching between sound modes

This commit is contained in:
Daryl Borth 2018-08-14 15:40:43 -06:00
parent 3f080d6208
commit 7dd08ac408

View File

@ -103,7 +103,10 @@ SwitchAudioMode(int mode)
{ {
#ifndef NO_SOUND #ifndef NO_SOUND
ASND_Pause(1); ASND_Pause(1);
ASND_End();
AUDIO_StopDMA(); AUDIO_StopDMA();
AUDIO_RegisterDMACallback(NULL);
DSP_Halt();
AUDIO_RegisterDMACallback(AudioPlayer); AUDIO_RegisterDMACallback(AudioPlayer);
#endif #endif
memset(soundbuffer[0],0,3840); memset(soundbuffer[0],0,3840);
@ -117,6 +120,7 @@ SwitchAudioMode(int mode)
{ {
IsPlaying = 0; IsPlaying = 0;
#ifndef NO_SOUND #ifndef NO_SOUND
DSP_Unhalt();
ASND_Init(); ASND_Init();
ASND_Pause(0); ASND_Pause(0);
#else #else