From 4f2e4511d83ce356938666ef7b9da6233ee71566 Mon Sep 17 00:00:00 2001 From: Luke Usher Date: Wed, 4 Jan 2017 06:52:57 +0000 Subject: [PATCH] Fix an issue where g_CPUOthers was being used before being set. --- src/CxbxKrnl/CxbxKrnl.cpp | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/src/CxbxKrnl/CxbxKrnl.cpp b/src/CxbxKrnl/CxbxKrnl.cpp index 03332592e..a938affc3 100644 --- a/src/CxbxKrnl/CxbxKrnl.cpp +++ b/src/CxbxKrnl/CxbxKrnl.cpp @@ -563,23 +563,7 @@ extern "C" CXBXKRNL_API void CxbxKrnlInit //extern void InitializeSectionStructures(void); InitializeSectionStructures(); - DbgPrintf("EmuMain (0x%X): Initializing Direct3D.\n", GetCurrentThreadId()); - XTL::EmuD3DInit(pXbeHeader, dwXbeHeaderSize); - - EmuHLEIntercept(pLibraryVersion, pXbeHeader); - - // - // initialize FS segment selector - // - - { - EmuInitFS(); - - EmuGenerateFS(pTLS, pTLSData); - } - - DbgPrintf("EmuMain : Determining CPU affinity.\n"); // Make sure the Xbox1 code runs on one core (as the box itself has only 1 CPU, @@ -602,6 +586,23 @@ extern "C" CXBXKRNL_API void CxbxKrnlInit SetThreadAffinityMask(GetCurrentThread(), g_CPUXbox); } + DbgPrintf("EmuMain (0x%X): Initializing Direct3D.\n", GetCurrentThreadId()); + + XTL::EmuD3DInit(pXbeHeader, dwXbeHeaderSize); + + EmuHLEIntercept(pLibraryVersion, pXbeHeader); + + // + // initialize FS segment selector + // + + { + EmuInitFS(); + + EmuGenerateFS(pTLS, pTLSData); + } + + DbgPrintf("EmuMain (0x%X): Initial thread starting.\n", GetCurrentThreadId()); CxbxLaunchXbe(Entry);