AutoFire() now takes lag into account. If last frame was a lag frame it repeats the previous pattern.

This commit is contained in:
adelikat 2008-07-26 18:31:45 +00:00
parent 11cfac9920
commit 697f248eb0
1 changed files with 8 additions and 3 deletions

View File

@ -60,7 +60,7 @@
#endif
int AFon, AFoff, AutoFireOffset = 0; //For keeping track of autofire settings
bool justLagged = false;
FCEUGI::FCEUGI()
: filename(0)
, archiveFilename(0)
@ -504,7 +504,7 @@ void SetAutoFireOffset(int offset)
void AutoFire(void)
{
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
//doesn't get screwed up when loading.
if(FCEUMOV_Mode(MOVIEMODE_RECORD | MOVIEMODE_PLAY))
@ -597,7 +597,12 @@ void FCEUI_Emulate(uint8 **pXBuf, int32 **SoundBuf, int32 *SoundBufSize, int ski
}
currMovieData.TryDumpIncremental();
if (lagFlag) lagCounter++;
if (lagFlag)
{
lagCounter++;
justLagged = true;
}
else justLagged = false;
}