mirror of https://github.com/RPCS3/rpcs3.git
rsx: Fix VBLANK time
This commit is contained in:
parent
5ad4b6249e
commit
610d29dab0
|
@ -654,7 +654,7 @@ namespace rsx
|
||||||
#else
|
#else
|
||||||
constexpr u32 host_min_quantum = 500;
|
constexpr u32 host_min_quantum = 500;
|
||||||
#endif
|
#endif
|
||||||
u64 start_time = rsx::uclock();
|
u64 start_time = get_system_time();
|
||||||
|
|
||||||
u64 vblank_rate = g_cfg.video.vblank_rate;
|
u64 vblank_rate = g_cfg.video.vblank_rate;
|
||||||
u64 vblank_period = 1'000'000 + u64{g_cfg.video.vblank_ntsc.get()} * 1000;
|
u64 vblank_period = 1'000'000 + u64{g_cfg.video.vblank_ntsc.get()} * 1000;
|
||||||
|
@ -665,7 +665,7 @@ namespace rsx
|
||||||
while (!is_stopped())
|
while (!is_stopped())
|
||||||
{
|
{
|
||||||
// Get current time
|
// 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
|
// 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;
|
const u64 post_event_time = start_time + (local_vblank_count + 1) * vblank_period / vblank_rate;
|
||||||
|
@ -711,7 +711,7 @@ namespace rsx
|
||||||
}
|
}
|
||||||
else
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue