reorganize lagflag code

This commit is contained in:
zeromus 2008-07-10 04:55:52 +00:00
parent ef349c0a0d
commit 81241b5d26
4 changed files with 12 additions and 18 deletions

View File

@ -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++;
}

View File

@ -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)

View File

@ -278,5 +278,9 @@ struct EMUCMDTABLE
extern struct EMUCMDTABLE FCEUI_CommandTable[];
extern unsigned int lagCounter;
extern bool lagCounterDisplay;
extern bool lagFlag;
#endif //_INPUT_H_

View File

@ -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