mute frame advance option works once again
This commit is contained in:
parent
201261c142
commit
ef228133f6
119
src/fceu.cpp
119
src/fceu.cpp
|
@ -47,6 +47,11 @@
|
|||
#include "file.h"
|
||||
#include "vsuni.h"
|
||||
|
||||
//TODO - we really need some kind of global platform-specific options api
|
||||
#ifdef WIN32
|
||||
#include "drivers/win/main.h"
|
||||
#endif
|
||||
|
||||
|
||||
uint64 timestampbase;
|
||||
|
||||
|
@ -483,73 +488,73 @@ void UpdateRewind(void);
|
|||
///Skip may be passed in, if FRAMESKIP is #defined, to cause this to emulate more than one frame
|
||||
void FCEUI_Emulate(uint8 **pXBuf, int32 **SoundBuf, int32 *SoundBufSize, int skip)
|
||||
{
|
||||
int r,ssize;
|
||||
|
||||
JustFrameAdvanced = false;
|
||||
int r,ssize;
|
||||
|
||||
if(frameAdvanceRequested) {
|
||||
if(frameAdvanceDelay==0) {
|
||||
EmulationPaused = 3;
|
||||
frameAdvanceDelay++;
|
||||
} else {
|
||||
if(frameAdvanceDelay>=10) {
|
||||
EmulationPaused = 3;
|
||||
} else frameAdvanceDelay++;
|
||||
}
|
||||
}
|
||||
JustFrameAdvanced = false;
|
||||
|
||||
if(frameAdvanceRequested) {
|
||||
if(frameAdvanceDelay==0) {
|
||||
EmulationPaused = 3;
|
||||
frameAdvanceDelay++;
|
||||
} else {
|
||||
if(frameAdvanceDelay>=10) {
|
||||
EmulationPaused = 3;
|
||||
} else frameAdvanceDelay++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(EmulationPaused&2)
|
||||
EmulationPaused &= ~1; // clear paused flag temporarily (frame advance)
|
||||
else if(EmulationPaused&1 || FCEU_BotMode())
|
||||
{
|
||||
memcpy(XBuf, XBackBuf, 256*256);
|
||||
FCEU_PutImage();
|
||||
*pXBuf=XBuf;
|
||||
*SoundBuf=WaveFinal;
|
||||
*SoundBufSize=0;
|
||||
if(EmulationPaused&2)
|
||||
EmulationPaused &= ~1; // clear paused flag temporarily (frame advance)
|
||||
else if(EmulationPaused&1 || FCEU_BotMode())
|
||||
{
|
||||
memcpy(XBuf, XBackBuf, 256*256);
|
||||
FCEU_PutImage();
|
||||
*pXBuf=XBuf;
|
||||
*SoundBuf=WaveFinal;
|
||||
*SoundBufSize=0;
|
||||
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if(!FCEU_BotMode())
|
||||
{
|
||||
AutoFire();
|
||||
UpdateRewind();
|
||||
}
|
||||
|
||||
FCEU_UpdateInput();
|
||||
if(geniestage!=1) FCEU_ApplyPeriodicCheats();
|
||||
r=FCEUPPU_Loop(skip);
|
||||
|
||||
ssize=FlushEmulateSound();
|
||||
if(!FCEU_BotMode())
|
||||
{
|
||||
AutoFire();
|
||||
UpdateRewind();
|
||||
}
|
||||
|
||||
//#ifdef WIN32
|
||||
// FCEUI_AviVideoUpdate(XBuf);
|
||||
//#endif
|
||||
FCEU_UpdateInput();
|
||||
if(geniestage!=1) FCEU_ApplyPeriodicCheats();
|
||||
r=FCEUPPU_Loop(skip);
|
||||
|
||||
timestampbase += timestamp;
|
||||
timestamp = 0;
|
||||
ssize=FlushEmulateSound();
|
||||
|
||||
//#ifdef WIN32
|
||||
// FCEUI_AviVideoUpdate(XBuf);
|
||||
//#endif
|
||||
|
||||
timestampbase += timestamp;
|
||||
timestamp = 0;
|
||||
|
||||
|
||||
*pXBuf=skip?0:XBuf;
|
||||
*SoundBuf=WaveFinal;
|
||||
*SoundBufSize=ssize;
|
||||
*pXBuf=skip?0:XBuf;
|
||||
*SoundBuf=WaveFinal;
|
||||
*SoundBufSize=ssize;
|
||||
|
||||
//if we were asked to frame advance, then since we have just finished
|
||||
//a frame, we should switch to regular pause
|
||||
if(EmulationPaused&2)
|
||||
{
|
||||
EmulationPaused = 1; // restore paused flag
|
||||
//mbg merge 7/28/06 don't like the looks of this...
|
||||
//#ifdef WIN32
|
||||
// #define SO_MUTEFA 16
|
||||
// extern int soundoptions;
|
||||
// if(soundoptions&SO_MUTEFA)
|
||||
//#endif
|
||||
*SoundBufSize=0; // keep sound muted
|
||||
JustFrameAdvanced = true;
|
||||
}
|
||||
//if we were asked to frame advance, then since we have just finished
|
||||
//a frame, we should switch to regular pause
|
||||
if(EmulationPaused&2)
|
||||
{
|
||||
EmulationPaused = 1; // restore paused flag
|
||||
|
||||
//mute the frame advance if the user requested it
|
||||
#ifdef WIN32
|
||||
if(soundoptions&SO_MUTEFA)
|
||||
*SoundBufSize=0; // keep sound muted
|
||||
#endif
|
||||
|
||||
JustFrameAdvanced = true;
|
||||
}
|
||||
}
|
||||
|
||||
void FCEUI_CloseGame(void)
|
||||
|
|
|
@ -13,12 +13,10 @@ Global
|
|||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{6893EF44-FEA3-46DF-B236-C4C200F54294}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{6893EF44-FEA3-46DF-B236-C4C200F54294}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{6893EF44-FEA3-46DF-B236-C4C200F54294}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{6893EF44-FEA3-46DF-B236-C4C200F54294}.Debug|x64.Build.0 = Debug|x64
|
||||
{6893EF44-FEA3-46DF-B236-C4C200F54294}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
{6893EF44-FEA3-46DF-B236-C4C200F54294}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{6893EF44-FEA3-46DF-B236-C4C200F54294}.Release|Win32.Build.0 = Release|Win32
|
||||
{6893EF44-FEA3-46DF-B236-C4C200F54294}.Release|x64.ActiveCfg = Release|x64
|
||||
{6893EF44-FEA3-46DF-B236-C4C200F54294}.Release|x64.Build.0 = Release|x64
|
||||
{6893EF44-FEA3-46DF-B236-C4C200F54294}.Release|x64.ActiveCfg = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
Loading…
Reference in New Issue