Libraries: Update libcInternal (#2265)

* Added all stubs + logging

* Added back memory and math functions from the original code + added some more math functions

* More string functions, snprintf, memmove and setjmp

* Add longjmp + clang

* gmtime, __cxa_atexit and log what functions some games use

* Add Mspace unreachable

* Renaming

* Take out mspace functions to their own file

* Factor out io to a new file

* Empty str and memory files

* Overloaded functions be like:

* str

* memory + math +clang

* clang...

* adjustments :D

* longjmp is questionable

---------

Co-authored-by: georgemoralis <giorgosmrls@gmail.com>
This commit is contained in:
kalaposfos13 2025-02-14 08:58:38 +01:00 committed by GitHub
parent 0f8bd509b2
commit 7db30d12cb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 21727 additions and 209 deletions

View file

@ -399,6 +399,18 @@ set(VIDEOOUT_LIB src/core/libraries/videoout/buffer.h
set(LIBC_SOURCES src/core/libraries/libc_internal/libc_internal.cpp
src/core/libraries/libc_internal/libc_internal.h
src/core/libraries/libc_internal/libc_internal_mspace.cpp
src/core/libraries/libc_internal/libc_internal_mspace.h
src/core/libraries/libc_internal/libc_internal_io.cpp
src/core/libraries/libc_internal/libc_internal_io.h
src/core/libraries/libc_internal/libc_internal_memory.cpp
src/core/libraries/libc_internal/libc_internal_memory.h
src/core/libraries/libc_internal/libc_internal_str.cpp
src/core/libraries/libc_internal/libc_internal_str.h
src/core/libraries/libc_internal/libc_internal_stream.cpp
src/core/libraries/libc_internal/libc_internal_stream.h
src/core/libraries/libc_internal/libc_internal_math.cpp
src/core/libraries/libc_internal/libc_internal_math.h
)
set(IME_LIB src/core/libraries/ime/error_dialog.cpp

View file

@ -80,6 +80,7 @@ bool ParseFilterRule(Filter& instance, Iterator begin, Iterator end) {
SUB(Kernel, Sce) \
CLS(Lib) \
SUB(Lib, LibC) \
SUB(Lib, LibcInternal) \
SUB(Lib, Kernel) \
SUB(Lib, Pad) \
SUB(Lib, GnmDriver) \

View file

@ -47,6 +47,7 @@ enum class Class : u8 {
Lib, ///< HLE implementation of system library. Each major library
///< should have its own subclass.
Lib_LibC, ///< The LibC implementation.
Lib_LibcInternal, ///< The LibcInternal implementation.
Lib_Kernel, ///< The LibKernel implementation.
Lib_Pad, ///< The LibScePad implementation.
Lib_GnmDriver, ///< The LibSceGnmDriver implementation.

File diff suppressed because it is too large Load diff

View file

@ -10,12 +10,9 @@ class SymbolsResolver;
}
namespace Libraries::LibcInternal {
void* PS4_SYSV_ABI internal_memset(void* s, int c, size_t n);
void* PS4_SYSV_ABI internal_memcpy(void* dest, const void* src, size_t n);
int PS4_SYSV_ABI internal_memcpy_s(void* dest, size_t destsz, const void* src, size_t count);
int PS4_SYSV_ABI internal_strcpy_s(char* dest, size_t dest_size, const char* src);
int PS4_SYSV_ABI internal_memcmp(const void* s1, const void* s2, size_t n);
float PS4_SYSV_ABI internal_expf(float x);
// I won't manage definitons of 3000+ functions, and they don't need to be accessed externally,
// so everything is just in the .cpp file
void RegisterlibSceLibcInternal(Core::Loader::SymbolsResolver* sym);
} // namespace Libraries::LibcInternal

View file

@ -0,0 +1,472 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <cstdarg>
#include <cstdio>
#include "common/assert.h"
#include "common/logging/log.h"
#include "core/libraries/error_codes.h"
#include "core/libraries/libs.h"
#include "libc_internal_io.h"
namespace Libraries::LibcInternal {
s32 PS4_SYSV_ABI internal___vfprintf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal__Printf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal__WPrintf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_asprintf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_fprintf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_fprintf_s() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_fwprintf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_fwprintf_s() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_printf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_printf_s() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_snprintf(char* s, size_t n, const char* format, ...) {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_snprintf_s() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_snwprintf_s() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_sprintf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_sprintf_s() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_swprintf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_swprintf_s() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_swscanf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_swscanf_s() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_vasprintf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_vfprintf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_vfprintf_s() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_vfscanf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_vfscanf_s() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_vfwprintf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_vfwprintf_s() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_vfwscanf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_vfwscanf_s() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_vprintf(const char* format, va_list args) {
// Copy the va_list because vsnprintf consumes it
va_list args_copy;
va_copy(args_copy, args);
// Calculate the required buffer size
int size = std::vsnprintf(nullptr, 0, format, args_copy);
va_end(args_copy);
if (size < 0) {
// Handle vsnprintf error
LOG_ERROR(Lib_LibcInternal, "vsnprintf failed to calculate size");
return size;
}
// Create a string with the required size
std::string buffer(size, '\0');
// Format the string into the buffer
int result =
std::vsnprintf(buffer.data(), buffer.size() + 1, format, args); // +1 for null terminator
if (result >= 0) {
// Log the formatted result
LOG_INFO(Lib_LibcInternal, "{}", buffer);
} else {
LOG_ERROR(Lib_LibcInternal, "vsnprintf failed during formatting");
}
return result;
}
s32 PS4_SYSV_ABI internal_vprintf_s() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_vscanf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_vscanf_s() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_vsnprintf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_vsnprintf_s() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_vsnwprintf_s() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_vsprintf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_vsprintf_s() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_vsscanf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_vsscanf_s() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_vswprintf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_vswprintf_s() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_vswscanf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_vswscanf_s() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_vwprintf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_vwprintf_s() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_vwscanf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_vwscanf_s() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_wprintf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_wprintf_s() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_wscanf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_wscanf_s() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal__Scanf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal__WScanf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_fscanf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_fscanf_s() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_fwscanf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_fwscanf_s() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_scanf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_scanf_s() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_sscanf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_sscanf_s() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
void RegisterlibSceLibcInternalIo(Core::Loader::SymbolsResolver* sym) {
LIB_FUNCTION("yAZ5vOpmBus", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal___vfprintf);
LIB_FUNCTION("FModQzwn1-4", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal__Printf);
LIB_FUNCTION("kvEP5-KOG1U", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal__WPrintf);
LIB_FUNCTION("cOYia2dE0Ik", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_asprintf);
LIB_FUNCTION("fffwELXNVFA", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_fprintf);
LIB_FUNCTION("-e-F9HjUFp8", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_fprintf_s);
LIB_FUNCTION("ZRAcn3dPVmA", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_fwprintf);
LIB_FUNCTION("9kOFELic7Pk", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_fwprintf_s);
LIB_FUNCTION("a6CYO8YOzfw", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_fwscanf);
LIB_FUNCTION("Bo5wtXSj4kc", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_fwscanf_s);
LIB_FUNCTION("hcuQgD53UxM", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_printf);
LIB_FUNCTION("w1NxRBQqfmQ", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_printf_s);
LIB_FUNCTION("eLdDw6l0-bU", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_snprintf);
LIB_FUNCTION("3BytPOQgVKc", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_snprintf_s);
LIB_FUNCTION("jbj2wBoiCyg", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_snwprintf_s);
LIB_FUNCTION("tcVi5SivF7Q", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_sprintf);
LIB_FUNCTION("xEszJVGpybs", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_sprintf_s);
LIB_FUNCTION("1Pk0qZQGeWo", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_sscanf);
LIB_FUNCTION("24m4Z4bUaoY", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_sscanf_s);
LIB_FUNCTION("nJz16JE1txM", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_swprintf);
LIB_FUNCTION("Im55VJ-Bekc", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_swprintf_s);
LIB_FUNCTION("HNnWdT43ues", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_swscanf);
LIB_FUNCTION("tQNolUV1q5A", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_swscanf_s);
LIB_FUNCTION("qjBlw2cVMAM", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_vasprintf);
LIB_FUNCTION("pDBDcY6uLSA", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_vfprintf);
LIB_FUNCTION("GhTZtaodo7o", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_vfprintf_s);
LIB_FUNCTION("lckWSkHDBrY", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_vfscanf);
LIB_FUNCTION("JjPXy-HX5dY", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_vfscanf_s);
LIB_FUNCTION("M2bGWSqt764", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_vfwprintf);
LIB_FUNCTION("XX9KWzJvRf0", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_vfwprintf_s);
LIB_FUNCTION("WF4fBmip+38", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_vfwscanf);
LIB_FUNCTION("Wvm90I-TGl0", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_vfwscanf_s);
LIB_FUNCTION("GMpvxPFW924", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_vprintf);
LIB_FUNCTION("YfJUGNPkbK4", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_vprintf_s);
LIB_FUNCTION("j7Jk3yd3yC8", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_vscanf);
LIB_FUNCTION("fQYpcUzy3zo", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_vscanf_s);
LIB_FUNCTION("Q2V+iqvjgC0", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_vsnprintf);
LIB_FUNCTION("rWSuTWY2JN0", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_vsnprintf_s);
LIB_FUNCTION("8SKVXgeK1wY", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_vsnwprintf_s);
LIB_FUNCTION("jbz9I9vkqkk", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_vsprintf);
LIB_FUNCTION("+qitMEbkSWk", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_vsprintf_s);
LIB_FUNCTION("UTrpOVLcoOA", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_vsscanf);
LIB_FUNCTION("tfNbpqL3D0M", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_vsscanf_s);
LIB_FUNCTION("u0XOsuOmOzc", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_vswprintf);
LIB_FUNCTION("oDoV9tyHTbA", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_vswprintf_s);
LIB_FUNCTION("KGotca3AjYw", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_vswscanf);
LIB_FUNCTION("39HHkIWrWNo", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_vswscanf_s);
LIB_FUNCTION("QuF2rZGE-v8", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_vwprintf);
LIB_FUNCTION("XPrliF5n-ww", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_vwprintf_s);
LIB_FUNCTION("QNwdOK7HfJU", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_vwscanf);
LIB_FUNCTION("YgZ6qvFH3QI", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_vwscanf_s);
LIB_FUNCTION("OGVdXU3E-xg", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_wprintf);
LIB_FUNCTION("FEtOJURNey0", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_wprintf_s);
LIB_FUNCTION("D8JBAR3RiZQ", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_wscanf);
LIB_FUNCTION("RV7X3FrWfTI", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_wscanf_s);
LIB_FUNCTION("s+MeMHbB1Ro", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal__Scanf);
LIB_FUNCTION("fzgkSILqRHE", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal__WScanf);
LIB_FUNCTION("npLpPTaSuHg", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_fscanf);
LIB_FUNCTION("vj2WUi2LrfE", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_fscanf_s);
LIB_FUNCTION("7XEv6NnznWw", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_scanf);
LIB_FUNCTION("-B76wP6IeVA", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_scanf_s);
}
} // namespace Libraries::LibcInternal

View file

@ -0,0 +1,14 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include "common/types.h"
namespace Core::Loader {
class SymbolsResolver;
}
namespace Libraries::LibcInternal {
void RegisterlibSceLibcInternalIo(Core::Loader::SymbolsResolver* sym);
} // namespace Libraries::LibcInternal

View file

@ -0,0 +1,773 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "common/assert.h"
#include "common/logging/log.h"
#include "core/libraries/error_codes.h"
#include "core/libraries/libs.h"
#include "libc_internal_mspace.h"
namespace Libraries::LibcInternal {
s32 PS4_SYSV_ABI internal_abs() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
double PS4_SYSV_ABI internal_acos(double x) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::acos(x);
}
float PS4_SYSV_ABI internal_acosf(float x) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::acosf(x);
}
float PS4_SYSV_ABI internal_acosh(float x) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::acosh(x);
}
float PS4_SYSV_ABI internal_acoshf(float x) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::acoshf(x);
}
float PS4_SYSV_ABI internal_acoshl(float x) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::acoshl(x);
}
float PS4_SYSV_ABI internal_acosl(float x) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::acosl(x);
}
double PS4_SYSV_ABI internal_asin(double x) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::asin(x);
}
float PS4_SYSV_ABI internal_asinf(float x) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::asinf(x);
}
float PS4_SYSV_ABI internal_asinh(float x) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::asinh(x);
}
float PS4_SYSV_ABI internal_asinhf(float x) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::asinhf(x);
}
float PS4_SYSV_ABI internal_asinhl(float x) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::asinhl(x);
}
float PS4_SYSV_ABI internal_asinl(float x) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::asinl(x);
}
double PS4_SYSV_ABI internal_atan(double x) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::atan(x);
}
double PS4_SYSV_ABI internal_atan2(double y, double x) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::atan2(y, x);
}
s32 PS4_SYSV_ABI internal_atan2f() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_atan2l() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_atanf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_atanh() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_atanhf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_atanhl() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_atanl() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_ceil() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_ceilf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_ceill() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
double PS4_SYSV_ABI internal_cos(double x) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::cos(x);
}
float PS4_SYSV_ABI internal_cosf(float x) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::cosf(x);
}
s32 PS4_SYSV_ABI internal_cosh() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_coshf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_coshl() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_cosl() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
double PS4_SYSV_ABI internal_exp(double x) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::exp(x);
}
double PS4_SYSV_ABI internal_exp2(double x) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::exp2(x);
}
float PS4_SYSV_ABI internal_exp2f(float x) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::exp2f(x);
}
float PS4_SYSV_ABI internal_exp2l(float x) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::exp2l(x);
}
float PS4_SYSV_ABI internal_expf(float x) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::expf(x);
}
s32 PS4_SYSV_ABI internal_expl() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_expm1() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_expm1f() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_expm1l() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_fabs() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_fabsf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_fabsl() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_floor() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_floorf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_floorl() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_fmax() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_fmaxf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_fmaxl() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_fmin() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_fminf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_fminl() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_fmod() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_fmodf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_fmodl() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_frexp() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_frexpf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_frexpl() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_ilogb() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_ilogbf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_ilogbl() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_imaxabs() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_imaxdiv() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_isinf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_islower() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_isnan() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_isnanf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_isupper() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_log() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_log10() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
float PS4_SYSV_ABI internal_log10f(float x) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::log10f(x);
}
s32 PS4_SYSV_ABI internal_log10l() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_log1p() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_log1pf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_log1pl() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_log2() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_log2f() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_log2l() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_logb() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_logbf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_logbl() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_logf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_logl() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_lround() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_lroundf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_lroundl() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_nan() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_nanf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_nanl() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
double PS4_SYSV_ABI internal_pow(double x, double y) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::pow(x, y);
}
float PS4_SYSV_ABI internal_powf(float x, float y) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::powf(x, y);
}
s32 PS4_SYSV_ABI internal_powl() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_remainder() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
double PS4_SYSV_ABI internal_sin(double x) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::sin(x);
}
void PS4_SYSV_ABI internal_sincos(double x, double* sinp, double* cosp) {
LOG_DEBUG(Lib_LibcInternal, "called");
*sinp = std::sin(x);
*cosp = std::cos(x);
}
void PS4_SYSV_ABI internal_sincosf(double x, double* sinp, double* cosp) {
LOG_DEBUG(Lib_LibcInternal, "called");
*sinp = std::sinf(x);
*cosp = std::cosf(x);
}
float PS4_SYSV_ABI internal_sinf(float x) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::sinf(x);
}
float PS4_SYSV_ABI internal_sinh(float x) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::sinh(x);
}
float PS4_SYSV_ABI internal_sinhf(float x) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::sinhf(x);
}
float PS4_SYSV_ABI internal_sinhl(float x) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::sinhl(x);
}
float PS4_SYSV_ABI internal_sinl(float x) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::sinl(x);
}
s32 PS4_SYSV_ABI internal_sqrt() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_sqrtf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_sqrtl() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_srand() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_tan() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_tanf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_tanh() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_tanhf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_tanhl() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_tanl() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
float PS4_SYSV_ABI internal__Fsin(float arg, unsigned int m, int n) {
ASSERT(n == 0);
if (m != 0) {
return cosf(arg);
} else {
return sinf(arg);
}
}
double PS4_SYSV_ABI internal__Sin(double x) {
return sin(x);
}
void RegisterlibSceLibcInternalMath(Core::Loader::SymbolsResolver* sym) {
LIB_FUNCTION("Ye20uNnlglA", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal_abs);
LIB_FUNCTION("JBcgYuW8lPU", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal_acos);
LIB_FUNCTION("QI-x0SL8jhw", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_acosf);
LIB_FUNCTION("Fk7-KFKZi-8", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_acosh);
LIB_FUNCTION("XJp2C-b0tRU", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_acoshf);
LIB_FUNCTION("u14Y1HFh0uY", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_acoshl);
LIB_FUNCTION("iH4YAIRcecA", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_acosl);
LIB_FUNCTION("7Ly52zaL44Q", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal_asin);
LIB_FUNCTION("GZWjF-YIFFk", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_asinf);
LIB_FUNCTION("2eQpqTjJ5Y4", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_asinh);
LIB_FUNCTION("yPPtp1RMihw", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_asinhf);
LIB_FUNCTION("iCl-Z-g-uuA", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_asinhl);
LIB_FUNCTION("Nx-F5v0-qU8", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_asinl);
LIB_FUNCTION("OXmauLdQ8kY", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal_atan);
LIB_FUNCTION("HUbZmOnT-Dg", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_atan2);
LIB_FUNCTION("EH-x713A99c", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_atan2f);
LIB_FUNCTION("9VeY8wiqf8M", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_atan2l);
LIB_FUNCTION("weDug8QD-lE", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_atanf);
LIB_FUNCTION("YjbpxXpi6Zk", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_atanh);
LIB_FUNCTION("cPGyc5FGjy0", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_atanhf);
LIB_FUNCTION("a3BNqojL4LM", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_atanhl);
LIB_FUNCTION("KvOHPTz595Y", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_atanl);
LIB_FUNCTION("gacfOmO8hNs", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal_ceil);
LIB_FUNCTION("GAUuLKGhsCw", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_ceilf);
LIB_FUNCTION("aJKn6X+40Z8", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_ceill);
LIB_FUNCTION("2WE3BTYVwKM", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal_cos);
LIB_FUNCTION("-P6FNMzk2Kc", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal_cosf);
LIB_FUNCTION("m7iLTaO9RMs", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal_cosh);
LIB_FUNCTION("RCQAffkEh9A", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_coshf);
LIB_FUNCTION("XK2R46yx0jc", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_coshl);
LIB_FUNCTION("x8dc5Y8zFgc", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal_cosl);
LIB_FUNCTION("NVadfnzQhHQ", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal_exp);
LIB_FUNCTION("dnaeGXbjP6E", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal_exp2);
LIB_FUNCTION("wuAQt-j+p4o", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_exp2f);
LIB_FUNCTION("9O1Xdko-wSo", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_exp2l);
LIB_FUNCTION("8zsu04XNsZ4", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal_expf);
LIB_FUNCTION("qMp2fTDCyMo", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal_expl);
LIB_FUNCTION("gqKfOiJaCOo", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_expm1);
LIB_FUNCTION("3EgxfDRefdw", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_expm1f);
LIB_FUNCTION("jVS263HH1b0", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_expm1l);
LIB_FUNCTION("388LcMWHRCA", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal_fabs);
LIB_FUNCTION("fmT2cjPoWBs", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_fabsf);
LIB_FUNCTION("w-AryX51ObA", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_fabsl);
LIB_FUNCTION("mpcTgMzhUY8", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_floor);
LIB_FUNCTION("mKhVDmYciWA", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_floorf);
LIB_FUNCTION("06QaR1Cpn-k", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_floorl);
LIB_FUNCTION("fiOgmWkP+Xc", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal_fmax);
LIB_FUNCTION("Lyx2DzUL7Lc", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_fmaxf);
LIB_FUNCTION("0H5TVprQSkA", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_fmaxl);
LIB_FUNCTION("iU0z6SdUNbI", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal_fmin);
LIB_FUNCTION("uVRcM2yFdP4", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_fminf);
LIB_FUNCTION("DQ7K6s8euWY", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_fminl);
LIB_FUNCTION("pKwslsMUmSk", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal_fmod);
LIB_FUNCTION("88Vv-AzHVj8", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_fmodf);
LIB_FUNCTION("A1R5T0xOyn8", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_fmodl);
LIB_FUNCTION("kA-TdiOCsaY", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_frexp);
LIB_FUNCTION("aaDMGGkXFxo", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_frexpf);
LIB_FUNCTION("YZk9sHO0yNg", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_frexpl);
LIB_FUNCTION("h6pVBKjcLiU", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_ilogb);
LIB_FUNCTION("0dQrYWd7g94", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_ilogbf);
LIB_FUNCTION("wXs12eD3uvA", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_ilogbl);
LIB_FUNCTION("UgZ7Rhk60cQ", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_imaxabs);
LIB_FUNCTION("V0X-mrfdM9E", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_imaxdiv);
LIB_FUNCTION("2q5PPh7HsKE", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_isinf);
LIB_FUNCTION("KqYTqtSfGos", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_islower);
LIB_FUNCTION("20qj+7O69XY", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_isnan);
LIB_FUNCTION("3pF7bUSIH8o", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_isnanf);
LIB_FUNCTION("GcFKlTJEMkI", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_isupper);
LIB_FUNCTION("rtV7-jWC6Yg", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal_log);
LIB_FUNCTION("WuMbPBKN1TU", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_log10);
LIB_FUNCTION("lhpd6Wk6ccs", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_log10f);
LIB_FUNCTION("CT4aR0tBgkQ", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_log10l);
LIB_FUNCTION("VfsML+n9cDM", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_log1p);
LIB_FUNCTION("MFe91s8apQk", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_log1pf);
LIB_FUNCTION("77qd0ksTwdI", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_log1pl);
LIB_FUNCTION("Y5DhuDKGlnQ", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal_log2);
LIB_FUNCTION("hsi9drzHR2k", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_log2f);
LIB_FUNCTION("CfOrGjBj-RY", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_log2l);
LIB_FUNCTION("owKuegZU4ew", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal_logb);
LIB_FUNCTION("RWqyr1OKuw4", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_logbf);
LIB_FUNCTION("txJTOe0Db6M", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_logbl);
LIB_FUNCTION("RQXLbdT2lc4", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal_logf);
LIB_FUNCTION("EiHf-aLDImI", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal_logl);
LIB_FUNCTION("J3XuGS-cC0Q", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_lround);
LIB_FUNCTION("C6gWCWJKM+U", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_lroundf);
LIB_FUNCTION("4ITASgL50uc", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_lroundl);
LIB_FUNCTION("zck+6bVj5pA", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal_nan);
LIB_FUNCTION("DZU+K1wozGI", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal_nanf);
LIB_FUNCTION("ZUvemFIkkhQ", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal_nanl);
LIB_FUNCTION("9LCjpWyQ5Zc", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal_pow);
LIB_FUNCTION("1D0H2KNjshE", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal_powf);
LIB_FUNCTION("95V3PF0kUEA", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal_powl);
LIB_FUNCTION("pv2etu4pocs", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_remainder);
LIB_FUNCTION("H8ya2H00jbI", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal_sin);
LIB_FUNCTION("jMB7EFyu30Y", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_sincos);
LIB_FUNCTION("pztV4AF18iI", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_sincosf);
LIB_FUNCTION("Q4rRL34CEeE", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal_sinf);
LIB_FUNCTION("ZjtRqSMJwdw", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal_sinh);
LIB_FUNCTION("1t1-JoZ0sZQ", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_sinhf);
LIB_FUNCTION("lYdqBvDgeHU", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_sinhl);
LIB_FUNCTION("vxgqrJxDPHo", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal_sinl);
LIB_FUNCTION("MXRNWnosNlM", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal_sqrt);
LIB_FUNCTION("Q+xU11-h0xQ", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_sqrtf);
LIB_FUNCTION("RIkUZRadZgc", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_sqrtl);
LIB_FUNCTION("VPbJwTCgME0", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_srand);
LIB_FUNCTION("T7uyNqP7vQA", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal_tan);
LIB_FUNCTION("ZE6RNL+eLbk", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal_tanf);
LIB_FUNCTION("JM4EBvWT9rc", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal_tanh);
LIB_FUNCTION("SAd0Z3wKwLA", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_tanhf);
LIB_FUNCTION("JCmHsYVc2eo", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_tanhl);
LIB_FUNCTION("QL+3q43NfEA", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal_tanl);
LIB_FUNCTION("ZtjspkJQ+vw", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal__FSin);
LIB_FUNCTION("cCXjU72Z0Ow", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal__Sin);
}
} // namespace Libraries::LibcInternal

View file

@ -0,0 +1,14 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include "common/types.h"
namespace Core::Loader {
class SymbolsResolver;
}
namespace Libraries::LibcInternal {
void RegisterlibSceLibcInternalMath(Core::Loader::SymbolsResolver* sym);
} // namespace Libraries::LibcInternal

View file

@ -0,0 +1,314 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "common/assert.h"
#include "common/logging/log.h"
#include "core/libraries/error_codes.h"
#include "core/libraries/libs.h"
#include "libc_internal_memory.h"
namespace Libraries::LibcInternal {
s32 PS4_SYSV_ABI internal__malloc_finalize_lv2() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal__malloc_fini() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal__malloc_init() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal__malloc_init_lv2() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal__malloc_postfork() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal__malloc_prefork() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal__malloc_thread_cleanup() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal__sceLibcGetMallocParam() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_operator_new(size_t size) {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_malloc(size_t size) {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_malloc_check_memory_bounds() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_malloc_finalize() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_malloc_get_footer_value() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_malloc_get_malloc_state() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_malloc_initialize() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_malloc_report_memory_blocks() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_malloc_stats() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_malloc_stats_fast() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_malloc_usable_size() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_memalign() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_memchr() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_memcmp(const void* s1, const void* s2, size_t n) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::memcmp(s1, s2, n);
}
void* PS4_SYSV_ABI internal_memcpy(void* dest, const void* src, size_t n) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::memcpy(dest, src, n);
}
s32 PS4_SYSV_ABI internal_memcpy_s(void* dest, size_t destsz, const void* src, size_t count) {
LOG_DEBUG(Lib_LibcInternal, "called");
#ifdef _WIN64
return memcpy_s(dest, destsz, src, count);
#else
std::memcpy(dest, src, count);
return 0; // ALL OK
#endif
}
s32 PS4_SYSV_ABI internal_memmove(void* d, void* s, size_t n) {
LOG_DEBUG(Lib_LibcInternal, "called");
std::memmove(d, s, n);
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_memmove_s() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_memrchr() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
void* PS4_SYSV_ABI internal_memset(void* s, int c, size_t n) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::memset(s, c, n);
}
s32 PS4_SYSV_ABI internal_memset_s() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_posix_memalign() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_realloc() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_reallocalign() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_reallocf() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_wmemchr() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_wmemcmp() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_wmemcpy() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_wmemcpy_s() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_wmemmove() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_wmemmove_s() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_wmemset() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
void PS4_SYSV_ABI internal_operator_delete(void* ptr) {
if (ptr) {
std::free(ptr);
}
}
void PS4_SYSV_ABI internal_free(void* ptr) {
std::free(ptr);
}
void RegisterlibSceLibcInternalMemory(Core::Loader::SymbolsResolver* sym) {
LIB_FUNCTION("RnqlvEmvkdw", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal__malloc_finalize_lv2);
LIB_FUNCTION("21KFhEQDJ3s", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal__malloc_fini);
LIB_FUNCTION("z8GPiQwaAEY", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal__malloc_init);
LIB_FUNCTION("20cUk0qX9zo", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal__malloc_init_lv2);
LIB_FUNCTION("V94pLruduLg", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal__malloc_postfork);
LIB_FUNCTION("aLYyS4Kx6rQ", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal__malloc_prefork);
LIB_FUNCTION("Sopthb9ztZI", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal__malloc_thread_cleanup);
LIB_FUNCTION("1nZ4Xfnyp38", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal__sceLibcGetMallocParam);
LIB_FUNCTION("fJnpuVVBbKk", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_operator_new);
LIB_FUNCTION("cVSk9y8URbc", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_posix_memalign);
LIB_FUNCTION("Ujf3KzMvRmI", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_memalign);
LIB_FUNCTION("8u8lPzUEq+U", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_memchr);
LIB_FUNCTION("DfivPArhucg", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_memcmp);
LIB_FUNCTION("Q3VBxCXhUHs", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_memcpy);
LIB_FUNCTION("NFLs+dRJGNg", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_memcpy_s);
LIB_FUNCTION("+P6FRGH4LfA", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_memmove);
LIB_FUNCTION("B59+zQQCcbU", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_memmove_s);
LIB_FUNCTION("5G2ONUzRgjY", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_memrchr);
LIB_FUNCTION("8zTFvBIAIN8", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_memset);
LIB_FUNCTION("h8GwqPFbu6I", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_memset_s);
LIB_FUNCTION("Y7aJ1uydPMo", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_realloc);
LIB_FUNCTION("OGybVuPAhAY", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_reallocalign);
LIB_FUNCTION("YMZO9ChZb0E", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_reallocf);
LIB_FUNCTION("fnUEjBCNRVU", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_wmemchr);
LIB_FUNCTION("QJ5xVfKkni0", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_wmemcmp);
LIB_FUNCTION("fL3O02ypZFE", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_wmemcpy);
LIB_FUNCTION("BTsuaJ6FxKM", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_wmemcpy_s);
LIB_FUNCTION("Noj9PsJrsa8", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_wmemmove);
LIB_FUNCTION("F8b+Wb-YQVs", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_wmemmove_s);
LIB_FUNCTION("Al8MZJh-4hM", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_wmemset);
LIB_FUNCTION("gQX+4GDQjpM", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_malloc);
LIB_FUNCTION("ECOPpUQEch0", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_malloc_check_memory_bounds);
LIB_FUNCTION("J6FoFNydpFI", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_malloc_finalize);
LIB_FUNCTION("SlG1FN-y0N0", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_malloc_get_footer_value);
LIB_FUNCTION("Nmezc1Lh7TQ", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_malloc_get_malloc_state);
LIB_FUNCTION("owT6zLJxrTs", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_malloc_initialize);
LIB_FUNCTION("0F08WOP8G3s", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_malloc_report_memory_blocks);
LIB_FUNCTION("CC-BLMBu9-I", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_malloc_stats);
LIB_FUNCTION("KuOuD58hqn4", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_malloc_stats_fast);
LIB_FUNCTION("NDcSfcYZRC8", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_malloc_usable_size);
LIB_FUNCTION("MLWl90SFWNE", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_operator_delete);
LIB_FUNCTION("tIhsqj0qsFE", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1, internal_free);
}
} // namespace Libraries::LibcInternal

View file

@ -0,0 +1,14 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include "common/types.h"
namespace Core::Loader {
class SymbolsResolver;
}
namespace Libraries::LibcInternal {
void RegisterlibSceLibcInternalMemory(Core::Loader::SymbolsResolver* sym);
} // namespace Libraries::LibcInternal

View file

@ -0,0 +1,247 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "common/assert.h"
#include "common/logging/log.h"
#include "core/libraries/error_codes.h"
#include "core/libraries/libs.h"
#include "libc_internal_mspace.h"
namespace Libraries::LibcInternal {
s32 PS4_SYSV_ABI sceLibcMspaceAlignedAlloc() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI sceLibcMspaceCalloc() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
void* PS4_SYSV_ABI sceLibcMspaceCreate(char* name, u64 param_2, u64 param_3, u32 param_4,
s8* param_5) {
UNREACHABLE_MSG("Missing sceLibcMspace impementation!");
return 0;
}
s32 PS4_SYSV_ABI sceLibcMspaceDestroy() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI sceLibcMspaceFree() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI sceLibcMspaceGetAddressRanges() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI sceLibcMspaceIsHeapEmpty() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI sceLibcMspaceMalloc() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI sceLibcMspaceMallocStats() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI sceLibcMspaceMallocStatsFast() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI sceLibcMspaceMallocUsableSize() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI sceLibcMspaceMemalign() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI sceLibcMspacePosixMemalign() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI sceLibcMspaceRealloc() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI sceLibcMspaceReallocalign() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI sceLibcMspaceSetMallocCallback() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI sceLibcPafMspaceCalloc() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI sceLibcPafMspaceCheckMemoryBounds() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI sceLibcPafMspaceCreate() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI sceLibcPafMspaceDestroy() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI sceLibcPafMspaceFree() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI sceLibcPafMspaceGetFooterValue() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI sceLibcPafMspaceIsHeapEmpty() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI sceLibcPafMspaceMalloc() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI sceLibcPafMspaceMallocStats() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI sceLibcPafMspaceMallocStatsFast() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI sceLibcPafMspaceMallocUsableSize() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI sceLibcPafMspaceMemalign() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI sceLibcPafMspacePosixMemalign() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI sceLibcPafMspaceRealloc() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI sceLibcPafMspaceReallocalign() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI sceLibcPafMspaceReportMemoryBlocks() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI sceLibcPafMspaceTrim() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
void RegisterlibSceLibcInternalMspace(Core::Loader::SymbolsResolver* sym) {
LIB_FUNCTION("ljkqMcC4-mk", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
sceLibcMspaceAlignedAlloc);
LIB_FUNCTION("LYo3GhIlB38", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
sceLibcMspaceCalloc);
LIB_FUNCTION("-hn1tcVHq5Q", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
sceLibcMspaceCreate);
LIB_FUNCTION("W6SiVSiCDtI", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
sceLibcMspaceDestroy);
LIB_FUNCTION("Vla-Z+eXlxo", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
sceLibcMspaceFree);
LIB_FUNCTION("raRgiuQfvWk", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
sceLibcMspaceGetAddressRanges);
LIB_FUNCTION("pzUa7KEoydw", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
sceLibcMspaceIsHeapEmpty);
LIB_FUNCTION("OJjm-QOIHlI", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
sceLibcMspaceMalloc);
LIB_FUNCTION("mfHdJTIvhuo", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
sceLibcMspaceMallocStats);
LIB_FUNCTION("k04jLXu3+Ic", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
sceLibcMspaceMallocStatsFast);
LIB_FUNCTION("fEoW6BJsPt4", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
sceLibcMspaceMallocUsableSize);
LIB_FUNCTION("iF1iQHzxBJU", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
sceLibcMspaceMemalign);
LIB_FUNCTION("qWESlyXMI3E", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
sceLibcMspacePosixMemalign);
LIB_FUNCTION("gigoVHZvVPE", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
sceLibcMspaceRealloc);
LIB_FUNCTION("p6lrRW8-MLY", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
sceLibcMspaceReallocalign);
LIB_FUNCTION("+CbwGRMnlfU", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
sceLibcMspaceSetMallocCallback);
LIB_FUNCTION("-lZdT34nAAE", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
sceLibcPafMspaceCalloc);
LIB_FUNCTION("Pcq7UoYAcFE", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
sceLibcPafMspaceCheckMemoryBounds);
LIB_FUNCTION("6hdfGRKHefs", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
sceLibcPafMspaceCreate);
LIB_FUNCTION("qB5nGjWa-bk", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
sceLibcPafMspaceDestroy);
LIB_FUNCTION("9mMuuhXMwqQ", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
sceLibcPafMspaceFree);
LIB_FUNCTION("kv4kgdjswN0", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
sceLibcPafMspaceGetFooterValue);
LIB_FUNCTION("htdTOnMxDbQ", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
sceLibcPafMspaceIsHeapEmpty);
LIB_FUNCTION("QuZzFJD5Hrw", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
sceLibcPafMspaceMalloc);
LIB_FUNCTION("mO8NB8whKy8", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
sceLibcPafMspaceMallocStats);
LIB_FUNCTION("OmG3YPCBLJs", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
sceLibcPafMspaceMallocStatsFast);
LIB_FUNCTION("6JcY5RDA4jY", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
sceLibcPafMspaceMallocUsableSize);
LIB_FUNCTION("PKJcFUfhKtw", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
sceLibcPafMspaceMemalign);
LIB_FUNCTION("7hOUKGcT6jM", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
sceLibcPafMspacePosixMemalign);
LIB_FUNCTION("u32UXVridxQ", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
sceLibcPafMspaceRealloc);
LIB_FUNCTION("4SvlEtd0j40", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
sceLibcPafMspaceReallocalign);
LIB_FUNCTION("0FnzR6qum90", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
sceLibcPafMspaceReportMemoryBlocks);
LIB_FUNCTION("AUYdq63RG3U", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
sceLibcPafMspaceTrim);
}
} // namespace Libraries::LibcInternal

View file

@ -0,0 +1,14 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include "common/types.h"
namespace Core::Loader {
class SymbolsResolver;
}
namespace Libraries::LibcInternal {
void RegisterlibSceLibcInternalMspace(Core::Loader::SymbolsResolver* sym);
} // namespace Libraries::LibcInternal

View file

@ -0,0 +1,532 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "common/assert.h"
#include "common/logging/log.h"
#include "core/libraries/error_codes.h"
#include "core/libraries/libs.h"
#include "libc_internal_str.h"
namespace Libraries::LibcInternal {
s32 PS4_SYSV_ABI internal__CStrftime() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal__CStrxfrm() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal__Getstr() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal__Stod() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal__Stodx() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal__Stof() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal__Stoflt() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal__Stofx() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal__Stold() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal__Stoldx() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal__Stoll() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal__Stollx() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal__Stolx() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal__Stopfx() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal__Stoul() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal__Stoull() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal__Stoullx() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal__Stoulx() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal__Stoxflt() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal__Strcollx() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal__Strerror() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal__Strxfrmx() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_strcasecmp(const char* str1, const char* str2) {
LOG_DEBUG(Lib_LibcInternal, "called");
#ifdef _WIN32
return _stricmp(str1, str2);
#else
return strcasecmp(str1, str2);
#endif
}
char* PS4_SYSV_ABI internal_strcat(char* dest, const char* src) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::strcat(dest, src);
}
s32 PS4_SYSV_ABI internal_strcat_s() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
const char* PS4_SYSV_ABI internal_strchr(const char* str, int c) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::strchr(str, c);
}
s32 PS4_SYSV_ABI internal_strcmp(const char* str1, const char* str2) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::strcmp(str1, str2);
}
s32 PS4_SYSV_ABI internal_strcoll() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
char* PS4_SYSV_ABI internal_strcpy(char* dest, const char* src) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::strcpy(dest, src);
}
char* PS4_SYSV_ABI internal_strcpy_s(char* dest, u64 len, const char* src) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::strncpy(dest, src, len);
}
s32 PS4_SYSV_ABI internal_strcspn(const char* str1, const char* str2) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::strcspn(str1, str2);
}
char* PS4_SYSV_ABI internal_strdup() {
LOG_DEBUG(Lib_LibcInternal, "called");
char* dup = (char*)std::malloc(std::strlen(str1) + 1);
if (dup != NULL)
strcpy(dup, str1);
return dup;
}
s32 PS4_SYSV_ABI internal_strerror() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_strerror_r() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_strerror_s() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_strerrorlen_s() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_strftime() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_strlcat() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_strlcpy() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
size_t PS4_SYSV_ABI internal_strlen(const char* str) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::strlen(str);
}
s32 PS4_SYSV_ABI internal_strncasecmp(const char* str1, const char* str2, size_t num) {
LOG_DEBUG(Lib_LibcInternal, "called");
#ifdef _WIN32
return _strnicmp(str1, str2, num);
#else
return strncasecmp(str1, str2, num);
#endif
}
s32 PS4_SYSV_ABI internal_strncat() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_strncat_s() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_strncmp(const char* str1, const char* str2, size_t num) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::strncmp(str1, str2, num);
}
char* PS4_SYSV_ABI internal_strncpy(char* dest, const char* src, std::size_t count) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::strncpy(dest, src, count);
}
s32 PS4_SYSV_ABI internal_strncpy_s(char* dest, size_t destsz, const char* src, size_t count) {
LOG_DEBUG(Lib_LibcInternal, "called");
#ifdef _WIN64
return strncpy_s(dest, destsz, src, count);
#else
std::strcpy(dest, src);
return 0;
#endif
}
s32 PS4_SYSV_ABI internal_strndup() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_strnlen(const char* str, size_t maxlen) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::min(std::strlen(str), maxlen);
}
s32 PS4_SYSV_ABI internal_strnlen_s() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_strnstr() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
const char* PS4_SYSV_ABI internal_strpbrk(const char* str1, const char* str2) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::strpbrk(str1, str2);
}
const char* PS4_SYSV_ABI internal_strrchr(const char* str, int c) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::strrchr(str, c);
}
char* PS4_SYSV_ABI internal_strsep(char** strp, const char* delim) {
LOG_DEBUG(Lib_LibcInternal, "called");
#ifdef _GNU_SOURCE
return strsep(strp, delim);
#else
if (!*strp)
return nullptr;
char* token = *strp;
*strp = std::strpbrk(token, delim);
if (*strp)
*(*strp)++ = '\0';
return token;
#endif
}
s32 PS4_SYSV_ABI internal_strspn(const char* str1, const char* str2) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::strspn(str1, str2);
}
char* PS4_SYSV_ABI internal_strstr(char* h, char* n) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::strstr(h, n);
}
double PS4_SYSV_ABI internal_strtod(const char* str, char** endptr) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::strtod(str, endptr);
}
float PS4_SYSV_ABI internal_strtof(const char* str, char** endptr) {
LOG_DEBUG(Lib_LibcInternal, "called");
return std::strtof(str, endptr);
}
s32 PS4_SYSV_ABI internal_strtoimax() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_strtok() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_strtok_r() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_strtok_s() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_strtol() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_strtold() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_strtoll() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_strtoul() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_strtoull() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_strtoumax() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_strtouq() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_strxfrm() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
s32 PS4_SYSV_ABI internal_wcsstr() {
LOG_ERROR(Lib_LibcInternal, "(STUBBED) called");
return ORBIS_OK;
}
void RegisterlibSceLibcInternalStr(Core::Loader::SymbolsResolver* sym) {
LIB_FUNCTION("ykNF6P3ZsdA", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal__CStrftime);
LIB_FUNCTION("we-vQBAugV8", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal__CStrxfrm);
LIB_FUNCTION("i2yN6xBwooo", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal__Getstr);
LIB_FUNCTION("c41UEHVtiEA", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal__Stod);
LIB_FUNCTION("QlcJbyd6jxM", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal__Stodx);
LIB_FUNCTION("CpWcnrEZbLA", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal__Stof);
LIB_FUNCTION("wO1-omboFjo", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal__Stoflt);
LIB_FUNCTION("7dlAxeH-htg", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal__Stofx);
LIB_FUNCTION("iNbtyJKM0iQ", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal__Stold);
LIB_FUNCTION("BKidCxmLC5w", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal__Stoldx);
LIB_FUNCTION("7pNKcscKrf8", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal__Stoll);
LIB_FUNCTION("mOnfZ5aNDQE", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal__Stollx);
LIB_FUNCTION("Ecwid6wJMhY", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal__Stolx);
LIB_FUNCTION("yhbF6MbVuYc", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal__Stopfx);
LIB_FUNCTION("zlfEH8FmyUA", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal__Stoul);
LIB_FUNCTION("q+9E0X3aWpU", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal__Stoull);
LIB_FUNCTION("pSpDCDyxkaY", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal__Stoullx);
LIB_FUNCTION("YDnLaav6W6Q", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal__Stoulx);
LIB_FUNCTION("Ouz5Q8+SUq4", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal__Stoxflt);
LIB_FUNCTION("v6rXYSx-WGA", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal__Strcollx);
LIB_FUNCTION("4F11tHMpJa0", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal__Strerror);
LIB_FUNCTION("CpiD2ZXrhNo", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal__Strxfrmx);
LIB_FUNCTION("AV6ipCNa4Rw", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strcasecmp);
LIB_FUNCTION("Ls4tzzhimqQ", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strcat);
LIB_FUNCTION("K+gcnFFJKVc", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strcat_s);
LIB_FUNCTION("ob5xAW4ln-0", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strchr);
LIB_FUNCTION("Ovb2dSJOAuE", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strcmp);
LIB_FUNCTION("gjbmYpP-XJQ", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strcoll);
LIB_FUNCTION("kiZSXIWd9vg", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strcpy);
LIB_FUNCTION("5Xa2ACNECdo", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strcpy_s);
LIB_FUNCTION("q0F6yS-rCms", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strcspn);
LIB_FUNCTION("g7zzzLDYGw0", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strdup);
LIB_FUNCTION("RIa6GnWp+iU", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strerror);
LIB_FUNCTION("RBcs3uut1TA", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strerror_r);
LIB_FUNCTION("o+ok6Y+DtgY", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strerror_s);
LIB_FUNCTION("-g26XITGVgE", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strerrorlen_s);
LIB_FUNCTION("Av3zjWi64Kw", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strftime);
LIB_FUNCTION("ByfjUZsWiyg", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strlcat);
LIB_FUNCTION("SfQIZcqvvms", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strlcpy);
LIB_FUNCTION("j4ViWNHEgww", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strlen);
LIB_FUNCTION("pXvbDfchu6k", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strncasecmp);
LIB_FUNCTION("kHg45qPC6f0", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strncat);
LIB_FUNCTION("NC4MSB+BRQg", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strncat_s);
LIB_FUNCTION("aesyjrHVWy4", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strncmp);
LIB_FUNCTION("6sJWiWSRuqk", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strncpy);
LIB_FUNCTION("YNzNkJzYqEg", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strncpy_s);
LIB_FUNCTION("XGnuIBmEmyk", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strndup);
LIB_FUNCTION("5jNubw4vlAA", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strnlen);
LIB_FUNCTION("DQbtGaBKlaw", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strnlen_s);
LIB_FUNCTION("Xnrfb2-WhVw", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strnstr);
LIB_FUNCTION("kDZvoVssCgQ", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strpbrk);
LIB_FUNCTION("9yDWMxEFdJU", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strrchr);
LIB_FUNCTION("cJWGxiQPmDQ", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strsep);
LIB_FUNCTION("-kU6bB4M-+k", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strspn);
LIB_FUNCTION("viiwFMaNamA", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strstr);
LIB_FUNCTION("2vDqwBlpF-o", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strtod);
LIB_FUNCTION("xENtRue8dpI", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strtof);
LIB_FUNCTION("q5MWYCDfu3c", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strtoimax);
LIB_FUNCTION("oVkZ8W8-Q8A", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strtok);
LIB_FUNCTION("enqPGLfmVNU", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strtok_r);
LIB_FUNCTION("-vXEQdRADLI", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strtok_s);
LIB_FUNCTION("mXlxhmLNMPg", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strtol);
LIB_FUNCTION("nW9JRkciRk4", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strtold);
LIB_FUNCTION("VOBg+iNwB-4", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strtoll);
LIB_FUNCTION("QxmSHBCuKTk", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strtoul);
LIB_FUNCTION("5OqszGpy7Mg", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strtoull);
LIB_FUNCTION("QNyUWGXmXNc", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strtoumax);
LIB_FUNCTION("g-McpZfseZo", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strtouq);
LIB_FUNCTION("zogPrkd46DY", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_strxfrm);
LIB_FUNCTION("WDpobjImAb4", "libSceLibcInternal", 1, "libSceLibcInternal", 1, 1,
internal_wcsstr);
}
} // namespace Libraries::LibcInternal

View file

@ -0,0 +1,14 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include "common/types.h"
namespace Core::Loader {
class SymbolsResolver;
}
namespace Libraries::LibcInternal {
void RegisterlibSceLibcInternalStr(Core::Loader::SymbolsResolver* sym);
} // namespace Libraries::LibcInternal

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,14 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include "common/types.h"
namespace Core::Loader {
class SymbolsResolver;
}
namespace Libraries::LibcInternal {
void RegisterlibSceLibcInternalStream(Core::Loader::SymbolsResolver* sym);
} // namespace Libraries::LibcInternal