This commit is contained in:
PatrickvL 2017-01-13 11:56:24 +01:00
parent b7131a8cfe
commit b8fac8bf16
3 changed files with 6 additions and 13 deletions

View File

@ -175,8 +175,3 @@ extern const uint32 HLEDataBaseCount = sizeof(HLEDataBase) / sizeof(HLEData);
// * XRefDataBase
// ******************************************************************
extern uint32 XRefDataBase[XREF_COUNT] = { 0 }; // Reset and populated by EmuHLEIntercept
// ******************************************************************
// * track XRef location
// ******************************************************************
extern uint32 UnResolvedXRefs = sizeof(XRefDataBase)/sizeof(uint32);

View File

@ -111,11 +111,6 @@ HLEDataBase[];
// ******************************************************************
extern const uint32 HLEDataBaseCount;
// ******************************************************************
// * UnResolvedXRefs
// ******************************************************************
extern uint32 UnResolvedXRefs;
// ******************************************************************
// * XRefDataBaseOffset
// ******************************************************************
@ -334,7 +329,7 @@ enum XRefDataBaseOffset
// XREF_XLoadSectionByHandle,
// XREF_XFreeSectionByHandle,
XREF_COUNT // XREF_COUONT must always be last.
XREF_COUNT // XREF_COUNT must always be last.
// Also, if XREF_COUNT > sizeof(byte), enlarge struct OOVPA.XRefSaveIndex (and Value somehow)
};

View File

@ -69,6 +69,7 @@ bool bLLE_GPU = false; // Set this to true for experimental GPU (graphics) LLE
bool bLLE_JIT = false; // Set this to true for experimental JIT
bool bXRefFirstPass; // For search speed optimization, set in EmuHLEIntercept, read in EmuLocateFunction
uint32 UnResolvedXRefs; // Tracks XRef location, used (read/write) in EmuHLEIntercept and EmuLocateFunction
void EmuHLEIntercept(Xbe::LibraryVersion *pLibraryVersion, Xbe::Header *pXbeHeader)
{
@ -165,6 +166,8 @@ void EmuHLEIntercept(Xbe::LibraryVersion *pLibraryVersion, Xbe::Header *pXbeHead
{
DbgPrintf("HLE: Detected Microsoft XDK application...\n");
UnResolvedXRefs = XREF_COUNT; // = sizeof(XRefDataBase) / sizeof(uint32)
uint32 dwLibraryVersions = pXbeHeader->dwLibraryVersions;
uint32 LastUnResolvedXRefs = UnResolvedXRefs+1;
uint32 OrigUnResolvedXRefs = UnResolvedXRefs;
@ -521,7 +524,7 @@ void EmuHLEIntercept(Xbe::LibraryVersion *pLibraryVersion, Xbe::Header *pXbeHead
// }
}
DbgPrintf("HLE: * Searching HLE database for %s version 1.0.%d...", szLibraryName, BuildVersion);
DbgPrintf("HLE: * Searching HLE database for %s version 1.0.%d...\n", szLibraryName, BuildVersion);
const HLEData *FoundHLEData = nullptr;
for(uint32 d = 0; d < HLEDataBaseCount; d++) {
@ -599,7 +602,7 @@ static inline void EmuInstallWrapper(void *FunctionAddr, void *WrapperAddr)
{
uint08 *FuncBytes = (uint08*)FunctionAddr;
*(uint08*)&FuncBytes[0] = 0xE9;
*(uint08*)&FuncBytes[0] = 0xE9; // = opcode for JMP rel32 (Jump near, relative, displacement relative to next instruction)
*(uint32*)&FuncBytes[1] = (uint32)WrapperAddr - (uint32)FunctionAddr - 5;
}