From f45742df52b77390a7b91fa484a1e4b519d7109b Mon Sep 17 00:00:00 2001 From: kd-11 Date: Sun, 11 Jan 2026 23:25:12 +0300 Subject: [PATCH] gcm: Implement cellGcmGetTimeStampLocation as HLE to improve timestamp reports detection - Timestamp reports don't need host GPU access and are much faster to emulate --- rpcs3/Emu/Cell/Modules/cellGcmSys.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/rpcs3/Emu/Cell/Modules/cellGcmSys.cpp b/rpcs3/Emu/Cell/Modules/cellGcmSys.cpp index a96017b16b..ac8183b689 100644 --- a/rpcs3/Emu/Cell/Modules/cellGcmSys.cpp +++ b/rpcs3/Emu/Cell/Modules/cellGcmSys.cpp @@ -235,10 +235,20 @@ u32 cellGcmGetReportDataLocation(u32 index, u32 location) u64 cellGcmGetTimeStampLocation(u32 index, u32 location) { - cellGcmSys.warning("cellGcmGetTimeStampLocation(index=%d, location=%d)", index, location); + cellGcmSys.trace("cellGcmGetTimeStampLocation(index=%d, location=%d)", index, location); - // NOTE: No error checkings - return cellGcmGetReportDataAddressLocation(index, location)->timer; + if (location == CELL_GCM_LOCATION_LOCAL) + { + return cellGcmGetTimeStamp(index); + } + + if (index >= 1024 * 1024) + { + cellGcmSys.error("cellGcmGetTimeStampLocation: Wrong main index (%d)", index); + } + + const auto address = gcmIoOffsetToAddress(0x0e000000 + index * 0x10); + return *vm::get_super_ptr(address); } //---------------------------------------------------------------------------- @@ -1508,8 +1518,8 @@ DECLARE(ppu_module_manager::cellGcmSys)("cellGcmSys", []() REG_FUNC(cellGcmSys, cellGcmGetReportDataAddress); REG_FUNC(cellGcmSys, cellGcmGetReportDataAddressLocation); REG_FUNC(cellGcmSys, cellGcmGetReportDataLocation); - REG_FUNC(cellGcmSys, cellGcmGetTimeStamp).flag(MFF_FORCED_HLE); // HLE-ing this allows for optimizations around reports - REG_FUNC(cellGcmSys, cellGcmGetTimeStampLocation); + REG_FUNC(cellGcmSys, cellGcmGetTimeStamp).flag(MFF_FORCED_HLE); // HLE-ing this allows for optimizations around reports + REG_FUNC(cellGcmSys, cellGcmGetTimeStampLocation).flag(MFF_FORCED_HLE); // Ditto // Command Buffer Control REG_FUNC(cellGcmSys, cellGcmGetControlRegister);