Commit Graph

10 Commits

Author SHA1 Message Date
Phi1ow 75c2ea8548 feat(sysmodule): implement sceSysmoduleLoadModuleInternal and sceSysmoduleUnloadModuleInternal
Two exports were missing. System modules are linked statically, so load and unload are
reference counts over the known module table, exactly like the existing
sceSysmoduleLoadModuleInternalWithArg and sceSysmoduleUnloadModule:

- sceSysmoduleLoadModuleInternal(uint32_t) -> increments the module's load count, returns 0
- sceSysmoduleUnloadModuleInternal(uint32_t) -> decrements it, or 0x80A90003 when the module
  was not loaded

Unknown or zero ids throw, like the sibling internal loader. Adds a CMakeLists.txt so the
library can carry its guest test. Signatures follow the public OpenOrbis SDK headers.

New test core/libs/tests/GuestSysmodule.cpp loads a module twice, unloads it twice and checks
the not-loaded error on a third unload; it fails without the change (the symbols are
undefined) and passes with it.
2026-10-04 21:56:29 +02:00
Pacuka a2520aa071 fix(sysmodule): unload unknown module ids as no-ops
sceSysmoduleLoadModule and sceSysmoduleIsLoaded already accept ids the
project does not know and log them; unloading such an id threw, so a title
that loads and later unloads an unknown module aborted at the unload.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 21:32:15 +02:00
owner 63209b584f fix: correct sscanf %x signedness and avoid a substr copy
libSceSysmodule/Export.cpp parsed /proc/self/maps device major/minor
numbers into signed int with a %x format, which is undefined behaviour
per the C standard even though it happened to work on this target;
switched to unsigned int to match the format specifier.

NidPatcherUtils.hpp's StripNidPostfix built a truncated copy with
substr(0, n) where the prefix is already the string itself; resize(n)
does the same truncation without the extra allocation and copy.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-26 14:11:50 -06:00
boykopovar b4db9fdd69 chore(sceSysmodule): log unknown module id loading 2026-09-12 18:00:34 +03:00
boykopovar abc72da741 feat(libs): define vabi macros + add to declarations 2026-09-10 08:07:03 +03:00
boykopovar 7592031dc9 feat(libs): add windows branch for get sysmodule info 2026-09-07 11:21:44 +03:00
boykopovar 0bbf0923ef feat(sysmodule): add new modules mapping 2026-09-07 11:17:36 +03:00
boykopovar 1e0fc3f33a feat(libs): add libSysmodule impl 2026-09-07 10:55:32 +03:00
boykopovar 6123893998 feat(libs): throw not impl ex in every stub 2026-09-06 15:05:04 +03:00
boykopovar 59bee8d187 feat(libs): add libs function signatures 2026-08-20 23:18:16 +03:00