From 97b90d0f9e4adc367530ae5ce29acc62141e029d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=98yvind=20Kol=C3=A5s?= <pippin@gimp.org>
Date: Wed, 20 May 2026 04:08:02 +0200
Subject: [PATCH 1/5] Add an option to show the runnings fps in display

---
 drivers/gc9a01/display.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/gc9a01/display.c b/drivers/gc9a01/display.c
index 34532c3..3062800 100644
--- a/drivers/gc9a01/display.c
+++ b/drivers/gc9a01/display.c
@@ -68,6 +68,17 @@ void tildagon_blit_fb (void)
 
 void tildagon_end_frame(Ctx *ctx)
 {
+  ctx_restore (ctx);
+  ctx_save (ctx);
+  ctx_rectangle (ctx, 0, 0, 240, 15);
+  ctx_rgba (ctx, 0, 0, 0, 1.0);
+  ctx_fill (ctx);
+  ctx_rgba (ctx, 1, 1, 1, 1.0);
+  ctx_font_size (ctx, 15);
+  ctx_move_to (ctx, 100, 14);
+  char buf[23];
+  sprintf (buf, "%.2f", st3m_gfx_fps());
+  ctx_text (ctx, buf);
   ctx_restore (ctx);
   tildagon_blit_fb ();
   // display.end_frame() cannot call ctx_end_frame() directly here: that resets
-- 
2.53.0

