From 4edc55f02ed641e0ba68d7d976fd3d65f5d0b783 Mon Sep 17 00:00:00 2001 From: Maschell Date: Sat, 6 Jun 2020 22:10:41 +0200 Subject: [PATCH] Get module_information_t pointer from args instead of "guessing" it --- source/main.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/source/main.cpp b/source/main.cpp index 9ca61bb..4d20b4f 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -20,9 +20,9 @@ WUMS_MODULE_EXPORT_NAME("homebrew_wupsbackend"); std::vector loadPlugins(const std::vector &pluginList, MEMHeapHandle heapHandle); -#define gModuleData ((module_information_t *) (0x00880000)) - -WUMS_INITIALIZE(){ +module_information_t *gModuleData = NULL; +WUMS_INITIALIZE(args) { + gModuleData = args.module_information; } WUMS_APPLICATION_STARTS() { @@ -33,7 +33,9 @@ WUMS_APPLICATION_STARTS() { } bool initNeeded = false; if (pluginDataHeap == NULL) { - DCFlushRange((void *) 0x00880000, sizeof(module_information_t)); + + DEBUG_FUNCTION_LINE("gModuleData = %08X", gModuleData); + DCFlushRange((void *) gModuleData, sizeof(module_information_t)); uint32_t endAddress = 0; DEBUG_FUNCTION_LINE("Using %d modules", gModuleData->number_used_modules); for (int i = 0; i < gModuleData->number_used_modules; i++) {