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/main.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 541ce44..ecd818e 100644 --- a/src/main.c +++ b/src/main.c @@ -137,7 +137,9 @@ int main(int argc, char **argv) { // Emulate a full frame, honoring debugger pause/step/breakpoints when // the control socket is active (otherwise a plain full frame). + control_input_frame(gb); // drive input from a replay movie if playing control_run_frame(gb); + control_record_frame(gb); // append to the video capture if recording // decide whether to draw this frame bool do_render = (since_render >= frameskip); -- cgit v1.3.1-sl0p