From f867dc0479f35862b28657ca9179f62a9d18b0d5 Mon Sep 17 00:00:00 2001 From: Andrea Odetti Date: Mon, 30 Nov 2020 18:44:31 +0000 Subject: [PATCH] Make the code more similar to AW. Signed-off-by: Andrea Odetti --- source/Core.cpp | 9 +++++++-- source/StdAfx.h | 37 ++++++++++++++++++++++++++++++++++--- test/TestCPU6502/stdafx.h | 21 ++++++++++++++++++++- 3 files changed, 61 insertions(+), 6 deletions(-) diff --git a/source/Core.cpp b/source/Core.cpp index 834a3bb1..89cd8e0b 100644 --- a/source/Core.cpp +++ b/source/Core.cpp @@ -38,6 +38,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "Speaker.h" #include "Registry.h" #include "SynchronousEventManager.h" +#include "Configuration/PropertySheet.h" #ifdef USE_SPEECH_API #include "Speech.h" @@ -79,8 +80,12 @@ int g_nMemoryClearType = MIP_FF_FF_00_00; // Note: -1 = random MIP in Memory.c SynchronousEventManager g_SynchronousEventMgr; -static IPropertySheet * sg = nullptr; -IPropertySheet& sg_PropertySheet = *sg; // *new CPropertySheet; +#ifdef _MSC_VER +IPropertySheet& sg_PropertySheet = *new CPropertySheet; +#else +static IPropertySheet* nullPropertySheet = nullptr; +IPropertySheet& sg_PropertySheet = *nullPropertySheet; +#endif HANDLE g_hCustomRomF8 = INVALID_HANDLE_VALUE; // Cmd-line specified custom F8 ROM at $F800..$FFFF bool g_bCustomRomF8Failed = false; // Set if custom F8 ROM file failed diff --git a/source/StdAfx.h b/source/StdAfx.h index 7143dd02..d7d6c196 100644 --- a/source/StdAfx.h +++ b/source/StdAfx.h @@ -1,3 +1,5 @@ +#ifdef _MSC_VER + //#define WIN32_LEAN_AND_MEAN // Required for Win98/ME support: @@ -15,13 +17,31 @@ #endif // Not needed in VC7.1, but needed in VC Express +#include + +#include +#include +#include #include #include #include #include +#if _MSC_VER >= 1600 // supported from VS2010 (cl.exe v16.00) #include // cleanup WORD DWORD -> uint16_t uint32_t +#else +typedef UINT8 uint8_t; +typedef UINT16 uint16_t; +typedef UINT32 uint32_t; +typedef UINT64 uint64_t; +#endif +#include +#include // WM_MOUSEWHEEL +#include +#include +#include +#include #include #include @@ -32,9 +52,6 @@ #include #include #include -#include - -#include "linux/win.h" // SM_CXPADDEDBORDER is not supported on 2000 & XP: // http://msdn.microsoft.com/en-nz/library/windows/desktop/ms724385(v=vs.85).aspx @@ -42,4 +59,18 @@ #define SM_CXPADDEDBORDER 92 #endif +#define USE_SPEECH_API + +#else + +#include +#include +#include +#include +#include + +#include "linux/win.h" + //#define USE_SPEECH_API + +#endif diff --git a/test/TestCPU6502/stdafx.h b/test/TestCPU6502/stdafx.h index df7e529f..b8148f00 100644 --- a/test/TestCPU6502/stdafx.h +++ b/test/TestCPU6502/stdafx.h @@ -5,8 +5,27 @@ #pragma once +#ifdef _MSC_VER + #include +#include + +#include + +#if _MSC_VER >= 1600 // supported from VS2010 (cl.exe v16.00) +#include // cleanup WORD DWORD -> uint16_t uint32_t +#else +#include +typedef UINT8 uint8_t; +typedef UINT16 uint16_t; +typedef UINT32 uint32_t; +typedef UINT64 uint64_t; +#endif + +#include + +#else #include -#include +#endif