feat(libSceRazorCpu): add sceRazorCpuPlotValue and sceRazorCpuWriteBookmark #1247

Merged
gjonn merged 1 commit from upstream-pr/1247 into main 2026-10-07 20:22:47 +00:00
gjonn commented 2026-10-07 19:37:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by gjonn on 2026-10-07T19:37:05Z.


What

Adds sceRazorCpuPlotValue (njGikRrxkC0) and sceRazorCpuWriteBookmark (G3brhegfyNg) to libSceRazorCpu. main exports neither, so PPSA06320 (Ape Escape, PS1HD emulator 1.7) stops at startup with unresolved ELF import njGikRrxkC0 from libSceRazorCpu.prx.

  • Signatures from SharpProspero (Interop/Debug/RazorCpu.cs): int sceRazorCpuPlotValue(const char* series, float value) and int sceRazorCpuWriteBookmark(const char* label, const char* description), with an optional description. They match the title's calls: the plot gets a name in rdi and a float in xmm0 (CD-ROM read time in ms), and the bookmark gets a label in rdi and a formatted BLOCKING READ of lba=0x... string in rsi.
  • There is no Razor capture (sceRazorCpuIsCapturing returns 0), so both do nothing and return 0, like sceRazorCpuPushMarkerStatic and sceRazorCpuPopMarker.
  • TechnicalDebt "Unknown function info" entry next to the other RazorCpu ones.

Tested

Windows 11, MinGW-w64 GCC 15.2.0, Release:

  • guest_razor_cpu passes; it now also calls both functions, the bookmark with and without a description.
  • PPSA06320 relinked for Windows: on main it stops at startup on the unresolved import. With this change it gets past it, and the PS1HD emulator starts and loads its configuration up to the next missing function (sceKernelGetModuleInfoFromAddr on Windows, which #1188 covers).
  • tools/check_conventions.py --base origin/main passes with POSIX path handling, as on CI. Run on Windows, the script reports a false doc-link/silent-stub because os.path.normpath returns backslashes.

Linux: not built locally.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4777541874 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1247). Originally posted by [gjonn](https://github.com/gjonn) on 2026-10-07T19:37:05Z. --- ### What Adds `sceRazorCpuPlotValue` (`njGikRrxkC0`) and `sceRazorCpuWriteBookmark` (`G3brhegfyNg`) to libSceRazorCpu. `main` exports neither, so PPSA06320 (Ape Escape, PS1HD emulator 1.7) stops at startup with `unresolved ELF import njGikRrxkC0 from libSceRazorCpu.prx`. - Signatures from [SharpProspero](https://github.com/SvenGDK/SharpProspero) (`Interop/Debug/RazorCpu.cs`): `int sceRazorCpuPlotValue(const char* series, float value)` and `int sceRazorCpuWriteBookmark(const char* label, const char* description)`, with an optional description. They match the title's calls: the plot gets a name in `rdi` and a float in `xmm0` (CD-ROM read time in ms), and the bookmark gets a label in `rdi` and a formatted `BLOCKING READ of lba=0x...` string in `rsi`. - There is no Razor capture (`sceRazorCpuIsCapturing` returns 0), so both do nothing and return 0, like `sceRazorCpuPushMarkerStatic` and `sceRazorCpuPopMarker`. - TechnicalDebt "Unknown function info" entry next to the other RazorCpu ones. ### Tested Windows 11, MinGW-w64 GCC 15.2.0, Release: - `guest_razor_cpu` passes; it now also calls both functions, the bookmark with and without a description. - PPSA06320 relinked for Windows: on `main` it stops at startup on the unresolved import. With this change it gets past it, and the PS1HD emulator starts and loads its configuration up to the next missing function (`sceKernelGetModuleInfoFromAddr` on Windows, which #1188 covers). - `tools/check_conventions.py --base origin/main` passes with POSIX path handling, as on CI. Run on Windows, the script reports a false `doc-link`/`silent-stub` because `os.path.normpath` returns backslashes. Linux: not built locally. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-07 19:37:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-07T19:37:29Z.


Progress report (4764e59 → 531d5c1)

📈 System libraries: 86.06% (+0.01%, +2 implemented functions)

✅ 2 implemented
Library Name
libSceRazorCpu sceRazorCpuPlotValue
libSceRazorCpu sceRazorCpuWriteBookmark
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6045407298 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1247#issuecomment-6045407298). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-07T19:37:29Z. --- <!-- progress-report --> ### Progress report (4764e59 → 531d5c1) 📈 **System libraries**: 86.06% (+0.01%, +2 implemented functions) <details> <summary>✅ 2 implemented</summary> | Library | Name | | - | - | | libSceRazorCpu | `sceRazorCpuPlotValue` | | libSceRazorCpu | `sceRazorCpuWriteBookmark` | </details>
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
boykopovar/AnyPS5!1247
No description provided.