mute frame advance option works once again

This commit is contained in:
zeromus 2008-05-12 16:53:18 +00:00
parent 201261c142
commit ef228133f6
2 changed files with 64 additions and 61 deletions

View File

@ -47,6 +47,11 @@
#include "file.h" #include "file.h"
#include "vsuni.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; 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 ///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) void FCEUI_Emulate(uint8 **pXBuf, int32 **SoundBuf, int32 *SoundBufSize, int skip)
{ {
int r,ssize; int r,ssize;
JustFrameAdvanced = false;
if(frameAdvanceRequested) { JustFrameAdvanced = false;
if(frameAdvanceDelay==0) {
EmulationPaused = 3; if(frameAdvanceRequested) {
frameAdvanceDelay++; if(frameAdvanceDelay==0) {
} else { EmulationPaused = 3;
if(frameAdvanceDelay>=10) { frameAdvanceDelay++;
EmulationPaused = 3; } else {
} else frameAdvanceDelay++; if(frameAdvanceDelay>=10) {
} EmulationPaused = 3;
} } else frameAdvanceDelay++;
}
}
if(EmulationPaused&2) if(EmulationPaused&2)
EmulationPaused &= ~1; // clear paused flag temporarily (frame advance) EmulationPaused &= ~1; // clear paused flag temporarily (frame advance)
else if(EmulationPaused&1 || FCEU_BotMode()) else if(EmulationPaused&1 || FCEU_BotMode())
{ {
memcpy(XBuf, XBackBuf, 256*256); memcpy(XBuf, XBackBuf, 256*256);
FCEU_PutImage(); FCEU_PutImage();
*pXBuf=XBuf; *pXBuf=XBuf;
*SoundBuf=WaveFinal; *SoundBuf=WaveFinal;
*SoundBufSize=0; *SoundBufSize=0;
return; return;
} }
if(!FCEU_BotMode()) if(!FCEU_BotMode())
{ {
AutoFire(); AutoFire();
UpdateRewind(); UpdateRewind();
} }
FCEU_UpdateInput();
if(geniestage!=1) FCEU_ApplyPeriodicCheats();
r=FCEUPPU_Loop(skip);
ssize=FlushEmulateSound();
//#ifdef WIN32 FCEU_UpdateInput();
// FCEUI_AviVideoUpdate(XBuf); if(geniestage!=1) FCEU_ApplyPeriodicCheats();
//#endif r=FCEUPPU_Loop(skip);
timestampbase += timestamp; ssize=FlushEmulateSound();
timestamp = 0;
//#ifdef WIN32
// FCEUI_AviVideoUpdate(XBuf);
//#endif
timestampbase += timestamp;
timestamp = 0;
*pXBuf=skip?0:XBuf; *pXBuf=skip?0:XBuf;
*SoundBuf=WaveFinal; *SoundBuf=WaveFinal;
*SoundBufSize=ssize; *SoundBufSize=ssize;
//if we were asked to frame advance, then since we have just finished //if we were asked to frame advance, then since we have just finished
//a frame, we should switch to regular pause //a frame, we should switch to regular pause
if(EmulationPaused&2) if(EmulationPaused&2)
{ {
EmulationPaused = 1; // restore paused flag EmulationPaused = 1; // restore paused flag
//mbg merge 7/28/06 don't like the looks of this...
//#ifdef WIN32 //mute the frame advance if the user requested it
// #define SO_MUTEFA 16 #ifdef WIN32
// extern int soundoptions; if(soundoptions&SO_MUTEFA)
// if(soundoptions&SO_MUTEFA) *SoundBufSize=0; // keep sound muted
//#endif #endif
*SoundBufSize=0; // keep sound muted
JustFrameAdvanced = true; JustFrameAdvanced = true;
} }
} }
void FCEUI_CloseGame(void) void FCEUI_CloseGame(void)

View File

@ -13,12 +13,10 @@ Global
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6893EF44-FEA3-46DF-B236-C4C200F54294}.Debug|Win32.ActiveCfg = Debug|Win32 {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|Win32.Build.0 = Debug|Win32
{6893EF44-FEA3-46DF-B236-C4C200F54294}.Debug|x64.ActiveCfg = Debug|x64 {6893EF44-FEA3-46DF-B236-C4C200F54294}.Debug|x64.ActiveCfg = Debug|Win32
{6893EF44-FEA3-46DF-B236-C4C200F54294}.Debug|x64.Build.0 = Debug|x64
{6893EF44-FEA3-46DF-B236-C4C200F54294}.Release|Win32.ActiveCfg = Release|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|Win32.Build.0 = Release|Win32
{6893EF44-FEA3-46DF-B236-C4C200F54294}.Release|x64.ActiveCfg = Release|x64 {6893EF44-FEA3-46DF-B236-C4C200F54294}.Release|x64.ActiveCfg = Release|Win32
{6893EF44-FEA3-46DF-B236-C4C200F54294}.Release|x64.Build.0 = Release|x64
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE