Files
psxrecomp/overlay_toolchain/include/psx_vblank_clock.h
T
Matthew Stanley fe42da2744 Merge release/native-rendering-20261003 into master
Keeps both lines: master's PGXP session, draw-distance clamps, masked rejects
and saturated-winding NCLIP; the release's render-pass kit additions, verified
media/disc extents, timeline/present rings, cull-scale sites. Overlay ABI v30.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-04 19:27:02 -07:00

37 lines
1.2 KiB
C

#ifndef PSXRECOMP_PSX_VBLANK_CLOCK_H
#define PSXRECOMP_PSX_VBLANK_CLOCK_H
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Exact rational native-cycle period generator. `fraction` is the remainder
* after selecting `current_cycles`, which makes the five fields complete
* deterministic save-state data once the configured ratio is fixed. */
typedef struct PSXVBlankClock {
uint32_t period_floor;
uint32_t period_remainder;
uint32_t period_denominator;
uint32_t fraction;
uint32_t current_cycles;
} PSXVBlankClock;
int psx_vblank_clock_configure(PSXVBlankClock *clock,
uint64_t period_numerator,
uint32_t period_denominator);
void psx_vblank_clock_next(PSXVBlankClock *clock);
int psx_vblank_clock_restore_fraction(PSXVBlankClock *clock,
uint32_t fraction);
uint64_t psx_vblank_clock_cycles_for_frames_ceil(
const PSXVBlankClock *clock, uint32_t frames);
uint64_t psx_vblank_clock_frames_for_cycles_floor(
const PSXVBlankClock *clock, uint64_t cycles);
#ifdef __cplusplus
}
#endif
#endif