From b84e95d7686cb92cec5144d771f1c215a38ab573 Mon Sep 17 00:00:00 2001 From: Eladash Date: Fri, 29 Oct 2021 22:23:29 +0300 Subject: [PATCH] rsx: Fixate time stamp of VBLANK --- rpcs3/Emu/Cell/lv2/sys_rsx.cpp | 9 ++++++++- rpcs3/Emu/RSX/RSXThread.cpp | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/Cell/lv2/sys_rsx.cpp b/rpcs3/Emu/Cell/lv2/sys_rsx.cpp index c8b569fa6a..f3c9eb5ed1 100644 --- a/rpcs3/Emu/Cell/lv2/sys_rsx.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_rsx.cpp @@ -732,13 +732,20 @@ error_code sys_rsx_context_attribute(u32 context_id, u32 package_id, u64 a3, u64 case 0xFED: // hack: vblank command { + if (get_current_cpu_thread()) + { + // VBLANK thread only + return CELL_EINVAL; + } + // NOTE: There currently seem to only be 2 active heads on PS3 ensure(a3 < 2); // todo: this is wrong and should be 'second' vblank handler and freq, but since currently everything is reported as being 59.94, this should be fine vm::_ref(render->device_addr + 0x30) = 1; - const u64 current_time = rsxTimeStamp(); + // Time point is supplied in argument 4 + const u64 current_time = a4; driverInfo.head[a3].lastSecondVTime = current_time; diff --git a/rpcs3/Emu/RSX/RSXThread.cpp b/rpcs3/Emu/RSX/RSXThread.cpp index 628c50a56f..a9a547976c 100644 --- a/rpcs3/Emu/RSX/RSXThread.cpp +++ b/rpcs3/Emu/RSX/RSXThread.cpp @@ -696,7 +696,7 @@ namespace rsx } else { - sys_rsx_context_attribute(0x55555555, 0xFED, 1, 0, 0, 0); + sys_rsx_context_attribute(0x55555555, 0xFED, 1, post_event_time, 0, 0); } } }