From b9315e3e0d54d4342718f50ec88dc558ff942787 Mon Sep 17 00:00:00 2001 From: PatrickvL Date: Thu, 29 Dec 2016 16:06:28 +0100 Subject: [PATCH] Read configured LLE components from EmuShared --- src/CxbxKrnl/CxbxKrnl.cpp | 6 ++++++ src/CxbxKrnl/EmuShared.h | 5 +++++ src/CxbxKrnl/HLEIntercept.cpp | 8 ++++---- src/CxbxKrnl/HLEIntercept.h | 3 +++ 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/CxbxKrnl/CxbxKrnl.cpp b/src/CxbxKrnl/CxbxKrnl.cpp index 80a391cac..ec54ba8a9 100644 --- a/src/CxbxKrnl/CxbxKrnl.cpp +++ b/src/CxbxKrnl/CxbxKrnl.cpp @@ -461,6 +461,12 @@ extern "C" CXBXKRNL_API void CxbxKrnlInit strncpy_s((PSTR)DummyKernel->SectionHeader.Name, 8, "DONGS", 8); } + // Read which components need to be LLE'ed : + int CxbxLLE_Flags; + g_EmuShared->GetFlagsLLE(&CxbxLLE_Flags); + bLLE_APU = (CxbxLLE_Flags & LLE_APU) > 0; + bLLE_GPU = (CxbxLLE_Flags & LLE_GPU) > 0; + // Initialize devices : char szBuffer[MAX_PATH]; SHGetSpecialFolderPath(NULL, szBuffer, CSIDL_APPDATA, TRUE); diff --git a/src/CxbxKrnl/EmuShared.h b/src/CxbxKrnl/EmuShared.h index d48ba4c74..a3334e414 100644 --- a/src/CxbxKrnl/EmuShared.h +++ b/src/CxbxKrnl/EmuShared.h @@ -40,6 +40,11 @@ #include +enum { + LLE_APU = 1 << 0, + LLE_GPU = 1 << 1, +}; + // ****************************************************************** // * EmuShared : Shared memory // ****************************************************************** diff --git a/src/CxbxKrnl/HLEIntercept.cpp b/src/CxbxKrnl/HLEIntercept.cpp index 0c33d9427..acc6e4afd 100644 --- a/src/CxbxKrnl/HLEIntercept.cpp +++ b/src/CxbxKrnl/HLEIntercept.cpp @@ -61,6 +61,10 @@ static bool bCacheInp = false; static std::vector vCacheInp; static std::vector::const_iterator vCacheInpIter; +// Set these for experimental APU(sound) / GPU (graphics) LLE +bool bLLE_APU = false; +bool bLLE_GPU = false; + void EmuHLEIntercept(Xbe::LibraryVersion *pLibraryVersion, Xbe::Header *pXbeHeader) { Xbe::Certificate *pCertificate = (Xbe::Certificate*)pXbeHeader->dwCertificateAddr; @@ -162,10 +166,6 @@ void EmuHLEIntercept(Xbe::LibraryVersion *pLibraryVersion, Xbe::Header *pXbeHead uint32 LastUnResolvedXRefs = UnResolvedXRefs+1; uint32 OrigUnResolvedXRefs = UnResolvedXRefs; - // Set these for experimental APU(sound) / GPU (graphics) LLE - bool bLLE_APU = false; - bool bLLE_GPU = false; - for(int p=0;UnResolvedXRefs < LastUnResolvedXRefs;p++) { DbgPrintf("HLE: Starting pass #%d...\n", p+1); diff --git a/src/CxbxKrnl/HLEIntercept.h b/src/CxbxKrnl/HLEIntercept.h index dd3d6332d..962e5fa85 100644 --- a/src/CxbxKrnl/HLEIntercept.h +++ b/src/CxbxKrnl/HLEIntercept.h @@ -34,6 +34,9 @@ #ifndef HLEINTERCEPT_H #define HLEINTERCEPT_H +extern bool bLLE_APU; +extern bool bLLE_GPU; + void EmuHLEIntercept(Xbe::LibraryVersion *LibraryVersion, Xbe::Header *XbeHeader); #endif