summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;