[PR #2726] [MERGED] Emulate sceKernelInternalMemory mapping #2939

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

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/2726
Author: @StevenMiller123
Created: 3/30/2025
Status: Merged
Merged: 3/30/2025
Merged by: @georgemoralis

Base: mainHead: better-kernel-init-emulation


📝 Commits (2)

📊 Changes

1 file changed (+13 additions, -1 deletions)

View changed files

📝 src/core/linker.cpp (+13 -1)

📄 Description

During game relocation, libkernel performs a call to libSceLibcInternal's _malloc_init function. This function seems to perform many behaviors, most of which only matter for LLE firmware library behaviors.
This PR emulates one behavior of this function, a large flexible memory mapping it performs to the system reserved area of memory. Without handling this, games have more available flexible memory than they may expect.

This fixes a variable underflow on The Last of Us™ Part II startup, allowing it to progress further.


🔄 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/2726 **Author:** [@StevenMiller123](https://github.com/StevenMiller123) **Created:** 3/30/2025 **Status:** ✅ Merged **Merged:** 3/30/2025 **Merged by:** [@georgemoralis](https://github.com/georgemoralis) **Base:** `main` ← **Head:** `better-kernel-init-emulation` --- ### 📝 Commits (2) - [`dd10049`](https://github.com/shadps4-emu/shadPS4/commit/dd1004916e61c2c355a9f29523a397ea752f4384) Emulate sceKernelInternalMemory mapping - [`a0eeee7`](https://github.com/shadps4-emu/shadPS4/commit/a0eeee775580dc138400ad5670fa339cc30327fe) Fix name ### 📊 Changes **1 file changed** (+13 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/core/linker.cpp` (+13 -1) </details> ### 📄 Description During game relocation, libkernel performs a call to libSceLibcInternal's _malloc_init function. This function seems to perform many behaviors, most of which only matter for LLE firmware library behaviors. This PR emulates one behavior of this function, a large flexible memory mapping it performs to the system reserved area of memory. Without handling this, games have more available flexible memory than they may expect. This fixes a variable underflow on The Last of Us™ Part II startup, allowing it to progress further. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:01:50 +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#2939
No description provided.