diff options
| author | gbc dev <gbc@localhost> | 2026-07-04 23:07:50 +0200 |
|---|---|---|
| committer | gbc dev <gbc@localhost> | 2026-07-04 23:07:50 +0200 |
| commit | f4ba890eb4b98e1a65a3d9fc8ba8f62dda66895b (patch) | |
| tree | cb1cccb2dfd0f1b59e59e8e86454849179c88cb2 /src/render.h | |
| parent | input: external control channel via FIFO (diff) | |
| download | sl0pboy-f4ba890eb4b98e1a65a3d9fc8ba8f62dda66895b.tar.gz sl0pboy-f4ba890eb4b98e1a65a3d9fc8ba8f62dda66895b.tar.xz sl0pboy-f4ba890eb4b98e1a65a3d9fc8ba8f62dda66895b.zip | |
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.
Diffstat (limited to 'src/render.h')
| -rw-r--r-- | src/render.h | 6 |
1 files changed, 6 insertions, 0 deletions
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 |
