Lag Counter now has colors!

This commit is contained in:
adelikat 2008-07-10 03:21:04 +00:00
parent 3bff3154c7
commit 584c444118
2 changed files with 9 additions and 1 deletions

View File

@ -587,6 +587,7 @@ void FCEUI_Emulate(uint8 **pXBuf, int32 **SoundBuf, int32 *SoundBufSize, int ski
currMovieData.TryDumpIncremental(); currMovieData.TryDumpIncremental();
if (lagFlag) LagCounter++; if (lagFlag) LagCounter++;
} }
void FCEUI_CloseGame(void) void FCEUI_CloseGame(void)

View File

@ -906,15 +906,22 @@ void FCEU_DrawMovies(uint8 *XBuf)
void FCEU_DrawLagCounter(uint8 *XBuf) void FCEU_DrawLagCounter(uint8 *XBuf)
{ {
unsigned int lastLagCounter;
extern bool lagCounterDisplay; extern bool lagCounterDisplay;
extern unsigned int LagCounter; extern unsigned int LagCounter;
extern bool lagFlag;
uint8 color;
if (lagFlag) color = 0x16+0x80; //If currently lagging display red
else color = 0x19+0x80; //else display green
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, 0x20+0x80); DrawTextTrans(XBuf+FCEU_TextScanlineOffsetFromBottom(32), 256, (uint8*)counterbuf, color); //0x20+0x80
} }
} }