From 2a0edb3c90424da7e64ca71498ff1a4d28e79492 Mon Sep 17 00:00:00 2001 From: luigi__ Date: Thu, 8 Oct 2009 18:20:14 +0000 Subject: [PATCH] SPU refactoring, step 1: Goodbye SNDDXThread. Music doesn't continue playing anymore while the emu is paused. Feel free to revert. --- desmume/src/windows/main.cpp | 1 + desmume/src/windows/snddx.cpp | 25 ------------------------- 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/desmume/src/windows/main.cpp b/desmume/src/windows/main.cpp index e9eda43a8..41c132954 100644 --- a/desmume/src/windows/main.cpp +++ b/desmume/src/windows/main.cpp @@ -1198,6 +1198,7 @@ static void StepRunLoop_Core() { Lock lock; NDS_exec(); + SPU_Emulate_user(); win_sound_samplecounter = 735; } inFrameBoundary = true; diff --git a/desmume/src/windows/snddx.cpp b/desmume/src/windows/snddx.cpp index 889ad8ac7..acf7e7369 100755 --- a/desmume/src/windows/snddx.cpp +++ b/desmume/src/windows/snddx.cpp @@ -70,24 +70,8 @@ static int issoundmuted; ////////////////////////////////////////////////////////////////////////////// -static volatile bool doterminate; -static volatile bool terminated; - extern volatile int win_sound_samplecounter; -DWORD WINAPI SNDDXThread( LPVOID ) -{ - for(;;) { - if(doterminate) break; - { - Lock lock; - SPU_Emulate_user(); - } - Sleep(10); - } - terminated = true; - return 0; -} int SNDDXInit(int buffersize) { @@ -185,10 +169,6 @@ int SNDDXInit(int buffersize) soundvolume = DSBVOLUME_MAX; issoundmuted = 0; - doterminate = false; - terminated = false; - CreateThread(0,0,SNDDXThread,0,0,0); - return 0; } @@ -198,11 +178,6 @@ void SNDDXDeInit() { DWORD status=0; - doterminate = true; - while(!terminated) { - Sleep(1); - } - if (lpDSB2) { IDirectSoundBuffer8_GetStatus(lpDSB2, &status);