summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorneonloop2021-03-12 22:18:28 +0000
committerneonloop2021-03-12 22:18:28 +0000
commit6c76f136e5c0793dbb3d716b51cfccd4b1e21cdf (patch)
tree1f9c51f9571440eaa8fd3bf5a3581359fc634ca7
parentcd20f918cf1f7c7b3f63b61d64891d3b03cbe340 (diff)
downloadsnes9x2002-6c76f136e5c0793dbb3d716b51cfccd4b1e21cdf.tar.gz
snes9x2002-6c76f136e5c0793dbb3d716b51cfccd4b1e21cdf.tar.bz2
snes9x2002-6c76f136e5c0793dbb3d716b51cfccd4b1e21cdf.zip
Brings back the built-in frame counter
-rw-r--r--shell/emu/core.c1
-rw-r--r--src/gfx16.c16
2 files changed, 17 insertions, 0 deletions
diff --git a/shell/emu/core.c b/shell/emu/core.c
index 99759a6..41bd095 100644
--- a/shell/emu/core.c
+++ b/shell/emu/core.c
@@ -270,6 +270,7 @@ void init_sfc_setting(void)
#endif
Settings.SpeedHacks = true;
Settings.HBlankStart = (256 * Settings.H_Max) / SNES_HCOUNTER_MAX;
+ Settings.DisplayFrameRate = false;
}
void Init_SFC(void)
diff --git a/src/gfx16.c b/src/gfx16.c
index db35e6a..0c17f34 100644
--- a/src/gfx16.c
+++ b/src/gfx16.c
@@ -661,6 +661,9 @@ void S9xEndScreenRefresh()
IPPU.ColorsChanged = FALSE;
//}
+ if (Settings.DisplayFrameRate)
+ S9xDisplayFrameRate();
+
S9xDeinitUpdate(IPPU.RenderedScreenWidth, IPPU.RenderedScreenHeight,
1);
}
@@ -2531,6 +2534,19 @@ void DisplayChar(uint8* Screen, uint8 c)
}
}
+void S9xDisplayFrameRate()
+{
+ char string[16];
+ uint8 *Screen = GFX.Screen;
+
+ sprintf(string, "%02d/%02d", IPPU.DisplayedRenderedFrameCount, (int)Memory.ROMFramesPerSecond);
+
+ for (int i = 0; i < 5; i++) {
+ DisplayChar(Screen, string[i]);
+ Screen += (font_width - 1) * sizeof(uint16);
+ }
+}
+
static void S9xUpdateScreenTransparency() // ~30-50ms! (called from FLUSH_REDRAW())
{
uint32 starty = GFX.StartY;