mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-25 15:56:00 +03:00
[PR #2807] [MERGED] Emulate memory behavior of libSceGnmDriver initialization #2993
Labels
No labels
Bloodborne
bug
contributor wanted
documentation
enhancement
frontend
good first issue
help wanted
linux
pull-request
question
release
verification progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/shadPS4#2993
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/shadps4-emu/shadPS4/pull/2807
Author: @StevenMiller123
Created: 4/18/2025
Status: ✅ Merged
Merged: 4/18/2025
Merged by: @georgemoralis
Base:
main← Head:nba-fix📝 Commits (6)
de549a2Emulate memory behavior of libSceGnmDriver _DT_INIT36ed12eClangc40bd3fFix address input for direct memory call273fabaMerge branch 'shadps4-emu:main' into nba-fixedbe39aFix bug with DirectQueryAvailablea242e66DirectQueryAvailable fix📊 Changes
4 files changed (+16 additions, -10 deletions)
View changed files
📝
src/core/libraries/gnmdriver/gnmdriver.cpp(+1 -1)📝
src/core/libraries/kernel/memory.cpp(+0 -6)📝
src/core/linker.cpp(+14 -2)📝
src/core/memory.cpp(+1 -1)📄 Description
Some games check if sceKernelAllocateDirectMemory failed by looking at the phys_addr_out returned, treating a returned value of 0 as a failed call. On real hardware, a phys_addr_out of 0 is never returned due to libSceGnmDriver's initialization performing a direct memory mapping. This PR naively implements this by adding the relevant code to Linker::Execute, similar to how I handled the SceKernelInternalMemory mapping.
Also includes a hotfix for sceKernelAvailableDirectMemorySize, as emulating this mapping revealed a typo in my code.
This PR fixes an early crash in NBA2K18 (CUSA08500), and fixes the remaining discrepancy shown in the tests I did for https://github.com/shadps4-emu/shadPS4/pull/2803
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.