From 53632f7890ba1ae7812ac041dd26e5a3a4f3c8c9 Mon Sep 17 00:00:00 2001 From: Luke Usher Date: Wed, 19 Apr 2017 23:22:53 +0100 Subject: [PATCH] Add TODO notes for caching. --- src/CxbxKrnl/HLEIntercept.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/CxbxKrnl/HLEIntercept.cpp b/src/CxbxKrnl/HLEIntercept.cpp index 80cf03b58..3705f0e79 100644 --- a/src/CxbxKrnl/HLEIntercept.cpp +++ b/src/CxbxKrnl/HLEIntercept.cpp @@ -48,7 +48,9 @@ static xbaddr EmuLocateFunction(OOVPA *Oovpa, xbaddr lower, xbaddr upper); static void EmuInstallPatches(OOVPATable *OovpaTable, uint32 OovpaTableSize, Xbe::Header *pXbeHeader); #include -#include +#include + +std::unordered_map g_HLECache; uint32 g_BuildVersion; @@ -70,6 +72,12 @@ void EmuHLEIntercept(Xbe::Header *pXbeHeader) printf("*******************************************************************************\n"); printf("\n"); + // TODO: Hash the loaded XBE, use it as a filename + // TODO: Attempt to open the HLE Cache file of this filename + // TODO: Check the cache header to make sure the compiletime is valid + // TODO: If so, load it + // TODO: Iterate through the cache calling GetProcAddress on all functions. + // // initialize Microsoft XDK emulation // @@ -412,6 +420,7 @@ void EmuHLEIntercept(Xbe::Header *pXbeHeader) printf("\n"); + // TODO: Save the found symbols into the file return; } @@ -643,6 +652,7 @@ static void EmuInstallPatches(OOVPATable *OovpaTable, uint32 OovpaTableSize, Xbe if ((OovpaTable[a].Flags & Flag_DontScan) == 0 && (addr != nullptr)) { printf("\t*PATCHED*"); + g_HLECache[OovpaTable[a].szFuncName] = (uint32_t)addr; EmuInstallPatch(pFunc, addr); }