Clean up more Cemuhook leftovers (#253)

This commit is contained in:
Francesco Saltori 2022-09-16 13:34:41 +02:00 committed by GitHub
parent cebdccfdf5
commit 664d7ee902
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 7 additions and 48 deletions

View file

@ -217,7 +217,6 @@ bool RPLLoader_ProcessHeaders(std::string_view moduleName, uint8* rplData, uint3
// setup RPL info struct
RPLModule* rplLoaderContext = new RPLModule();
rplLoaderContext->RPLRawData = std::span<uint8>(rplData, rplSize);
rplLoaderContext->rplData_depr = rplData;
rplLoaderContext->heapTrampolineArea.setBaseAllocator(&rplLoaderHeap_lowerAreaCodeMem2);
// load section table
if ((uint32)rplHeader->sectionTableEntrySize != sizeof(rplSectionEntryNew_t))
@ -282,12 +281,6 @@ bool RPLLoader_ProcessHeaders(std::string_view moduleName, uint8* rplData, uint3
// convert modulename to lower-case
for(auto& c : rplLoaderContext->moduleName2)
c = _ansiToLower(c);
// cemuhook compatibility
rplLoaderContext->moduleNamePtr__depr = rplLoaderContext->moduleName2.data();
rplLoaderContext->moduleNameLength__depr = rplLoaderContext->moduleName2.size();
rplLoaderContext->moduleNameSize = 0;
rplLoaderContext->sectionAddressTable__depr = rplLoaderContext->sectionAddressTable2.data();
rplLoaderContext->sectionAddressTableSize__depr = rplLoaderContext->sectionAddressTable2.size() * sizeof(rplSectionAddressEntry_t);
// load CRC section
uint32 crcTableExpectedSize = sectionCount * sizeof(uint32be);

View file

@ -144,25 +144,13 @@ struct RPLModule
{
uint32 ukn00; // pointer to shared memory region? (0xEFE01000)
uint32 ukn04; // related to text region size?
char* moduleNamePtr__depr; // converted to lower case
uint32 moduleNameLength__depr; // length of module name
uint32 moduleNameSize; // aligned alloc size, not the same as actual length
uint32 padding14;
uint32 padding18;
rplHeaderNew_t rplHeader;
rplSectionEntryNew_t* sectionTablePtr; // copy of section table
RPLFileInfoData* fileInfoPtr__depr{}; // copy of fileinfo section
uint32 fileInfoSize__depr{}; // size of fileInfo section
uint32 fileInfoAllocSize__depr{}; // aligned alloc size
uint32be* crcTablePtr_depr{}; // copy of CRC section
uint32 crcTableAllocSize_depr{};
uint32 entrypoint;
uint8* rplData_depr; // Cemuhook might still read this
MPTR textRegionTemp; // temporary memory for text section?
MEMPTR<void> regionMappingBase_text; // base destination address for text region
@ -171,15 +159,11 @@ struct RPLModule
uint8* tempRegionPtr;
uint32 tempRegionAllocSize;
rplSectionAddressEntry_t* sectionAddressTable__depr;
uint32 sectionAddressTableSize__depr;
uint32 exportDCount;
rplExportTableEntry_t* exportDDataPtr;
uint32 exportFCount;
rplExportTableEntry_t* exportFDataPtr;
/* above are hardcoded in Cemuhook */
std::string moduleName2;
std::vector<rplSectionAddressEntry_t> sectionAddressTable2;