diff --git a/src/fceu.cpp b/src/fceu.cpp index 1f09973f..2dbaf652 100644 --- a/src/fceu.cpp +++ b/src/fceu.cpp @@ -513,9 +513,6 @@ void UpdateAutosave(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) { - extern unsigned int LagCounter; - extern bool lagCounterDisplay; - extern bool lagFlag; //lagFlag = true; int r,ssize; @@ -587,7 +584,7 @@ void FCEUI_Emulate(uint8 **pXBuf, int32 **SoundBuf, int32 *SoundBufSize, int ski } currMovieData.TryDumpIncremental(); - if (lagFlag) LagCounter++; + if (lagFlag) lagCounter++; } diff --git a/src/input.cpp b/src/input.cpp index 99926312..af834b4c 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -75,9 +75,12 @@ extern INPUTCFC *FCEU_InitTopRider(void); extern INPUTCFC *FCEU_InitBarcodeWorld(void); //--------------- -unsigned int LagCounter; +//global lag variables +unsigned int lagCounter; bool lagCounterDisplay; bool lagFlag; +//------------- + static uint8 joy_readbit[2]; uint8 joy[4]={0,0,0,0}; //HACK - should be static but movie needs it static uint8 LastStrobe; @@ -108,12 +111,6 @@ static DECLFR(JPRead) ret|=joyports[A&1].driver->Read(A&1); - /* this code effectively does nothing as zzz is never used - if(!(A&1) && ret) - { - int zzz=9; - } - */ if(portFC.driver) ret = portFC.driver->Read(A&1,ret); @@ -913,12 +910,12 @@ static void ObjectDisplayToggle(void) static void LagCounterReset(void) { - LagCounter = 0; + lagCounter = 0; } static void LagCounterToggle(void) { -lagCounterDisplay ^= 1; + lagCounterDisplay ^= 1; } static void LaunchMemoryWatch(void) diff --git a/src/input.h b/src/input.h index 0043fcfb..26bc3a99 100644 --- a/src/input.h +++ b/src/input.h @@ -278,5 +278,9 @@ struct EMUCMDTABLE extern struct EMUCMDTABLE FCEUI_CommandTable[]; +extern unsigned int lagCounter; +extern bool lagCounterDisplay; +extern bool lagFlag; + #endif //_INPUT_H_ diff --git a/src/movie.cpp b/src/movie.cpp index 12e7d40a..918bdb9e 100644 --- a/src/movie.cpp +++ b/src/movie.cpp @@ -906,10 +906,6 @@ void FCEU_DrawMovies(uint8 *XBuf) void FCEU_DrawLagCounter(uint8 *XBuf) { - unsigned int lastLagCounter; - extern bool lagCounterDisplay; - extern unsigned int LagCounter; - extern bool lagFlag; uint8 color; if (lagFlag) color = 0x16+0x80; //If currently lagging display red @@ -918,7 +914,7 @@ void FCEU_DrawLagCounter(uint8 *XBuf) if(lagCounterDisplay) { char counterbuf[32] = {0}; - sprintf(counterbuf,"%d",LagCounter); + sprintf(counterbuf,"%d",lagCounter); if(counterbuf[0]) DrawTextTrans(XBuf+FCEU_TextScanlineOffsetFromBottom(32), 256, (uint8*)counterbuf, color); //0x20+0x80