mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-26 00:05:58 +03:00
[PR #2803] [MERGED] libkernel: Fix sceKernelAllocateDirectMemory and sceKernelAvailableDirectMemorySize #2990
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#2990
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/2803
Author: @StevenMiller123
Created: 4/18/2025
Status: ✅ Merged
Merged: 4/18/2025
Merged by: @georgemoralis
Base:
main← Head:dmem-fixes📝 Commits (8)
8e351deAllocateDirectMemory fixes8442408DirectQueryAvailable fixes7ba45e3Reduce sceKernelGetDirectMemorySize log severitye92053aClang6c277d7Fix phys_addr_outd4b7ebcDividing by zero is funffefe2dUpdate memory.cpp008b1cdClang📊 Changes
2 files changed (+42 additions, -25 deletions)
View changed files
📝
src/core/libraries/kernel/memory.cpp(+1 -1)📝
src/core/memory.cpp(+41 -24)📄 Description
Both sceKernelAllocateDirectMemory and sceKernelAvailableDirectMemorySize handled the search area parameters improperly. This PR adjusts these functions to behave closer to observed hardware behavior.
Real hardware:

Main:

This PR:

I've also reduced the log severity of sceKernelGetDirectMemorySize, since it's behavior appears to be hardware accurate.
So far I've tested a few games and it seems like it doesn't break anything. Wouldn't hurt to have more people test though.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.