diff --git a/desmume/src/FIFO.cpp b/desmume/src/FIFO.cpp index e8c04a17a..b07752920 100644 --- a/desmume/src/FIFO.cpp +++ b/desmume/src/FIFO.cpp @@ -265,4 +265,4 @@ u32 DISP_FIFOrecv() if (disp_fifo.head > 0x5FFF) disp_fifo.head = 0; return (val); -} \ No newline at end of file +} diff --git a/desmume/src/NDSSystem.cpp b/desmume/src/NDSSystem.cpp index 79f3d8f78..f078bf854 100644 --- a/desmume/src/NDSSystem.cpp +++ b/desmume/src/NDSSystem.cpp @@ -64,9 +64,10 @@ BOOL fw_success = FALSE; NDSSystem nds; -int lagframecounter=0; -int LagFrameFlag=0; -int lastLag=0; +int lagframecounter; +int LagFrameFlag; +int lastLag; +int TotalLagFrames; /* ------------------------------------------------------------------------- */ /* FIRMWARE DECRYPTION */ @@ -862,6 +863,11 @@ void NDS_Reset( void) if (!header) return ; + lagframecounter=0; + LagFrameFlag=0; + lastLag=0; + TotalLagFrames=0; + MMU_clearMem(); //ARM7 BIOS IRQ HANDLER @@ -2218,6 +2224,7 @@ u32 NDS_exec(s32 nb) if(LagFrameFlag) { lagframecounter++; + TotalLagFrames++; } else { diff --git a/desmume/src/NDSSystem.h b/desmume/src/NDSSystem.h index 36af8407f..3279aede6 100644 --- a/desmume/src/NDSSystem.h +++ b/desmume/src/NDSSystem.h @@ -332,7 +332,7 @@ extern Driver* driver; extern std::string InputDisplayString; extern int LagFrameFlag; -extern int lastLag; +extern int lastLag, TotalLagFrames; #endif diff --git a/desmume/src/rtc.h b/desmume/src/rtc.h index fbc016532..cefbb1e45 100644 --- a/desmume/src/rtc.h +++ b/desmume/src/rtc.h @@ -30,4 +30,4 @@ extern void rtcInit(); extern u16 rtcRead(); extern void rtcWrite(u16 val); -#endif \ No newline at end of file +#endif diff --git a/desmume/src/windows/main.cpp b/desmume/src/windows/main.cpp index 4e85326c7..8cd2415fd 100644 --- a/desmume/src/windows/main.cpp +++ b/desmume/src/windows/main.cpp @@ -1015,7 +1015,7 @@ DWORD WINAPI run() frameCounter++; if (frameCounterDisplay) osd->addFixed(0, 25, "%d",frameCounter); if (ShowInputDisplay) osd->addFixed(0, 45, "%s",InputDisplayString.c_str()); - if (ShowLagFrameCounter) osd->addFixed(0, 65, "%d",lastLag); + if (ShowLagFrameCounter) osd->addFixed(0, 65, "%d",TotalLagFrames); DisplayMessage(); CheckMessages(); }