From 47a65ce01ec48ad6f38468c201547bacec98d969 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Fri, 22 Dec 2023 21:17:46 +1000 Subject: [PATCH] Misc: Slim down PCH --- cmake/SearchForStuff.cmake | 2 +- common/vsprops/common.props | 2 +- pcsx2-qt/Debugger/CpuWidget.cpp | 7 +++-- pcsx2-qt/DisplayWidget.cpp | 1 + pcsx2-qt/GameList/GameListWidget.cpp | 1 + .../Settings/ControllerBindingWidgets.cpp | 1 + pcsx2-qt/Settings/MemoryCardConvertDialog.cpp | 1 + pcsx2-qt/Settings/MemoryCardConvertWorker.cpp | 1 + pcsx2/CDVD/BlockdumpFileReader.cpp | 2 ++ pcsx2/CDVD/CDVDcommon.cpp | 1 + pcsx2/CDVD/CDVDisoReader.cpp | 1 + pcsx2/CDVD/ChdFileReader.cpp | 1 + pcsx2/CDVD/CsoFileReader.cpp | 1 + pcsx2/CDVD/GzippedFileReader.cpp | 1 + pcsx2/CDVD/InputIsoFile.cpp | 1 + pcsx2/CDVD/IsoReader.cpp | 1 + pcsx2/CDVD/OutputIsoFile.cpp | 1 + pcsx2/DEV9/ATA/HddCreate.cpp | 4 ++- pcsx2/DEV9/AdapterUtils.cpp | 13 ++++---- pcsx2/DEV9/InternalServers/DNS_Logger.cpp | 2 ++ pcsx2/DEV9/PacketReader/IP/IP_Packet.cpp | 2 ++ pcsx2/DEV9/PacketReader/IP/TCP/TCP_Packet.cpp | 2 ++ .../PacketReader/IP/UDP/DHCP/DHCP_Options.cpp | 2 ++ .../PacketReader/IP/UDP/DHCP/DHCP_Packet.cpp | 2 ++ pcsx2/DEV9/PacketReader/IP/UDP/UDP_Packet.cpp | 2 ++ .../Sessions/UDP_Session/UDP_FixedPort.cpp | 1 + .../DEV9/Sessions/UDP_Session/UDP_Session.cpp | 1 + pcsx2/DebugTools/DebugInterface.cpp | 18 +++++------ pcsx2/DebugTools/SymbolMap.cpp | 21 ++++++------- pcsx2/FW.cpp | 11 +++---- pcsx2/GS/GSCapture.cpp | 5 +++- pcsx2/GS/GSLzma.cpp | 1 + pcsx2/GS/GSState.cpp | 2 ++ pcsx2/GS/Renderers/Common/GSDevice.cpp | 1 + pcsx2/GS/Renderers/Common/GSTexture.cpp | 3 ++ pcsx2/GS/Renderers/Common/GSVertexTrace.cpp | 2 ++ pcsx2/GS/Renderers/DX11/GSTexture11.cpp | 1 + pcsx2/GS/Renderers/DX12/GSDevice12.cpp | 1 + pcsx2/GS/Renderers/DX12/GSTexture12.cpp | 1 + pcsx2/GS/Renderers/HW/GSRendererHW.cpp | 1 + pcsx2/GS/Renderers/HW/GSTextureCache.cpp | 2 ++ .../HW/GSTextureReplacementLoaders.cpp | 1 + .../GS/Renderers/HW/GSTextureReplacements.cpp | 1 + pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.cpp | 1 + pcsx2/GS/Renderers/OpenGL/GSTextureOGL.cpp | 1 + pcsx2/GS/Renderers/SW/GSDrawScanline.cpp | 2 ++ .../SW/GSDrawScanlineCodeGenerator.cpp | 3 ++ pcsx2/GS/Renderers/SW/GSRasterizer.cpp | 4 ++- pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp | 1 + pcsx2/GS/Renderers/Vulkan/GSTextureVK.cpp | 1 + pcsx2/GS/Renderers/Vulkan/VKBuilders.cpp | 1 + pcsx2/GameDatabase.cpp | 1 + pcsx2/ImGui/ImGuiFullscreen.cpp | 1 + pcsx2/Input/InputManager.cpp | 1 + pcsx2/MultipartFileReader.cpp | 1 + pcsx2/PINE.cpp | 2 +- pcsx2/PrecompiledHeader.h | 30 ++----------------- pcsx2/R3000AOpcodeTables.cpp | 2 ++ pcsx2/SIO/Memcard/MemoryCardFile.cpp | 1 + pcsx2/SIO/Memcard/MemoryCardFolder.cpp | 1 + pcsx2/SIO/Memcard/MemoryCardProtocol.cpp | 2 ++ pcsx2/SIO/Pad/Pad.cpp | 1 + pcsx2/SIO/Pad/PadGuitar.cpp | 2 ++ pcsx2/SPU2/Debug.cpp | 1 + pcsx2/SPU2/Reverb.cpp | 2 ++ pcsx2/SPU2/Wavedump_wav.cpp | 1 + pcsx2/SPU2/spu2sys.cpp | 2 ++ pcsx2/USB/USB.cpp | 1 + pcsx2/USB/qemu-usb/core.cpp | 2 ++ .../qemu-usb/input-keymap-qcode-to-qnum.cpp | 2 ++ pcsx2/USB/qemu-usb/usb-ohci.cpp | 2 ++ pcsx2/USB/usb-eyetoy/cam-windows.cpp | 1 + pcsx2/USB/usb-eyetoy/usb-eyetoy-webcam.cpp | 2 ++ pcsx2/USB/usb-hid/usb-hid.cpp | 2 ++ pcsx2/USB/usb-lightgun/guncon2.cpp | 1 + pcsx2/USB/usb-mic/usb-headset.cpp | 2 ++ pcsx2/USB/usb-mic/usb-mic-singstar.cpp | 3 ++ pcsx2/USB/usb-msd/usb-msd.cpp | 11 ++++--- pcsx2/USB/usb-pad/usb-pad-ff.cpp | 2 ++ pcsx2/USB/usb-pad/usb-pad.cpp | 2 ++ pcsx2/USB/usb-pad/usb-seamic.cpp | 2 ++ pcsx2/USB/usb-printer/usb-printer.cpp | 1 + pcsx2/VUops.cpp | 8 ++--- pcsx2/VUops.h | 20 ++++++------- pcsx2/x86/iR3000Atables.cpp | 2 ++ pcsx2/x86/ix86-32/iCore.cpp | 1 + pcsx2/x86/microVU.h | 8 ++--- pcsx2/x86/microVU_Macro.inl | 2 +- tests/ctest/core/GS/swizzle_test_main.cpp | 1 + 89 files changed, 177 insertions(+), 95 deletions(-) diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index 7aa695032c..f81fe46ffb 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -172,5 +172,5 @@ add_subdirectory(3rdparty/demangler EXCLUDE_FROM_ALL) # Deliberately at the end. We don't want to set the flag on third-party projects. if(MSVC) # Don't warn about "deprecated" POSIX functions. - add_definitions("-D_CRT_SECURE_NO_WARNINGS" "-DCRT_SECURE_NO_DEPRECATE") + add_definitions("-D_CRT_NONSTDC_NO_WARNINGS" "-D_CRT_SECURE_NO_WARNINGS" "-DCRT_SECURE_NO_DEPRECATE") endif() diff --git a/common/vsprops/common.props b/common/vsprops/common.props index d0a8e0489d..04e030d93c 100644 --- a/common/vsprops/common.props +++ b/common/vsprops/common.props @@ -23,7 +23,7 @@ true $(SolutionDir);$(ProjectDir);%(AdditionalIncludeDirectories) - __WIN32__;WIN32;_WINDOWS;WIN32_LEAN_AND_MEAN;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_WARNINGS;_HAS_EXCEPTIONS=0;WINVER=0x0A00;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) + __WIN32__;WIN32;_WINDOWS;WIN32_LEAN_AND_MEAN;NOMINMAX;_CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_WARNINGS;_HAS_EXCEPTIONS=0;WINVER=0x0A00;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions) PCSX2_DEBUG;PCSX2_DEVBUILD;_SECURE_SCL_=1;%(PreprocessorDefinitions) PCSX2_DEVEL;PCSX2_DEVBUILD;NDEBUG;_SECURE_SCL_=1;%(PreprocessorDefinitions) NDEBUG;_SECURE_SCL_=0;%(PreprocessorDefinitions) diff --git a/pcsx2-qt/Debugger/CpuWidget.cpp b/pcsx2-qt/Debugger/CpuWidget.cpp index 0bb8c7ce40..433e616521 100644 --- a/pcsx2-qt/Debugger/CpuWidget.cpp +++ b/pcsx2-qt/Debugger/CpuWidget.cpp @@ -28,14 +28,17 @@ #include "DebugTools/MipsStackWalk.h" #include "QtUtils.h" + +#include "common/Console.h" + +#include "demangler/demangler.h" + #include #include #include #include #include -#include "demangler/demangler.h" - using namespace QtUtils; using namespace MipsStackWalk; diff --git a/pcsx2-qt/DisplayWidget.cpp b/pcsx2-qt/DisplayWidget.cpp index 2ad8c09e7f..5582546966 100644 --- a/pcsx2-qt/DisplayWidget.cpp +++ b/pcsx2-qt/DisplayWidget.cpp @@ -23,6 +23,7 @@ #include "pcsx2/ImGui/ImGuiManager.h" #include "common/Assertions.h" +#include "common/Console.h" #include #include diff --git a/pcsx2-qt/GameList/GameListWidget.cpp b/pcsx2-qt/GameList/GameListWidget.cpp index 0ec940e959..461dcbe812 100644 --- a/pcsx2-qt/GameList/GameListWidget.cpp +++ b/pcsx2-qt/GameList/GameListWidget.cpp @@ -25,6 +25,7 @@ #include "pcsx2/Host.h" #include "common/Assertions.h" +#include "common/Console.h" #include "common/StringUtil.h" #include "fmt/format.h" diff --git a/pcsx2-qt/Settings/ControllerBindingWidgets.cpp b/pcsx2-qt/Settings/ControllerBindingWidgets.cpp index dc311b154a..c484f7a9db 100644 --- a/pcsx2-qt/Settings/ControllerBindingWidgets.cpp +++ b/pcsx2-qt/Settings/ControllerBindingWidgets.cpp @@ -23,6 +23,7 @@ #include #include "fmt/format.h" +#include "common/Console.h" #include "common/StringUtil.h" #include "pcsx2/Host.h" diff --git a/pcsx2-qt/Settings/MemoryCardConvertDialog.cpp b/pcsx2-qt/Settings/MemoryCardConvertDialog.cpp index 471f837427..e63ad7c9a5 100644 --- a/pcsx2-qt/Settings/MemoryCardConvertDialog.cpp +++ b/pcsx2-qt/Settings/MemoryCardConvertDialog.cpp @@ -21,6 +21,7 @@ #include #include +#include "common/Console.h" #include "common/Path.h" #include "common/StringUtil.h" diff --git a/pcsx2-qt/Settings/MemoryCardConvertWorker.cpp b/pcsx2-qt/Settings/MemoryCardConvertWorker.cpp index 546d29ce23..ee7a095a7b 100644 --- a/pcsx2-qt/Settings/MemoryCardConvertWorker.cpp +++ b/pcsx2-qt/Settings/MemoryCardConvertWorker.cpp @@ -3,6 +3,7 @@ #include "MemoryCardConvertWorker.h" +#include "common/Console.h" #include "common/Path.h" #include "common/FileSystem.h" diff --git a/pcsx2/CDVD/BlockdumpFileReader.cpp b/pcsx2/CDVD/BlockdumpFileReader.cpp index 4cce8ce9cb..56ab660780 100644 --- a/pcsx2/CDVD/BlockdumpFileReader.cpp +++ b/pcsx2/CDVD/BlockdumpFileReader.cpp @@ -16,7 +16,9 @@ #include "PrecompiledHeader.h" #include "AsyncFileReader.h" #include "IsoFileFormats.h" + #include "common/Assertions.h" +#include "common/Console.h" #include "common/FileSystem.h" #include "common/Error.h" diff --git a/pcsx2/CDVD/CDVDcommon.cpp b/pcsx2/CDVD/CDVDcommon.cpp index 1f3f96d878..f596932548 100644 --- a/pcsx2/CDVD/CDVDcommon.cpp +++ b/pcsx2/CDVD/CDVDcommon.cpp @@ -25,6 +25,7 @@ #include "IconsFontAwesome5.h" #include "common/Assertions.h" +#include "common/Console.h" #include "common/FileSystem.h" #include "common/Path.h" #include "common/StringUtil.h" diff --git a/pcsx2/CDVD/CDVDisoReader.cpp b/pcsx2/CDVD/CDVDisoReader.cpp index 56b6ca5309..793d5615cd 100644 --- a/pcsx2/CDVD/CDVDisoReader.cpp +++ b/pcsx2/CDVD/CDVDisoReader.cpp @@ -19,6 +19,7 @@ #include "CDVD/CDVD.h" #include "common/Assertions.h" +#include "common/Console.h" #include "common/Error.h" #include diff --git a/pcsx2/CDVD/ChdFileReader.cpp b/pcsx2/CDVD/ChdFileReader.cpp index 43c6c73084..7997e12b0f 100644 --- a/pcsx2/CDVD/ChdFileReader.cpp +++ b/pcsx2/CDVD/ChdFileReader.cpp @@ -17,6 +17,7 @@ #include "ChdFileReader.h" #include "common/Assertions.h" +#include "common/Console.h" #include "common/Error.h" #include "common/FileSystem.h" #include "common/Path.h" diff --git a/pcsx2/CDVD/CsoFileReader.cpp b/pcsx2/CDVD/CsoFileReader.cpp index a9b8c87f47..ff0720e131 100644 --- a/pcsx2/CDVD/CsoFileReader.cpp +++ b/pcsx2/CDVD/CsoFileReader.cpp @@ -18,6 +18,7 @@ #include "AsyncFileReader.h" #include "CsoFileReader.h" +#include "common/Console.h" #include "common/FileSystem.h" #include "common/Error.h" #include "common/StringUtil.h" diff --git a/pcsx2/CDVD/GzippedFileReader.cpp b/pcsx2/CDVD/GzippedFileReader.cpp index fa104d5259..a89777e6eb 100644 --- a/pcsx2/CDVD/GzippedFileReader.cpp +++ b/pcsx2/CDVD/GzippedFileReader.cpp @@ -21,6 +21,7 @@ #include "Host.h" #include "CDVD/zlib_indexed.h" +#include "common/Console.h" #include "common/FileSystem.h" #include "common/Error.h" #include "common/Path.h" diff --git a/pcsx2/CDVD/InputIsoFile.cpp b/pcsx2/CDVD/InputIsoFile.cpp index 470a1df77d..feb490ec11 100644 --- a/pcsx2/CDVD/InputIsoFile.cpp +++ b/pcsx2/CDVD/InputIsoFile.cpp @@ -21,6 +21,7 @@ #include "Host.h" #include "common/Assertions.h" +#include "common/Console.h" #include "common/Error.h" #include "fmt/format.h" diff --git a/pcsx2/CDVD/IsoReader.cpp b/pcsx2/CDVD/IsoReader.cpp index ba2ec81ac0..e6b50fe816 100644 --- a/pcsx2/CDVD/IsoReader.cpp +++ b/pcsx2/CDVD/IsoReader.cpp @@ -19,6 +19,7 @@ #include "CDVD/IsoReader.h" #include "common/Assertions.h" +#include "common/Console.h" #include "common/Error.h" #include "common/StringUtil.h" diff --git a/pcsx2/CDVD/OutputIsoFile.cpp b/pcsx2/CDVD/OutputIsoFile.cpp index 08ff0b8fa0..1b555d7a59 100644 --- a/pcsx2/CDVD/OutputIsoFile.cpp +++ b/pcsx2/CDVD/OutputIsoFile.cpp @@ -18,6 +18,7 @@ #include "CDVD/IsoFileFormats.h" #include "Host.h" +#include "common/Console.h" #include "common/FileSystem.h" #include "common/StringUtil.h" diff --git a/pcsx2/DEV9/ATA/HddCreate.cpp b/pcsx2/DEV9/ATA/HddCreate.cpp index 6a617985ac..5f2a35145f 100644 --- a/pcsx2/DEV9/ATA/HddCreate.cpp +++ b/pcsx2/DEV9/ATA/HddCreate.cpp @@ -22,7 +22,6 @@ #if _WIN32 #include "common/RedtapeWindows.h" -#include "common/StringUtil.h" #include #include #elif defined(__POSIX__) @@ -32,6 +31,9 @@ #include #endif +#include "common/Console.h" +#include "common/StringUtil.h" + void HddCreate::Start() { Init(); diff --git a/pcsx2/DEV9/AdapterUtils.cpp b/pcsx2/DEV9/AdapterUtils.cpp index b646fa3e2a..a6503b4e10 100644 --- a/pcsx2/DEV9/AdapterUtils.cpp +++ b/pcsx2/DEV9/AdapterUtils.cpp @@ -15,6 +15,12 @@ #include "PrecompiledHeader.h" +#include "AdapterUtils.h" + +#include "common/Assertions.h" +#include "common/Console.h" +#include "common/StringUtil.h" + #ifdef __POSIX__ #include #include @@ -23,8 +29,6 @@ #include #include -#include "common/StringUtil.h" - #ifdef __linux__ #include #include @@ -34,14 +38,9 @@ #include #include #include - -#include "common/Assertions.h" - #endif #endif -#include "AdapterUtils.h" - using namespace PacketReader; using namespace PacketReader::IP; diff --git a/pcsx2/DEV9/InternalServers/DNS_Logger.cpp b/pcsx2/DEV9/InternalServers/DNS_Logger.cpp index 9353303728..bc63f0b08b 100644 --- a/pcsx2/DEV9/InternalServers/DNS_Logger.cpp +++ b/pcsx2/DEV9/InternalServers/DNS_Logger.cpp @@ -19,6 +19,8 @@ #include "DEV9/PacketReader/IP/UDP/UDP_Packet.h" #include "DEV9/PacketReader/IP/UDP/DNS/DNS_Packet.h" +#include "common/Console.h" + using PacketReader::PayloadPtr; using namespace PacketReader::IP; using namespace PacketReader::IP::UDP; diff --git a/pcsx2/DEV9/PacketReader/IP/IP_Packet.cpp b/pcsx2/DEV9/PacketReader/IP/IP_Packet.cpp index deccd00b01..2749f2dee0 100644 --- a/pcsx2/DEV9/PacketReader/IP/IP_Packet.cpp +++ b/pcsx2/DEV9/PacketReader/IP/IP_Packet.cpp @@ -18,6 +18,8 @@ #include "IP_Packet.h" #include "DEV9/PacketReader/NetLib.h" +#include "common/Console.h" + namespace PacketReader::IP { int IP_Packet::GetHeaderLength() diff --git a/pcsx2/DEV9/PacketReader/IP/TCP/TCP_Packet.cpp b/pcsx2/DEV9/PacketReader/IP/TCP/TCP_Packet.cpp index a8d63f61ef..92ac0aa772 100644 --- a/pcsx2/DEV9/PacketReader/IP/TCP/TCP_Packet.cpp +++ b/pcsx2/DEV9/PacketReader/IP/TCP/TCP_Packet.cpp @@ -18,6 +18,8 @@ #include "TCP_Packet.h" #include "DEV9/PacketReader/NetLib.h" +#include "common/Console.h" + namespace PacketReader::IP::TCP { //Need flags diff --git a/pcsx2/DEV9/PacketReader/IP/UDP/DHCP/DHCP_Options.cpp b/pcsx2/DEV9/PacketReader/IP/UDP/DHCP/DHCP_Options.cpp index 5bdfc7a27b..9ccf3bbc1a 100644 --- a/pcsx2/DEV9/PacketReader/IP/UDP/DHCP/DHCP_Options.cpp +++ b/pcsx2/DEV9/PacketReader/IP/UDP/DHCP/DHCP_Options.cpp @@ -18,6 +18,8 @@ #include "DHCP_Options.h" #include "DEV9/PacketReader/NetLib.h" +#include "common/Console.h" + namespace PacketReader::IP::UDP::DHCP { DHCPopSubnet::DHCPopSubnet(IP_Address mask) diff --git a/pcsx2/DEV9/PacketReader/IP/UDP/DHCP/DHCP_Packet.cpp b/pcsx2/DEV9/PacketReader/IP/UDP/DHCP/DHCP_Packet.cpp index 55d549bb28..9d1880c80c 100644 --- a/pcsx2/DEV9/PacketReader/IP/UDP/DHCP/DHCP_Packet.cpp +++ b/pcsx2/DEV9/PacketReader/IP/UDP/DHCP/DHCP_Packet.cpp @@ -17,6 +17,8 @@ #include "DHCP_Packet.h" #include "DEV9/PacketReader/NetLib.h" +#include "common/Console.h" + namespace PacketReader::IP::UDP::DHCP { DHCP_Packet::DHCP_Packet(u8* buffer, int bufferSize) diff --git a/pcsx2/DEV9/PacketReader/IP/UDP/UDP_Packet.cpp b/pcsx2/DEV9/PacketReader/IP/UDP/UDP_Packet.cpp index 793d573b6b..a1bd2ef19f 100644 --- a/pcsx2/DEV9/PacketReader/IP/UDP/UDP_Packet.cpp +++ b/pcsx2/DEV9/PacketReader/IP/UDP/UDP_Packet.cpp @@ -18,6 +18,8 @@ #include "UDP_Packet.h" #include "DEV9/PacketReader/NetLib.h" +#include "common/Console.h" + namespace PacketReader::IP::UDP { UDP_Packet::UDP_Packet(Payload* data) diff --git a/pcsx2/DEV9/Sessions/UDP_Session/UDP_FixedPort.cpp b/pcsx2/DEV9/Sessions/UDP_Session/UDP_FixedPort.cpp index 6a89633df5..7d02ba44b6 100644 --- a/pcsx2/DEV9/Sessions/UDP_Session/UDP_FixedPort.cpp +++ b/pcsx2/DEV9/Sessions/UDP_Session/UDP_FixedPort.cpp @@ -16,6 +16,7 @@ #include "PrecompiledHeader.h" #include "common/Assertions.h" +#include "common/Console.h" #ifdef __POSIX__ #define SOCKET_ERROR -1 diff --git a/pcsx2/DEV9/Sessions/UDP_Session/UDP_Session.cpp b/pcsx2/DEV9/Sessions/UDP_Session/UDP_Session.cpp index e58e04b07b..dfb9d1d267 100644 --- a/pcsx2/DEV9/Sessions/UDP_Session/UDP_Session.cpp +++ b/pcsx2/DEV9/Sessions/UDP_Session/UDP_Session.cpp @@ -16,6 +16,7 @@ #include "PrecompiledHeader.h" #include "common/Assertions.h" +#include "common/Console.h" #ifdef __POSIX__ #define SOCKET_ERROR -1 diff --git a/pcsx2/DebugTools/DebugInterface.cpp b/pcsx2/DebugTools/DebugInterface.cpp index fb6d3fa669..036c0418f4 100644 --- a/pcsx2/DebugTools/DebugInterface.cpp +++ b/pcsx2/DebugTools/DebugInterface.cpp @@ -39,10 +39,6 @@ R5900DebugInterface r5900Debug; R3000DebugInterface r3000Debug; -#ifdef _WIN32 -#define strcasecmp stricmp -#endif - enum ReferenceIndexType { REF_INDEX_PC = 32, @@ -74,44 +70,44 @@ public: char reg[8]; std::snprintf(reg, std::size(reg), "r%d", i); - if (strcasecmp(str, reg) == 0 || strcasecmp(str, cpu->getRegisterName(0, i)) == 0) + if (StringUtil::Strcasecmp(str, reg) == 0 || StringUtil::Strcasecmp(str, cpu->getRegisterName(0, i)) == 0) { referenceIndex = i; return true; } } - if (strcasecmp(str, "pc") == 0) + if (StringUtil::Strcasecmp(str, "pc") == 0) { referenceIndex = REF_INDEX_PC; return true; } - if (strcasecmp(str, "hi") == 0) + if (StringUtil::Strcasecmp(str, "hi") == 0) { referenceIndex = REF_INDEX_HI; return true; } - if (strcasecmp(str, "lo") == 0) + if (StringUtil::Strcasecmp(str, "lo") == 0) { referenceIndex = REF_INDEX_LO; return true; } - if (strcasecmp(str, "target") == 0) + if (StringUtil::Strcasecmp(str, "target") == 0) { referenceIndex = REF_INDEX_OPTARGET; return true; } - if (strcasecmp(str, "load") == 0) + if (StringUtil::Strcasecmp(str, "load") == 0) { referenceIndex = REF_INDEX_OPLOAD; return true; } - if (strcasecmp(str, "store") == 0) + if (StringUtil::Strcasecmp(str, "store") == 0) { referenceIndex = REF_INDEX_OPSTORE; return true; diff --git a/pcsx2/DebugTools/SymbolMap.cpp b/pcsx2/DebugTools/SymbolMap.cpp index f81da07a56..318c79fa60 100644 --- a/pcsx2/DebugTools/SymbolMap.cpp +++ b/pcsx2/DebugTools/SymbolMap.cpp @@ -1,5 +1,5 @@ /* PCSX2 - PS2 Emulator for PCs - * Copyright (C) 2002-2014 PCSX2 Dev Team + * Copyright (C) 2002-2023 PCSX2 Dev Team * * PCSX2 is free software: you can redistribute it and/or modify it under the terms * of the GNU Lesser General Public License as published by the Free Software Found- @@ -14,20 +14,17 @@ */ #include "PrecompiledHeader.h" -#include "common/FileSystem.h" #include "SymbolMap.h" + +#include "common/FileSystem.h" +#include "common/StringUtil.h" + #include SymbolMap R5900SymbolMap; SymbolMap R3000SymbolMap; -#ifdef _WIN32 -#define strcasecmp stricmp -#endif - -#define ARRAY_SIZE(x) (sizeof((x)) / sizeof(*(x))) - void SymbolMap::SortSymbols() { std::lock_guard guard(m_lock); @@ -76,19 +73,19 @@ bool SymbolMap::LoadNocashSym(const std::string& filename) if (sscanf(s + 1, "%04X", &size) != 1) continue; - if (strcasecmp(value, ".byt") == 0) + if (StringUtil::Strcasecmp(value, ".byt") == 0) { AddData(address, size, DATATYPE_BYTE, 0); } - else if (strcasecmp(value, ".wrd") == 0) + else if (StringUtil::Strcasecmp(value, ".wrd") == 0) { AddData(address, size, DATATYPE_HALFWORD, 0); } - else if (strcasecmp(value, ".dbl") == 0) + else if (StringUtil::Strcasecmp(value, ".dbl") == 0) { AddData(address, size, DATATYPE_WORD, 0); } - else if (strcasecmp(value, ".asc") == 0) + else if (StringUtil::Strcasecmp(value, ".asc") == 0) { AddData(address, size, DATATYPE_ASCII, 0); } diff --git a/pcsx2/FW.cpp b/pcsx2/FW.cpp index b383976710..d4941b97b3 100644 --- a/pcsx2/FW.cpp +++ b/pcsx2/FW.cpp @@ -16,13 +16,14 @@ #include "PrecompiledHeader.h" #include "IopDma.h" #include "R3000A.h" -#include -#include -using namespace std; - #include "FW.h" -u8 phyregs[16]; +#include "common/Console.h" + +#include +#include + +static u8 phyregs[16]; s8* fwregs; s32 FWopen() diff --git a/pcsx2/GS/GSCapture.cpp b/pcsx2/GS/GSCapture.cpp index ad9bda27ed..523565e10f 100644 --- a/pcsx2/GS/GSCapture.cpp +++ b/pcsx2/GS/GSCapture.cpp @@ -25,6 +25,7 @@ #include "Host.h" #include "IconsFontAwesome5.h" #include "common/Assertions.h" +#include "common/Console.h" #include "common/BitUtils.h" #include "common/DynamicLibrary.h" #include "common/Path.h" @@ -36,7 +37,9 @@ #include #include -#ifdef __clang__ +#if defined(_MSC_VER) +#pragma warning(disable:4996) // warning C4996: 'AVCodecContext::channels': was declared deprecated +#elif defined (__clang__) // We're using deprecated fields because we're targeting multiple ffmpeg versions. #pragma clang diagnostic ignored "-Wdeprecated-declarations" #endif diff --git a/pcsx2/GS/GSLzma.cpp b/pcsx2/GS/GSLzma.cpp index abd7cbb4ec..b3878279e4 100644 --- a/pcsx2/GS/GSLzma.cpp +++ b/pcsx2/GS/GSLzma.cpp @@ -16,6 +16,7 @@ #include "PrecompiledHeader.h" #include "common/AlignedMalloc.h" +#include "common/Console.h" #include "common/FileSystem.h" #include "common/StringUtil.h" diff --git a/pcsx2/GS/GSState.cpp b/pcsx2/GS/GSState.cpp index 64c3b6049e..a672ce9127 100644 --- a/pcsx2/GS/GSState.cpp +++ b/pcsx2/GS/GSState.cpp @@ -19,6 +19,8 @@ #include "GS/GSGL.h" #include "GS/GSPerfMon.h" #include "GS/GSUtil.h" + +#include "common/Console.h" #include "common/BitUtils.h" #include "common/Path.h" #include "common/StringUtil.h" diff --git a/pcsx2/GS/Renderers/Common/GSDevice.cpp b/pcsx2/GS/Renderers/Common/GSDevice.cpp index 2f17cc7eb7..00c1382fbd 100644 --- a/pcsx2/GS/Renderers/Common/GSDevice.cpp +++ b/pcsx2/GS/Renderers/Common/GSDevice.cpp @@ -20,6 +20,7 @@ #include "GS/GS.h" #include "Host.h" +#include "common/Console.h" #include "common/BitUtils.h" #include "common/FileSystem.h" #include "common/Path.h" diff --git a/pcsx2/GS/Renderers/Common/GSTexture.cpp b/pcsx2/GS/Renderers/Common/GSTexture.cpp index d51886ed97..3fae9588cb 100644 --- a/pcsx2/GS/Renderers/Common/GSTexture.cpp +++ b/pcsx2/GS/Renderers/Common/GSTexture.cpp @@ -17,8 +17,11 @@ #include "GS/Renderers/Common/GSTexture.h" #include "GS/Renderers/Common/GSDevice.h" #include "GS/GSPng.h" + +#include "common/Console.h" #include "common/BitUtils.h" #include "common/StringUtil.h" + #include #include diff --git a/pcsx2/GS/Renderers/Common/GSVertexTrace.cpp b/pcsx2/GS/Renderers/Common/GSVertexTrace.cpp index 9accd89da6..4edb78a4a5 100644 --- a/pcsx2/GS/Renderers/Common/GSVertexTrace.cpp +++ b/pcsx2/GS/Renderers/Common/GSVertexTrace.cpp @@ -18,6 +18,8 @@ #include "GS/GSUtil.h" #include "GS/GSState.h" +#include "common/Console.h" + GSVertexTrace::GSVertexTrace(const GSState* state, bool provoking_vertex_first) : m_state(state) { diff --git a/pcsx2/GS/Renderers/DX11/GSTexture11.cpp b/pcsx2/GS/Renderers/DX11/GSTexture11.cpp index 7e5444bb8f..602ca53612 100644 --- a/pcsx2/GS/Renderers/DX11/GSTexture11.cpp +++ b/pcsx2/GS/Renderers/DX11/GSTexture11.cpp @@ -18,6 +18,7 @@ #include "GSTexture11.h" #include "GS/GSPng.h" #include "GS/GSPerfMon.h" +#include "common/Console.h" #include "common/BitUtils.h" GSTexture11::GSTexture11(wil::com_ptr_nothrow texture, const D3D11_TEXTURE2D_DESC& desc, diff --git a/pcsx2/GS/Renderers/DX12/GSDevice12.cpp b/pcsx2/GS/Renderers/DX12/GSDevice12.cpp index d13187c0d5..d9037ac339 100644 --- a/pcsx2/GS/Renderers/DX12/GSDevice12.cpp +++ b/pcsx2/GS/Renderers/DX12/GSDevice12.cpp @@ -26,6 +26,7 @@ #include "Host.h" #include "ShaderCacheVersion.h" +#include "common/Console.h" #include "common/BitUtils.h" #include "common/ScopedGuard.h" #include "common/StringUtil.h" diff --git a/pcsx2/GS/Renderers/DX12/GSTexture12.cpp b/pcsx2/GS/Renderers/DX12/GSTexture12.cpp index bb955fe1cc..f02d5d24e9 100644 --- a/pcsx2/GS/Renderers/DX12/GSTexture12.cpp +++ b/pcsx2/GS/Renderers/DX12/GSTexture12.cpp @@ -22,6 +22,7 @@ #include "GS/GSGL.h" #include "common/Assertions.h" +#include "common/Console.h" #include "common/BitUtils.h" #include "common/StringUtil.h" diff --git a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp index 5b633f1510..0d3b24dafd 100644 --- a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp +++ b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp @@ -20,6 +20,7 @@ #include "GS/GSPerfMon.h" #include "GS/GSUtil.h" #include "Host.h" +#include "common/Console.h" #include "common/BitUtils.h" #include "common/StringUtil.h" #include diff --git a/pcsx2/GS/Renderers/HW/GSTextureCache.cpp b/pcsx2/GS/Renderers/HW/GSTextureCache.cpp index 1f23977c87..7a681fe37b 100644 --- a/pcsx2/GS/Renderers/HW/GSTextureCache.cpp +++ b/pcsx2/GS/Renderers/HW/GSTextureCache.cpp @@ -22,6 +22,8 @@ #include "GS/GSPerfMon.h" #include "GS/GSUtil.h" #include "GS/GSXXH.h" + +#include "common/Console.h" #include "common/BitUtils.h" #include "common/HashCombine.h" diff --git a/pcsx2/GS/Renderers/HW/GSTextureReplacementLoaders.cpp b/pcsx2/GS/Renderers/HW/GSTextureReplacementLoaders.cpp index de3469288c..46ddecd3df 100644 --- a/pcsx2/GS/Renderers/HW/GSTextureReplacementLoaders.cpp +++ b/pcsx2/GS/Renderers/HW/GSTextureReplacementLoaders.cpp @@ -16,6 +16,7 @@ #include "PrecompiledHeader.h" #include "common/BitUtils.h" +#include "common/Console.h" #include "common/FileSystem.h" #include "common/Path.h" #include "common/StringUtil.h" diff --git a/pcsx2/GS/Renderers/HW/GSTextureReplacements.cpp b/pcsx2/GS/Renderers/HW/GSTextureReplacements.cpp index 2592c56547..3040988ee6 100644 --- a/pcsx2/GS/Renderers/HW/GSTextureReplacements.cpp +++ b/pcsx2/GS/Renderers/HW/GSTextureReplacements.cpp @@ -16,6 +16,7 @@ #include "PrecompiledHeader.h" #include "common/AlignedMalloc.h" +#include "common/Console.h" #include "common/HashCombine.h" #include "common/FileSystem.h" #include "common/Path.h" diff --git a/pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.cpp b/pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.cpp index adeb112c6c..f1b1f200d4 100644 --- a/pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.cpp +++ b/pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.cpp @@ -24,6 +24,7 @@ #include "GS/GSUtil.h" #include "Host.h" +#include "common/Console.h" #include "common/StringUtil.h" #include "imgui.h" diff --git a/pcsx2/GS/Renderers/OpenGL/GSTextureOGL.cpp b/pcsx2/GS/Renderers/OpenGL/GSTextureOGL.cpp index bb0e526809..ba89d36112 100644 --- a/pcsx2/GS/Renderers/OpenGL/GSTextureOGL.cpp +++ b/pcsx2/GS/Renderers/OpenGL/GSTextureOGL.cpp @@ -21,6 +21,7 @@ #include "GS/GSExtra.h" #include "GS/GSPerfMon.h" #include "GS/GSGL.h" +#include "common/Console.h" #include "common/BitUtils.h" #include "common/AlignedMalloc.h" #include "common/StringUtil.h" diff --git a/pcsx2/GS/Renderers/SW/GSDrawScanline.cpp b/pcsx2/GS/Renderers/SW/GSDrawScanline.cpp index 84d5f2dbed..a70b1cdcb9 100644 --- a/pcsx2/GS/Renderers/SW/GSDrawScanline.cpp +++ b/pcsx2/GS/Renderers/SW/GSDrawScanline.cpp @@ -19,6 +19,8 @@ #include "GS/Renderers/SW/GSScanlineEnvironment.h" #include "GS/Renderers/SW/GSRasterizer.h" +#include "common/Console.h" + // Comment to disable all dynamic code generation. #define ENABLE_JIT_RASTERIZER diff --git a/pcsx2/GS/Renderers/SW/GSDrawScanlineCodeGenerator.cpp b/pcsx2/GS/Renderers/SW/GSDrawScanlineCodeGenerator.cpp index 22e36a52f0..f08d21036b 100644 --- a/pcsx2/GS/Renderers/SW/GSDrawScanlineCodeGenerator.cpp +++ b/pcsx2/GS/Renderers/SW/GSDrawScanlineCodeGenerator.cpp @@ -17,6 +17,9 @@ #include "GSDrawScanlineCodeGenerator.h" #include "GSDrawScanlineCodeGenerator.all.h" #include "GSDrawScanline.h" + +#include "common/Console.h" + #include #include #include diff --git a/pcsx2/GS/Renderers/SW/GSRasterizer.cpp b/pcsx2/GS/Renderers/SW/GSRasterizer.cpp index 7311e3ec60..62b657127c 100644 --- a/pcsx2/GS/Renderers/SW/GSRasterizer.cpp +++ b/pcsx2/GS/Renderers/SW/GSRasterizer.cpp @@ -20,10 +20,12 @@ #include "GS/Renderers/SW/GSDrawScanline.h" #include "GS/GSExtra.h" #include "PerformanceMetrics.h" +#include "VMManager.h" + #include "common/AlignedMalloc.h" +#include "common/Console.h" #include "common/General.h" #include "common/StringUtil.h" -#include "VMManager.h" #define ENABLE_DRAW_STATS 0 diff --git a/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp b/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp index 18e7edc2d1..36028d5b63 100644 --- a/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp +++ b/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp @@ -26,6 +26,7 @@ #include "Host.h" +#include "common/Console.h" #include "common/BitUtils.h" #include "common/Path.h" #include "common/ScopedGuard.h" diff --git a/pcsx2/GS/Renderers/Vulkan/GSTextureVK.cpp b/pcsx2/GS/Renderers/Vulkan/GSTextureVK.cpp index 0ce46811d7..03bbaa1acb 100644 --- a/pcsx2/GS/Renderers/Vulkan/GSTextureVK.cpp +++ b/pcsx2/GS/Renderers/Vulkan/GSTextureVK.cpp @@ -22,6 +22,7 @@ #include "GS/Renderers/Vulkan/VKBuilders.h" #include "common/Assertions.h" +#include "common/Console.h" #include "common/BitUtils.h" static constexpr const VkComponentMapping s_identity_swizzle{VK_COMPONENT_SWIZZLE_IDENTITY, diff --git a/pcsx2/GS/Renderers/Vulkan/VKBuilders.cpp b/pcsx2/GS/Renderers/Vulkan/VKBuilders.cpp index e9dd63f12c..81afeafcb7 100644 --- a/pcsx2/GS/Renderers/Vulkan/VKBuilders.cpp +++ b/pcsx2/GS/Renderers/Vulkan/VKBuilders.cpp @@ -18,6 +18,7 @@ #include "GS/Renderers/Vulkan/VKBuilders.h" #include "common/Assertions.h" +#include "common/Console.h" #include diff --git a/pcsx2/GameDatabase.cpp b/pcsx2/GameDatabase.cpp index b51cf971ef..2c62262ced 100644 --- a/pcsx2/GameDatabase.cpp +++ b/pcsx2/GameDatabase.cpp @@ -21,6 +21,7 @@ #include "IconsFontAwesome5.h" #include "vtlb.h" +#include "common/Console.h" #include "common/Error.h" #include "common/FileSystem.h" #include "common/Path.h" diff --git a/pcsx2/ImGui/ImGuiFullscreen.cpp b/pcsx2/ImGui/ImGuiFullscreen.cpp index 58e378521a..41ea12761e 100644 --- a/pcsx2/ImGui/ImGuiFullscreen.cpp +++ b/pcsx2/ImGui/ImGuiFullscreen.cpp @@ -25,6 +25,7 @@ #include "ImGui/ImGuiFullscreen.h" #include "common/Assertions.h" +#include "common/Console.h" #include "common/Easing.h" #include "common/Image.h" #include "common/LRUCache.h" diff --git a/pcsx2/Input/InputManager.cpp b/pcsx2/Input/InputManager.cpp index 7095d81685..59715981c4 100644 --- a/pcsx2/Input/InputManager.cpp +++ b/pcsx2/Input/InputManager.cpp @@ -24,6 +24,7 @@ #include "VMManager.h" #include "common/Assertions.h" +#include "common/Console.h" #include "common/StringUtil.h" #include "common/Timer.h" diff --git a/pcsx2/MultipartFileReader.cpp b/pcsx2/MultipartFileReader.cpp index f1c8886f5b..7353167de9 100644 --- a/pcsx2/MultipartFileReader.cpp +++ b/pcsx2/MultipartFileReader.cpp @@ -17,6 +17,7 @@ #include "AsyncFileReader.h" #include "common/Assertions.h" +#include "common/Console.h" #include "common/FileSystem.h" #include "common/Error.h" #include "common/Path.h" diff --git a/pcsx2/PINE.cpp b/pcsx2/PINE.cpp index 3f4a3af127..3d9bf43315 100644 --- a/pcsx2/PINE.cpp +++ b/pcsx2/PINE.cpp @@ -75,7 +75,7 @@ bool PINEServer::Initialize(int slot) // yes very good windows s/sun/sin/g sure is fine server.sin_family = AF_INET; // localhost only - server.sin_addr.s_addr = inet_addr("127.0.0.1"); + server.sin_addr.s_addr = INADDR_LOOPBACK; server.sin_port = htons(slot); if (bind(m_sock, (struct sockaddr*)&server, sizeof(server)) == SOCKET_ERROR) diff --git a/pcsx2/PrecompiledHeader.h b/pcsx2/PrecompiledHeader.h index 2108ab3506..8898ad5424 100644 --- a/pcsx2/PrecompiledHeader.h +++ b/pcsx2/PrecompiledHeader.h @@ -1,5 +1,5 @@ /* PCSX2 - PS2 Emulator for PCs - * Copyright (C) 2002-2010 PCSX2 Dev Team + * Copyright (C) 2002-2023 PCSX2 Dev Team * * PCSX2 is free software: you can redistribute it and/or modify it under the terms * of the GNU Lesser General Public License as published by the Free Software Found- @@ -13,13 +13,11 @@ * If not, see . */ -#ifndef PCSX2_PRECOMPILED_HEADER -#define PCSX2_PRECOMPILED_HEADER +#pragma once // Disable some pointless warnings... #ifdef _MSC_VER # pragma warning(disable:4250) //'class' inherits 'method' via dominance -# pragma warning(disable:4996) //ignore the stricmp deprecated warning #endif #include "common/Pcsx2Defs.h" @@ -64,27 +62,3 @@ // need a full recompile anyway, when modified (etc) #include "PCSX2Base.h" - -#include "common/Console.h" -#include "common/General.h" -#include "common/emitter/tools.h" - -typedef void FnType_Void(); -typedef FnType_Void* Fnptr_Void; - -// -------------------------------------------------------------------------------------- -// Compiler/OS specific macros and defines -// -------------------------------------------------------------------------------------- - -#if defined(_MSC_VER) - -# define strnicmp _strnicmp -# define stricmp _stricmp - -#else // must be GCC or Clang - -#include - -#endif - -#endif diff --git a/pcsx2/R3000AOpcodeTables.cpp b/pcsx2/R3000AOpcodeTables.cpp index bfebcb50c8..1ec237888e 100644 --- a/pcsx2/R3000AOpcodeTables.cpp +++ b/pcsx2/R3000AOpcodeTables.cpp @@ -19,6 +19,8 @@ #include "IopGte.h" #include "IopMem.h" +#include "common/Console.h" + // Note: Branch instructions of the Interpreter are defined externally because // the recompiler shouldn't be using them (it isn't entirely safe, due to the // delay slot and event handling differences between recs and ints) diff --git a/pcsx2/SIO/Memcard/MemoryCardFile.cpp b/pcsx2/SIO/Memcard/MemoryCardFile.cpp index a03fc05e17..dcba443b2b 100644 --- a/pcsx2/SIO/Memcard/MemoryCardFile.cpp +++ b/pcsx2/SIO/Memcard/MemoryCardFile.cpp @@ -21,6 +21,7 @@ #include "SIO/Sio.h" #include "common/Assertions.h" +#include "common/Console.h" #include "common/FileSystem.h" #include "common/Path.h" #include "common/StringUtil.h" diff --git a/pcsx2/SIO/Memcard/MemoryCardFolder.cpp b/pcsx2/SIO/Memcard/MemoryCardFolder.cpp index 8040c38f5b..87a64ab701 100644 --- a/pcsx2/SIO/Memcard/MemoryCardFolder.cpp +++ b/pcsx2/SIO/Memcard/MemoryCardFolder.cpp @@ -26,6 +26,7 @@ #include "Host.h" #include "IconsFontAwesome5.h" +#include "common/Console.h" #include "common/FileSystem.h" #include "common/Path.h" #include "common/StringUtil.h" diff --git a/pcsx2/SIO/Memcard/MemoryCardProtocol.cpp b/pcsx2/SIO/Memcard/MemoryCardProtocol.cpp index 4f7269ff7e..aebc2885c8 100644 --- a/pcsx2/SIO/Memcard/MemoryCardProtocol.cpp +++ b/pcsx2/SIO/Memcard/MemoryCardProtocol.cpp @@ -21,6 +21,8 @@ #include "SIO/Sio2.h" #include "SIO/Sio0.h" +#include "common/Console.h" + #define MC_LOG_ENABLE 0 #define MC_LOG if (MC_LOG_ENABLE) DevCon diff --git a/pcsx2/SIO/Pad/Pad.cpp b/pcsx2/SIO/Pad/Pad.cpp index e8a0ece433..8947bdadd8 100644 --- a/pcsx2/SIO/Pad/Pad.cpp +++ b/pcsx2/SIO/Pad/Pad.cpp @@ -27,6 +27,7 @@ #include "VMManager.h" #include "common/Assertions.h" +#include "common/Console.h" #include "common/FileSystem.h" #include "common/Path.h" #include "common/SettingsInterface.h" diff --git a/pcsx2/SIO/Pad/PadGuitar.cpp b/pcsx2/SIO/Pad/PadGuitar.cpp index 19ee82193e..9325851882 100644 --- a/pcsx2/SIO/Pad/PadGuitar.cpp +++ b/pcsx2/SIO/Pad/PadGuitar.cpp @@ -23,6 +23,8 @@ #include "IconsPromptFont.h" +#include "common/Console.h" + // The generic input bindings on this might seem bizarre, but they are intended to match what DS2 buttons // would do what actions, if you played Guitar Hero on a PS2 with a DS2 instead of a controller. static const InputBindingInfo s_bindings[] = { diff --git a/pcsx2/SPU2/Debug.cpp b/pcsx2/SPU2/Debug.cpp index 47513c334d..762671e506 100644 --- a/pcsx2/SPU2/Debug.cpp +++ b/pcsx2/SPU2/Debug.cpp @@ -18,6 +18,7 @@ #include "SPU2/Global.h" #include "Config.h" +#include "common/Console.h" #include "common/FileSystem.h" #include diff --git a/pcsx2/SPU2/Reverb.cpp b/pcsx2/SPU2/Reverb.cpp index 8f4440ed24..bb86b49b18 100644 --- a/pcsx2/SPU2/Reverb.cpp +++ b/pcsx2/SPU2/Reverb.cpp @@ -17,6 +17,8 @@ #include "Global.h" #include "GS/GSVector.h" +#include "common/Console.h" + #include void V_Core::AnalyzeReverbPreset() diff --git a/pcsx2/SPU2/Wavedump_wav.cpp b/pcsx2/SPU2/Wavedump_wav.cpp index 1975b51430..8ba4d1041e 100644 --- a/pcsx2/SPU2/Wavedump_wav.cpp +++ b/pcsx2/SPU2/Wavedump_wav.cpp @@ -19,6 +19,7 @@ #include "pcsx2/Config.h" #include "fmt/format.h" +#include "common/Console.h" #include "common/Path.h" #include "common/StringUtil.h" #include "common/WAVWriter.h" diff --git a/pcsx2/SPU2/spu2sys.cpp b/pcsx2/SPU2/spu2sys.cpp index cc3e147723..a9c8b56d7c 100644 --- a/pcsx2/SPU2/spu2sys.cpp +++ b/pcsx2/SPU2/spu2sys.cpp @@ -30,6 +30,8 @@ #include "SPU2/Global.h" #include "SPU2/spu2.h" +#include "common/Console.h" + s16 spu2regs[0x010000 / sizeof(s16)]; s16 _spu2mem[0x200000 / sizeof(s16)]; diff --git a/pcsx2/USB/USB.cpp b/pcsx2/USB/USB.cpp index 3f6d8628f7..6c6e1c5069 100644 --- a/pcsx2/USB/USB.cpp +++ b/pcsx2/USB/USB.cpp @@ -22,6 +22,7 @@ #include "USB/qemu-usb/USBinternal.h" #include "USB/qemu-usb/desc.h" +#include "common/Console.h" #include "common/SettingsInterface.h" #include "common/WindowInfo.h" diff --git a/pcsx2/USB/qemu-usb/core.cpp b/pcsx2/USB/qemu-usb/core.cpp index 132b951140..d8f686288b 100644 --- a/pcsx2/USB/qemu-usb/core.cpp +++ b/pcsx2/USB/qemu-usb/core.cpp @@ -28,6 +28,8 @@ #include "USB/qemu-usb/qusb.h" #include +#include "common/Console.h" + void usb_pick_speed(USBPort* port) { static const int speeds[] = { diff --git a/pcsx2/USB/qemu-usb/input-keymap-qcode-to-qnum.cpp b/pcsx2/USB/qemu-usb/input-keymap-qcode-to-qnum.cpp index 77121a1b09..9adfdc1742 100644 --- a/pcsx2/USB/qemu-usb/input-keymap-qcode-to-qnum.cpp +++ b/pcsx2/USB/qemu-usb/input-keymap-qcode-to-qnum.cpp @@ -16,6 +16,8 @@ #include "PrecompiledHeader.h" #include "input-keymap.h" +#include + //TODO how much does std::map kill perf if any? static const std::map qemu_input_map_qcode_to_qnum = { {Q_KEY_CODE_0, 0xb}, /* qcode:Q_KEY_CODE_0 (0) -> linux:11 (KEY_0) -> qnum:11 */ diff --git a/pcsx2/USB/qemu-usb/usb-ohci.cpp b/pcsx2/USB/qemu-usb/usb-ohci.cpp index 4be7c5c1a0..18bd2c7d12 100644 --- a/pcsx2/USB/qemu-usb/usb-ohci.cpp +++ b/pcsx2/USB/qemu-usb/usb-ohci.cpp @@ -34,6 +34,8 @@ #include "USB/qemu-usb/USBinternal.h" #include "IopMem.h" +#include "common/Console.h" + #define DMA_DIRECTION_TO_DEVICE 0 #define DMA_DIRECTION_FROM_DEVICE 1 #define ED_LINK_LIMIT 32 diff --git a/pcsx2/USB/usb-eyetoy/cam-windows.cpp b/pcsx2/USB/usb-eyetoy/cam-windows.cpp index 58d51a4870..9ef9034b28 100644 --- a/pcsx2/USB/usb-eyetoy/cam-windows.cpp +++ b/pcsx2/USB/usb-eyetoy/cam-windows.cpp @@ -15,6 +15,7 @@ #include "PrecompiledHeader.h" +#include "common/Console.h" #include "common/StringUtil.h" #include "jpge.h" diff --git a/pcsx2/USB/usb-eyetoy/usb-eyetoy-webcam.cpp b/pcsx2/USB/usb-eyetoy/usb-eyetoy-webcam.cpp index 577da2ee7f..99363d7aa8 100644 --- a/pcsx2/USB/usb-eyetoy/usb-eyetoy-webcam.cpp +++ b/pcsx2/USB/usb-eyetoy/usb-eyetoy-webcam.cpp @@ -22,6 +22,8 @@ #include "USB/USB.h" #include "StateWrapper.h" +#include "common/Console.h" + namespace usb_eyetoy { typedef struct EYETOYState diff --git a/pcsx2/USB/usb-hid/usb-hid.cpp b/pcsx2/USB/usb-hid/usb-hid.cpp index 5328f8143c..eba1df22d2 100644 --- a/pcsx2/USB/usb-hid/usb-hid.cpp +++ b/pcsx2/USB/usb-hid/usb-hid.cpp @@ -34,6 +34,8 @@ #include "USB/qemu-usb/desc.h" #include "USB/usb-hid/usb-hid.h" +#include "common/Console.h" + namespace usb_hid { struct UsbHIDState diff --git a/pcsx2/USB/usb-lightgun/guncon2.cpp b/pcsx2/USB/usb-lightgun/guncon2.cpp index 40f0add0c5..143dd455e3 100644 --- a/pcsx2/USB/usb-lightgun/guncon2.cpp +++ b/pcsx2/USB/usb-lightgun/guncon2.cpp @@ -27,6 +27,7 @@ #include "USB/usb-lightgun/guncon2.h" #include "VMManager.h" +#include "common/Console.h" #include "common/StringUtil.h" #include diff --git a/pcsx2/USB/usb-mic/usb-headset.cpp b/pcsx2/USB/usb-mic/usb-headset.cpp index 63a3ddbc2b..91d8a95f9e 100644 --- a/pcsx2/USB/usb-mic/usb-headset.cpp +++ b/pcsx2/USB/usb-mic/usb-headset.cpp @@ -35,6 +35,8 @@ #include "USB/USB.h" #include "StateWrapper.h" +#include "common/Console.h" + #define BUFFER_FRAMES 200 /* diff --git a/pcsx2/USB/usb-mic/usb-mic-singstar.cpp b/pcsx2/USB/usb-mic/usb-mic-singstar.cpp index 74ba866be5..8484f7301b 100644 --- a/pcsx2/USB/usb-mic/usb-mic-singstar.cpp +++ b/pcsx2/USB/usb-mic/usb-mic-singstar.cpp @@ -36,6 +36,9 @@ #include "USB/USB.h" #include "Host.h" #include "StateWrapper.h" + +#include "common/Console.h" + #include "fmt/format.h" static FILE* file = NULL; diff --git a/pcsx2/USB/usb-msd/usb-msd.cpp b/pcsx2/USB/usb-msd/usb-msd.cpp index ac2df241de..97484a74dc 100644 --- a/pcsx2/USB/usb-msd/usb-msd.cpp +++ b/pcsx2/USB/usb-msd/usb-msd.cpp @@ -8,18 +8,21 @@ */ #include "PrecompiledHeader.h" -#include -#include -#include #include "USB/qemu-usb/qusb.h" #include "USB/qemu-usb/desc.h" #include "USB/qemu-usb/USBinternal.h" #include "USB/usb-msd/usb-msd.h" #include "USB/USB.h" -#include "common/FileSystem.h" #include "Host.h" #include "StateWrapper.h" +#include "common/Console.h" +#include "common/FileSystem.h" + +#include +#include +#include + #define le32_to_cpu(x) (x) #define cpu_to_le32(x) (x) diff --git a/pcsx2/USB/usb-pad/usb-pad-ff.cpp b/pcsx2/USB/usb-pad/usb-pad-ff.cpp index 4d30503958..75fdf9f3c4 100644 --- a/pcsx2/USB/usb-pad/usb-pad-ff.cpp +++ b/pcsx2/USB/usb-pad/usb-pad-ff.cpp @@ -17,6 +17,8 @@ #include "usb-pad.h" #include "lg/lg_ff.h" +#include "common/Console.h" + namespace usb_pad { static void SetConstantForce(FFDevice* ffdev, int force) diff --git a/pcsx2/USB/usb-pad/usb-pad.cpp b/pcsx2/USB/usb-pad/usb-pad.cpp index 575098b31d..bbdf82a9f0 100644 --- a/pcsx2/USB/usb-pad/usb-pad.cpp +++ b/pcsx2/USB/usb-pad/usb-pad.cpp @@ -21,6 +21,8 @@ #include "Host.h" #include "StateWrapper.h" +#include "common/Console.h" + namespace usb_pad { static const USBDescStrings df_desc_strings = { diff --git a/pcsx2/USB/usb-pad/usb-seamic.cpp b/pcsx2/USB/usb-pad/usb-seamic.cpp index 8aac62820d..b6e7b7c2ac 100644 --- a/pcsx2/USB/usb-pad/usb-seamic.cpp +++ b/pcsx2/USB/usb-pad/usb-seamic.cpp @@ -20,6 +20,8 @@ #include "USB/usb-mic/usb-mic-singstar.h" #include "USB/USB.h" +#include "common/Console.h" + namespace usb_pad { diff --git a/pcsx2/USB/usb-printer/usb-printer.cpp b/pcsx2/USB/usb-printer/usb-printer.cpp index be3295a87d..530c4bec9c 100644 --- a/pcsx2/USB/usb-printer/usb-printer.cpp +++ b/pcsx2/USB/usb-printer/usb-printer.cpp @@ -18,6 +18,7 @@ #include "USB/qemu-usb/USBinternal.h" #include "USB/usb-printer/usb-printer.h" #include "USB/USB.h" +#include "common/Console.h" #include "common/FileSystem.h" #include "common/Path.h" #include "common/StringUtil.h" diff --git a/pcsx2/VUops.cpp b/pcsx2/VUops.cpp index 1e21d39f8d..b2fb3ae57a 100644 --- a/pcsx2/VUops.cpp +++ b/pcsx2/VUops.cpp @@ -4675,15 +4675,15 @@ alignas(16) const FNTYPE PREFIX##_UPPER_OPCODE[64] = { \ } \ _vuTablesPre(VU0, VU0) -_vuTablesMess(VU0, Fnptr_Void) +_vuTablesMess(VU0, FnPtr_VuVoid) _vuTablesPost(VU0, VU0) _vuTablesPre(VU1, VU1) -_vuTablesMess(VU1, Fnptr_Void) +_vuTablesMess(VU1, FnPtr_VuVoid) _vuTablesPost(VU1, VU1) -_vuRegsTables(VU0, VU0regs, Fnptr_VuRegsN) -_vuRegsTables(VU1, VU1regs, Fnptr_VuRegsN) +_vuRegsTables(VU0, VU0regs, FnPtr_VuRegsN) +_vuRegsTables(VU1, VU1regs, FnPtr_VuRegsN) // -------------------------------------------------------------------------------------- diff --git a/pcsx2/VUops.h b/pcsx2/VUops.h index d37e405a60..7a4682946e 100644 --- a/pcsx2/VUops.h +++ b/pcsx2/VUops.h @@ -38,18 +38,18 @@ struct _VURegsNum { int cycles; }; -typedef void FnType_VuRegsN(_VURegsNum *VUregsn); -typedef FnType_VuRegsN* Fnptr_VuRegsN; +using FnPtr_VuVoid = void (*)(); +using FnPtr_VuRegsN = void(*)(_VURegsNum *VUregsn); -alignas(16) extern const Fnptr_Void VU0_LOWER_OPCODE[128]; -alignas(16) extern const Fnptr_Void VU0_UPPER_OPCODE[64]; -alignas(16) extern const Fnptr_VuRegsN VU0regs_LOWER_OPCODE[128]; -alignas(16) extern const Fnptr_VuRegsN VU0regs_UPPER_OPCODE[64]; +alignas(16) extern const FnPtr_VuVoid VU0_LOWER_OPCODE[128]; +alignas(16) extern const FnPtr_VuVoid VU0_UPPER_OPCODE[64]; +alignas(16) extern const FnPtr_VuRegsN VU0regs_LOWER_OPCODE[128]; +alignas(16) extern const FnPtr_VuRegsN VU0regs_UPPER_OPCODE[64]; -alignas(16) extern const Fnptr_Void VU1_LOWER_OPCODE[128]; -alignas(16) extern const Fnptr_Void VU1_UPPER_OPCODE[64]; -alignas(16) extern const Fnptr_VuRegsN VU1regs_LOWER_OPCODE[128]; -alignas(16) extern const Fnptr_VuRegsN VU1regs_UPPER_OPCODE[64]; +alignas(16) extern const FnPtr_VuVoid VU1_LOWER_OPCODE[128]; +alignas(16) extern const FnPtr_VuVoid VU1_UPPER_OPCODE[64]; +alignas(16) extern const FnPtr_VuRegsN VU1regs_LOWER_OPCODE[128]; +alignas(16) extern const FnPtr_VuRegsN VU1regs_UPPER_OPCODE[64]; extern void _vuClearFMAC(VURegs * VU); extern void _vuTestPipes(VURegs * VU); extern void _vuTestUpperStalls(VURegs * VU, _VURegsNum *VUregsn); diff --git a/pcsx2/x86/iR3000Atables.cpp b/pcsx2/x86/iR3000Atables.cpp index bf1d1db1bb..e2b1d5fc0a 100644 --- a/pcsx2/x86/iR3000Atables.cpp +++ b/pcsx2/x86/iR3000Atables.cpp @@ -22,6 +22,8 @@ #include "IopDma.h" #include "IopGte.h" +#include "common/Console.h" + using namespace x86Emitter; extern int g_psxWriteOk; diff --git a/pcsx2/x86/ix86-32/iCore.cpp b/pcsx2/x86/ix86-32/iCore.cpp index 3c8a0564e3..4e46a4eb6f 100644 --- a/pcsx2/x86/ix86-32/iCore.cpp +++ b/pcsx2/x86/ix86-32/iCore.cpp @@ -22,6 +22,7 @@ #include "x86/iR3000A.h" #include "x86/iR5900.h" +#include "common/Console.h" #include "common/emitter/x86emitter.h" using namespace x86Emitter; diff --git a/pcsx2/x86/microVU.h b/pcsx2/x86/microVU.h index 8c5ff8efdc..ea68ccc9c6 100644 --- a/pcsx2/x86/microVU.h +++ b/pcsx2/x86/microVU.h @@ -1,5 +1,5 @@ /* PCSX2 - PS2 Emulator for PCs - * Copyright (C) 2002-2010 PCSX2 Dev Team + * Copyright (C) 2002-2023 PCSX2 Dev Team * * PCSX2 is free software: you can redistribute it and/or modify it under the terms * of the GNU Lesser General Public License as published by the Free Software Found- @@ -14,11 +14,9 @@ */ #pragma once -//#define mVUlogProg // Dumps MicroPrograms to \logs\*.html -//#define mVUprofileProg // Shows opcode statistics in console -class AsciiFile; -using namespace x86Emitter; + //#define mVUlogProg // Dumps MicroPrograms to \logs\*.html +//#define mVUprofileProg // Shows opcode statistics in console #include #include diff --git a/pcsx2/x86/microVU_Macro.inl b/pcsx2/x86/microVU_Macro.inl index bafad491a1..4e62931b9a 100644 --- a/pcsx2/x86/microVU_Macro.inl +++ b/pcsx2/x86/microVU_Macro.inl @@ -405,7 +405,7 @@ static void mVUFinishVU0() skipvuidle.SetTarget(); } -static void TEST_FBRST_RESET(int flagreg, FnType_Void* resetFunct, int vuIndex) +static void TEST_FBRST_RESET(int flagreg, void(*resetFunct)(), int vuIndex) { xTEST(xRegister32(flagreg), (vuIndex) ? 0x200 : 0x002); xForwardJZ8 skip; diff --git a/tests/ctest/core/GS/swizzle_test_main.cpp b/tests/ctest/core/GS/swizzle_test_main.cpp index 436c40b564..e12ddb38b2 100644 --- a/tests/ctest/core/GS/swizzle_test_main.cpp +++ b/tests/ctest/core/GS/swizzle_test_main.cpp @@ -17,6 +17,7 @@ #include "pcsx2/GS/GSBlock.h" #include "pcsx2/GS/GSClut.h" #include "pcsx2/GS/MultiISA.h" +#include "common/emitter/tools.h" #include #include