-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Libraries: Update libcInternal #2265
base: main
Are you sure you want to change the base?
Conversation
…ome more math functions
This is a really large file, it should probably at least be split by the type of function. Also to be clear, games don't use this directly, it is used by other system modules only. So if your game needs it it's just that a LLE system module you have loaded for the game needs it. |
And lastly as you can see from the build results, defining the symbols as is will conflict with the host standard library, which is why we added |
libc_internal_math , libc_interna_memory files as well |
fix that clang already ;D |
I thought first I'd need to separate the important things like memory and math functions into their own file? Clang is less than a minute, so I'll just do that when I'm done |
ok one suggestion , move the implemented functions on the top of the file , it will be easier to review them that searching all that big files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOG_DEBUG will spam a lot , at least remove them from the ones that proven to be correct (1:1 matches from std ones)
} | ||
|
||
s32 PS4_SYSV_ABI internal_clearerr() { | ||
LOG_ERROR(Lib_LibcInter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gmtime_s something missing here...
|
||
char* PS4_SYSV_ABI internal_strsep(char** strp, const char* delim) { | ||
LOG_DEBUG(Lib_LibcInternal, "called"); | ||
#ifdef _GNU_SOURCE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
????
} | ||
|
||
void* PS4_SYSV_ABI internal_malloc(size_t size) { | ||
return std::malloc(size); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't like this. Guest ps4 uses own memory allocating, no need to alloc on host
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For what it's worth (at least in my opinion) this HLE is basically just useful if you want to debug something by intercepting the calls. I don't think there's much interest in actually implementing HLE for this library because a) it has a very large API surface and b) by HLE-ing other modules you no longer need this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does that mean that there are plans to implement libraries that come with the games (in sce_modules)? I know that there are some things that use it that are not manually loaded system libraries, like libSceNpToolkit for GR2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, although in all likelihood anything Np related would likely be a stub. NpToolkit definitely doesn't need all this stuff added here anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not that easy to get rid lle modules for example ngs2 will require a lot of effort. Also there are gamemodules that might need it so it is not a useless efford
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not that easy to get rid lle modules for example ngs2 will require a lot of effort.
Correct, but if you have LLE sysmodules there's no reason to not just put libcInternal with them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The less the better 😌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well if you're actually looking for a serious libcInternal HLE replacement then the original comment stands here, passing to host malloc
won't be acceptable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes it isn't. I thought it was general talk didn't see it is under a review 🤔
Added all stubs, added back all things that were already implemented, and added functions based on what my games called. I have some basic implementation of printf functions, but I'm not really satisfied with the implementation, so I only did the ones that are actually called by games, and will update the rest when I find a better solution (Also, the non string variants should interface with shadPS4's tty system as well). The new things are:
More math functions
More str functions
setjmp, longjmp (Driveclub needs it to work)
memmove
The main thing that needs implementing for Gravity Rush 2 (and probably other games as well) is the sceLibcMspace functions, which are their own memory management sublibrary, from what I can see.
Logs filtered by
*:Critical Lib.LibcInternal:Info
are welcome if they contain stubsThis probably won't help a lot of games go further without sceLibcInternal as LLE (though implementing sceLibcMspace might do that), and my only game that reached further was Driveclub.