rsx: Fix VBLANK time

This commit is contained in:
Elad Ashkenazi 2022-05-27 21:01:42 +03:00 committed by Megamouse
parent 5ad4b6249e
commit 610d29dab0

View File

@ -654,7 +654,7 @@ namespace rsx
#else
constexpr u32 host_min_quantum = 500;
#endif
u64 start_time = rsx::uclock();
u64 start_time = get_system_time();
u64 vblank_rate = g_cfg.video.vblank_rate;
u64 vblank_period = 1'000'000 + u64{g_cfg.video.vblank_ntsc.get()} * 1000;
@ -665,7 +665,7 @@ namespace rsx
while (!is_stopped())
{
// Get current time
const u64 current = rsx::uclock();
const u64 current = get_system_time();
// Calculate the time at which we need to send a new VBLANK signal
const u64 post_event_time = start_time + (local_vblank_count + 1) * vblank_period / vblank_rate;
@ -711,7 +711,7 @@ namespace rsx
}
else
{
sys_rsx_context_attribute(0x55555555, 0xFED, 1, post_event_time, 0, 0);
sys_rsx_context_attribute(0x55555555, 0xFED, 1, get_guest_system_time(post_event_time), 0, 0);
}
}
}