SPU refactoring, step 1: Goodbye SNDDXThread.
Music doesn't continue playing anymore while the emu is paused. Feel free to revert.
This commit is contained in:
parent
680c4b3b00
commit
2a0edb3c90
|
@ -1198,6 +1198,7 @@ static void StepRunLoop_Core()
|
||||||
{
|
{
|
||||||
Lock lock;
|
Lock lock;
|
||||||
NDS_exec<false>();
|
NDS_exec<false>();
|
||||||
|
SPU_Emulate_user();
|
||||||
win_sound_samplecounter = 735;
|
win_sound_samplecounter = 735;
|
||||||
}
|
}
|
||||||
inFrameBoundary = true;
|
inFrameBoundary = true;
|
||||||
|
|
|
@ -70,24 +70,8 @@ static int issoundmuted;
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
static volatile bool doterminate;
|
|
||||||
static volatile bool terminated;
|
|
||||||
|
|
||||||
extern volatile int win_sound_samplecounter;
|
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)
|
int SNDDXInit(int buffersize)
|
||||||
{
|
{
|
||||||
|
@ -185,10 +169,6 @@ int SNDDXInit(int buffersize)
|
||||||
soundvolume = DSBVOLUME_MAX;
|
soundvolume = DSBVOLUME_MAX;
|
||||||
issoundmuted = 0;
|
issoundmuted = 0;
|
||||||
|
|
||||||
doterminate = false;
|
|
||||||
terminated = false;
|
|
||||||
CreateThread(0,0,SNDDXThread,0,0,0);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,11 +178,6 @@ void SNDDXDeInit()
|
||||||
{
|
{
|
||||||
DWORD status=0;
|
DWORD status=0;
|
||||||
|
|
||||||
doterminate = true;
|
|
||||||
while(!terminated) {
|
|
||||||
Sleep(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (lpDSB2)
|
if (lpDSB2)
|
||||||
{
|
{
|
||||||
IDirectSoundBuffer8_GetStatus(lpDSB2, &status);
|
IDirectSoundBuffer8_GetStatus(lpDSB2, &status);
|
||||||
|
|
Loading…
Reference in New Issue