Allow early init of the Module System, check EnvrionmentLoader version

This commit is contained in:
Maschell
2024-04-19 13:11:28 +02:00
parent 40bec5454c
commit 40420432e2
6 changed files with 31 additions and 10 deletions

View File

@@ -1,4 +1,5 @@
#include "kernel.h"
#include "../wumsloader/src/globals.h"
#include "ElfUtils.h"
#include "wumsloader_elf.h"
#include <coreinit/cache.h>
@@ -20,6 +21,9 @@ void SetupWUMSLoader() {
KernelWriteU32(repl_addr, 0x48000003 | entryPoint);
DCFlushRange((void *) repl_addr, 4);
ICInvalidateRange((void *) (repl_addr), 4);
// We call the mainhook (wumloader) once with a MAGIC number to set up the WUMS Modules but not actually call the original main function
((int (*)(int, char **))(entryPoint))(WUMS_LOADER_SETUP_MAGIC_WORD, nullptr);
}
void KernelWriteU32(uint32_t addr, uint32_t value) {