printf implementation

This commit is contained in:
georgemoralis 2023-10-06 14:19:09 +03:00
parent cefd3d95ed
commit 551455e56e
6 changed files with 72 additions and 11 deletions

View file

@ -5,6 +5,8 @@
#include "../Loader/Elf.h"
#include "Libs.h"
#include "Emulator/HLE/Libraries/LibC/libc.h"
namespace HLE::Libs::LibC {
@ -86,11 +88,6 @@ static PS4_SYSV_ABI int atexit(void (*func)()) {
}
static PS4_SYSV_ABI void _Assert() { BREAKPOINT(); }
static PS4_SYSV_ABI int printf(const char* s) {
puts(s);
return 0; // not correct
}
void LibC_Register(SymbolsResolver* sym) {
LIB_FUNCTION("bzQExy189ZI", "libc", 1, "libc", 1, 1, init_env);
LIB_FUNCTION("3GPpjQdAMTw", "libc", 1, "libc", 1, 1, __cxa_guard_acquire);
@ -101,7 +98,7 @@ void LibC_Register(SymbolsResolver* sym) {
LIB_FUNCTION("uMei1W9uyNo", "libc", 1, "libc", 1, 1, exit);
LIB_FUNCTION("8G2LB+A3rzg", "libc", 1, "libc", 1, 1, atexit);
LIB_FUNCTION("-QgqOT5u2Vk", "libc", 1, "libc", 1, 1, _Assert);
LIB_FUNCTION("hcuQgD53UxM", "libc", 1, "libc", 1, 1, printf);
LIB_FUNCTION("hcuQgD53UxM", "libc", 1, "libc", 1, 1, Emulator::HLE::Libraries::LibC::printf);
LIB_OBJ("P330P3dFF68", "libc", 1, "libc", 1, 1, &HLE::Libs::LibC::g_need_sceLibc);
}