[PR #2265] [MERGED] Libraries: Update libcInternal #2609

Closed
opened 2026-02-27 22:00:34 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/2265
Author: @kalaposfos13
Created: 1/29/2025
Status: Merged
Merged: 2/14/2025
Merged by: @georgemoralis

Base: mainHead: libc-internal


📝 Commits (10+)

  • 7b8e2c5 Added all stubs + logging
  • 370e754 Added back memory and math functions from the original code + added some more math functions
  • be851cc More string functions, snprintf, memmove and setjmp
  • f2686c2 Add longjmp + clang
  • 7a08ba1 gmtime, __cxa_atexit and log what functions some games use
  • 5e72799 Add Mspace unreachable
  • 38a4777 Renaming
  • aff3fb7 Take out mspace functions to their own file
  • bd2c989 Factor out io to a new file
  • 00d9162 Empty str and memory files

📊 Changes

17 files changed (+21727 additions, -209 deletions)

View changed files

📝 CMakeLists.txt (+12 -0)
📝 src/common/logging/filter.cpp (+1 -0)
📝 src/common/logging/types.h (+1 -0)
📝 src/core/libraries/libc_internal/libc_internal.cpp (+16149 -203)
📝 src/core/libraries/libc_internal/libc_internal.h (+3 -6)
src/core/libraries/libc_internal/libc_internal_io.cpp (+472 -0)
src/core/libraries/libc_internal/libc_internal_io.h (+14 -0)
src/core/libraries/libc_internal/libc_internal_math.cpp (+773 -0)
src/core/libraries/libc_internal/libc_internal_math.h (+14 -0)
src/core/libraries/libc_internal/libc_internal_memory.cpp (+314 -0)
src/core/libraries/libc_internal/libc_internal_memory.h (+14 -0)
src/core/libraries/libc_internal/libc_internal_mspace.cpp (+247 -0)
src/core/libraries/libc_internal/libc_internal_mspace.h (+14 -0)
src/core/libraries/libc_internal/libc_internal_str.cpp (+532 -0)
src/core/libraries/libc_internal/libc_internal_str.h (+14 -0)
src/core/libraries/libc_internal/libc_internal_stream.cpp (+3139 -0)
src/core/libraries/libc_internal/libc_internal_stream.h (+14 -0)

📄 Description

Added all stubs, added back all things that were already implemented, and added functions based on what my games called. I have some basic implementation of printf functions, but I'm not really satisfied with the implementation, so I only did the ones that are actually called by games, and will update the rest when I find a better solution (Also, the non string variants should interface with shadPS4's tty system as well). The new things are:
More math functions
More str functions
setjmp, longjmp (Driveclub needs it to work)
memmove

The main thing that needs implementing for Gravity Rush 2 (and probably other games as well) is the sceLibcMspace functions, which are their own memory management sublibrary, from what I can see.

Logs filtered by *:Critical Lib.LibcInternal:Info are welcome if they contain stubs

This probably won't help a lot of games go further without sceLibcInternal as LLE (though implementing sceLibcMspace might do that), and my only game that reached further was Driveclub.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/2265 **Author:** [@kalaposfos13](https://github.com/kalaposfos13) **Created:** 1/29/2025 **Status:** ✅ Merged **Merged:** 2/14/2025 **Merged by:** [@georgemoralis](https://github.com/georgemoralis) **Base:** `main` ← **Head:** `libc-internal` --- ### 📝 Commits (10+) - [`7b8e2c5`](https://github.com/shadps4-emu/shadPS4/commit/7b8e2c550c192c2f6cd75bb56e9a5cfc59ebff60) Added all stubs + logging - [`370e754`](https://github.com/shadps4-emu/shadPS4/commit/370e754dbf7a5aae21f789c078fdc1f8db9e46f4) Added back memory and math functions from the original code + added some more math functions - [`be851cc`](https://github.com/shadps4-emu/shadPS4/commit/be851ccd016cf68e7ba9409e85bf7e4119edf633) More string functions, snprintf, memmove and setjmp - [`f2686c2`](https://github.com/shadps4-emu/shadPS4/commit/f2686c2223caebd13203684fac43934bc92a4373) Add longjmp + clang - [`7a08ba1`](https://github.com/shadps4-emu/shadPS4/commit/7a08ba1a452128fabf6f4823c4a1b7a4efba039c) gmtime, __cxa_atexit and log what functions some games use - [`5e72799`](https://github.com/shadps4-emu/shadPS4/commit/5e727993754656bfe02b72451e7ba44aeb8f3b8e) Add Mspace unreachable - [`38a4777`](https://github.com/shadps4-emu/shadPS4/commit/38a4777b39f06f41d47961623e3dba45db67a09f) Renaming - [`aff3fb7`](https://github.com/shadps4-emu/shadPS4/commit/aff3fb7ad3fb0f9958744de397adaa73f87e6559) Take out mspace functions to their own file - [`bd2c989`](https://github.com/shadps4-emu/shadPS4/commit/bd2c9890e979f0f39e7eedf31921dd1d6baca234) Factor out io to a new file - [`00d9162`](https://github.com/shadps4-emu/shadPS4/commit/00d916208900671e55a6b78a0a20e98cd3970cca) Empty str and memory files ### 📊 Changes **17 files changed** (+21727 additions, -209 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+12 -0) 📝 `src/common/logging/filter.cpp` (+1 -0) 📝 `src/common/logging/types.h` (+1 -0) 📝 `src/core/libraries/libc_internal/libc_internal.cpp` (+16149 -203) 📝 `src/core/libraries/libc_internal/libc_internal.h` (+3 -6) ➕ `src/core/libraries/libc_internal/libc_internal_io.cpp` (+472 -0) ➕ `src/core/libraries/libc_internal/libc_internal_io.h` (+14 -0) ➕ `src/core/libraries/libc_internal/libc_internal_math.cpp` (+773 -0) ➕ `src/core/libraries/libc_internal/libc_internal_math.h` (+14 -0) ➕ `src/core/libraries/libc_internal/libc_internal_memory.cpp` (+314 -0) ➕ `src/core/libraries/libc_internal/libc_internal_memory.h` (+14 -0) ➕ `src/core/libraries/libc_internal/libc_internal_mspace.cpp` (+247 -0) ➕ `src/core/libraries/libc_internal/libc_internal_mspace.h` (+14 -0) ➕ `src/core/libraries/libc_internal/libc_internal_str.cpp` (+532 -0) ➕ `src/core/libraries/libc_internal/libc_internal_str.h` (+14 -0) ➕ `src/core/libraries/libc_internal/libc_internal_stream.cpp` (+3139 -0) ➕ `src/core/libraries/libc_internal/libc_internal_stream.h` (+14 -0) </details> ### 📄 Description Added all stubs, added back all things that were already implemented, and added functions based on what my games called. I have some basic implementation of printf functions, but I'm not really satisfied with the implementation, so I only did the ones that are actually called by games, and will update the rest when I find a better solution (Also, the non string variants should interface with shadPS4's tty system as well). The new things are: More math functions More str functions setjmp, longjmp (Driveclub needs it to work) memmove The main thing that needs implementing for Gravity Rush 2 (and probably other games as well) is the sceLibcMspace functions, which are their own memory management sublibrary, from what I can see. Logs filtered by `*:Critical Lib.LibcInternal:Info` are welcome if they contain stubs This probably won't help a lot of games go further without sceLibcInternal as LLE (though implementing sceLibcMspace might do that), and my only game that reached further was Driveclub. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:00:34 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#2609
No description provided.