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.
This commit is contained in:
RadWolfie 2019-07-12 19:10:00 -05:00
parent 52f0d6f03b
commit 95d2406937
3 changed files with 13 additions and 1 deletions

View File

@ -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)

View File

@ -35,6 +35,11 @@
#include "common\Settings.hpp"
#include <commctrl.h>
// 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

View File

@ -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);