AutoFire() now takes lag into account. If last frame was a lag frame it repeats the previous pattern.
This commit is contained in:
parent
11cfac9920
commit
697f248eb0
11
src/fceu.cpp
11
src/fceu.cpp
|
@ -60,7 +60,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int AFon, AFoff, AutoFireOffset = 0; //For keeping track of autofire settings
|
int AFon, AFoff, AutoFireOffset = 0; //For keeping track of autofire settings
|
||||||
|
bool justLagged = false;
|
||||||
FCEUGI::FCEUGI()
|
FCEUGI::FCEUGI()
|
||||||
: filename(0)
|
: filename(0)
|
||||||
, archiveFilename(0)
|
, archiveFilename(0)
|
||||||
|
@ -504,7 +504,7 @@ void SetAutoFireOffset(int offset)
|
||||||
void AutoFire(void)
|
void AutoFire(void)
|
||||||
{
|
{
|
||||||
static int counter = 0;
|
static int counter = 0;
|
||||||
counter = (counter + 1) % (8*7*5*3);
|
if (justLagged == false) counter = (counter + 1) % (8*7*5*3);
|
||||||
//If recording a movie, use the frame # for the autofire so the offset
|
//If recording a movie, use the frame # for the autofire so the offset
|
||||||
//doesn't get screwed up when loading.
|
//doesn't get screwed up when loading.
|
||||||
if(FCEUMOV_Mode(MOVIEMODE_RECORD | MOVIEMODE_PLAY))
|
if(FCEUMOV_Mode(MOVIEMODE_RECORD | MOVIEMODE_PLAY))
|
||||||
|
@ -597,7 +597,12 @@ void FCEUI_Emulate(uint8 **pXBuf, int32 **SoundBuf, int32 *SoundBufSize, int ski
|
||||||
}
|
}
|
||||||
|
|
||||||
currMovieData.TryDumpIncremental();
|
currMovieData.TryDumpIncremental();
|
||||||
if (lagFlag) lagCounter++;
|
if (lagFlag)
|
||||||
|
{
|
||||||
|
lagCounter++;
|
||||||
|
justLagged = true;
|
||||||
|
}
|
||||||
|
else justLagged = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue