From 2c165c9b6d384b2aade0ad0ddb18225ee495347c Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 14 Feb 2021 09:25:20 -0800 Subject: [PATCH 01/10] Windows: Fix improper case or missing includes. As per mingw errors/warnings. --- Common/File/FileUtil.cpp | 1 + Common/GPU/D3D11/thin3d_d3d11.cpp | 4 ++-- Common/GPU/thin3d_create.h | 2 +- Core/Dialog/PSPSaveDialog.cpp | 1 + Core/FileSystems/DirectoryFileSystem.cpp | 1 + Core/FileSystems/VirtualDiscFileSystem.cpp | 1 + Core/HDRemaster.h | 1 + Core/HLE/sceOpenPSID.cpp | 2 +- GPU/D3D11/ShaderManagerD3D11.cpp | 2 +- Windows/DSoundStream.h | 4 +++- Windows/Debugger/Debugger_Disasm.cpp | 2 +- Windows/Debugger/Debugger_Disasm.h | 2 +- Windows/DinputDevice.cpp | 10 +++++----- Windows/GEDebugger/CtrlDisplayListView.cpp | 2 +- Windows/GEDebugger/GEDebugger.cpp | 1 + Windows/XinputDevice.h | 4 ++-- 16 files changed, 24 insertions(+), 16 deletions(-) diff --git a/Common/File/FileUtil.cpp b/Common/File/FileUtil.cpp index 05af060d95..d7a09d3069 100644 --- a/Common/File/FileUtil.cpp +++ b/Common/File/FileUtil.cpp @@ -25,6 +25,7 @@ #include "ppsspp_config.h" #include +#include #include #include "Common/Log.h" diff --git a/Common/GPU/D3D11/thin3d_d3d11.cpp b/Common/GPU/D3D11/thin3d_d3d11.cpp index 9403f1cada..385c83ebbf 100644 --- a/Common/GPU/D3D11/thin3d_d3d11.cpp +++ b/Common/GPU/D3D11/thin3d_d3d11.cpp @@ -14,10 +14,10 @@ #include "Common/Log.h" #include -#include +#include #include #include -#include +#include #ifdef __MINGW32__ #undef __uuidof diff --git a/Common/GPU/thin3d_create.h b/Common/GPU/thin3d_create.h index a2030792af..6df80731eb 100644 --- a/Common/GPU/thin3d_create.h +++ b/Common/GPU/thin3d_create.h @@ -12,7 +12,7 @@ #endif #define WIN32_LEAN_AND_MEAN #include -#include +#include struct IDirect3DDevice9; struct IDirect3D9; struct IDirect3DDevice9Ex; diff --git a/Core/Dialog/PSPSaveDialog.cpp b/Core/Dialog/PSPSaveDialog.cpp index ee584cd698..99fc0bd39b 100755 --- a/Core/Dialog/PSPSaveDialog.cpp +++ b/Core/Dialog/PSPSaveDialog.cpp @@ -19,6 +19,7 @@ #define _POSIX_THREAD_SAFE_FUNCTIONS 200112L #endif +#include #include #include "Common/Data/Text/I18n.h" diff --git a/Core/FileSystems/DirectoryFileSystem.cpp b/Core/FileSystems/DirectoryFileSystem.cpp index d6594ee52e..b73634ca35 100644 --- a/Core/FileSystems/DirectoryFileSystem.cpp +++ b/Core/FileSystems/DirectoryFileSystem.cpp @@ -18,6 +18,7 @@ #include "ppsspp_config.h" #include +#include #include #include "Common/Data/Text/I18n.h" diff --git a/Core/FileSystems/VirtualDiscFileSystem.cpp b/Core/FileSystems/VirtualDiscFileSystem.cpp index fde9808d8c..63e78fcbf1 100644 --- a/Core/FileSystems/VirtualDiscFileSystem.cpp +++ b/Core/FileSystems/VirtualDiscFileSystem.cpp @@ -16,6 +16,7 @@ // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. #include "ppsspp_config.h" +#include #include "Common/File/FileUtil.h" #include "Common/StringUtils.h" diff --git a/Core/HDRemaster.h b/Core/HDRemaster.h index 8d6939f91c..47884976ed 100644 --- a/Core/HDRemaster.h +++ b/Core/HDRemaster.h @@ -17,6 +17,7 @@ #pragma once +#include #include "Common/CommonTypes.h" // This bool is the key to having the HD remasters work. diff --git a/Core/HLE/sceOpenPSID.cpp b/Core/HLE/sceOpenPSID.cpp index 86e35bc4fe..2fd31a12da 100644 --- a/Core/HLE/sceOpenPSID.cpp +++ b/Core/HLE/sceOpenPSID.cpp @@ -17,9 +17,9 @@ #include "Core/HLE/HLE.h" #include "Core/HLE/FunctionWrappers.h" +#include "Core/HLE/proAdhoc.h" #include "Core/HLE/sceOpenPSID.h" #include "Core/MemMapHelpers.h" -#include SceOpenPSID dummyOpenPSID = { 0x10, 0x02, 0xA3, 0x44, 0x13, 0xF5, 0x93, 0xB0, 0xCC, 0x6E, 0xD1, 0x32, 0x27, 0x85, 0x0F, 0x9D }; diff --git a/GPU/D3D11/ShaderManagerD3D11.cpp b/GPU/D3D11/ShaderManagerD3D11.cpp index 8d612e2fc9..35dd4a4386 100644 --- a/GPU/D3D11/ShaderManagerD3D11.cpp +++ b/GPU/D3D11/ShaderManagerD3D11.cpp @@ -18,7 +18,7 @@ #include "ppsspp_config.h" #include -#include +#include #include diff --git a/Windows/DSoundStream.h b/Windows/DSoundStream.h index 22af665e35..a0b2f3f7b2 100644 --- a/Windows/DSoundStream.h +++ b/Windows/DSoundStream.h @@ -4,7 +4,9 @@ #include "WindowsAudio.h" #include -#include + +struct IDirectSound8; +struct IDirectSoundBuffer; class DSoundAudioBackend : public WindowsAudioBackend { public: diff --git a/Windows/Debugger/Debugger_Disasm.cpp b/Windows/Debugger/Debugger_Disasm.cpp index d420ac0dd1..1a311b3936 100644 --- a/Windows/Debugger/Debugger_Disasm.cpp +++ b/Windows/Debugger/Debugger_Disasm.cpp @@ -2,7 +2,7 @@ #include "Core/Config.h" #include "Core/MemMap.h" -#include "Windows/Resource.h" +#include "Windows/resource.h" #include "Windows/InputBox.h" #include "Core/Debugger/Breakpoints.h" diff --git a/Windows/Debugger/Debugger_Disasm.h b/Windows/Debugger/Debugger_Disasm.h index f743538a4f..c95ba39bd7 100644 --- a/Windows/Debugger/Debugger_Disasm.h +++ b/Windows/Debugger/Debugger_Disasm.h @@ -4,7 +4,7 @@ #include "Windows/W32Util/DialogManager.h" #include "Windows/W32Util/TabControl.h" -#include "Windows/Debugger/CtrlDisasmView.h" +#include "Windows/Debugger/CtrlDisAsmView.h" #include "Windows/Debugger/Debugger_Lists.h" #include "Windows/Debugger/CPURegsInterface.h" #include "Core/MIPS/MIPSDebugInterface.h" diff --git a/Windows/DinputDevice.cpp b/Windows/DinputDevice.cpp index 4d415b7c8a..b87bc95537 100644 --- a/Windows/DinputDevice.cpp +++ b/Windows/DinputDevice.cpp @@ -19,15 +19,15 @@ #include #include #include +#include -#include "Core/HLE/sceCtrl.h" -#include "DinputDevice.h" -#include "Core/Config.h" #include "Common/Input/InputState.h" -#include "Common/System/NativeApp.h" #include "Common/Input/KeyCodes.h" +#include "Common/System/NativeApp.h" +#include "Core/Config.h" +#include "Core/HLE/sceCtrl.h" #include "Core/Reporting.h" -#include "Xinput.h" +#include "Windows/DinputDevice.h" #pragma comment(lib,"dinput8.lib") #ifdef min diff --git a/Windows/GEDebugger/CtrlDisplayListView.cpp b/Windows/GEDebugger/CtrlDisplayListView.cpp index 78b3373a5e..16f0769d3c 100644 --- a/Windows/GEDebugger/CtrlDisplayListView.cpp +++ b/Windows/GEDebugger/CtrlDisplayListView.cpp @@ -2,7 +2,7 @@ #include "Windows/GEDebugger/CtrlDisplayListView.h" #include "Windows/GEDebugger/GEDebugger.h" #include "Windows/InputBox.h" -#include "Windows/Main.h" +#include "Windows/main.h" #include "Core/Config.h" #include "GPU/Debugger/Breakpoints.h" #include "GPU/GPUState.h" diff --git a/Windows/GEDebugger/GEDebugger.cpp b/Windows/GEDebugger/GEDebugger.cpp index 16d293776d..606fae6eb3 100644 --- a/Windows/GEDebugger/GEDebugger.cpp +++ b/Windows/GEDebugger/GEDebugger.cpp @@ -15,6 +15,7 @@ // Official git repository and contact information can be found at // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. +#include #include #include #include diff --git a/Windows/XinputDevice.h b/Windows/XinputDevice.h index fc640e708e..bcff3e5db8 100644 --- a/Windows/XinputDevice.h +++ b/Windows/XinputDevice.h @@ -1,8 +1,8 @@ #pragma once -#include "InputDevice.h" -#include "Xinput.h" +#include #include "Core/HLE/sceCtrl.h" +#include "Windows/InputDevice.h" class XinputDevice final : public InputDevice { public: From 622b078518f7021ade4330293dd806616dd6f479 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 14 Feb 2021 09:26:48 -0800 Subject: [PATCH 02/10] Build: Use ws2_32 and iphlpapi names directly. On mingw, find_library can't find these. We already use them directly elsewhere in this same file. --- CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f71e066314..f3618f74c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1912,9 +1912,7 @@ if(USE_MINIUPNPC) endif() if (WIN32) set_source_files_properties(${MINIUPNPC_SOURCES} PROPERTIES COMPILE_DEFINITIONS "MINIUPNP_STATICLIB;MINIUPNP_EXPORTS") - find_library(WINSOCK2_LIBRARY NAMES ws2_32 WS2_32 Ws2_32) - find_library(IPHLPAPI_LIBRARY NAMES iphlpapi) - set(LDLIBS ${WINSOCK2_LIBRARY} ${IPHLPAPI_LIBRARY} ${LDLIBS}) + set(LDLIBS ws2_32 iphlpapi ${LDLIBS}) #elseif (CMAKE_SYSTEM_NAME STREQUAL "Solaris") # find_library (SOCKET_LIBRARY NAMES socket) # find_library (NSL_LIBRARY NAMES nsl) From 7aa4b53422e9519e7b3c8fbc570cf1e669affbdd Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 14 Feb 2021 09:38:23 -0800 Subject: [PATCH 03/10] Common: Fix AVX check on mingw/lower targets. --- Common/CPUDetect.cpp | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/Common/CPUDetect.cpp b/Common/CPUDetect.cpp index 70c640eee7..04780f5f7f 100644 --- a/Common/CPUDetect.cpp +++ b/Common/CPUDetect.cpp @@ -26,6 +26,7 @@ #include #endif +#include #include #include @@ -34,10 +35,9 @@ #include "Common/File/FileUtil.h" #include "Common/StringUtils.h" -#if defined(_WIN32) && !defined(__MINGW32__) +#if defined(_WIN32) +#include "Common/CommonWindows.h" -#define WIN32_LEAN_AND_MEAN -#include #define _interlockedbittestandset workaround_ms_header_bug_platform_sdk6_set #define _interlockedbittestandreset workaround_ms_header_bug_platform_sdk6_reset #define _interlockedbittestandset64 workaround_ms_header_bug_platform_sdk6_set64 @@ -55,21 +55,27 @@ void do_cpuid(u32 regs[4], u32 cpuid_leaf) { __cpuid((int *)regs, cpuid_leaf); } +#ifdef __MINGW32__ +static uint64_t do_xgetbv(unsigned int index) { + unsigned int eax, edx; + // This is xgetbv directly, so we can avoid compilers warning we need runtime checks. + asm(".byte 0x0f, 0x01, 0xd0" : "=a"(eax), "=d"(edx) : "c"(index)); + return ((uint64_t)edx << 32) | eax; +} +#else +#define do_xgetbv _xgetbv +#endif + #else // _WIN32 #ifdef _M_SSE #include -#define _XCR_XFEATURE_ENABLED_MASK 0 -static unsigned long long _xgetbv(unsigned int index) -{ +static uint64_t do_xgetbv(unsigned int index) { unsigned int eax, edx; __asm__ __volatile__("xgetbv" : "=a"(eax), "=d"(edx) : "c"(index)); - return ((unsigned long long)edx << 32) | eax; + return ((uint64_t)edx << 32) | eax; } - -#else -#define _XCR_XFEATURE_ENABLED_MASK 0 #endif // _M_SSE #if !defined(MIPS) @@ -98,6 +104,9 @@ void do_cpuid(u32 regs[4], u32 cpuid_leaf) #endif // !win32 +#ifndef _XCR_XFEATURE_ENABLED_MASK +#define _XCR_XFEATURE_ENABLED_MASK 0 +#endif CPUInfo cpu_info; @@ -215,10 +224,8 @@ void CPUInfo::Detect() { // - Is the XSAVE bit set in CPUID? ( >>26) // - Is the OSXSAVE bit set in CPUID? ( >>27) // - XGETBV result has the XCR bit set. - if (((cpu_id[2] >> 28) & 1) && ((cpu_id[2] >> 27) & 1) && ((cpu_id[2] >> 26) & 1)) - { - if ((_xgetbv(_XCR_XFEATURE_ENABLED_MASK) & 0x6) == 0x6) - { + if (((cpu_id[2] >> 28) & 1) && ((cpu_id[2] >> 27) & 1) && ((cpu_id[2] >> 26) & 1)) { + if ((do_xgetbv(_XCR_XFEATURE_ENABLED_MASK) & 0x6) == 0x6) { bAVX = true; if ((cpu_id[2] >> 12) & 1) bFMA3 = true; From 0ffac20fcdac4eb83b427ba86c6be11952880293 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 14 Feb 2021 09:49:14 -0800 Subject: [PATCH 04/10] Common: Include unistd.h before ctime on mingw. This is required for localtime_r and similar to be available. --- Common/File/FileUtil.cpp | 6 ++++++ Common/TimeUtil.cpp | 2 +- Core/Dialog/PSPSaveDialog.cpp | 3 +++ Core/FileSystems/DirectoryFileSystem.cpp | 7 +++++++ Core/FileSystems/VirtualDiscFileSystem.cpp | 6 ++++++ Core/HLE/sceUsbGps.cpp | 3 +++ Core/Replay.cpp | 7 +++++++ 7 files changed, 33 insertions(+), 1 deletion(-) diff --git a/Common/File/FileUtil.cpp b/Common/File/FileUtil.cpp index d7a09d3069..03cc5a649a 100644 --- a/Common/File/FileUtil.cpp +++ b/Common/File/FileUtil.cpp @@ -24,6 +24,12 @@ #include "ppsspp_config.h" +#ifdef __MINGW32__ +#include +#ifndef _POSIX_THREAD_SAFE_FUNCTIONS +#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L +#endif +#endif #include #include #include diff --git a/Common/TimeUtil.cpp b/Common/TimeUtil.cpp index 8f0ce379ed..08f48e742a 100644 --- a/Common/TimeUtil.cpp +++ b/Common/TimeUtil.cpp @@ -1,6 +1,5 @@ #include #include -#include #include "ppsspp_config.h" @@ -18,6 +17,7 @@ #include #include #endif +#include static double curtime = 0; diff --git a/Core/Dialog/PSPSaveDialog.cpp b/Core/Dialog/PSPSaveDialog.cpp index 99fc0bd39b..0253db8283 100755 --- a/Core/Dialog/PSPSaveDialog.cpp +++ b/Core/Dialog/PSPSaveDialog.cpp @@ -16,8 +16,11 @@ // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. #ifdef __MINGW32__ +#include +#ifndef _POSIX_THREAD_SAFE_FUNCTIONS #define _POSIX_THREAD_SAFE_FUNCTIONS 200112L #endif +#endif #include #include diff --git a/Core/FileSystems/DirectoryFileSystem.cpp b/Core/FileSystems/DirectoryFileSystem.cpp index b73634ca35..1cbd075b97 100644 --- a/Core/FileSystems/DirectoryFileSystem.cpp +++ b/Core/FileSystems/DirectoryFileSystem.cpp @@ -17,6 +17,13 @@ #include "ppsspp_config.h" +#ifdef __MINGW32__ +#include +#ifndef _POSIX_THREAD_SAFE_FUNCTIONS +#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L +#endif +#endif + #include #include #include diff --git a/Core/FileSystems/VirtualDiscFileSystem.cpp b/Core/FileSystems/VirtualDiscFileSystem.cpp index 63e78fcbf1..4c1f5c324c 100644 --- a/Core/FileSystems/VirtualDiscFileSystem.cpp +++ b/Core/FileSystems/VirtualDiscFileSystem.cpp @@ -16,6 +16,12 @@ // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. #include "ppsspp_config.h" +#ifdef __MINGW32__ +#include +#ifndef _POSIX_THREAD_SAFE_FUNCTIONS +#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L +#endif +#endif #include #include "Common/File/FileUtil.h" diff --git a/Core/HLE/sceUsbGps.cpp b/Core/HLE/sceUsbGps.cpp index 456d09b487..2c9f320044 100644 --- a/Core/HLE/sceUsbGps.cpp +++ b/Core/HLE/sceUsbGps.cpp @@ -15,6 +15,9 @@ // Official git repository and contact information can be found at // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. +#ifdef __MINGW32__ +#include +#endif #include #include "Common/System/System.h" diff --git a/Core/Replay.cpp b/Core/Replay.cpp index fb03eeea4a..eaf1d5a959 100644 --- a/Core/Replay.cpp +++ b/Core/Replay.cpp @@ -15,6 +15,13 @@ // Official git repository and contact information can be found at // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. +#ifdef __MINGW32__ +#include +#ifndef _POSIX_THREAD_SAFE_FUNCTIONS +#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L +#endif +#endif + #include #include #include From 6247e4d0ee1abb893ff4fe2fbd66425572bf5481 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 14 Feb 2021 09:53:05 -0800 Subject: [PATCH 05/10] Windows: Add some missing override specifiers. --- Common/GPU/D3D11/thin3d_d3d11.cpp | 4 ++-- Common/GPU/D3D9/thin3d_d3d9.cpp | 2 +- GPU/Directx9/FramebufferManagerDX9.h | 4 ++-- Windows/GPU/WindowsVulkanContext.h | 2 +- Windows/WASAPIStream.cpp | 10 +++++----- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Common/GPU/D3D11/thin3d_d3d11.cpp b/Common/GPU/D3D11/thin3d_d3d11.cpp index 385c83ebbf..5c2fcd34cb 100644 --- a/Common/GPU/D3D11/thin3d_d3d11.cpp +++ b/Common/GPU/D3D11/thin3d_d3d11.cpp @@ -68,7 +68,7 @@ public: void CopyFramebufferImage(Framebuffer *src, int level, int x, int y, int z, Framebuffer *dst, int dstLevel, int dstX, int dstY, int dstZ, int width, int height, int depth, int channelBits, const char *tag) override; bool BlitFramebuffer(Framebuffer *src, int srcX1, int srcY1, int srcX2, int srcY2, Framebuffer *dst, int dstX1, int dstY1, int dstX2, int dstY2, int channelBits, FBBlitFilter filter, const char *tag) override; - bool CopyFramebufferToMemorySync(Framebuffer *src, int channelBits, int x, int y, int w, int h, Draw::DataFormat format, void *pixels, int pixelStride, const char *tag); + bool CopyFramebufferToMemorySync(Framebuffer *src, int channelBits, int x, int y, int w, int h, Draw::DataFormat format, void *pixels, int pixelStride, const char *tag) override; // These functions should be self explanatory. void BindFramebufferAsRenderTarget(Framebuffer *fbo, const RenderPassInfo &rp, const char *tag) override; @@ -110,7 +110,7 @@ public: void Draw(int vertexCount, int offset) override; void DrawIndexed(int vertexCount, int offset) override; void DrawUP(const void *vdata, int vertexCount) override; - void Clear(int mask, uint32_t colorval, float depthVal, int stencilVal); + void Clear(int mask, uint32_t colorval, float depthVal, int stencilVal) override; void BeginFrame() override; diff --git a/Common/GPU/D3D9/thin3d_d3d9.cpp b/Common/GPU/D3D9/thin3d_d3d9.cpp index 83a1ca2bdf..afd920535d 100644 --- a/Common/GPU/D3D9/thin3d_d3d9.cpp +++ b/Common/GPU/D3D9/thin3d_d3d9.cpp @@ -564,7 +564,7 @@ public: void Draw(int vertexCount, int offset) override; void DrawIndexed(int vertexCount, int offset) override; void DrawUP(const void *vdata, int vertexCount) override; - void Clear(int mask, uint32_t colorval, float depthVal, int stencilVal); + void Clear(int mask, uint32_t colorval, float depthVal, int stencilVal) override; uint64_t GetNativeObject(NativeObject obj) override { switch (obj) { diff --git a/GPU/Directx9/FramebufferManagerDX9.h b/GPU/Directx9/FramebufferManagerDX9.h index 385caf47c0..897e3e2aa9 100644 --- a/GPU/Directx9/FramebufferManagerDX9.h +++ b/GPU/Directx9/FramebufferManagerDX9.h @@ -44,13 +44,13 @@ public: void SetDrawEngine(DrawEngineDX9 *td); void DrawActiveTexture(float x, float y, float w, float h, float destW, float destH, float u0, float v0, float u1, float v1, int uvRotation, int flags) override; - void DestroyAllFBOs(); + void DestroyAllFBOs() override; void EndFrame(); virtual bool NotifyStencilUpload(u32 addr, int size, StencilUpload flags = StencilUpload::NEEDS_CLEAR) override; - bool GetFramebuffer(u32 fb_address, int fb_stride, GEBufferFormat format, GPUDebugBuffer &buffer, int maxRes); + bool GetFramebuffer(u32 fb_address, int fb_stride, GEBufferFormat format, GPUDebugBuffer &buffer, int maxRes) override; bool GetDepthbuffer(u32 fb_address, int fb_stride, u32 z_address, int z_stride, GPUDebugBuffer &buffer) override; bool GetStencilbuffer(u32 fb_address, int fb_stride, GPUDebugBuffer &buffer) override; bool GetOutputFramebuffer(GPUDebugBuffer &buffer) override; diff --git a/Windows/GPU/WindowsVulkanContext.h b/Windows/GPU/WindowsVulkanContext.h index 098d737e98..49e6613e3e 100644 --- a/Windows/GPU/WindowsVulkanContext.h +++ b/Windows/GPU/WindowsVulkanContext.h @@ -34,7 +34,7 @@ public: void Resize() override; void Poll() override; - void *GetAPIContext(); + void *GetAPIContext() override; Draw::DrawContext *GetDrawContext() override { return draw_; } private: diff --git a/Windows/WASAPIStream.cpp b/Windows/WASAPIStream.cpp index 9e11d558c5..a529dcf771 100644 --- a/Windows/WASAPIStream.cpp +++ b/Windows/WASAPIStream.cpp @@ -86,7 +86,7 @@ public: // Callback methods for device-event notifications. - HRESULT STDMETHODCALLTYPE OnDefaultDeviceChanged(EDataFlow flow, ERole role, LPCWSTR pwstrDeviceId) { + HRESULT STDMETHODCALLTYPE OnDefaultDeviceChanged(EDataFlow flow, ERole role, LPCWSTR pwstrDeviceId) override { std::lock_guard guard(lock_); if (flow != eRender || role != eMultimedia) { @@ -109,22 +109,22 @@ public: return S_OK; } - HRESULT STDMETHODCALLTYPE OnDeviceAdded(LPCWSTR pwstrDeviceId) { + HRESULT STDMETHODCALLTYPE OnDeviceAdded(LPCWSTR pwstrDeviceId) override { // Ignore. return S_OK; }; - HRESULT STDMETHODCALLTYPE OnDeviceRemoved(LPCWSTR pwstrDeviceId) { + HRESULT STDMETHODCALLTYPE OnDeviceRemoved(LPCWSTR pwstrDeviceId) override { // Ignore. return S_OK; } - HRESULT STDMETHODCALLTYPE OnDeviceStateChanged(LPCWSTR pwstrDeviceId, DWORD dwNewState) { + HRESULT STDMETHODCALLTYPE OnDeviceStateChanged(LPCWSTR pwstrDeviceId, DWORD dwNewState) override { // Ignore. return S_OK; } - HRESULT STDMETHODCALLTYPE OnPropertyValueChanged(LPCWSTR pwstrDeviceId, const PROPERTYKEY key) { + HRESULT STDMETHODCALLTYPE OnPropertyValueChanged(LPCWSTR pwstrDeviceId, const PROPERTYKEY key) override { INFO_LOG(SCEAUDIO, "Changed audio device property " "{%8.8x-%4.4x-%4.4x-%2.2x%2.2x-%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x}#%d", key.fmtid.Data1, key.fmtid.Data2, key.fmtid.Data3, From da2e7227942b743407febe37cfcd4fd897922fe3 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 14 Feb 2021 09:59:04 -0800 Subject: [PATCH 06/10] Windows: Fix some format warnings. --- Common/File/FileUtil.cpp | 4 ++-- Core/FileSystems/DirectoryFileSystem.cpp | 2 +- Core/FileSystems/VirtualDiscFileSystem.cpp | 4 ++-- Core/Instance.cpp | 4 ++-- GPU/D3D11/TextureCacheD3D11.cpp | 2 +- GPU/Directx9/FramebufferManagerDX9.cpp | 6 +++--- GPU/Directx9/StencilBufferDX9.cpp | 2 +- GPU/Directx9/TextureCacheDX9.cpp | 2 +- Windows/EmuThread.cpp | 2 +- Windows/GEDebugger/SimpleGLWindow.cpp | 2 +- Windows/GPU/D3D9Context.cpp | 2 +- Windows/WASAPIStream.cpp | 4 ++-- 12 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Common/File/FileUtil.cpp b/Common/File/FileUtil.cpp index 03cc5a649a..2cef9f29f4 100644 --- a/Common/File/FileUtil.cpp +++ b/Common/File/FileUtil.cpp @@ -245,7 +245,7 @@ bool IsDirectory(const std::string &filename) std::wstring copy = ConvertUTF8ToWString(fn); WIN32_FILE_ATTRIBUTE_DATA data{}; if (!GetFileAttributesEx(copy.c_str(), GetFileExInfoStandard, &data) || data.dwFileAttributes == INVALID_FILE_ATTRIBUTES) { - WARN_LOG(COMMON, "GetFileAttributes failed on %s: %08x", fn.c_str(), GetLastError()); + WARN_LOG(COMMON, "GetFileAttributes failed on %s: %08x", fn.c_str(), (uint32_t)GetLastError()); return false; } DWORD result = data.dwFileAttributes; @@ -311,7 +311,7 @@ bool CreateDir(const std::string &path) WARN_LOG(COMMON, "CreateDir: CreateDirectory failed on %s: already exists", path.c_str()); return true; } - ERROR_LOG(COMMON, "CreateDir: CreateDirectory failed on %s: %i", path.c_str(), error); + ERROR_LOG(COMMON, "CreateDir: CreateDirectory failed on %s: %08x", path.c_str(), (uint32_t)error); return false; #else if (mkdir(fn.c_str(), 0755) == 0) diff --git a/Core/FileSystems/DirectoryFileSystem.cpp b/Core/FileSystems/DirectoryFileSystem.cpp index 1cbd075b97..8c559f46b3 100644 --- a/Core/FileSystems/DirectoryFileSystem.cpp +++ b/Core/FileSystems/DirectoryFileSystem.cpp @@ -630,7 +630,7 @@ int DirectoryFileSystem::OpenFile(std::string filename, FileAccess access, const err = ReplayApplyDisk(ReplayAction::FILE_OPEN, err, CoreTiming::GetGlobalTimeUs()); if (err != 0) { #ifdef _WIN32 - ERROR_LOG(FILESYS, "DirectoryFileSystem::OpenFile: FAILED, %i - access = %i", GetLastError(), (int)access); + ERROR_LOG(FILESYS, "DirectoryFileSystem::OpenFile: FAILED, %i - access = %i", (int)GetLastError(), (int)access); #else ERROR_LOG(FILESYS, "DirectoryFileSystem::OpenFile: FAILED, %i - access = %i", errno, (int)access); #endif diff --git a/Core/FileSystems/VirtualDiscFileSystem.cpp b/Core/FileSystems/VirtualDiscFileSystem.cpp index 4c1f5c324c..0805688d88 100644 --- a/Core/FileSystems/VirtualDiscFileSystem.cpp +++ b/Core/FileSystems/VirtualDiscFileSystem.cpp @@ -372,7 +372,7 @@ int VirtualDiscFileSystem::OpenFile(std::string filename, FileAccess access, con if (!success) { #ifdef _WIN32 - ERROR_LOG(FILESYS, "VirtualDiscFileSystem::OpenFile: FAILED, %i", GetLastError()); + ERROR_LOG(FILESYS, "VirtualDiscFileSystem::OpenFile: FAILED, %i", (int)GetLastError()); #else ERROR_LOG(FILESYS, "VirtualDiscFileSystem::OpenFile: FAILED"); #endif @@ -398,7 +398,7 @@ int VirtualDiscFileSystem::OpenFile(std::string filename, FileAccess access, con if (!success) { #ifdef _WIN32 - ERROR_LOG(FILESYS, "VirtualDiscFileSystem::OpenFile: FAILED, %i - access = %i", GetLastError(), (int)access); + ERROR_LOG(FILESYS, "VirtualDiscFileSystem::OpenFile: FAILED, %i - access = %i", (int)GetLastError(), (int)access); #else ERROR_LOG(FILESYS, "VirtualDiscFileSystem::OpenFile: FAILED, access = %i", (int)access); #endif diff --git a/Core/Instance.cpp b/Core/Instance.cpp index 43536418e3..355edb4a5b 100644 --- a/Core/Instance.cpp +++ b/Core/Instance.cpp @@ -64,7 +64,7 @@ static bool UpdateInstanceCounter(void (*callback)(volatile InstanceInfo *)) { sizeof(InstanceInfo)); if (!buf) { - ERROR_LOG(SCENET, "Could not map view of file %s (%d).", ID_SHM_NAME, GetLastError()); + ERROR_LOG(SCENET, "Could not map view of file %s (%08x)", ID_SHM_NAME, (uint32_t)GetLastError()); return false; } @@ -136,7 +136,7 @@ void InitInstanceCounter() { DWORD lasterr = GetLastError(); if (!hIDMapFile) { - ERROR_LOG(SCENET, "Could not create %s file mapping object (%d).", ID_SHM_NAME, lasterr); + ERROR_LOG(SCENET, "Could not create %s file mapping object (%08x)", ID_SHM_NAME, (uint32_t)lasterr); PPSSPP_ID = 1; return; } diff --git a/GPU/D3D11/TextureCacheD3D11.cpp b/GPU/D3D11/TextureCacheD3D11.cpp index 8e4aadfc0a..ab9d708409 100644 --- a/GPU/D3D11/TextureCacheD3D11.cpp +++ b/GPU/D3D11/TextureCacheD3D11.cpp @@ -697,7 +697,7 @@ void TextureCacheD3D11::LoadTextureLevel(TexCacheEntry &entry, ReplacedTexture & size_t bufSize = sizeof(u32) * (mapRowPitch / bpp) * h; mapData = (u32 *)AllocateAlignedMemory(bufSize, 16); if (!mapData) { - ERROR_LOG(G3D, "Ran out of RAM trying to allocate a temporary texture upload buffer (alloc size: %d, %dx%d)", bufSize, mapRowPitch / sizeof(u32), h); + ERROR_LOG(G3D, "Ran out of RAM trying to allocate a temporary texture upload buffer (alloc size: %lld, %dx%d)", (unsigned long long)bufSize, mapRowPitch / (int)sizeof(u32), h); return; } pixelData = (u32 *)mapData; diff --git a/GPU/Directx9/FramebufferManagerDX9.cpp b/GPU/Directx9/FramebufferManagerDX9.cpp index f47678456c..dce162f49d 100644 --- a/GPU/Directx9/FramebufferManagerDX9.cpp +++ b/GPU/Directx9/FramebufferManagerDX9.cpp @@ -213,7 +213,7 @@ static const D3DVERTEXELEMENT9 g_FramebufferVertexElements[] = { dxstate.stencilMask.set(0xFF); HRESULT hr = device_->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, 2, coord, 5 * sizeof(float)); if (FAILED(hr)) { - ERROR_LOG_REPORT(G3D, "DrawActiveTexture() failed: %08x", hr); + ERROR_LOG_REPORT(G3D, "DrawActiveTexture() failed: %08x", (uint32_t)hr); } } @@ -377,7 +377,7 @@ static const D3DVERTEXELEMENT9 g_FramebufferVertexElements[] = { ConvertFromBGRA8888(Memory::GetPointer(fb_address + dstByteOffset), (u8 *)locked.pBits, vfb->fb_stride, locked.Pitch / 4, w, h, vfb->format); offscreen->UnlockRect(); } else { - ERROR_LOG_REPORT(G3D, "Unable to lock rect from %08x: %d,%d %dx%d of %dx%d", fb_address, rect.left, rect.top, rect.right, rect.bottom, vfb->renderWidth, vfb->renderHeight); + ERROR_LOG_REPORT(G3D, "Unable to lock rect from %08x: %d,%d %dx%d of %dx%d", fb_address, (int)rect.left, (int)rect.top, (int)rect.right, (int)rect.bottom, vfb->renderWidth, vfb->renderHeight); } } else { ERROR_LOG_REPORT(G3D, "Unable to download render target data from %08x", fb_address); @@ -428,7 +428,7 @@ static const D3DVERTEXELEMENT9 g_FramebufferVertexElements[] = { tex->UnlockRect(0); } else { - ERROR_LOG_REPORT(G3D, "Unable to lock rect from depth %08x: %d,%d %dx%d of %dx%d", vfb->fb_address, rect.left, rect.top, rect.right, rect.bottom, vfb->renderWidth, vfb->renderHeight); + ERROR_LOG_REPORT(G3D, "Unable to lock rect from depth %08x: %d,%d %dx%d of %dx%d", vfb->fb_address, (int)rect.left, (int)rect.top, (int)rect.right, (int)rect.bottom, vfb->renderWidth, vfb->renderHeight); } } else { ERROR_LOG_REPORT(G3D, "Unable to download render target depth from %08x", vfb->fb_address); diff --git a/GPU/Directx9/StencilBufferDX9.cpp b/GPU/Directx9/StencilBufferDX9.cpp index d8e740836b..5da225ae2c 100644 --- a/GPU/Directx9/StencilBufferDX9.cpp +++ b/GPU/Directx9/StencilBufferDX9.cpp @@ -244,7 +244,7 @@ bool FramebufferManagerDX9::NotifyStencilUpload(u32 addr, int size, StencilUploa } HRESULT hr = device_->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, coord, 5 * sizeof(float)); if (FAILED(hr)) { - ERROR_LOG_REPORT(G3D, "Failed to draw stencil bit %x: %08x", i, hr); + ERROR_LOG_REPORT(G3D, "Failed to draw stencil bit %x: %08x", i, (uint32_t)hr); } } diff --git a/GPU/Directx9/TextureCacheDX9.cpp b/GPU/Directx9/TextureCacheDX9.cpp index 9cfb36935e..3f19241382 100644 --- a/GPU/Directx9/TextureCacheDX9.cpp +++ b/GPU/Directx9/TextureCacheDX9.cpp @@ -315,7 +315,7 @@ public: device_->SetViewport(&vp); HRESULT hr = device_->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, verts_, (3 + 2) * sizeof(float)); if (FAILED(hr)) { - ERROR_LOG_REPORT(G3D, "Depal render failed: %08x", hr); + ERROR_LOG_REPORT(G3D, "Depal render failed: %08x", (uint32_t)hr); } dxstate.Restore(); diff --git a/Windows/EmuThread.cpp b/Windows/EmuThread.cpp index 120130161e..7cf7c7170e 100644 --- a/Windows/EmuThread.cpp +++ b/Windows/EmuThread.cpp @@ -202,7 +202,7 @@ void MainThreadFunc() { std::string full_error = StringFromFormat("%s\n\n%s", genericError, error_string.c_str()); std::wstring title = ConvertUTF8ToWString(err->T("GenericGraphicsError", "Graphics Error")); bool yes = IDYES == MessageBox(0, ConvertUTF8ToWString(full_error).c_str(), title.c_str(), MB_ICONERROR | MB_YESNO); - ERROR_LOG(BOOT, full_error.c_str()); + ERROR_LOG(BOOT, "%s", full_error.c_str()); if (yes) { // Change the config to the alternative and restart. diff --git a/Windows/GEDebugger/SimpleGLWindow.cpp b/Windows/GEDebugger/SimpleGLWindow.cpp index 37e6b7bd28..f27cfeadc8 100644 --- a/Windows/GEDebugger/SimpleGLWindow.cpp +++ b/Windows/GEDebugger/SimpleGLWindow.cpp @@ -109,7 +109,7 @@ void SimpleGLWindow::SetupGL() { pfd.cDepthBits = 16; pfd.iLayerType = PFD_MAIN_PLANE; -#define ENFORCE(x, msg) { if (!(x)) { ERROR_LOG(COMMON, "SimpleGLWindow: %s (%08x)", msg, GetLastError()); return; } } +#define ENFORCE(x, msg) { if (!(x)) { ERROR_LOG(COMMON, "SimpleGLWindow: %s (%08x)", msg, (uint32_t)GetLastError()); return; } } ENFORCE(hDC_ = GetDC(hWnd_), "Unable to create DC."); ENFORCE(pixelFormat = ChoosePixelFormat(hDC_, &pfd), "Unable to match pixel format."); diff --git a/Windows/GPU/D3D9Context.cpp b/Windows/GPU/D3D9Context.cpp index 0ccfa8364c..67e472d0b9 100644 --- a/Windows/GPU/D3D9Context.cpp +++ b/Windows/GPU/D3D9Context.cpp @@ -108,7 +108,7 @@ bool D3D9Context::Init(HINSTANCE hInst, HWND wnd, std::string *error_message) { } if (FAILED(d3d_->GetDeviceCaps(adapterId_, D3DDEVTYPE_HAL, &d3dCaps))) { - *error_message = "GetDeviceCaps failed (???)"; + *error_message = "GetDeviceCaps failed (?)"; d3d_->Release(); return false; } diff --git a/Windows/WASAPIStream.cpp b/Windows/WASAPIStream.cpp index a529dcf771..2bf597761d 100644 --- a/Windows/WASAPIStream.cpp +++ b/Windows/WASAPIStream.cpp @@ -127,12 +127,12 @@ public: HRESULT STDMETHODCALLTYPE OnPropertyValueChanged(LPCWSTR pwstrDeviceId, const PROPERTYKEY key) override { INFO_LOG(SCEAUDIO, "Changed audio device property " "{%8.8x-%4.4x-%4.4x-%2.2x%2.2x-%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x}#%d", - key.fmtid.Data1, key.fmtid.Data2, key.fmtid.Data3, + (uint32_t)key.fmtid.Data1, key.fmtid.Data2, key.fmtid.Data3, key.fmtid.Data4[0], key.fmtid.Data4[1], key.fmtid.Data4[2], key.fmtid.Data4[3], key.fmtid.Data4[4], key.fmtid.Data4[5], key.fmtid.Data4[6], key.fmtid.Data4[7], - key.pid); + (int)key.pid); return S_OK; } From 9d22297a9000134ab163ed101dff9271b079f79e Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 14 Feb 2021 10:02:28 -0800 Subject: [PATCH 07/10] Windows: Use CommonWindows more consistently. Also, make sure WinSock2.h is included beforehand where it's needed. --- Common/GPU/thin3d_create.h | 6 +----- Core/FileSystems/DirectoryFileSystem.cpp | 1 + Core/HLE/proAdhoc.cpp | 1 + Core/HLE/proAdhocServer.cpp | 1 + Core/HLE/sceNetAdhoc.cpp | 1 + Core/HLE/sceUsbCam.cpp | 4 +--- Core/HLE/sceUsbMic.cpp | 2 +- Windows/WindowsHost.cpp | 2 +- 8 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Common/GPU/thin3d_create.h b/Common/GPU/thin3d_create.h index 6df80731eb..702e7f45c2 100644 --- a/Common/GPU/thin3d_create.h +++ b/Common/GPU/thin3d_create.h @@ -7,11 +7,7 @@ // Separated this stuff into its own file so we don't get Windows.h included if all we want is the thin3d declarations. #ifdef _WIN32 -#ifndef NOMINMAX -#define NOMINMAX -#endif -#define WIN32_LEAN_AND_MEAN -#include +#include "Common/CommonWindows.h" #include struct IDirect3DDevice9; struct IDirect3D9; diff --git a/Core/FileSystems/DirectoryFileSystem.cpp b/Core/FileSystems/DirectoryFileSystem.cpp index 8c559f46b3..a2ca786dfa 100644 --- a/Core/FileSystems/DirectoryFileSystem.cpp +++ b/Core/FileSystems/DirectoryFileSystem.cpp @@ -49,6 +49,7 @@ #ifdef _WIN32 #include "Common/CommonWindows.h" #include +#undef FILE_OPEN #else #include #include diff --git a/Core/HLE/proAdhoc.cpp b/Core/HLE/proAdhoc.cpp index dda1f66143..cada3c4b11 100644 --- a/Core/HLE/proAdhoc.cpp +++ b/Core/HLE/proAdhoc.cpp @@ -22,6 +22,7 @@ // All credit goes to him! #if defined(_WIN32) +#include #include "Common/CommonWindows.h" #endif diff --git a/Core/HLE/proAdhocServer.cpp b/Core/HLE/proAdhocServer.cpp index 02dd1ee323..0bc53a02e7 100644 --- a/Core/HLE/proAdhocServer.cpp +++ b/Core/HLE/proAdhocServer.cpp @@ -33,6 +33,7 @@ #include // Net stuff #if defined(_WIN32) +#include #include #else #include diff --git a/Core/HLE/sceNetAdhoc.cpp b/Core/HLE/sceNetAdhoc.cpp index cb0537b80a..5bd9b4357f 100644 --- a/Core/HLE/sceNetAdhoc.cpp +++ b/Core/HLE/sceNetAdhoc.cpp @@ -16,6 +16,7 @@ // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. #if defined(_WIN32) +#include #include "Common/CommonWindows.h" #endif diff --git a/Core/HLE/sceUsbCam.cpp b/Core/HLE/sceUsbCam.cpp index 3882e140fb..18417bb9c2 100644 --- a/Core/HLE/sceUsbCam.cpp +++ b/Core/HLE/sceUsbCam.cpp @@ -34,9 +34,7 @@ #endif #ifdef HAVE_WIN32_CAMERA -#ifndef NOMINMAX -#define NOMINMAX -#endif +#include "Common/CommonWindows.h" #include "Windows/CaptureDevice.h" #endif diff --git a/Core/HLE/sceUsbMic.cpp b/Core/HLE/sceUsbMic.cpp index 086b968f45..59a5bf74af 100644 --- a/Core/HLE/sceUsbMic.cpp +++ b/Core/HLE/sceUsbMic.cpp @@ -33,7 +33,7 @@ #endif #ifdef HAVE_WIN32_MICROPHONE -#define NOMINMAX +#include "Common/CommonWindows.h" #include "Windows/CaptureDevice.h" #endif diff --git a/Windows/WindowsHost.cpp b/Windows/WindowsHost.cpp index 5a14a45380..8ef757e4b1 100644 --- a/Windows/WindowsHost.cpp +++ b/Windows/WindowsHost.cpp @@ -20,7 +20,7 @@ #include // For shell links -#include "windows.h" +#include "Common/CommonWindows.h" #include "winnls.h" #include "shobjidl.h" #include "objbase.h" From abfeacef610713f218e71e1a3733d4c089b5618a Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 14 Feb 2021 10:14:23 -0800 Subject: [PATCH 08/10] GPU: Fix a type comparison warning. --- GPU/Common/TextureCacheCommon.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GPU/Common/TextureCacheCommon.cpp b/GPU/Common/TextureCacheCommon.cpp index 91f54c06ff..6e2284f974 100644 --- a/GPU/Common/TextureCacheCommon.cpp +++ b/GPU/Common/TextureCacheCommon.cpp @@ -940,8 +940,8 @@ FramebufferMatchInfo TextureCacheCommon::MatchFramebuffer( } // This is either normal or we failed to generate a shader to depalettize - if (framebuffer->format == entry.format || matchingClutFormat) { - if (framebuffer->format != entry.format) { + if ((int)framebuffer->format == (int)entry.format || matchingClutFormat) { + if ((int)framebuffer->format != (int)entry.format) { WARN_LOG_ONCE(diffFormat2, G3D, "Texturing from framebuffer with different formats %s != %s at %08x", GeTextureFormatToString(entry.format), GeBufferFormatToString(framebuffer->format), fb_address); return fbInfo; From bfd86e4999a242edfe1ba61d415cdd038e54bba0 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 14 Feb 2021 10:15:51 -0800 Subject: [PATCH 09/10] Windows: Make InputDevice destructor virtual. --- Windows/InputDevice.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Windows/InputDevice.h b/Windows/InputDevice.h index 06d0ccd283..eaf6577214 100644 --- a/Windows/InputDevice.h +++ b/Windows/InputDevice.h @@ -24,6 +24,9 @@ class InputDevice { public: + virtual ~InputDevice() { + } + enum { UPDATESTATE_SKIP_PAD = 0x1234}; virtual int UpdateState() = 0; From 47b33846475d05e8f8828674ba40d5afc92647b0 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 14 Feb 2021 10:23:18 -0800 Subject: [PATCH 10/10] Windows: Fix some const type conversion warnings. --- Windows/Debugger/Debugger_VFPUDlg.cpp | 12 ++++++------ Windows/GEDebugger/CtrlDisplayListView.cpp | 6 +++--- Windows/GEDebugger/CtrlDisplayListView.h | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Windows/Debugger/Debugger_VFPUDlg.cpp b/Windows/Debugger/Debugger_VFPUDlg.cpp index 8851afd62e..5075e61731 100644 --- a/Windows/Debugger/Debugger_VFPUDlg.cpp +++ b/Windows/Debugger/Debugger_VFPUDlg.cpp @@ -32,23 +32,23 @@ CVFPUDlg::CVFPUDlg(HINSTANCE _hInstance, HWND _hParent, DebugInterface *cpu_) : ZeroMemory (&tcItem,sizeof (tcItem)); tcItem.mask = TCIF_TEXT; tcItem.dwState = 0; - tcItem.pszText = L"Float"; + tcItem.pszText = (LPTSTR)L"Float"; tcItem.cchTextMax = (int)wcslen(tcItem.pszText)+1; tcItem.iImage = 0; TabCtrl_InsertItem(tabs, TabCtrl_GetItemCount(tabs),&tcItem); - tcItem.pszText = L"HalfFloat"; + tcItem.pszText = (LPTSTR)L"HalfFloat"; tcItem.cchTextMax = (int)wcslen(tcItem.pszText)+1; TabCtrl_InsertItem(tabs, TabCtrl_GetItemCount(tabs),&tcItem); - tcItem.pszText = L"Hex"; + tcItem.pszText = (LPTSTR)L"Hex"; tcItem.cchTextMax = (int)wcslen(tcItem.pszText)+1; TabCtrl_InsertItem(tabs, TabCtrl_GetItemCount(tabs),&tcItem); - tcItem.pszText = L"Bytes"; + tcItem.pszText = (LPTSTR)L"Bytes"; tcItem.cchTextMax = (int)wcslen(tcItem.pszText)+1; TabCtrl_InsertItem(tabs, TabCtrl_GetItemCount(tabs),&tcItem); - tcItem.pszText = L"Shorts"; + tcItem.pszText = (LPTSTR)L"Shorts"; tcItem.cchTextMax = (int)wcslen(tcItem.pszText)+1; TabCtrl_InsertItem(tabs, TabCtrl_GetItemCount(tabs),&tcItem); - tcItem.pszText = L"Ints"; + tcItem.pszText = (LPTSTR)L"Ints"; tcItem.cchTextMax = (int)wcslen(tcItem.pszText)+1; TabCtrl_InsertItem(tabs, TabCtrl_GetItemCount(tabs),&tcItem); mode=0; diff --git a/Windows/GEDebugger/CtrlDisplayListView.cpp b/Windows/GEDebugger/CtrlDisplayListView.cpp index 16f0769d3c..83b7f7bfb7 100644 --- a/Windows/GEDebugger/CtrlDisplayListView.cpp +++ b/Windows/GEDebugger/CtrlDisplayListView.cpp @@ -1,3 +1,5 @@ +#include +#include #include "Common/System/Display.h" #include "Windows/GEDebugger/CtrlDisplayListView.h" #include "Windows/GEDebugger/GEDebugger.h" @@ -7,9 +9,7 @@ #include "GPU/Debugger/Breakpoints.h" #include "GPU/GPUState.h" -#include - -const PTCHAR CtrlDisplayListView::windowClass = _T("CtrlDisplayListView"); +LPCTSTR CtrlDisplayListView::windowClass = _T("CtrlDisplayListView"); const int POPUP_SUBMENU_ID_DISPLAYLISTVIEW = 8; extern HMENU g_hPopupMenus; diff --git a/Windows/GEDebugger/CtrlDisplayListView.h b/Windows/GEDebugger/CtrlDisplayListView.h index 319d54ec20..fe605f799e 100644 --- a/Windows/GEDebugger/CtrlDisplayListView.h +++ b/Windows/GEDebugger/CtrlDisplayListView.h @@ -1,14 +1,14 @@ #pragma once +#include #include "Common/CommonWindows.h" #include "GPU/Common/GPUDebugInterface.h" -#include class CtrlDisplayListView { HWND wnd; RECT rect; - static const PTCHAR windowClass; + static LPCTSTR windowClass; DisplayList list; HFONT font; @@ -85,4 +85,4 @@ public: void scrollAddressIntoView(); bool curAddressIsVisible(); -}; \ No newline at end of file +};