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 ///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)
{ {
extern unsigned int LagCounter;
extern bool lagCounterDisplay;
extern bool lagFlag;
//lagFlag = true; //lagFlag = true;
int r,ssize; int r,ssize;
@ -587,7 +584,7 @@ void FCEUI_Emulate(uint8 **pXBuf, int32 **SoundBuf, int32 *SoundBufSize, int ski
} }
currMovieData.TryDumpIncremental(); currMovieData.TryDumpIncremental();
if (lagFlag) LagCounter++; if (lagFlag) lagCounter++;
} }

View File

@ -75,9 +75,12 @@ extern INPUTCFC *FCEU_InitTopRider(void);
extern INPUTCFC *FCEU_InitBarcodeWorld(void); extern INPUTCFC *FCEU_InitBarcodeWorld(void);
//--------------- //---------------
unsigned int LagCounter; //global lag variables
unsigned int lagCounter;
bool lagCounterDisplay; bool lagCounterDisplay;
bool lagFlag; bool lagFlag;
//-------------
static uint8 joy_readbit[2]; static uint8 joy_readbit[2];
uint8 joy[4]={0,0,0,0}; //HACK - should be static but movie needs it uint8 joy[4]={0,0,0,0}; //HACK - should be static but movie needs it
static uint8 LastStrobe; static uint8 LastStrobe;
@ -108,12 +111,6 @@ static DECLFR(JPRead)
ret|=joyports[A&1].driver->Read(A&1); 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) if(portFC.driver)
ret = portFC.driver->Read(A&1,ret); ret = portFC.driver->Read(A&1,ret);
@ -913,7 +910,7 @@ static void ObjectDisplayToggle(void)
static void LagCounterReset(void) static void LagCounterReset(void)
{ {
LagCounter = 0; lagCounter = 0;
} }
static void LagCounterToggle(void) static void LagCounterToggle(void)

View File

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

View File

@ -906,10 +906,6 @@ void FCEU_DrawMovies(uint8 *XBuf)
void FCEU_DrawLagCounter(uint8 *XBuf) void FCEU_DrawLagCounter(uint8 *XBuf)
{ {
unsigned int lastLagCounter;
extern bool lagCounterDisplay;
extern unsigned int LagCounter;
extern bool lagFlag;
uint8 color; uint8 color;
if (lagFlag) color = 0x16+0x80; //If currently lagging display red if (lagFlag) color = 0x16+0x80; //If currently lagging display red
@ -918,7 +914,7 @@ void FCEU_DrawLagCounter(uint8 *XBuf)
if(lagCounterDisplay) if(lagCounterDisplay)
{ {
char counterbuf[32] = {0}; char counterbuf[32] = {0};
sprintf(counterbuf,"%d",LagCounter); sprintf(counterbuf,"%d",lagCounter);
if(counterbuf[0]) if(counterbuf[0])
DrawTextTrans(XBuf+FCEU_TextScanlineOffsetFromBottom(32), 256, (uint8*)counterbuf, color); //0x20+0x80 DrawTextTrans(XBuf+FCEU_TextScanlineOffsetFromBottom(32), 256, (uint8*)counterbuf, color); //0x20+0x80