Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved error handling in sceKernelAllocateDirectMemory #2037

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

StevenMiller123
Copy link
Contributor

@StevenMiller123 StevenMiller123 commented Jan 3, 2025

Some games, most notably the Call of Duty series of games, intentionally make sceKernelAllocateDirectMemory calls that fail. To match hardware behavior, we should return ORBIS_KERNEL_ERROR_EAGAIN instead of throwing an assert.

This should fix games that still hit Unable to find free direct memory area asserts after #1896.

Credits to @red-prig and @raphaelthegreat for helping with the error cases.

This needs testing, as it could hide deeper issues in some games.

@StevenMiller123 StevenMiller123 changed the title Handle errors in sceKernelAllocateDirectMemory Improved error handling in sceKernelAllocateDirectMemory Jan 3, 2025
@Missake212
Copy link

Pretty sure we already tested this on Discord but since these commits are more recent I thought I'd give them a try and send the logs here.

NBA2K15
shad_log.txt

NBA2K17
shad_log.txt

@squidbus
Copy link
Collaborator

What is the current status of this PR?

@StevenMiller123
Copy link
Contributor Author

This does resolve the issues I saw in Call of Duty games, but leads to hangs or crashes in other games that hit the Unable to find free direct memory area asserts, like Hatsune Miku Project Diva X and the NBA games Missake212 tested.
I'd like to see if I can figure out why those NBA games are behaving weirdly before marking this PR as ready, since the issues in those games seem to be related to sceKernelAllocateDirectMemory.

@Missake212
Copy link

This does resolve the issues I saw in Call of Duty games, but leads to hangs or crashes in other games that hit the Unable to find free direct memory area asserts, like Hatsune Miku Project Diva X and the NBA games Missake212 tested. I'd like to see if I can figure out why those NBA games are behaving weirdly before marking this PR as ready, since the issues in those games seem to be related to sceKernelAllocateDirectMemory.

If you want me to I could try to merge this PR locally and check through VS why it's hanging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants