From bf115fe7ab9e3e5c2b671ba728cbff0c67e074f5 Mon Sep 17 00:00:00 2001 From: PatrickvL Date: Thu, 7 Feb 2019 13:51:00 +0100 Subject: [PATCH] Complete Emulation DLL project by adding all Cxbx source files (except GUI-related stuff). Entire solution builds again with this. Next steps : - Actually getting the emulation DLL to work - Complete CxbxGUI project by adding all Cxbx GUI-related source files --- src/common/AddressRanges.h | 4 ++++ src/core/hle/D3D8/Direct3D9/Direct3D9.cpp | 23 +++++++++++++++++++---- src/emulator/targetver.h | 2 +- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/common/AddressRanges.h b/src/common/AddressRanges.h index e68704ded..3396480f5 100644 --- a/src/common/AddressRanges.h +++ b/src/common/AddressRanges.h @@ -35,8 +35,12 @@ // ****************************************************************** #pragma once +#ifndef CXBXEMULATOR_EXPORTS // Only trim Windows symbols CxbxLoader, not in CxbxEmulator #include #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +#endif // CXBXEMULATOR_EXPORTS + +#undef FIELD_OFFSET // prevent macro redefinition warnings #include // For DWORD, CALLBACK, VirtualAlloc, LPVOID, SIZE_T, HMODULE #define KB(x) ((x) * 1024 ) // = 0x00000400 diff --git a/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp b/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp index e8ae724c3..ae392e413 100644 --- a/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp +++ b/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp @@ -26,6 +26,11 @@ // ****************************************************************** #define LOG_PREFIX CXBXR_MODULE::D3D8 +#ifdef CXBXEMULATOR_EXPORTS // DbgConsole only in Cxbx, not in CxbxEmulator + #undef INCLUDE_DBG_CONSOLE +#else + #define INCLUDE_DBG_CONSOLE +#endif #include "common\util\hasher.h" #include #include @@ -41,7 +46,9 @@ namespace xboxkrnl #include "core\kernel\init\CxbxKrnl.h" #include "core\kernel\support\Emu.h" #include "EmuShared.h" +#ifdef INCLUDE_DBG_CONSOLE #include "gui\DbgConsole.h" +#endif #include "core\hle\D3D8\ResourceTracker.h" #include "core\hle\D3D8\Direct3D9\Direct3D9.h" // For LPDIRECTDRAWSURFACE7 #include "core\hle\D3D8\XbVertexBuffer.h" @@ -1783,7 +1790,9 @@ static DWORD WINAPI EmuRenderWindow(LPVOID lpVoid) SetFocus(g_hEmuWindow); - DbgConsole *dbgConsole = new DbgConsole(); +#ifdef INCLUDE_DBG_CONSOLE + DbgConsole *dbgConsole = new DbgConsole(); +#endif // message processing loop { @@ -1806,21 +1815,27 @@ static DWORD WINAPI EmuRenderWindow(LPVOID lpVoid) { Sleep(0); +#ifdef INCLUDE_DBG_CONSOLE // if we've just switched back to display off, clear buffer & display prompt if(!g_bPrintfOn && lPrintfOn) { - dbgConsole->Reset(); + dbgConsole->Reset(); } +#endif lPrintfOn = g_bPrintfOn; - dbgConsole->Process(); +#ifdef INCLUDE_DBG_CONSOLE + dbgConsole->Process(); +#endif } } g_bRenderWindowActive = false; - delete dbgConsole; +#ifdef INCLUDE_DBG_CONSOLE + delete dbgConsole; +#endif CxbxKrnlCleanup(nullptr); } diff --git a/src/emulator/targetver.h b/src/emulator/targetver.h index 90e767bfc..ba864c29a 100644 --- a/src/emulator/targetver.h +++ b/src/emulator/targetver.h @@ -5,4 +5,4 @@ // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. -#include +//#include