Make sure the sdaBase and sda2Base are set properly

This commit is contained in:
Maschell 2023-03-26 15:27:30 +02:00
parent 141e77cd80
commit f7f8b007fa
2 changed files with 10 additions and 0 deletions

View File

@ -11,6 +11,7 @@
#include "utils/utils.h" #include "utils/utils.h"
#include "version.h" #include "version.h"
#include <coreinit/debug.h> #include <coreinit/debug.h>
#include <coreinit/kernel.h>
#include <coreinit/memexpheap.h> #include <coreinit/memexpheap.h>
#include <cstdint> #include <cstdint>
#include <list> #include <list>
@ -43,6 +44,14 @@ extern "C" int _start(int argc, char **argv) {
doStart(argc, argv); doStart(argc, argv);
} }
KernelInfo0 kernelInfo0;
__KernelGetInfo0(&kernelInfo0, 0);
asm(
"mr 13,%0\n"
"mr 2,%1\n" ::"r"(kernelInfo0.sdaBase),
"r"(kernelInfo0.sda2Base)
:);
return ((int (*)(int, char **))(*(unsigned int *) 0x1005E040))(argc, argv); return ((int (*)(int, char **))(*(unsigned int *) 0x1005E040))(argc, argv);
} }

View File

@ -34,6 +34,7 @@ IMPORT(OSSignalCond);
IMPORT(OSSwapAtomic); IMPORT(OSSwapAtomic);
IMPORT(OSDynLoad_GetAllocator); IMPORT(OSDynLoad_GetAllocator);
IMPORT(OSDynLoad_SetAllocator); IMPORT(OSDynLoad_SetAllocator);
IMPORT(__KernelGetInfo);
IMPORT(FSTimeToCalendarTime); IMPORT(FSTimeToCalendarTime);
IMPORT(FSInit); IMPORT(FSInit);