diff --git a/rpcs3/Emu/Cell/lv2/sys_rsx.cpp b/rpcs3/Emu/Cell/lv2/sys_rsx.cpp index a9fc455291..5bc2c10185 100644 --- a/rpcs3/Emu/Cell/lv2/sys_rsx.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_rsx.cpp @@ -625,8 +625,16 @@ error_code sys_rsx_context_attribute(u32 context_id, u32 package_id, u64 a3, u64 // 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(); + + driverInfo.head[a3].lastSecondVTime = current_time; + + // Note: not atomic + driverInfo.head[a3].lastVTimeLow = static_cast(current_time); + driverInfo.head[a3].lastVTimeHigh = static_cast(current_time >> 32); + driverInfo.head[a3].vBlankCount++; - driverInfo.head[a3].lastSecondVTime = rsxTimeStamp(); u64 event_flags = SYS_RSX_EVENT_VBLANK; diff --git a/rpcs3/Emu/Cell/lv2/sys_rsx.h b/rpcs3/Emu/Cell/lv2/sys_rsx.h index 5cb6c5cd12..3edb8b0c38 100644 --- a/rpcs3/Emu/Cell/lv2/sys_rsx.h +++ b/rpcs3/Emu/Cell/lv2/sys_rsx.h @@ -27,12 +27,12 @@ struct RsxDriverInfo be_t flipBufferId; // 0x10 be_t lastQueuedBufferId; // 0x14 todo: this is definately not this variable but its 'unused' so im using it for queueId to pass to flip handler be_t unk3; // 0x18 - be_t unk6; // 0x18 possible low bits of time stamp? used in getlastVBlankTime + be_t lastVTimeLow; // 0x1C last time for first vhandler freq (low 32-bits) be_t lastSecondVTime; // 0x20 last time for second vhandler freq be_t unk4; // 0x28 - atomic_be_t vBlankCount; // 0x30 + atomic_be_t vBlankCount; // 0x30 be_t unk; // 0x38 possible u32, 'flip field', top/bottom for interlaced - be_t unk5; // 0x3C possible high bits of time stamp? used in getlastVBlankTime + be_t lastVTimeHigh; // 0x3C last time for first vhandler freq (high 32-bits) } head[8]; // size = 0x40, 0x200 be_t unk7; // 0x12B8