diff --git a/plugins/LilyPad/Config.cpp b/plugins/LilyPad/Config.cpp index d790eb8d0a..8fcc55938b 100644 --- a/plugins/LilyPad/Config.cpp +++ b/plugins/LilyPad/Config.cpp @@ -1,17 +1,9 @@ #include "Global.h" -#include -#include -#include "Config.h" #include "PS2Edefs.h" #include "Resource.h" #include "Diagnostics.h" -#include -#include -#include -#include #include "DeviceEnumerator.h" -#include "InputManager.h" #include "KeyboardQueue.h" #include "WndProcEater.h" #include "DualShock3.h" diff --git a/plugins/LilyPad/Config.h b/plugins/LilyPad/Config.h index ff8737330f..be5d96048a 100644 --- a/plugins/LilyPad/Config.h +++ b/plugins/LilyPad/Config.h @@ -1,9 +1,6 @@ #ifndef CONFIG_H #define CONFIG_H -#include "InputManager.h" -#include "PS2Etypes.h" - extern u8 ps2e; enum PadType { diff --git a/plugins/LilyPad/DeviceEnumerator.cpp b/plugins/LilyPad/DeviceEnumerator.cpp index ccd8dfecaa..cd41ce8fd7 100644 --- a/plugins/LilyPad/DeviceEnumerator.cpp +++ b/plugins/LilyPad/DeviceEnumerator.cpp @@ -1,6 +1,5 @@ #include "Global.h" #include "DeviceEnumerator.h" -#include "InputManager.h" #include "WindowsMessaging.h" #include "DirectInput.h" #include "KeyboardHook.h" diff --git a/plugins/LilyPad/Diagnostics.cpp b/plugins/LilyPad/Diagnostics.cpp index 07c2f3812a..6e19343fd9 100644 --- a/plugins/LilyPad/Diagnostics.cpp +++ b/plugins/LilyPad/Diagnostics.cpp @@ -1,10 +1,7 @@ #include "Global.h" -#include "InputManager.h" #include "DeviceEnumerator.h" #include "resource.h" #include "KeyboardQueue.h" -#include -#include Device *dev; diff --git a/plugins/LilyPad/DirectInput.cpp b/plugins/LilyPad/DirectInput.cpp index 93d244d09b..540a340f46 100644 --- a/plugins/LilyPad/DirectInput.cpp +++ b/plugins/LilyPad/DirectInput.cpp @@ -1,13 +1,10 @@ -#define DIRECTINPUT_VERSION 0x0800 - #include "Global.h" + #include "VKey.h" #include "DirectInput.h" #include -#include "InputManager.h" #include "DeviceEnumerator.h" #include "PS2Etypes.h" -#include // All for getting GUIDs of XInput devices.... #include diff --git a/plugins/LilyPad/DirectInput.h b/plugins/LilyPad/DirectInput.h index 9d263f7e5a..e206067020 100644 --- a/plugins/LilyPad/DirectInput.h +++ b/plugins/LilyPad/DirectInput.h @@ -1,3 +1 @@ -#include "InputManager.h" - void EnumDirectInputDevices(int ignoreXInput); diff --git a/plugins/LilyPad/DualShock3.cpp b/plugins/LilyPad/DualShock3.cpp index 5a422242ad..fdc1cb8077 100644 --- a/plugins/LilyPad/DualShock3.cpp +++ b/plugins/LilyPad/DualShock3.cpp @@ -1,7 +1,6 @@ #include "Global.h" #include "usb.h" #include "HidDevice.h" -#include "InputManager.h" #define VID 0x054c diff --git a/plugins/LilyPad/DualShock3.h b/plugins/LilyPad/DualShock3.h index 97d7df3baa..1c46774d34 100644 --- a/plugins/LilyPad/DualShock3.h +++ b/plugins/LilyPad/DualShock3.h @@ -1,6 +1,5 @@ int DualShock3Possible(); void EnumDualShock3s(); -#include "InputManager.h" // May move elsewhere in the future. int InitLibUsb(); diff --git a/plugins/LilyPad/Global.cpp b/plugins/LilyPad/Global.cpp new file mode 100644 index 0000000000..a57d59275b --- /dev/null +++ b/plugins/LilyPad/Global.cpp @@ -0,0 +1 @@ +#include "Global.h" diff --git a/plugins/LilyPad/Global.h b/plugins/LilyPad/Global.h index 92543f5aae..ef2823822c 100644 --- a/plugins/LilyPad/Global.h +++ b/plugins/LilyPad/Global.h @@ -3,6 +3,8 @@ // dll size by over 100k while avoiding any dependencies on updated CRT dlls. #pragma once +#define DIRECTINPUT_VERSION 0x0800 + #ifdef NO_CRT #define _CRT_ALLOCATION_DEFINED #endif @@ -27,6 +29,15 @@ #include +#include +#include +#include +#include + +#include +// Only needed for DBT_DEVNODES_CHANGED +#include + #include "PS2Etypes.h" #include "PS2Edefs.h" @@ -66,7 +77,17 @@ EXPORT_C_(s32) PADfreeze(int mode, freezeData *data); EXPORT_C_(s32) PADsetSlot(u8 port, u8 slot); EXPORT_C_(s32) PADqueryMtap(u8 port); +#include "InputManager.h" +#include "Config.h" #ifdef NO_CRT + +#define malloc MyMalloc +#define calloc MyCalloc +#define free MyFree +#define realloc MyRealloc +#define wcsdup MyWcsdup +#define wcsicmp MyWcsicmp + inline void * malloc(size_t size) { return HeapAlloc(GetProcessHeap(), 0, size); } diff --git a/plugins/LilyPad/InputManager.cpp b/plugins/LilyPad/InputManager.cpp index 43b82668d5..50d1b27151 100644 --- a/plugins/LilyPad/InputManager.cpp +++ b/plugins/LilyPad/InputManager.cpp @@ -1,7 +1,6 @@ -#include "InputManager.h" #include "Global.h" +#include "InputManager.h" #include "KeyboardQueue.h" -#include InputDeviceManager *dm = 0; diff --git a/plugins/LilyPad/KeyboardHook.cpp b/plugins/LilyPad/KeyboardHook.cpp index d3c45d9897..b80dbc674a 100644 --- a/plugins/LilyPad/KeyboardHook.cpp +++ b/plugins/LilyPad/KeyboardHook.cpp @@ -1,9 +1,7 @@ #include "Global.h" #include "KeyboardHook.h" -#include "InputManager.h" #include "WindowsKeyboard.h" -#include "Config.h" #include "VKey.h" #include "WndProcEater.h" #include "DeviceEnumerator.h" diff --git a/plugins/LilyPad/KeyboardQueue.cpp b/plugins/LilyPad/KeyboardQueue.cpp index 70badb83de..c8498ee119 100644 --- a/plugins/LilyPad/KeyboardQueue.cpp +++ b/plugins/LilyPad/KeyboardQueue.cpp @@ -1,3 +1,4 @@ +#include "Global.h" // This is undoubtedly completely unnecessary. #include "KeyboardQueue.h" diff --git a/plugins/LilyPad/KeyboardQueue.h b/plugins/LilyPad/KeyboardQueue.h index 3b8407be73..c5e44afad5 100644 --- a/plugins/LilyPad/KeyboardQueue.h +++ b/plugins/LilyPad/KeyboardQueue.h @@ -1,5 +1,3 @@ -#include "Global.h" -#include "PS2Edefs.h" // This entire thing isn't really needed, // but takes little enough effort to be safe... diff --git a/plugins/LilyPad/LilyPad.cpp b/plugins/LilyPad/LilyPad.cpp index 646d7ce558..701a6744da 100644 --- a/plugins/LilyPad/LilyPad.cpp +++ b/plugins/LilyPad/LilyPad.cpp @@ -1,17 +1,10 @@ #include "Global.h" -#include -#include -#include // For escape timer, so as not to break GSDX+DX9. #include #define PADdefs -#include "PS2Etypes.h" -#include "PS2Edefs.h" -#include "Config.h" -#include "InputManager.h" #include "DeviceEnumerator.h" #include "WndProcEater.h" #include "KeyboardQueue.h" @@ -596,27 +589,26 @@ u32 CALLBACK PS2EgetLibVersion2(u32 type) { // Used in about and config screens. void GetNameAndVersionString(wchar_t *out) { -#ifdef PCSX2_DEBUG - wsprintfW(out, L"LilyPad Debug %i.%i.%i (r%i)", (VERSION>>8)&0xFF, VERSION&0xFF, (VERSION>>24)&0xFF, SVN_REV); -#elif (_MSC_VER != 1400) +#ifdef NO_CRT wsprintfW(out, L"LilyPad svn %i.%i.%i (r%i)", (VERSION>>8)&0xFF, VERSION&0xFF, (VERSION>>24)&0xFF, SVN_REV); +#elif defined(PCSX2_DEBUG) + wsprintfW(out, L"LilyPad Debug %i.%i.%i (r%i)", (VERSION>>8)&0xFF, VERSION&0xFF, (VERSION>>24)&0xFF, SVN_REV); #else wsprintfW(out, L"LilyPad %i.%i.%i", (VERSION>>8)&0xFF, VERSION&0xFF, (VERSION>>24)&0xFF, SVN_REV); #endif } char* CALLBACK PSEgetLibName() { -#ifdef PCSX2_DEBUG +#ifdef NO_CRT + return "LilyPad"; +#elif defined(PCSX2_DEBUG) static char version[50]; sprintf(version, "LilyPad Debug (r%i)", SVN_REV); return version; #else - #if (_MSC_VER != 1400) - static char version[50]; - sprintf(version, "LilyPad svn (r%i)", SVN_REV); - return version; - #endif - return "LilyPad"; + static char version[50]; + sprintf(version, "LilyPad svn (r%i)", SVN_REV); + return version; #endif } @@ -1412,18 +1404,6 @@ u32 CALLBACK PSEgetLibVersion() { return (VERSION & 0xFFFFFF); } -// Little funkiness to handle rounding floating points to ints without the C runtime. -// Unfortunately, means I can't use /GL optimization option when NO_CRT is defined. -#ifdef NO_CRT -extern "C" long _cdecl _ftol(); -extern "C" long _cdecl _ftol2_sse() { - return _ftol(); -} -extern "C" long _cdecl _ftol2() { - return _ftol(); -} -#endif - s32 CALLBACK PADqueryMtap(u8 port) { port--; if (port > 1) return 0; @@ -1441,3 +1421,16 @@ s32 CALLBACK PADsetSlot(u8 port, u8 slot) { // First slot always allowed. return pads[port][slot].enabled | !slot; } + +// Little funkiness to handle rounding floating points to ints without the C runtime. +// Unfortunately, means I can't use /GL optimization option when NO_CRT is defined. +#ifdef NO_CRT +extern "C" long _cdecl _ftol(); +extern "C" long _cdecl _ftol2_sse() { + return _ftol(); +} +extern "C" long _cdecl _ftol2() { + return _ftol(); +} +#endif + diff --git a/plugins/LilyPad/LilyPad_VC2005.sln b/plugins/LilyPad/LilyPad_VC2005.sln deleted file mode 100644 index a5dc5d75fa..0000000000 --- a/plugins/LilyPad/LilyPad_VC2005.sln +++ /dev/null @@ -1,25 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LilyPad", "LilyPad_VC2005.vcproj", "{E4081455-398C-4610-A87C-90A8A7D72DC3}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E4081455-398C-4610-A87C-90A8A7D72DC3}.Debug|Win32.ActiveCfg = Debug|Win32 - {E4081455-398C-4610-A87C-90A8A7D72DC3}.Debug|Win32.Build.0 = Debug|Win32 - {E4081455-398C-4610-A87C-90A8A7D72DC3}.Debug|x64.ActiveCfg = Debug|x64 - {E4081455-398C-4610-A87C-90A8A7D72DC3}.Debug|x64.Build.0 = Debug|x64 - {E4081455-398C-4610-A87C-90A8A7D72DC3}.Release|Win32.ActiveCfg = Release|Win32 - {E4081455-398C-4610-A87C-90A8A7D72DC3}.Release|Win32.Build.0 = Release|Win32 - {E4081455-398C-4610-A87C-90A8A7D72DC3}.Release|x64.ActiveCfg = Release|x64 - {E4081455-398C-4610-A87C-90A8A7D72DC3}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/plugins/LilyPad/LilyPad_VC2005.vcproj b/plugins/LilyPad/LilyPad_VC2005.vcproj deleted file mode 100644 index 474764ddb9..0000000000 --- a/plugins/LilyPad/LilyPad_VC2005.vcproj +++ /dev/null @@ -1,764 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/LilyPad/LilyPad_VC2008.vcproj b/plugins/LilyPad/LilyPad_VC2008.vcproj index 037a6f92d1..c1fbce1b59 100644 --- a/plugins/LilyPad/LilyPad_VC2008.vcproj +++ b/plugins/LilyPad/LilyPad_VC2008.vcproj @@ -20,7 +20,6 @@ + + + + + + + + + + + + + + + + + + + @@ -183,90 +268,6 @@ Name="VCPostBuildEventTool" /> - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -506,14 +784,6 @@ PreprocessorDefinitions="" /> - - - @@ -522,6 +792,14 @@ PreprocessorDefinitions="" /> + + + @@ -530,6 +808,22 @@ PreprocessorDefinitions="" /> + + + + + + + + + + + + +#include "VKey.h" wchar_t *GetVKStringW(unsigned char vk) { int flag; diff --git a/plugins/LilyPad/WindowsKeyboard.h b/plugins/LilyPad/WindowsKeyboard.h index 938ec1dc0c..bff14e9418 100644 --- a/plugins/LilyPad/WindowsKeyboard.h +++ b/plugins/LilyPad/WindowsKeyboard.h @@ -1,5 +1,3 @@ -#include "InputManager.h" - // Shared functionality for WM and RAW keyboards. class WindowsKeyboard : public Device { public: diff --git a/plugins/LilyPad/WindowsMessaging.h b/plugins/LilyPad/WindowsMessaging.h index 11957fda5d..8b96616381 100644 --- a/plugins/LilyPad/WindowsMessaging.h +++ b/plugins/LilyPad/WindowsMessaging.h @@ -1,3 +1 @@ -#include "InputManager.h" - void EnumWindowsMessagingDevices(); diff --git a/plugins/LilyPad/WindowsMouse.h b/plugins/LilyPad/WindowsMouse.h index 5fa5772c4a..938e2256d8 100644 --- a/plugins/LilyPad/WindowsMouse.h +++ b/plugins/LilyPad/WindowsMouse.h @@ -1,5 +1,3 @@ -#include "InputManager.h" - // Shared functionality for WM and RAW keyboards. class WindowsMouse : public Device { public: diff --git a/plugins/LilyPad/WndProcEater.cpp b/plugins/LilyPad/WndProcEater.cpp index 27d27cbdeb..a79247e115 100644 --- a/plugins/LilyPad/WndProcEater.cpp +++ b/plugins/LilyPad/WndProcEater.cpp @@ -1,3 +1,4 @@ +#include "Global.h" #include "WndProcEater.h" static HWND hWndEaten = 0; diff --git a/plugins/LilyPad/WndProcEater.h b/plugins/LilyPad/WndProcEater.h index b85af1fd20..b6821a6324 100644 --- a/plugins/LilyPad/WndProcEater.h +++ b/plugins/LilyPad/WndProcEater.h @@ -1,5 +1,3 @@ -#include "Global.h" - #define EATPROC_NO_UPDATE_WHILE_UPDATING_DEVICES 1 /* Need this to let window be subclassed multiple times but still clean up nicely. diff --git a/plugins/LilyPad/XInput.cpp b/plugins/LilyPad/XInput.cpp index e24a0ed11e..1a25d9740b 100644 --- a/plugins/LilyPad/XInput.cpp +++ b/plugins/LilyPad/XInput.cpp @@ -1,7 +1,6 @@ #include "Global.h" #include "VKey.h" #include -#include "InputManager.h" // This way, I don't require that XInput junk be installed. typedef void (CALLBACK *_XInputEnable)(BOOL enable); diff --git a/plugins/LilyPad/usb.h b/plugins/LilyPad/usb.h index b00591cec4..c6c5dca40e 100644 --- a/plugins/LilyPad/usb.h +++ b/plugins/LilyPad/usb.h @@ -3,9 +3,6 @@ #ifndef __USB_H__ #define __USB_H__ -#include -#include - /* * 'interface' is defined somewhere in the Windows header files. This macro * is deleted here to avoid conflicts and compile errors.