shadPS4/src/common
Stephen Miller cc6af03adf
Lib.SysModule: Proper HLE implementation (#4102)
* Replace sysmodule enums with table

Dumped this from the 12.52 module, using a script I created.

* Better documentation

* Separate from system libraries

That system folder is going to be getting quite large if I left all the sysmodule stuff in there.

* More arrays from library

* Found another preload list

Ghidra really hates decompiling libSceSysmodule, so I didn't notice this one at first.
Also documented specific versions tied to each preload list.

* Start work on implementation

* Some basic implementations

* Initial stub for module loading

Just enough to see if the logic functions appropriately.

* Clang

* sceSysmoduleLoadModule

Now I need to get sceSysmodulePreloadModuleForLibkernel done so that we don't have bugs from not loading internal LLEs.

* sceSysmoduleLoadModuleInternal

* sceSysmodulePreloadModuleForLibkernel

I have successfully broken quite literally everything.
I shall debug this tomorrow.

* Slight fix

* Maybe fix?

* Change log

Enjoy the log spam 😄

* Increased defined stub count

Now that libc and libSceLibcInternal loads later, all the auto stubs are getting consumed by it.

* sceSysmoduleUnloadModule stub

Also a couple fixes. Sysmodule does pass argc and argv to game modules, but only after loading them once to check  binaries.
Shouldn't matter for the most part.

* Clang

* Less stubs

2 thousand is seemingly enough.

* sceSysmoduleLoadModuleInternalWithArg

Doesn't hurt to have, since Apex Legends calls it.

* Oops

* Oops 2

* Rename isModuleLoaded to getModuleHandle

Review comment

* Remove debug game module loads

These cases only trigger when specific sceRegMgr key values are set, and for our purposes, we can treat that case as false.

* Allow preloading to fail

For kalaposfos

* Clang
2026-03-08 21:48:03 +02:00
..
logging Core: Force logging of critical errors (#4061) 2026-02-21 09:53:28 +02:00
support fix: fix #1457 again by moving av_err2str to a common header (#1688) 2024-12-08 00:52:03 +02:00
adaptive_mutex.h video_core: Page manager and memory tracker improvenets (#3155) 2025-06-26 18:38:53 +02:00
aes.h externals: Remove need for cryptopp build. (#2707) 2025-03-29 10:32:06 +02:00
alignment.h libraries: Add initial HLE JPEG encoder skeleton (#1607) 2024-11-30 21:43:12 +02:00
arch.h Initial support for compiling on ARM64. (#788) 2024-09-09 13:23:16 +03:00
assert.cpp Initial support for compiling on ARM64. (#788) 2024-09-09 13:23:16 +03:00
assert.h common: Rewrite logging based on cut down citra logger (#86) 2024-02-28 00:10:34 +02:00
bit_array.h bit_array: Remove non const operator~ (#3161) 2025-06-26 18:07:56 -07:00
bit_field.h Devtools improvements I (#1392) 2024-10-16 13:12:46 +03:00
bounded_threadsafe_queue.h texture_cache: Fix linear image uploads 2024-04-29 18:22:04 +03:00
concepts.h common: Rewrite logging based on cut down citra logger (#86) 2024-02-28 00:10:34 +02:00
config.cpp Low readbacks mode (#4085) 2026-02-28 17:17:11 +02:00
config.h the uber fix (#4092) 2026-03-01 21:02:21 +02:00
cstring.h ime_dialog: Initial implementation (#1267) 2024-10-11 04:53:32 +03:00
debug.h build: exclude Tracy from release builds 2024-12-22 22:51:48 +01:00
decoder.cpp Implement shader resource tables (#1165) 2024-11-01 08:55:53 +02:00
decoder.h Implement shader resource tables (#1165) 2024-11-01 08:55:53 +02:00
discord_rpc_handler.cpp Don't use github as a CDN for Discord RPC icon (#1496) 2024-11-21 12:09:10 +02:00
discord_rpc_handler.h added discord rpc (#1178) 2024-10-08 18:14:37 +03:00
div_ceil.h Switch remaining CRLF terminated files to LF 2024-12-24 13:56:31 +01:00
elf_info.h Lib.SysModule: Proper HLE implementation (#4102) 2026-03-08 21:48:03 +02:00
endian.h file formats and qt (#88) 2024-03-01 00:00:35 +02:00
enum.h video: Import new shader recompiler + display a triangle (#142) 2024-05-22 01:35:12 +03:00
error.cpp core: Rework memory manager 2024-06-10 02:13:44 +03:00
error.h common: Rewrite logging based on cut down citra logger (#86) 2024-02-28 00:10:34 +02:00
fixed_value.h Message Dialog library (#767) 2024-09-08 23:27:50 +03:00
func_traits.h video: Import new shader recompiler + display a triangle (#142) 2024-05-22 01:35:12 +03:00
hash.h Implement shader resource tables (#1165) 2024-11-01 08:55:53 +02:00
io_file.cpp Core: Simulate write-only file access with read-write access (#3360) 2025-11-04 10:57:26 +02:00
io_file.h Core: Simulate write-only file access with read-write access (#3360) 2025-11-04 10:57:26 +02:00
key_manager.cpp Introducing key_manager for storing encryption keys . (#3935) 2026-01-19 18:49:57 +02:00
key_manager.h Introducing key_manager for storing encryption keys . (#3935) 2026-01-19 18:49:57 +02:00
lru_cache.h video_core: garbage collector (part 1) (#3350) 2025-08-06 12:30:13 +02:00
memory_patcher.cpp Emulator state (#3906) 2026-01-09 19:42:05 +02:00
memory_patcher.h Remove Qt from emulator (#3733) 2025-10-31 10:28:39 +02:00
native_clock.cpp native_clock: Remove unused process code. (#1989) 2024-12-31 10:04:26 +02:00
native_clock.h native_clock: Remove unused process code. (#1989) 2024-12-31 10:04:26 +02:00
ntapi.cpp Switch remaining CRLF terminated files to LF 2024-12-24 13:56:31 +01:00
ntapi.h Switch remaining CRLF terminated files to LF 2024-12-24 13:56:31 +01:00
number_utils.cpp amdgpu: Split liverpool registers and cleanup (#3707) 2025-10-05 13:42:40 -07:00
number_utils.h video_core: Rework clear values (#1381) 2024-10-16 12:55:45 +03:00
object_pool.h video_core: Implement guest buffer manager (#373) 2024-08-08 15:02:10 +03:00
path_util.cpp Core: Mount system fonts (#4028) 2026-02-13 09:02:30 +02:00
path_util.h Core: Mount system fonts (#4028) 2026-02-13 09:02:30 +02:00
polyfill_thread.h Bump to Clang 19 (#2434) 2025-02-18 15:55:13 +02:00
range_lock.h video_core: Page manager and memory tracker improvenets (#3155) 2025-06-26 18:38:53 +02:00
rdtsc.cpp code: Add clang-format target and CI workflow (#82) 2024-02-23 22:57:57 +02:00
rdtsc.h Initial support for compiling on ARM64. (#788) 2024-09-09 13:23:16 +03:00
recursive_lock.cpp video_core: Implement DMA. (#2819) 2025-05-22 21:00:15 +03:00
recursive_lock.h video_core: Implement DMA. (#2819) 2025-05-22 21:00:15 +03:00
scm_rev.cpp.in Fix SSH remote links (#3025) 2025-06-02 19:02:37 +03:00
scm_rev.h Fix SSH remote links (#3025) 2025-06-02 19:02:37 +03:00
scope_exit.h core: Implement new memory manager (#133) 2024-05-16 15:55:50 +03:00
serdes.h video_core: Initial implementation of pipeline cache (#3816) 2025-11-29 11:52:08 +02:00
sha1.h externals: Remove need for cryptopp build. (#2707) 2025-03-29 10:32:06 +02:00
shared_first_mutex.h Kernel.Vmm: Attempt to address race conditions involving ClampRangeSize, CopySparseMemory, and TryWriteBacking (#3956) 2026-01-27 12:25:23 +02:00
signal_context.cpp Patch extrq (#943) 2024-09-23 19:19:52 +03:00
signal_context.h Patch extrq (#943) 2024-09-23 19:19:52 +03:00
singleton.h chore: Make shadps4 REUSE compliant 2024-02-23 23:33:43 +02:00
slab_heap.h kernel: Rewrite pthread emulation (#1440) 2024-11-21 22:59:38 +02:00
slot_array.h Ajm (#1456) 2024-11-05 09:16:57 +02:00
slot_vector.h video_core: Implement DMA. (#2819) 2025-05-22 21:00:15 +03:00
spin_lock.cpp Switch remaining CRLF terminated files to LF 2024-12-24 13:56:31 +01:00
spin_lock.h Switch remaining CRLF terminated files to LF 2024-12-24 13:56:31 +01:00
stb.cpp cmake: unbundle stb (#1601) 2024-12-05 23:10:27 +02:00
stb.h cmake: unbundle stb (#1601) 2024-12-05 23:10:27 +02:00
string_literal.h FidelityFX FSR implementation (#2624) 2025-03-12 20:33:30 +02:00
string_util.cpp Devtools - Shader editing (#1705) 2024-12-09 21:11:11 +01:00
string_util.h Devtools - Shader editing (#1705) 2024-12-09 21:11:11 +01:00
thread.cpp Fix thread names being set to garbage (#3985) 2026-02-03 09:58:22 +01:00
thread.h Add thread names to log lines (#3893) 2026-01-04 21:10:42 +02:00
types.h video_core: Rewrite vulkan and videoout 2024-04-14 17:10:40 +03:00
uint128.h Added const reference params if possible, removed less 16 size 2024-08-22 02:56:01 +03:00
unique_function.h Switch remaining CRLF terminated files to LF 2024-12-24 13:56:31 +01:00
va_ctx.h kernel: Clean up and fix some mistakes. (#2907) 2025-05-11 14:22:17 -07:00