diff --git a/include/PSX/System/syscalls.h b/include/PSX/System/syscalls.h index 9487627a..362c387a 100644 --- a/include/PSX/System/syscalls.h +++ b/include/PSX/System/syscalls.h @@ -48,7 +48,8 @@ struct __no_align __syscall_InterruptElement { }; #ifdef __cplusplus - reinterpret_cast<__VA_ARGS__>(table) + #define __syscall_function_cast(table, ...) reinterpret_cast<__VA_ARGS__>(table) + extern "C" { #else #define __syscall_function_cast(table, ...) ((__VA_ARGS__)(void*)table) #endif @@ -123,6 +124,10 @@ static __always_inline void __syscall_ExitCriticalSection() { __asm__ volatile("syscall" : "=r"(FuncID) : "r"(FuncID) : "at", "v0", "v1", "a1", "a2", "a3", "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9", "memory"); } -int __syscall_printf(const char* txt, ...); +void __syscall_printf(const char* txt, ...); + +#ifdef __cplusplus +} +#endif #endif //!__JABYENGINE_SYSCALLS__H \ No newline at end of file diff --git a/lib/pcsx-redux/ps-exe.ld b/lib/pcsx-redux/ps-exe.ld index ea9130da..9d93b5b2 100644 --- a/lib/pcsx-redux/ps-exe.ld +++ b/lib/pcsx-redux/ps-exe.ld @@ -26,8 +26,8 @@ SOFTWARE. OUTPUT_FORMAT("binary") -EXTERN(_start) -ENTRY(_start) +EXTERN(_ZN10JabyEngine5startEv) +ENTRY(_ZN10JabyEngine5startEv) TLOAD_ADDR = DEFINED(TLOAD_ADDR) ? TLOAD_ADDR : 0x80010000; @@ -97,7 +97,7 @@ SECTIONS { LONG(0); LONG(0); /* 0x0010 - 0x0013 : entry point */ - LONG(ABSOLUTE(_start)); + LONG(ABSOLUTE(_ZN10JabyEngine5startEv)); /* 0x0014 - 0x0017 : initial value of $gp */ LONG(0); diff --git a/src/Library/src/BootLoader/start.c b/src/Library/src/BootLoader/start.c deleted file mode 100644 index bf4f5e21..00000000 --- a/src/Library/src/BootLoader/start.c +++ /dev/null @@ -1,8 +0,0 @@ -#include - -int x = 0; - -void _start() { - //call main here - printf("Hello Planschbecken c: %i\n", x); -} \ No newline at end of file diff --git a/src/Library/src/BootLoader/start.cpp b/src/Library/src/BootLoader/start.cpp new file mode 100644 index 00000000..171a720f --- /dev/null +++ b/src/Library/src/BootLoader/start.cpp @@ -0,0 +1,7 @@ +#include + +namespace JabyEngine { + void start() { + printf("Hello Planschbecken\n"); + } +} \ No newline at end of file