MCPcopy Create free account
hub / github.com/TASEmulators/fceux / ShowFPS

Function ShowFPS

src/video.cpp:750–776  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

748}
749
750void ShowFPS(void)
751{
752 if (Show_FPS == false)
753 {
754 return;
755 }
756 static char fpsmsg[16] = { 0 };
757 uint64 ts = FCEUD_GetTime();
758 uint64 da;
759
760 if ( boop_ts == 0 )
761 {
762 boop_ts = ts;
763 }
764 da = ts - boop_ts;
765
766 if ( da > FCEUD_GetTimeFreq() )
767 {
768 sprintf(fpsmsg, "%.1f", (double)boopcount / ((double)da / FCEUD_GetTimeFreq()));
769
770 boopcount = 0;
771 boop_ts = ts;
772 }
773 boopcount++;
774
775 DrawTextTrans(XBuf + ((256 - ClipSidesOffset) - 40) + (FSettings.FirstSLine + 4) * 256, 256, (uint8*)fpsmsg, 0xA0);
776}
777
778bool showPauseCountDown = true;
779

Callers 2

FCEU_PutImageDummyFunction · 0.85
FCEU_PutImageFunction · 0.85

Calls 3

DrawTextTransFunction · 0.85
FCEUD_GetTimeFunction · 0.50
FCEUD_GetTimeFreqFunction · 0.50

Tested by

no test coverage detected