Win32 - more turbo sound skip fix. Sound is completely bypassed if muteturbo is set
This commit is contained in:
parent
9716bd99e3
commit
5a0185c0ad
|
@ -40,9 +40,10 @@ LPDIRECTINPUT7 lpDI=0;
|
|||
|
||||
void InitInputPorts(bool fourscore);
|
||||
|
||||
int tempwinsync = 0;
|
||||
int tempwinsync = 0; //Temp variable used by turbo to turn of sync settings
|
||||
int tempsoundquality = 0; //Temp variable used by turbo to turn of sound quality settings
|
||||
extern int winsync;
|
||||
|
||||
extern int soundquality;
|
||||
//UsrInputType[] is user-specified. InputType[] is current
|
||||
// (game/savestate/movie loading can override user settings)
|
||||
|
||||
|
@ -1481,22 +1482,32 @@ void FCEUD_TurboOn (void)
|
|||
{
|
||||
tempwinsync = winsync; //Store winsync setting
|
||||
winsync = 0; //turn off winsync for turbo (so that turbo can function even with VBlank sync methods
|
||||
tempsoundquality = soundquality; //Store sound quality settings
|
||||
FCEUI_SetSoundQuality(0); //Turn sound quality to low
|
||||
turbo = true;
|
||||
if (muteTurbo && soundo) TrashSound();
|
||||
}
|
||||
void FCEUD_TurboOff (void)
|
||||
{
|
||||
winsync = tempwinsync; //Restore winsync setting
|
||||
winsync = tempwinsync; //Restore winsync setting
|
||||
soundquality = tempsoundquality; //Restore sound quality settings
|
||||
FCEUI_SetSoundQuality(soundquality);
|
||||
turbo = false;
|
||||
if (muteTurbo && soundo) InitSound();
|
||||
}
|
||||
void FCEUD_TurboToggle(void)
|
||||
{
|
||||
if (turbo) winsync = tempwinsync; //If turbo was on, restore winsync
|
||||
if (turbo) {
|
||||
winsync = tempwinsync; //If turbo was on, restore winsync
|
||||
soundquality = tempsoundquality; //and restore sound quality setting
|
||||
FCEUI_SetSoundQuality(soundquality);
|
||||
}
|
||||
else
|
||||
{
|
||||
tempwinsync = winsync;
|
||||
winsync = 0; //If turbo was off, turn off winsync (so that turbo can function even with VBlank sync methods
|
||||
tempwinsync = winsync; //Store video sync settings
|
||||
tempsoundquality = soundquality; //Store sound quality settings
|
||||
winsync = 0; //If turbo was off, turn off winsync (so that turbo can function even with VBlank sync methods
|
||||
FCEUI_SetSoundQuality(0); //Set sound quality to low
|
||||
}
|
||||
|
||||
turbo = !turbo;
|
||||
|
|
|
@ -693,7 +693,7 @@ doloopy:
|
|||
{
|
||||
frameSkipCounter--;
|
||||
if (muteTurbo) skippy = 2; //If mute turbo is on, we want to bypass sound too, so set it to 2
|
||||
skippy = 1; //Else set it to 1 to just frameskip
|
||||
else skippy = 1; //Else set it to 1 to just frameskip
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
#include "common.h"
|
||||
#include "main.h"
|
||||
|
||||
extern bool turbo; //If turbo is running
|
||||
|
||||
/// controls whether playback is muted
|
||||
static bool mute = false;
|
||||
/// indicates whether we've been coerced into outputting 8bit audio
|
||||
|
@ -503,7 +505,7 @@ case WM_COMMAND:
|
|||
if(soundrate<44100)
|
||||
{
|
||||
soundquality=0;
|
||||
FCEUI_SetSoundQuality(0);
|
||||
if (!turbo) FCEUI_SetSoundQuality(0); ///If turbo is running, don't do this call, turbo will handle it instead
|
||||
UpdateSD(hwndDlg);
|
||||
}
|
||||
if(soundo)
|
||||
|
@ -519,7 +521,7 @@ case WM_COMMAND:
|
|||
case COMBO_SOUND_QUALITY:
|
||||
soundquality=SendDlgItemMessage(hwndDlg,COMBO_SOUND_QUALITY,CB_GETCURSEL,0,(LPARAM)(LPSTR)0);
|
||||
if(soundrate<44100) soundquality=0;
|
||||
FCEUI_SetSoundQuality(soundquality);
|
||||
if (!turbo) FCEUI_SetSoundQuality(soundquality); //If turbo is running, don't do this call, turbo will handle it instead
|
||||
UpdateSD(hwndDlg);
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue