From f4ba890eb4b98e1a65a3d9fc8ba8f62dda66895b Mon Sep 17 00:00:00 2001 From: gbc dev Date: Sat, 4 Jul 2026 23:07:50 +0200 Subject: speed control: frame skipping to decouple terminal draw from emulation Emulation always runs at native rate (correct game speed); --frameskip N draws only 1 of every N+1 frames so a slow terminal no longer bottlenecks the loop. Adds --fps cap, --uncapped/--turbo, live [ ] and f keys, HUD readout, and an exit summary of emulated-vs-drawn fps. Replaces the confusing --render-fps. --- src/render.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/render.h') diff --git a/src/render.h b/src/render.h index 27da080..3b6c7e4 100644 --- a/src/render.h +++ b/src/render.h @@ -7,6 +7,7 @@ void term_init(void); void term_restore(void); void render_frame(GB *gb); void render_force_full(void); // force a complete repaint next frame +void render_set_hud(int frameskip, bool turbo); // update HUD readout // Poll keyboard + control FIFO, update gb->buttons. False if quit requested. bool input_poll(GB *gb); @@ -15,4 +16,9 @@ bool input_poll(GB *gb); void input_open_fifo(const char *path); void input_close_fifo(void); +// Returns true once for each pending fast-forward (turbo) toggle keypress. +bool input_take_turbo(void); +// Net frameskip adjustment requested via '[' / ']' since last call. +int input_take_frameskip_delta(void); + #endif -- cgit v1.3.1-sl0p