From 95d240693787573f9339bf3e2dac6c68621009ec Mon Sep 17 00:00:00 2001 From: RadWolfie Date: Fri, 12 Jul 2019 19:10:00 -0500 Subject: [PATCH] fix compile build to able call CxbxKrnlMain in cxbx.exe Plus some fixes to able launch from cxbx.exe's emulation to verify the work is good or not. --- CMakeLists.txt | 2 ++ src/gui/WinMain.cpp | 10 +++++++++- src/gui/WndMain.cpp | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 459e3affd..08b52d34d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -252,6 +252,8 @@ file (GLOB CXBXR_SOURCE_GUIv1 "${CXBXR_ROOT_DIR}/src/gui/WinMain.cpp" "${CXBXR_ROOT_DIR}/src/gui/Wnd.cpp" "${CXBXR_ROOT_DIR}/src/gui/WndMain.cpp" +# Temporary usage for need ReserveAddressRanges func with cxbx.exe's emulation. + "${CXBXR_ROOT_DIR}/src/common/ReserveAddressRanges.cpp" ) # Emulator (module) diff --git a/src/gui/WinMain.cpp b/src/gui/WinMain.cpp index 736599631..df1192861 100644 --- a/src/gui/WinMain.cpp +++ b/src/gui/WinMain.cpp @@ -35,6 +35,11 @@ #include "common\Settings.hpp" #include +// Temporary usage for need ReserveAddressRanges func with cxbx.exe's emulation. +#ifndef CXBX_LOADER +#include "common/ReserveAddressRanges.h" +#endif + // Enable Visual Styles #pragma comment(linker,"\"/manifestdependency:type='win32' \ name = 'Microsoft.Windows.Common-Controls' version = '6.0.0.0' \ @@ -77,7 +82,10 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine if (bHasLoadArgument) { #ifndef CXBX_LOADER - CxbxKrnlMain(__argc, __argv); + uint32_t SystemDevBlocksReserved[384] = {}; + int system = SYSTEM_XBOX; // TODO: Temporary placeholder until loader is functional. + ReserveAddressRanges(system, SystemDevBlocksReserved); + CxbxKrnlMain(__argc, __argv, SystemDevBlocksReserved); EmuShared::Cleanup(); return EXIT_SUCCESS; #else diff --git a/src/gui/WndMain.cpp b/src/gui/WndMain.cpp index 5c79f3d10..3bf27c5f2 100644 --- a/src/gui/WndMain.cpp +++ b/src/gui/WndMain.cpp @@ -2243,8 +2243,10 @@ void WndMain::StartEmulation(HWND hwndParent, DebuggerState LocalDebuggerState / char szExeFileName[MAX_PATH]; GetModuleFileName(GetModuleHandle(nullptr), szExeFileName, MAX_PATH); +#ifdef CXBX_LOADER PathRemoveFileSpec(szExeFileName); PathAppend(szExeFileName, "\\cxbxr-ldr.exe"); +#endif bool AttachLocalDebugger = (LocalDebuggerState == debuggerOn); g_EmuShared->SetDebuggingFlag(&AttachLocalDebugger);