libc strcmp,mallon,strlen implementation

This commit is contained in:
georgemoralis 2023-10-15 00:23:01 +03:00
parent 22cbfd860d
commit c0649b8d24
3 changed files with 11 additions and 0 deletions

View file

@ -109,6 +109,9 @@ void LibC_Register(SymbolsResolver* sym) {
LIB_FUNCTION("hcuQgD53UxM", "libc", 1, "libc", 1, 1, Emulator::HLE::Libraries::LibC::printf);
LIB_FUNCTION("YQ0navp+YIc", "libc", 1, "libc", 1, 1, puts);
LIB_FUNCTION("cpCOXWMgha0", "libc", 1, "libc", 1, 1, rand);
LIB_FUNCTION("Ovb2dSJOAuE", "libc", 1, "libc", 1, 1, Emulator::HLE::Libraries::LibC::strcmp);
LIB_FUNCTION("gQX+4GDQjpM", "libc", 1, "libc", 1, 1, Emulator::HLE::Libraries::LibC::malloc);
LIB_FUNCTION("j4ViWNHEgww", "libc", 1, "libc", 1, 1, Emulator::HLE::Libraries::LibC::strlen);
LIB_OBJ("P330P3dFF68", "libc", 1, "libc", 1, 1, &HLE::Libs::LibC::g_need_sceLibc);
LIB_FUNCTION("z+P+xCnWLBk", "libc", 1, "libc", 1, 1, _ZdlPv);

View file

@ -28,4 +28,9 @@ void* PS4_SYSV_ABI memcpy(void* dest, const void* src, size_t n) { return std::m
void* PS4_SYSV_ABI memset(void* s, int c, size_t n) { return std::memset(s, c, n); }
void* PS4_SYSV_ABI malloc(size_t size) { return std::malloc(size); }
int PS4_SYSV_ABI strcmp(const char* str1, const char* str2) { return std::strcmp(str1, str2); }
size_t PS4_SYSV_ABI strlen(const char* str) { return std::strlen(str); }
}; // namespace Emulator::HLE::Libraries::LibC

View file

@ -13,4 +13,7 @@ PS4_SYSV_ABI int atexit(void (*func)());
int PS4_SYSV_ABI memcmp(const void* s1, const void* s2, size_t n);
void* PS4_SYSV_ABI memcpy(void* dest, const void* src, size_t n);
void* PS4_SYSV_ABI memset(void* s, int c, size_t n);
void* PS4_SYSV_ABI malloc(size_t size);
int PS4_SYSV_ABI strcmp(const char* str1, const char* str2);
size_t PS4_SYSV_ABI strlen(const char* str);
} // namespace Emulator::HLE::Libraries::LibC