Allow frame_time_accumulator to go negative

to be able to catch the underflow and correct it.
This commit is contained in:
pstef 2025-03-20 21:44:39 +00:00
parent a58ac85dbc
commit 3be0cfe09c

View file

@ -3645,7 +3645,7 @@ void video_driver_frame(const void *data, unsigned width,
static retro_time_t curr_time;
static retro_time_t fps_time;
static float last_fps, frame_time;
static uint16_t frame_time_accumulator;
static int32_t frame_time_accumulator;
/* Mark the start of nonblock state for
* ignoring initial previous frame time */
static int8_t nonblock_active;
@ -3729,7 +3729,7 @@ void video_driver_frame(const void *data, unsigned width,
|| (last_frame_duped && !!data))
)
{
uint16_t frame_time_accumulator_prev = frame_time_accumulator;
int32_t frame_time_accumulator_prev = frame_time_accumulator;
uint16_t frame_time_delta = new_time - last_time;
uint16_t frame_time_target = video_info.frame_time_target;