[PR #1624] [MERGED] libraries: Add libSceRazorCpu HLE skeleton. #2206

Closed
opened 2026-02-27 21:15:35 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/1624
Author: @squidbus
Created: 11/30/2024
Status: Merged
Merged: 11/30/2024
Merged by: @georgemoralis

Base: mainHead: razor-cpu-hle


📝 Commits (3)

📊 Changes

13 files changed (+334 additions, -29 deletions)

View changed files

📝 CMakeLists.txt (+2 -0)
📝 src/common/config.cpp (+37 -18)
📝 src/common/logging/filter.cpp (+1 -0)
📝 src/common/logging/types.h (+1 -0)
📝 src/core/libraries/kernel/file_system.cpp (+1 -1)
📝 src/core/libraries/kernel/memory.cpp (+15 -0)
📝 src/core/libraries/kernel/threads/pthread.cpp (+6 -6)
📝 src/core/libraries/kernel/threads/pthread_attr.cpp (+2 -0)
📝 src/core/libraries/kernel/threads/pthread_spec.cpp (+1 -0)
📝 src/core/libraries/libs.cpp (+2 -0)
src/core/libraries/razor_cpu/razor_cpu.cpp (+249 -0)
src/core/libraries/razor_cpu/razor_cpu.h (+17 -0)
📝 src/core/libraries/system/sysmodule.cpp (+0 -4)

📄 Description

Did a bit more looking into libSceRazorCpu and apparently the default behavior when the system hasn't initialized it with sceRazorCpuInitializeInternal is to just stub out every single function to return ORBIS_OK immediately.

Thus instead of pretending it isn't loaded, we can just add HLE stubs that debug log (to avoid spam) and return OK same as this default behavior, and everything works fine. This should help eliminate the log spam on some versions of PSPHD as well since it apparently does not check if the module is loaded. In the future we can also hook into these debug calls ourselves to add to our own debugging information.

Validated on Gravity Rush Remastered and Persona 5 Royal same as before.


🔄 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/1624 **Author:** [@squidbus](https://github.com/squidbus) **Created:** 11/30/2024 **Status:** ✅ Merged **Merged:** 11/30/2024 **Merged by:** [@georgemoralis](https://github.com/georgemoralis) **Base:** `main` ← **Head:** `razor-cpu-hle` --- ### 📝 Commits (3) - [`2d7766b`](https://github.com/shadps4-emu/shadPS4/commit/2d7766b70bd4d3c5331e81b899934ca4a66f1820) Remove save migration code (#1621) - [`666b060`](https://github.com/shadps4-emu/shadPS4/commit/666b0609f764301056cba75a05ceeba78e59f7bd) Kernel Fixes (#1605) - [`1a49c9d`](https://github.com/shadps4-emu/shadPS4/commit/1a49c9d5baee1dedc2c420bbb67cf9959bd3671a) libraries: Add libSceRazorCpu HLE skeleton. ### 📊 Changes **13 files changed** (+334 additions, -29 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+2 -0) 📝 `src/common/config.cpp` (+37 -18) 📝 `src/common/logging/filter.cpp` (+1 -0) 📝 `src/common/logging/types.h` (+1 -0) 📝 `src/core/libraries/kernel/file_system.cpp` (+1 -1) 📝 `src/core/libraries/kernel/memory.cpp` (+15 -0) 📝 `src/core/libraries/kernel/threads/pthread.cpp` (+6 -6) 📝 `src/core/libraries/kernel/threads/pthread_attr.cpp` (+2 -0) 📝 `src/core/libraries/kernel/threads/pthread_spec.cpp` (+1 -0) 📝 `src/core/libraries/libs.cpp` (+2 -0) ➕ `src/core/libraries/razor_cpu/razor_cpu.cpp` (+249 -0) ➕ `src/core/libraries/razor_cpu/razor_cpu.h` (+17 -0) 📝 `src/core/libraries/system/sysmodule.cpp` (+0 -4) </details> ### 📄 Description Did a bit more looking into `libSceRazorCpu` and apparently the default behavior when the system hasn't initialized it with `sceRazorCpuInitializeInternal` is to just stub out every single function to return `ORBIS_OK` immediately. Thus instead of pretending it isn't loaded, we can just add HLE stubs that debug log (to avoid spam) and return OK same as this default behavior, and everything works fine. This should help eliminate the log spam on some versions of PSPHD as well since it apparently does not check if the module is loaded. In the future we can also hook into these debug calls ourselves to add to our own debugging information. Validated on Gravity Rush Remastered and Persona 5 Royal same as before. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 21:15:35 +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#2206
No description provided.