mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-25 15:56:00 +03:00
[GH-ISSUE #789] The Last Of Us Part II (CUSA07820) sceKernelGetDirectMemorySize Halt #204
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#204
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?
Originally created by @StevenMiller123 on GitHub (Sep 5, 2024).
Original GitHub issue: https://github.com/shadps4-emu/shadPS4/issues/789
The Last Of Us Part II verifies the value of sceKernelGetDirectMemorySize, and halts if the returned value differs from what it expects. A log of this behavior can be found at https://github.com/shadps4-emu/shadps4-game-compatibility/issues/66. This behavior is probably because the game sets a flexible memory size, a behavior that appears to be emulated fine.
Through decompiling the game's eboot, I found that the game uses the constant value 0x15f200000 to verify the direct memory size. For reference, the game sets the flexible memory size to 0xce00000, assuming the current emulated behavior is accurate. This would put the expected total memory size at 0x16c000000. For whatever reason, the expected sizes do not change when isPS4Pro is enabled in the config. I'm not sure if I can share any relevant assembly, but if this would be liked and is considered fine, then I will. I cannot provide any decompilation, as my Ghidra couldn't decomp the function this is all contained in.
@dark147x commented on GitHub (Sep 5, 2024):
Cool, I don't know much about development, I just hope to play the game (I played the first part before the PC port on an RPCS3). I wish you good luck!!!
@raphaelthegreat commented on GitHub (Sep 5, 2024):
Does the game progress further with this adjustment?
@StevenMiller123 commented on GitHub (Sep 5, 2024):
Yes, the game gets past this halt, but then immediately crashes from what appears to be an issue with sceKernelAvailableFlexibleMemorySize. These are the printed errors.
Here is a log with my fix applied, I modified sceKernelGetDirectMemorySize to print the returned size for debugging purposes.
Log: TLOU2 log.txt
I've also confirmed that the game requires the direct memory size to be the exact value I listed, and changing the size to slightly above or below the variable I listed causes that halt to come back.
@StevenMiller123 commented on GitHub (Sep 16, 2024):
Looking at logs from running the game on a base PS4, I think the issue is likely with how we handle flexible memory size assignments instead. I think the game might be trying to reduce the flexible memory size to increase dmem size, though I don't know how I would verify this, and I won't have access to my PS4s for another month or so.
@Hermiten commented on GitHub (Nov 14, 2024):
Hey, can we have an update about this ? To put some labels and maybe report it on discord
@rmueller83 commented on GitHub (Dec 14, 2024):
@Hermiten still the same on
e752f04cdeshad_log.txt
@StevenMiller123 commented on GitHub (Dec 28, 2024):
Fixed by #1896
@nazzzzTLOU commented on GitHub (Feb 2, 2025):
Is this "case" closed? Tlou 2 is still crashing and I tried to convert the fixed log file into bin although I know it's impossible.
So I wanted to know if a fix has been found pls
@StevenMiller123 commented on GitHub (Feb 2, 2025):
The specific issue I was reporting in this issue was fixed, the game is crashing on something else now.
@nazzzzTLOU commented on GitHub (Feb 2, 2025):
Have you found the issue? Or a hint to it? If not i hope it does,thanks for ur help man!!
@StevenMiller123 commented on GitHub (Feb 2, 2025):
We know why it's crashing, but we haven't found a proper solution yet.
Either way, we've got a while before larger games start working, shadPS4 is still very early in development.
If you've got more questions, I recommend asking in the shadPS4 Discord server instead.