Files
AnyPS5/core/libs/tests/GuestRazorCpu.cpp
T
Phi1ow ce6b26fadb feat(razor): implement the libSceRazorCpu CPU profiler stubs
libSceRazorCpu is the CPU-side instrumentation for the Razor capture tool. AnyPS5 does not host
that tool, so the instrumentation does nothing and succeeds, which is also what shadPS4 does:

- sceRazorCpuIsCapturing -> 0 (no capture is in progress, so titles skip their profiling paths)
- sceRazorCpuJobManagerDispatch / sceRazorCpuJobManagerJob / sceRazorCpuJobManagerSequence -> 0

These only feed the profiler; they do not affect execution. Adds a CMakeLists.txt so the library
can carry its guest test.

New test core/libs/tests/GuestRazorCpu.cpp checks the four return values; it fails on main (the
functions throw) and passes with the change.
2026-10-04 23:12:52 +02:00

24 lines
644 B
C++

#include "prx/libc/include/general/VabiMacros.hpp"
#include <cstdint>
#include <cstdlib>
extern "C" {
std::uint32_t APS5_VABI sceRazorCpuIsCapturing(void);
int APS5_VABI sceRazorCpuJobManagerDispatch(const void* args);
int APS5_VABI sceRazorCpuJobManagerJob(const void* args);
int APS5_VABI sceRazorCpuJobManagerSequence(const void* args);
}
namespace {
void Require(bool value) { if (!value) std::abort(); }
}
int main() {
Require(sceRazorCpuIsCapturing() == 0);
Require(sceRazorCpuJobManagerDispatch(nullptr) == 0);
Require(sceRazorCpuJobManagerJob(nullptr) == 0);
Require(sceRazorCpuJobManagerSequence(nullptr) == 0);
}