From c309704d55ed7a4d021961441635545983f8b378 Mon Sep 17 00:00:00 2001 From: squall-leonhart Date: Wed, 25 Mar 2009 06:10:43 +0000 Subject: [PATCH] :) Applied OV2's pause when inactive fix, now works great! that'll make people happy. --- src/gba/Sound.cpp | 7 +++++++ src/gba/Sound.h | 3 +++ src/win32/MainWnd.cpp | 1 - src/win32/VBA.cpp | 3 +-- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/gba/Sound.cpp b/src/gba/Sound.cpp index 983fd9e2..e8f7523f 100644 --- a/src/gba/Sound.cpp +++ b/src/gba/Sound.cpp @@ -543,6 +543,13 @@ bool soundInit() return true; } +void soundSetThrottle(unsigned short throttle) +{ + if(!soundDriver) + return; + soundDriver->setThrottle(throttle); +} + long soundGetSampleRate() { return soundSampleRate; diff --git a/src/gba/Sound.h b/src/gba/Sound.h index 063130fc..f6661930 100644 --- a/src/gba/Sound.h +++ b/src/gba/Sound.h @@ -11,6 +11,9 @@ // current value in soundQuality global. bool soundInit(); +// sets the Sound throttle +void soundSetThrottle(unsigned short throttle); + // Manages sound volume, where 1.0 is normal void soundSetVolume( float ); float soundGetVolume(); diff --git a/src/win32/MainWnd.cpp b/src/win32/MainWnd.cpp index a41fa24e..f59ef53f 100644 --- a/src/win32/MainWnd.cpp +++ b/src/win32/MainWnd.cpp @@ -1220,7 +1220,6 @@ void MainWnd::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized) } theApp.active = a; } - theApp.active = a; memset(theApp.delta,255,sizeof(theApp.delta)); } diff --git a/src/win32/VBA.cpp b/src/win32/VBA.cpp index ca08bde5..2adc255c 100644 --- a/src/win32/VBA.cpp +++ b/src/win32/VBA.cpp @@ -882,8 +882,7 @@ void VBA::updateThrottle( unsigned short throttle ) systemFrameSkip = 0; } - soundShutdown(); - soundInit(); + soundSetThrottle(throttle); }