From 99d5c6e6df18faf0f577a43eba78c870ed506869 Mon Sep 17 00:00:00 2001 From: spacy51 Date: Tue, 26 Aug 2008 20:48:25 +0000 Subject: [PATCH] REMOVED soundOffFlag remains --- src/Sound.cpp | 9 ++------- src/Sound.h | 1 - src/dmg/GB.cpp | 27 --------------------------- src/dmg/gbSound.cpp | 10 ++-------- src/win32/MainWnd.cpp | 3 +-- src/win32/MainWndTools.cpp | 26 ++++++++++++-------------- src/win32/VBA.cpp | 2 +- 7 files changed, 18 insertions(+), 60 deletions(-) diff --git a/src/Sound.cpp b/src/Sound.cpp index 9b0efdd6..126a029f 100644 --- a/src/Sound.cpp +++ b/src/Sound.cpp @@ -71,7 +71,6 @@ int soundBufferLen = sizeof soundFinalWave; int soundDebug = 0; u32 soundNextPosition = 0; -bool soundOffFlag = false; bool soundPaused = true; void interp_rate() { /* empty for now */ } @@ -569,14 +568,10 @@ void soundSetQuality(int quality) { if ( systemCanChangeSoundQuality() ) { - if ( !soundOffFlag ) - soundShutdown(); - + soundShutdown(); soundQuality = quality; soundNextPosition = 0; - - if ( !soundOffFlag ) - soundInit(); + soundInit(); } else { diff --git a/src/Sound.h b/src/Sound.h index 5d42cf85..52875460 100644 --- a/src/Sound.h +++ b/src/Sound.h @@ -62,6 +62,5 @@ extern float soundFiltering; // 0.0 = none, 1.0 = max (only if soundInterpola extern int soundBufferTotalLen; extern u32 soundNextPosition; extern bool soundPaused; -extern bool soundOffFlag; #endif // VBA_SOUND_H diff --git a/src/dmg/GB.cpp b/src/dmg/GB.cpp index dbb2d82b..fe8760f5 100644 --- a/src/dmg/GB.cpp +++ b/src/dmg/GB.cpp @@ -5270,33 +5270,6 @@ void gbEmulate(int ticksToStop) while (gbInternalTimer<0) gbInternalTimer+=0x100; - /* - if(soundOffFlag) { - if(synchronize && !speedup) { - synchronizeTicks -= clockTicks; - - while(synchronizeTicks < 0) { - synchronizeTicks += SYNCHRONIZE_CLOCK_TICKS; - - DWORD now = GetTickCount(); - gbElapsedTime += (now - timeNow); - - if(gbElapsedTime < 50) { - DWORD diff = 50 - gbElapsedTime; - Sleep(diff); - timeNow = GetTickCount(); - elapsedTime = timeNow - now - diff; - if((int)elapsedTime < 0) - elapsedTime = 0; - } else { - timeNow = GetTickCount(); - elapsedTime = 0; - } - } - } - } - */ - clockTicks = 0; if (gbIntBreak == 1) diff --git a/src/dmg/gbSound.cpp b/src/dmg/gbSound.cpp index 89a1ae41..839f8385 100644 --- a/src/dmg/gbSound.cpp +++ b/src/dmg/gbSound.cpp @@ -43,8 +43,6 @@ extern int soundTicks; extern int SOUND_CLOCK_TICKS; extern u32 soundNextPosition; -extern bool soundOffFlag; - int const ticks_to_time = 2 * GB_APU_OVERCLOCK; static inline blip_time_t blip_time() @@ -235,14 +233,10 @@ void gbSoundSetQuality(int quality) { if ( systemCanChangeSoundQuality() ) { - if ( !soundOffFlag ) - soundShutdown(); - + soundShutdown(); soundQuality = quality; soundNextPosition = 0; - - if ( !soundOffFlag ) - soundInit(); + soundInit(); } else { diff --git a/src/win32/MainWnd.cpp b/src/win32/MainWnd.cpp index d9c2eea3..1af57b04 100644 --- a/src/win32/MainWnd.cpp +++ b/src/win32/MainWnd.cpp @@ -600,8 +600,7 @@ bool MainWnd::FileRun() else soundReset(); } else { - if(!soundOffFlag) - soundInit(); + soundInit(); theApp.soundInitialized = true; } diff --git a/src/win32/MainWndTools.cpp b/src/win32/MainWndTools.cpp index 5815f078..8bd1cf92 100644 --- a/src/win32/MainWndTools.cpp +++ b/src/win32/MainWndTools.cpp @@ -413,20 +413,18 @@ void MainWnd::OnToolsRecordStartavirecording() } // add audio stream - if( !soundOffFlag ) { - ret = theApp.aviRecorder->CreateAudioStream( - 2, - 44100 / soundQuality, - 16, - this->GetSafeHwnd() - ); - if( !ret ) { - systemMessage( IDS_AVI_CANNOT_CREATE_AUDIO, "Cannot create audio stream in AVI file." ); - delete theApp.aviRecorder; - theApp.aviRecorder = NULL; - theApp.aviRecording = false; - return; - } + ret = theApp.aviRecorder->CreateAudioStream( + 2, + 44100 / soundQuality, + 16, + this->GetSafeHwnd() + ); + if( !ret ) { + systemMessage( IDS_AVI_CANNOT_CREATE_AUDIO, "Cannot create audio stream in AVI file." ); + delete theApp.aviRecorder; + theApp.aviRecorder = NULL; + theApp.aviRecording = false; + return; } } diff --git a/src/win32/VBA.cpp b/src/win32/VBA.cpp index 220df57c..cd2a54bf 100644 --- a/src/win32/VBA.cpp +++ b/src/win32/VBA.cpp @@ -1360,7 +1360,7 @@ void systemWriteDataToSoundBuffer() } } - if( theApp.aviRecording && theApp.aviRecorder && !soundOffFlag ) { + if( theApp.aviRecording && theApp.aviRecorder ) { if( theApp.skipAudioFrames ) { theApp.skipAudioFrames--; } else {