Files
AnyPS5/core/libs/tests/GuestRegMgr.cpp
T
CapibaraandClaude Sonnet 5 6dc4567335 feat(libSceRegMgr): add sceRegMgrNonSysGetInt stub
AstroBot's import log (issue #4720) names sceRegMgrNonSysGetInt as the
only libSceRegMgr export it needs; no other RegMgr export appears in
its 1909 unique imports. The signature and NID are sourced from a
community dump of PS5 3.20 firmware, cross-checked against the
open-source ChonkyStation4 emulator, not from Sony documentation, so
the export throws per the project's unknown-behavior convention
instead of guessing a return value.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-15 08:14:37 -03:00

28 lines
846 B
C++

#include "prx/libc/include/general/VabiMacros.hpp"
#include <cstdint>
#include <cstdlib>
#include <stdexcept>
#include <string>
extern "C" {
std::int32_t APS5_VABI sceRegMgrNonSysGetInt(std::int64_t key, std::int32_t unk, std::int32_t* data);
}
static void Require(bool value) { if (!value) std::abort(); }
template <typename TCall>
static bool ReportsNotImplemented(const char* name, TCall call) {
try {
call();
} catch (const std::runtime_error& error) {
return std::string(error.what()) == std::string(name) + " not implemented";
}
return false;
}
int main() {
std::int32_t value = 0;
Require(ReportsNotImplemented("sceRegMgrNonSysGetInt", [&] { sceRegMgrNonSysGetInt(0, 0, &value); }));
Require(ReportsNotImplemented("sceRegMgrNonSysGetInt", [&] { sceRegMgrNonSysGetInt(-1, 1, nullptr); }));
}