mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-28 10:59:16 -04:00
027933ab48
Frame interpolation forgave a stall after 4 source periods (the stock frame pacer pays back up to 12) and a VBlank that arrived after all of its output deadlines presented nothing, so on a busy host a run with interpolation lost guest time and skipped new frames that a run without it kept. The schedule now holds its anchor for the stock pacer's 12 periods, and such a VBlank still presents once. A title can opt in to PSX_MOD_FRAME_PRESENT_CHANGED (psx_mod_set_frame_interpolation_present). The presenter then skips an output that would show the picture already on screen without waiting for its deadline (vsync is off, so the screen keeps it), refreshes every 4th guest VBlank and while the OSD shows something, copies hold-last only for a new frame, holds a HOLD pass image until the next one instead of crossfading, and refuses a present older in game time than the one on screen (a late pass generation). Any other swap clears the record of the picture on screen. The default (EVERY) presents every output as before. PSX_MOD_FRAME_INTERPOLATION_UNLIMITED names the 1000 top rate. gl_interp reports present_dups, render_pass_stats nonmonotonic_rejects; PSX_GL_PRESENT_TIME_TRACE=1 traces each swap's game-time stamp. Ported from feat/opportunistic-passes cf1a0924, 4630b989, 51da823e (presenter half), 3332463f, f1ccd4a9; the skip, hold-last and guard are now opt-in. Tests: frame_interpolation_schedule_test (12-period window), frame_interpolation_present_time_test, frame_interpolation_present_emit_test, frame_interpolation_present_time_wiring_test, render_pass_guards, frame_interpolation_flip_source, present_skip_cadence_guard pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>