From 6961be8291f31a8d22cb25836cd593889fee3ee9 Mon Sep 17 00:00:00 2001 From: Shokunin <30949000+tetrisgm@users.noreply.github.com> Date: Wed, 21 Oct 2026 11:34:30 -0700 Subject: [PATCH] Select a route frame for existing composed burst captures --- runtime/src/main.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/runtime/src/main.cpp b/runtime/src/main.cpp index 86a9b9d4..4790b2c9 100644 --- a/runtime/src/main.cpp +++ b/runtime/src/main.cpp @@ -4825,7 +4825,8 @@ static void input_replay_frame_completed(uint64_t frame) { static void input_replay_frontend_tick(uint64_t frame) { uint64_t relative = input_replay_frame(frame); if (relative == UINT64_MAX) return; - static uint64_t stop = 0, seconds = 0, deadline_us = 0; + static uint64_t stop = 0, seconds = 0, deadline_us = 0, shot_frame = 800; + static bool custom_shot_frame = false; static const char *report = nullptr, *shots = nullptr; static bool initialized = false, finished = false; auto &work = g_replay_work; @@ -4839,6 +4840,13 @@ static void input_replay_frontend_tick(uint64_t frame) { } report = std::getenv("PSX_INPUT_REPLAY_REPORT"); shots = std::getenv("PSX_INPUT_REPLAY_SHOTS"); + if (const char *e = std::getenv("PSX_INPUT_REPLAY_SHOT_FRAME")) { + char *end = nullptr; + shot_frame = std::strtoull(e, &end, 10); + if (!*e || !end || *end) + throw std::runtime_error("invalid replay shot frame"); + custom_shot_frame = true; + } if (report && *report) work.resize(HOST_FRAME_STAMP_CAP); initialized = true; } @@ -4854,7 +4862,7 @@ static void input_replay_frontend_tick(uint64_t frame) { g_runtime_perf.pacer_ticks * 1000000 / hz, (rs.backpressure_ns + rs.ring_full_ns + rs.acquire_ns) / 1000, 0}; } - if (shots && (relative == 800 || (stop > 0 && relative == stop+2))) { + if (shots && (relative == shot_frame || (!custom_shot_frame && stop > 0 && relative == stop+2))) { char path[512]; std::snprintf(path, sizeof path, "%s-%llu.png", shots, (unsigned long long)relative); present_shot_request(path);