From 95fa3f0095d6f383840992cab6833cac92493a60 Mon Sep 17 00:00:00 2001 From: gbc dev Date: Wed, 15 Jul 2026 16:53:28 +0200 Subject: control: video frame capture + deterministic input-movie replay Two socket features for building reproducible showcase clips: - record start [everyN] / record stop: append the RGB888 framebuffer of each produced frame to a flat 'GBCV' capture file (downsample with everyN). tools/gbgif.py turns it into a GIF (or PNG frames). Capture is decoupled from wall-clock/turbo/frameskip, so timing is always correct. - input play [reset] / input stop: drive the joypad from a synthesized TAS-style movie (text: ' [buttons...]' per line), frame-locked so replay is deterministic. 'reset' does an exact power-on (preserve cart ROM+SRAM, zero all other state) so a movie replays byte-identically -- verified by hashing two runs. tools/gbmovie.py is a Python builder for movies. --- src/control.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/control.h') diff --git a/src/control.h b/src/control.h index a625853..db5ee93 100644 --- a/src/control.h +++ b/src/control.h @@ -33,4 +33,12 @@ bool control_paused(void); // is inactive this simply runs a full frame like the plain emulator loop. void control_run_frame(GB *gb); +// If a recording is active (see the `record` command), append the frame just +// produced by control_run_frame() to the capture file. No-op otherwise. +void control_record_frame(GB *gb); + +// If a movie is playing (see the `input play` command), set this frame's joypad +// state from it. Call once per loop iteration *before* control_run_frame(). +void control_input_frame(GB *gb); + #endif -- cgit v1.3.1-sl0p