[PR #2633] [CLOSED] Kernel: Changes to scekernelUsleep to improve precision #2876

Closed
opened 2026-02-27 22:01:34 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/2633
Author: @diegolix29
Created: 3/9/2025
Status: Closed

Base: mainHead: Kernel-scekernelUsleep


📝 Commits (1)

  • d1604bc Kernel: Changes to scekernelUsleep to improve precision.

📊 Changes

1 file changed (+41 additions, -41 deletions)

View changed files

📝 src/core/libraries/kernel/time.cpp (+41 -41)

📄 Description

Modifies sceKernelUsleep to improve precision by using CLOCK_MONOTONIC_RAW in certain cases.

Utilizing GetCurrentProcess instead of GetCurrentThread may also help reduce crashes in games that rely on precise memory timings by improving thread synchronization and reducing timing drift

Changes the sleep logic to a while loop that updates req with rem if nanosleep is interrupted this helps for a better synchronization with real PS4 behavior, and slighly smoother control of time sensitive operations

Changins the generic POXIS implementation to a more orbis specific behaviour with tp
Using time pointer in this cases makes it clear that the argument is a pointer to a time related structure helping avoid confusion in function calls

This integrate my pr that helped Deathlight get ingame with the last changes from the kernel gettime pr just merged

image

Makes
Deadlight Director's Cut | CUSA04434 | 1.00 Playable (according to reports with image proof)

Mages of mystralia : works again but needs a few starts. (according to reports)

Mad max: is back ingame again. (acording to reports)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/2633 **Author:** [@diegolix29](https://github.com/diegolix29) **Created:** 3/9/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `Kernel-scekernelUsleep` --- ### 📝 Commits (1) - [`d1604bc`](https://github.com/shadps4-emu/shadPS4/commit/d1604bc77689980cc6482ce28b7637c98155381b) Kernel: Changes to scekernelUsleep to improve precision. ### 📊 Changes **1 file changed** (+41 additions, -41 deletions) <details> <summary>View changed files</summary> 📝 `src/core/libraries/kernel/time.cpp` (+41 -41) </details> ### 📄 Description Modifies sceKernelUsleep to improve precision by using CLOCK_MONOTONIC_RAW in certain cases. Utilizing GetCurrentProcess instead of GetCurrentThread may also help reduce crashes in games that rely on precise memory timings by improving thread synchronization and reducing timing drift Changes the sleep logic to a while loop that updates req with rem if nanosleep is interrupted this helps for a better synchronization with real PS4 behavior, and slighly smoother control of time sensitive operations Changins the generic POXIS implementation to a more orbis specific behaviour with tp Using time pointer in this cases makes it clear that the argument is a pointer to a time related structure helping avoid confusion in function calls This integrate my pr that helped Deathlight get ingame with the last changes from the kernel gettime pr just merged ![image](https://github.com/user-attachments/assets/74d81f03-9b99-4b59-8b0d-ecbe8896038f) Makes Deadlight Director's Cut | CUSA04434 | 1.00 Playable (according to reports with image proof) Mages of mystralia : works again but needs a few starts. (according to reports) Mad max: is back ingame again. (acording to reports) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:01:34 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#2876
No description provided.