Merge pull request #6497 from giovanniadamo/feat/libsceregmgr

feat(libSceRegMgr): add sceRegMgrNonSysGetInt stub
This commit is contained in:
Adrià authored and GitHub committed 2026-10-19 04:36:35 +02:00
commit ccbd40240f
4 files changed
+61

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
add_library(libSceRegMgr SHARED EXCLUDE_FROM_ALL Export.cpp)
target_include_directories(libSceRegMgr PRIVATE ${LIBS_INCLUDE_DIR})
configure_windows_unwind(libSceRegMgr)
if(BUILD_TESTING)
add_test_executable(guest_regmgr_tests ${LIBS_INCLUDE_DIR}/tests/GuestRegMgr.cpp)
target_include_directories(guest_regmgr_tests PRIVATE ${LIBS_INCLUDE_DIR})
target_link_libraries(guest_regmgr_tests PRIVATE libSceRegMgr libc)
configure_windows_unwind(guest_regmgr_tests)
add_test(NAME guest_regmgr COMMAND guest_regmgr_tests)
if(WIN32)
set_tests_properties(guest_regmgr PROPERTIES ENVIRONMENT_MODIFICATION
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libSceRegMgr>")
endif()
endif()
+14
View File
@@ -0,0 +1,14 @@
#include <cstdint>
#include "prx/libc/include/General.hpp"
extern "C" {
std::int32_t APS5_VABI sceRegMgrNonSysGetInt(std::int64_t key, std::int32_t unk, std::int32_t* data) {
(void)key;
(void)unk;
(void)data;
NotImplemented_nid_no_patch(__func__);
return 0;
}
}
+27
View File
@@ -0,0 +1,27 @@
#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); }));
}
+5
View File
@@ -0,0 +1,5 @@
# libSceRegMgr technical debt
### Unknown function info
- [sceRegMgrNonSysGetInt](../../../core/libs/prx/libSceRegMgr/Export.cpp) (libSceRegMgr, NID `dKeshzt29G4`) - imported by Astro Bot (PPSA21564), which fails to load without libSceRegMgr.prx (issue 4720); the `(int64_t key, int32_t unk, int32_t* data)` signature follows [ChonkyStation4](https://github.com/liuk7071/ChonkyStation4/blob/c101a23ecbc15e56c6e30d5dd24d3ed8880a957a/ChonkyStation4/OS/Libraries/SceRegMgr/SceRegMgr.cpp#L38-L47), not measured on a console, so every call throws