mirror of
https://github.com/wiiu-env/WUMSLoader.git
synced 2026-08-28 05:44:25 -05:00
relocator: Save the address of the PhysicalToEffective + EffectiveToPhysical function from the memory module is present.
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "utils/logger.h"
|
||||
#include "utils/dynamic.h"
|
||||
#include "globals.h"
|
||||
|
||||
#define gModuleData ((module_information_t *) (0x00880000))
|
||||
|
||||
@@ -113,6 +114,20 @@ extern "C" void doStart(int argc, char **argv) {
|
||||
if (!gInitCalled) {
|
||||
gInitCalled = 1;
|
||||
CallInitHook(loadedModules);
|
||||
for(auto& curModule : loadedModules){
|
||||
if(curModule.getExportName().compare("homebrew_memorymapping") == 0){
|
||||
for(auto& curExport : curModule.getExportDataList()){
|
||||
if(curExport.getName().compare("MemoryMappingEffectiveToPhysical") == 0){
|
||||
DEBUG_FUNCTION_LINE("Setting MemoryMappingEffectiveToPhysicalPTR to %08X\n", curExport.getAddress());
|
||||
MemoryMappingEffectiveToPhysicalPTR = (uint32_t) curExport.getAddress();
|
||||
}else if(curExport.getName().compare("MemoryMappingPhysicalToEffective") == 0){
|
||||
DEBUG_FUNCTION_LINE("Setting MemoryMappingPhysicalToEffectivePTR to %08X\n", curExport.getAddress());
|
||||
MemoryMappingPhysicalToEffectivePTR = (uint32_t) curExport.getAddress();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < gModuleData->number_used_modules; i++) {
|
||||
|
||||
4
relocator/src/globals.cpp
Normal file
4
relocator/src/globals.cpp
Normal file
@@ -0,0 +1,4 @@
|
||||
#include "globals.h"
|
||||
|
||||
uint32_t MemoryMappingEffectiveToPhysicalPTR = 0;
|
||||
uint32_t MemoryMappingPhysicalToEffectivePTR = 0;
|
||||
6
relocator/src/globals.h
Normal file
6
relocator/src/globals.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
extern uint32_t MemoryMappingEffectiveToPhysicalPTR;
|
||||
extern uint32_t MemoryMappingPhysicalToEffectivePTR;
|
||||
Reference in New Issue
Block a user