From 584c444118a93b8f1e76b8d81ebcfea9ee2cae35 Mon Sep 17 00:00:00 2001 From: adelikat Date: Thu, 10 Jul 2008 03:21:04 +0000 Subject: [PATCH] Lag Counter now has colors! --- src/fceu.cpp | 1 + src/movie.cpp | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/fceu.cpp b/src/fceu.cpp index 56c7f772..f8f39462 100644 --- a/src/fceu.cpp +++ b/src/fceu.cpp @@ -587,6 +587,7 @@ void FCEUI_Emulate(uint8 **pXBuf, int32 **SoundBuf, int32 *SoundBufSize, int ski currMovieData.TryDumpIncremental(); if (lagFlag) LagCounter++; + } void FCEUI_CloseGame(void) diff --git a/src/movie.cpp b/src/movie.cpp index e0295808..12e7d40a 100644 --- a/src/movie.cpp +++ b/src/movie.cpp @@ -906,15 +906,22 @@ 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 + else color = 0x19+0x80; //else display green + if(lagCounterDisplay) { char counterbuf[32] = {0}; sprintf(counterbuf,"%d",LagCounter); if(counterbuf[0]) - DrawTextTrans(XBuf+FCEU_TextScanlineOffsetFromBottom(32), 256, (uint8*)counterbuf, 0x20+0x80); + DrawTextTrans(XBuf+FCEU_TextScanlineOffsetFromBottom(32), 256, (uint8*)counterbuf, color); //0x20+0x80 } }