From 989b564fa42f64e78293aa66a82c4971b9f58385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 7 May 2019 21:47:50 +0200 Subject: [PATCH 01/14] Game server: Reject bad URLs --- ext/native/net/url.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ext/native/net/url.cpp b/ext/native/net/url.cpp index 32311c4354..ec32a3fe99 100644 --- a/ext/native/net/url.cpp +++ b/ext/native/net/url.cpp @@ -16,6 +16,10 @@ void Url::Split() { protocol_ = url_.substr(0, colonSlashSlash); size_t sep = url_.find('/', colonSlashSlash + 3); + if (sep == std::string::npos) { + valid_ = false; + return; + } host_ = url_.substr(colonSlashSlash + 3, sep - colonSlashSlash - 3); resource_ = url_.substr(sep); // include the slash! From 83039f3f906b67480da829f9eb954fe10db1a625 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 7 May 2019 23:23:43 +0200 Subject: [PATCH 02/14] Remote ISO: Fix bugs from issue #12018 and probably #12019 --- Core/FileLoaders/HTTPFileLoader.cpp | 6 ++++++ UI/RemoteISOScreen.cpp | 11 ++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Core/FileLoaders/HTTPFileLoader.cpp b/Core/FileLoaders/HTTPFileLoader.cpp index 9c14f5b9fb..0731c617fb 100644 --- a/Core/FileLoaders/HTTPFileLoader.cpp +++ b/Core/FileLoaders/HTTPFileLoader.cpp @@ -27,6 +27,12 @@ HTTPFileLoader::HTTPFileLoader(const std::string &filename) void HTTPFileLoader::Prepare() { std::call_once(preparedFlag_, [this](){ + if (!url_.Valid()) { + ERROR_LOG(LOADER, "HTTP request failed, invalid URL"); + latestError_ = "Invalid URL"; + return; + } + if (!client_.Resolve(url_.Host().c_str(), url_.Port())) { ERROR_LOG(LOADER, "HTTP request failed, unable to resolve: %s port %d", url_.Host().c_str(), url_.Port()); latestError_ = "Could not connect (name not resolved)"; diff --git a/UI/RemoteISOScreen.cpp b/UI/RemoteISOScreen.cpp index 9ba9df4f7d..783ec81f3d 100644 --- a/UI/RemoteISOScreen.cpp +++ b/UI/RemoteISOScreen.cpp @@ -204,7 +204,16 @@ static bool LoadGameList(const std::string &host, int port, std::vector Date: Wed, 8 May 2019 00:14:19 +0200 Subject: [PATCH 03/14] UWP: Update the temporary-key with a new one generated by dominater01 --- UWP/PPSSPP_UWP_TemporaryKey.pfx | Bin 2520 -> 2520 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/UWP/PPSSPP_UWP_TemporaryKey.pfx b/UWP/PPSSPP_UWP_TemporaryKey.pfx index b6b8f016d6acc7af0805821d4aad8f865d4ab49d..a7ffbad86017a6dcc26a9e41a9d00fbb28488520 100644 GIT binary patch delta 2267 zcmV<12qgE|6W9}wXn*(0TE!%Y({cg=2haq91lWsmaq=caIbH>)&cjz_H2eT?KV*!W zQ5>w+vJ~o16d+v}ey`#)$Ls9XQ_3X#x)<;CW z`pU4vzw3q>Fi(~NKdw=P((E~u1imn|70}38wFO^Hn6+^p>VLE!X#0_=`7G4p2yyVV zRO6)JHA#~}L->=axM}$bo{t^#EWEP4SR}36R-N0qLY(ieYGZOu^he{T3YgoF+LUIKv^$9bc&J8U6? zzb&u)sDZ>^B7f41|9zdKr4-3c0V8>wSL~d{ORnYfi{+oI2ct@-GUeOk=_UehEb(R$ zFsm*cUGAL*|0{q_yUwbuoRw*x&})pI^T;|NKHqpyn#0^639%E6YjyPDV zPpgBGiDuM=CNIaWS`VL1Ss@WFmvOzb*C;kj`%bpbZ6z42OTTR1>|=FPWq~+S<~hn8T<~J@>Q;0biP9 zyMGWdJpnPDyMSeF&Mc-=gGp}+%NHrxY-XYn_orH#Ke(9tjP0O>Y#tErfn1PeR^%vYOILuL7;sNi370s)q$3}(X;=n(clapt+rZoZI{H-zf;F#O;Euvx z#{3D4J^>_(`pd-Np%tc;)0=m0KbeYb7)3bIUc^(C&rAP?*yj9iy=w=&sN1=Fvwy6+ z>90>gvVs(Vw!6C2tjOirR8qtKbx0C|@|M)JAI{4&Nf5Apw|@ljZvq%c-`gI0R29*U zpg}!h_(>y0V;RhH*oso&{rw(LmBxr%8=>0jrUTz)8F;iT)-TIE?c~O`I05A$-Y{Aw zSDN;8UHv(Tv-ScPQGel&gB24J$$x2DyI9RgieBCGYAd2d0Wlkfg~=6w zLv8Rk6@$5znUEG>YJ+`#3m&P$mc}9u{v|Q0*zj8ywi2%M)*mv?3}r^B7tw4&LNQUu+&&|7GDINC>MMPObNH$Nt_uNY zmcbuw!X0uIwa={A-o%g1vY@(KIm4Ad<0Qm&50O|+;)nu6UQnRPV%(IER)2b=a#yJC zLtWvFx%iEd81Da7Q6cR9RI0rqsB!HAc08C;|H}`M2Q{PRMR9M)LM*3X$MkRNw3b(b z0sb`?(Iv=mZIy~fpBU?SmLOoVi;a^bbyt^&}aHCs}!*Co6!9y0q)^yw(%VALUe1Nd4Czv)%Ab|B8ZFk zY){o6V5UQx)kQFhOqRlPL!~TCu5d*utT%~$>1MR5n{VoVQ5)UCL%r1YySQ_fF)_lwFk^V>!6lzGPs4%j6{_)WG9xw$P8HgVg+yrfyn~| z(AH~~{M+T^H|%SRbX&#&@;)**f~>oz$&crIiJW@_moTuV+@=Rf&o1j@1P#)FQ$kSkI`+zUNkz6}?3j-d2@M8OPq<(@11W3SP70N6&!6r##1q;m?oW$gciH_BZm2H$I_k#K(%Y1Nuv356QOpPZmrKGQ}aoLfyG z)?=>n-P=yil=xsBZ^oU+F~Fgq|GFb4(&D-Ht!8Uz&arFM^Q-^zTa p65Kdz76NKeyGz#u6w~VdhqeO8SUpzSbw_lamrYgZrUU{42hb_QO2_~J delta 2267 zcmV<12qgE|6W9}wXn$neRCwwnXj=jT2haq91labkwYT2~M>Tq#oDwS1n0(*I_g>&9 zOeL;ue>tMg59x~`oa;Q5R{{9mURQQ5V}NS~Ac>`g#yU4vQr(27Dbv4w(1(v{b25M& zY4Rm?9yL_kG`vqJGxord$YwkFIVZe?As@DDSs!3%$%3n2h<}|Ru;^&y_OJ6Abc#Z; zow9_8p==JGKrWbrb@mvT(hChX<+>X&frrzXqML-8^7v=eU#t`BZNqrKgXpmjM{2I) zq15z*lhvDRhQt-~#3d%coFJ0nwFQ9r<8~8Mt7C{S2z9vkRd@wig#=Jen09<$=$Yz5 z|G79lhRgafh<_x{70&8l)vTfdjjyqtjYwKd38l$es;mpi_o?cK5|WNC@nsu0|8d=kTi(4+?$twDOMeFbEU5R+-C;MKIZ3@s#Bm$4 z6Uzj?5hc6^9qu#$rz_o zJ|zl-{k;$mKwcp`9LiLL-D33_mU)do@sFrOc{oVc2FPd~$6&_-vm1(kFOSKPukFrA zG=B`28a%4&m23cI3}ej@77%=vX;t6a`+UyS=6q^B-?VIwoa1wTdWvfn??Qs%h?H&w zxa4eGF*EjJ3AoTwXN~><1b5s3Vn?4<^H>aG#hJtN9dm@!WwCX*AsFYr1`)im5%jZT z;W79oIFB65J%q~UbbaITkHo9E**fRlpns2>Cj;?WBFMAEEr`axX4uoP-%}VsM^#TV z^b{&hfjpw!r>Yuty>H^Zo{?60<6_-%-IBo@mk+$_1A?I9;1r z=K`}ncbd8i^P>>)Ic+#HFkpfHynky&FWF4&)>nczD?DRIl!%!(Zsl@{xkI;czqZ@b zS0nLK7bCk^6MZ+Tkc6Ue*-3$kX!UuyyF0VR1v~DKMr9uFzj|`1&)8AZ0!z>>Q$fz2=z1_>&LNQUOEdVqCH2^sPH~=jGIRIn;FaR+CEdVzFHUKgJ zH~?h;H~={SF#uu!VE|s{%{FfNEreG2hf0m1287rzVa^evnJVGq7LX* z?wM;48pb#F$`LH?A0hSinYlc1u150bX?kOEfNPNz&#u3rSYM4p)*w7vU=$+Yg5#B? z4V3fd;YQ~O?|!m{5GU0MdU|p#oya?sYB<%hzy$dTniF#diw75xU;NQ7#DAxu9{FQ? zd&)i=v~}te=#>QRU9-HFEH&dumkh|Mzt562e3#{b|bEKJ$8z0(~Q%`IC= zkj@v#@~Oo7TH|GDF_zIPR5dnzq%Gu@BsAV}>v;jy*KRSF@O1DT?RDijA>J@oJQFF? z3Vq4ayxKFwRZ>s}VKP0)k$)0_pIu3OHW>h%k>`r^mqenv7E(7-+#WLUhWz}`kqgF;^gx6 zOEVDwjlBXLXm{*<;B0?CVg)|^gEgH-tVb#Qd76ObIOqd0uA^&(@qZBjv^u33HRp~2 zSQag1&CjKX+z^+6bKzZ^;-)c5BkQaetOz^ear#TA~;q>*-

Pa@$T7)qYWW~9U6*H+CPtD zXFWuto73&d&z*$SS$WSYUk!BDSOyEgYDkCI z@oGR!un&JB Date: Thu, 9 May 2019 23:58:23 +0200 Subject: [PATCH 04/14] Revert "Remove default SDK version from project files" Seems to have been the wrong thing to do, see: https://developercommunity.visualstudio.com/content/problem/140294/windowstargetplatformversion-makes-it-impossible-t.html Though due to the bug described there, there's no perfect solution, just some ugly ones (which I might try later). Anyway, I guess most people will move on to VS 2019 anyway.. This reverts commit 056494522e710f9384880d455d73e5ac463d2989. --- Common/Common.vcxproj | 2 +- Core/Core.vcxproj | 3 +-- GPU/GPU.vcxproj | 2 +- UI/UI.vcxproj | 2 +- Windows/PPSSPP.vcxproj | 2 +- ext/SPIRV-Cross.vcxproj | 2 +- ext/discord-rpc-build/discord-rpc.vcxproj | 2 +- ext/glslang.vcxproj | 2 +- ext/libarmips.vcxproj | 2 +- ext/libkirk/libkirk.vcxproj | 2 +- ext/native/native.vcxproj | 2 +- ext/zlib/zlib.vcxproj | 2 +- headless/Headless.vcxproj | 2 +- unittest/UnitTests.vcxproj | 2 +- 14 files changed, 14 insertions(+), 15 deletions(-) diff --git a/Common/Common.vcxproj b/Common/Common.vcxproj index 1a30dc46a2..c79aa139fc 100644 --- a/Common/Common.vcxproj +++ b/Common/Common.vcxproj @@ -38,7 +38,7 @@ {3FCDBAE2-5103-4350-9A8E-848CE9C73195} Win32Proj Common - + 10.0 diff --git a/Core/Core.vcxproj b/Core/Core.vcxproj index fd905fd4a3..a8033b59fa 100644 --- a/Core/Core.vcxproj +++ b/Core/Core.vcxproj @@ -37,8 +37,7 @@ {533F1D30-D04D-47CC-AD71-20F658907E36} Core - - + 10.0 diff --git a/GPU/GPU.vcxproj b/GPU/GPU.vcxproj index 93852595ec..865601e7d6 100644 --- a/GPU/GPU.vcxproj +++ b/GPU/GPU.vcxproj @@ -37,7 +37,7 @@ {457F45D2-556F-47BC-A31D-AFF0D15BEAED} GPU - + 10.0 diff --git a/UI/UI.vcxproj b/UI/UI.vcxproj index 594287ba99..c2e5cf0b1d 100644 --- a/UI/UI.vcxproj +++ b/UI/UI.vcxproj @@ -109,7 +109,7 @@ {004B8D11-2BE3-4BD9-AB40-2BE04CF2096F} Win32Proj UI - + 10.0 diff --git a/Windows/PPSSPP.vcxproj b/Windows/PPSSPP.vcxproj index ffddcb744d..fad5844b52 100644 --- a/Windows/PPSSPP.vcxproj +++ b/Windows/PPSSPP.vcxproj @@ -39,7 +39,7 @@ DaSh Win32Proj PPSSPPWindows - + 10.0 diff --git a/ext/SPIRV-Cross.vcxproj b/ext/SPIRV-Cross.vcxproj index 3c4cb76671..763edab373 100644 --- a/ext/SPIRV-Cross.vcxproj +++ b/ext/SPIRV-Cross.vcxproj @@ -38,7 +38,7 @@ {4328A62C-F1E9-47ED-B816-A1A81DAF4363} Win32Proj SPIRVCross - + 10.0 diff --git a/ext/discord-rpc-build/discord-rpc.vcxproj b/ext/discord-rpc-build/discord-rpc.vcxproj index 78d19d8887..a142afd718 100644 --- a/ext/discord-rpc-build/discord-rpc.vcxproj +++ b/ext/discord-rpc-build/discord-rpc.vcxproj @@ -57,7 +57,7 @@ {BEB0A821-3C7F-410F-A525-63AFBC69BF8F} Win32Proj discordrpc - + 10.0 diff --git a/ext/glslang.vcxproj b/ext/glslang.vcxproj index c3325050c6..2a17ea0287 100644 --- a/ext/glslang.vcxproj +++ b/ext/glslang.vcxproj @@ -38,7 +38,7 @@ {EDFA2E87-8AC1-4853-95D4-D7594FF81947} Win32Proj glslang - + 10.0 diff --git a/ext/libarmips.vcxproj b/ext/libarmips.vcxproj index a30fc1b7ec..a0819c06d1 100644 --- a/ext/libarmips.vcxproj +++ b/ext/libarmips.vcxproj @@ -54,7 +54,7 @@ {129E5E2B-39C1-4D84-96FE-DFD22DBB4A25} Win32Proj libarmips - + 10.0 diff --git a/ext/libkirk/libkirk.vcxproj b/ext/libkirk/libkirk.vcxproj index 064eafe636..58c2a185cc 100644 --- a/ext/libkirk/libkirk.vcxproj +++ b/ext/libkirk/libkirk.vcxproj @@ -37,7 +37,7 @@ {3BAAE095-E0AB-4B0E-B5DF-CE39C8AE31DE} libkirk - + 10.0 diff --git a/ext/native/native.vcxproj b/ext/native/native.vcxproj index 3a7d58e58e..8641c1190b 100644 --- a/ext/native/native.vcxproj +++ b/ext/native/native.vcxproj @@ -38,7 +38,7 @@ {C4DF647E-80EA-4111-A0A8-218B1B711E18} Win32Proj native - + 10.0 diff --git a/ext/zlib/zlib.vcxproj b/ext/zlib/zlib.vcxproj index d36394dcb6..df6dd32b14 100644 --- a/ext/zlib/zlib.vcxproj +++ b/ext/zlib/zlib.vcxproj @@ -68,7 +68,7 @@ {F761046E-6C38-4428-A5F1-38391A37BB34} Win32Proj zlib - + 10.0 diff --git a/headless/Headless.vcxproj b/headless/Headless.vcxproj index 09d01ce1e9..a9c1dfc5c9 100644 --- a/headless/Headless.vcxproj +++ b/headless/Headless.vcxproj @@ -39,7 +39,7 @@ Win32Proj Headless PPSSPPHeadless - + 10.0 diff --git a/unittest/UnitTests.vcxproj b/unittest/UnitTests.vcxproj index 19019e726a..ca4d104f57 100644 --- a/unittest/UnitTests.vcxproj +++ b/unittest/UnitTests.vcxproj @@ -39,7 +39,7 @@ Win32Proj UnitTests UnitTest - + 10.0 From 22d9ab4dbed8f8eeeaa278b90db48027971f805a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 8 May 2019 23:41:46 +0200 Subject: [PATCH 05/14] Fix #12023, accidental disabling of the GL backend on non-Windows ARM platform caused by #12013. --- GPU/GPU.cpp | 5 +++-- ext/native/gfx_es2/gpu_features.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/GPU/GPU.cpp b/GPU/GPU.cpp index 666cc760cd..5681fd442d 100644 --- a/GPU/GPU.cpp +++ b/GPU/GPU.cpp @@ -27,7 +27,7 @@ #if PPSSPP_PLATFORM(UWP) #include "GPU/D3D11/GPU_D3D11.h" #else -#if !defined(_M_ARM64) && !defined(_M_ARM) +#if !PPSSPP_PLATFORM(WINDOWS) || (!defined(_M_ARM64) && !defined(_M_ARM)) #include "GPU/GLES/GPU_GLES.h" #endif #include "GPU/Vulkan/GPU_Vulkan.h" @@ -72,7 +72,8 @@ bool GPU_Init(GraphicsContext *ctx, Draw::DrawContext *draw) { SetGPU(new NullGPU()); break; case GPUCORE_GLES: -#if !defined(_M_ARM64) && !defined(_M_ARM) + // Disable GLES on ARM Windows (but leave it enabled on other ARM platforms). +#if !PPSSPP_PLATFORM(WINDOWS) || (!defined(_M_ARM64) && !defined(_M_ARM)) SetGPU(new GPU_GLES(ctx, draw)); break; #else diff --git a/ext/native/gfx_es2/gpu_features.cpp b/ext/native/gfx_es2/gpu_features.cpp index 00c458b002..f23c310357 100644 --- a/ext/native/gfx_es2/gpu_features.cpp +++ b/ext/native/gfx_es2/gpu_features.cpp @@ -6,7 +6,7 @@ #include "base/logging.h" #include "base/stringutil.h" -#if !defined(_M_ARM64) && !defined(_M_ARM) +#if !PPSSPP_PLATFORM(WINDOWS) || (!defined(_M_ARM64) && !defined(_M_ARM)) #if !PPSSPP_PLATFORM(UWP) #include "gfx/gl_common.h" From 1f40aa48288c274643da0ca650834494a302f1f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 10 May 2019 22:44:12 +0200 Subject: [PATCH 06/14] Add WindowsSDKDesktopARM64Support to vcxproj files --- Common/Common.vcxproj | 2 ++ Core/Core.vcxproj | 2 ++ GPU/GPU.vcxproj | 2 ++ UI/UI.vcxproj | 2 ++ Windows/PPSSPP.vcxproj | 2 ++ ext/SPIRV-Cross.vcxproj | 2 ++ ext/discord-rpc-build/discord-rpc.vcxproj | 2 ++ ext/glslang.vcxproj | 2 ++ ext/libarmips.vcxproj | 6 +++--- ext/libkirk/libkirk.vcxproj | 2 ++ ext/native/native.vcxproj | 2 ++ ext/zlib/zlib.vcxproj | 3 ++- headless/Headless.vcxproj | 2 ++ unittest/UnitTests.vcxproj | 2 ++ 14 files changed, 29 insertions(+), 4 deletions(-) diff --git a/Common/Common.vcxproj b/Common/Common.vcxproj index c79aa139fc..40c9c0b12a 100644 --- a/Common/Common.vcxproj +++ b/Common/Common.vcxproj @@ -58,6 +58,7 @@ true Unicode $(DefaultPlatformToolset) + true StaticLibrary @@ -83,6 +84,7 @@ false Unicode $(DefaultPlatformToolset) + true StaticLibrary diff --git a/Core/Core.vcxproj b/Core/Core.vcxproj index a8033b59fa..618a77d5fb 100644 --- a/Core/Core.vcxproj +++ b/Core/Core.vcxproj @@ -57,6 +57,7 @@ true Unicode $(DefaultPlatformToolset) + true StaticLibrary @@ -83,6 +84,7 @@ false Unicode $(DefaultPlatformToolset) + true StaticLibrary diff --git a/GPU/GPU.vcxproj b/GPU/GPU.vcxproj index 865601e7d6..e526a86641 100644 --- a/GPU/GPU.vcxproj +++ b/GPU/GPU.vcxproj @@ -57,6 +57,7 @@ true Unicode $(DefaultPlatformToolset) + true StaticLibrary @@ -83,6 +84,7 @@ false Unicode $(DefaultPlatformToolset) + true StaticLibrary diff --git a/UI/UI.vcxproj b/UI/UI.vcxproj index c2e5cf0b1d..2447f6ff04 100644 --- a/UI/UI.vcxproj +++ b/UI/UI.vcxproj @@ -129,6 +129,7 @@ true $(DefaultPlatformToolset) Unicode + true StaticLibrary @@ -155,6 +156,7 @@ false $(DefaultPlatformToolset) Unicode + true StaticLibrary diff --git a/Windows/PPSSPP.vcxproj b/Windows/PPSSPP.vcxproj index fad5844b52..bf51116fdc 100644 --- a/Windows/PPSSPP.vcxproj +++ b/Windows/PPSSPP.vcxproj @@ -62,6 +62,7 @@ Application Unicode $(DefaultPlatformToolset) + true Application @@ -79,6 +80,7 @@ Unicode $(DefaultPlatformToolset) Spectre + true Application diff --git a/ext/SPIRV-Cross.vcxproj b/ext/SPIRV-Cross.vcxproj index 763edab373..5afe24d1af 100644 --- a/ext/SPIRV-Cross.vcxproj +++ b/ext/SPIRV-Cross.vcxproj @@ -64,6 +64,7 @@ true $(DefaultPlatformToolset) Unicode + true StaticLibrary @@ -83,6 +84,7 @@ false $(DefaultPlatformToolset) Unicode + true StaticLibrary diff --git a/ext/discord-rpc-build/discord-rpc.vcxproj b/ext/discord-rpc-build/discord-rpc.vcxproj index a142afd718..fb69271b70 100644 --- a/ext/discord-rpc-build/discord-rpc.vcxproj +++ b/ext/discord-rpc-build/discord-rpc.vcxproj @@ -83,6 +83,7 @@ true $(DefaultPlatformToolset) Unicode + true StaticLibrary @@ -102,6 +103,7 @@ false $(DefaultPlatformToolset) Unicode + true StaticLibrary diff --git a/ext/glslang.vcxproj b/ext/glslang.vcxproj index 2a17ea0287..d46a1bb5fb 100644 --- a/ext/glslang.vcxproj +++ b/ext/glslang.vcxproj @@ -64,6 +64,7 @@ true $(DefaultPlatformToolset) Unicode + true StaticLibrary @@ -83,6 +84,7 @@ false $(DefaultPlatformToolset) Unicode + true StaticLibrary diff --git a/ext/libarmips.vcxproj b/ext/libarmips.vcxproj index a0819c06d1..9fd151e373 100644 --- a/ext/libarmips.vcxproj +++ b/ext/libarmips.vcxproj @@ -74,6 +74,7 @@ true $(DefaultPlatformToolset) Unicode + true StaticLibrary @@ -99,6 +100,7 @@ true $(DefaultPlatformToolset) Unicode + true StaticLibrary @@ -323,9 +325,7 @@ Windows true - - $(OutDir)$(TargetName)$(TargetExt) - + diff --git a/ext/libkirk/libkirk.vcxproj b/ext/libkirk/libkirk.vcxproj index 58c2a185cc..0412a16e77 100644 --- a/ext/libkirk/libkirk.vcxproj +++ b/ext/libkirk/libkirk.vcxproj @@ -57,6 +57,7 @@ true $(DefaultPlatformToolset) Unicode + true StaticLibrary @@ -83,6 +84,7 @@ false $(DefaultPlatformToolset) Unicode + true StaticLibrary diff --git a/ext/native/native.vcxproj b/ext/native/native.vcxproj index 8641c1190b..a7eccdecdf 100644 --- a/ext/native/native.vcxproj +++ b/ext/native/native.vcxproj @@ -58,6 +58,7 @@ true Unicode $(DefaultPlatformToolset) + true StaticLibrary @@ -84,6 +85,7 @@ false Unicode $(DefaultPlatformToolset) + true StaticLibrary diff --git a/ext/zlib/zlib.vcxproj b/ext/zlib/zlib.vcxproj index df6dd32b14..7ed2294450 100644 --- a/ext/zlib/zlib.vcxproj +++ b/ext/zlib/zlib.vcxproj @@ -88,6 +88,7 @@ true Unicode $(DefaultPlatformToolset) + true StaticLibrary @@ -114,6 +115,7 @@ false Unicode $(DefaultPlatformToolset) + true StaticLibrary @@ -225,7 +227,6 @@ false NotSet Precise - Default true false false diff --git a/headless/Headless.vcxproj b/headless/Headless.vcxproj index a9c1dfc5c9..24e733f3c0 100644 --- a/headless/Headless.vcxproj +++ b/headless/Headless.vcxproj @@ -59,6 +59,7 @@ true Unicode $(DefaultPlatformToolset) + true Application @@ -85,6 +86,7 @@ false Unicode $(DefaultPlatformToolset) + true Application diff --git a/unittest/UnitTests.vcxproj b/unittest/UnitTests.vcxproj index ca4d104f57..cded0bf333 100644 --- a/unittest/UnitTests.vcxproj +++ b/unittest/UnitTests.vcxproj @@ -59,6 +59,7 @@ true $(DefaultPlatformToolset) Unicode + true Application @@ -85,6 +86,7 @@ false $(DefaultPlatformToolset) Unicode + true Application From 20d666ff554b1294c122603128a50ea5a82d80a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 10 May 2019 23:18:31 +0200 Subject: [PATCH 07/14] Remove DbgNew.h forced include in ARM debug builds, doesn't work for some reason. --- Common/Common.vcxproj | 4 ++-- Core/Core.vcxproj | 5 +++-- GPU/GPU.vcxproj | 5 +++-- UI/UI.vcxproj | 5 +++-- Windows/PPSSPP.vcxproj | 4 ++-- ext/libkirk/libkirk.vcxproj | 5 +++-- ext/native/native.vcxproj | 5 +++-- ext/zlib/zlib.vcxproj | 10 +++++++--- headless/Headless.vcxproj | 5 +++-- unittest/UnitTests.vcxproj | 5 +++-- 10 files changed, 32 insertions(+), 21 deletions(-) diff --git a/Common/Common.vcxproj b/Common/Common.vcxproj index 40c9c0b12a..539b1294d6 100644 --- a/Common/Common.vcxproj +++ b/Common/Common.vcxproj @@ -209,7 +209,7 @@ Use Level3 - stdafx.h;Common/DbgNew.h + stdafx.h MultiThreadedDebug _CRTDBG_MAP_ALLOC;USING_WIN_UI;_CRT_SECURE_NO_WARNINGS;WIN32;_ARCH_32=1;_DEBUG;_LIB;_UNICODE;UNICODE;%(PreprocessorDefinitions) ../ext/native;../ext/snappy;.. @@ -542,4 +542,4 @@ - + \ No newline at end of file diff --git a/Core/Core.vcxproj b/Core/Core.vcxproj index 618a77d5fb..2343ab775d 100644 --- a/Core/Core.vcxproj +++ b/Core/Core.vcxproj @@ -202,7 +202,8 @@ false false MultiThreadedDebug - Common/DbgNew.h + + ProgramDatabase @@ -1178,4 +1179,4 @@ - + \ No newline at end of file diff --git a/GPU/GPU.vcxproj b/GPU/GPU.vcxproj index e526a86641..84bf4322d5 100644 --- a/GPU/GPU.vcxproj +++ b/GPU/GPU.vcxproj @@ -233,7 +233,8 @@ false _CRTDBG_MAP_ALLOC;USING_WIN_UI;_CRT_SECURE_NO_WARNINGS;WIN32;_ARCH_32=1;_DEBUG;_LIB;_UNICODE;UNICODE;%(PreprocessorDefinitions) MultiThreadedDebug - Common/DbgNew.h + + ProgramDatabase @@ -704,4 +705,4 @@ - + \ No newline at end of file diff --git a/UI/UI.vcxproj b/UI/UI.vcxproj index 2447f6ff04..c512d47402 100644 --- a/UI/UI.vcxproj +++ b/UI/UI.vcxproj @@ -279,7 +279,8 @@ false MultiThreadedDebug false - Common/DbgNew.h + + $(EXTERNAL_COMPILE_OPTIONS) ProgramDatabase @@ -413,4 +414,4 @@ - + \ No newline at end of file diff --git a/Windows/PPSSPP.vcxproj b/Windows/PPSSPP.vcxproj index bf51116fdc..2a8f370250 100644 --- a/Windows/PPSSPP.vcxproj +++ b/Windows/PPSSPP.vcxproj @@ -336,7 +336,7 @@ Level3 ProgramDatabase ../dx9sdk/Include/DX11;../ext;../common;..;../ext/native;../ext/glew;../ext/zlib - stdafx.h;Common/DbgNew.h + stdafx.h MultiThreadedDebug false NotSet @@ -1019,4 +1019,4 @@ - + \ No newline at end of file diff --git a/ext/libkirk/libkirk.vcxproj b/ext/libkirk/libkirk.vcxproj index 0412a16e77..2b4003f62e 100644 --- a/ext/libkirk/libkirk.vcxproj +++ b/ext/libkirk/libkirk.vcxproj @@ -178,7 +178,8 @@ false MultiThreadedDebug false - ../../Common/DbgNew.h + + _CRTDBG_MAP_ALLOC;_USING_V110_SDK71_;%(PreprocessorDefinitions) ProgramDatabase @@ -287,4 +288,4 @@ - + \ No newline at end of file diff --git a/ext/native/native.vcxproj b/ext/native/native.vcxproj index a7eccdecdf..dcbf26d267 100644 --- a/ext/native/native.vcxproj +++ b/ext/native/native.vcxproj @@ -222,7 +222,8 @@ false MultiThreadedDebug false - ../../Common/DbgNew.h + + ProgramDatabase @@ -1200,4 +1201,4 @@ - + \ No newline at end of file diff --git a/ext/zlib/zlib.vcxproj b/ext/zlib/zlib.vcxproj index 7ed2294450..3b16ade6e0 100644 --- a/ext/zlib/zlib.vcxproj +++ b/ext/zlib/zlib.vcxproj @@ -152,7 +152,10 @@ - + + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + @@ -231,7 +234,8 @@ false false MultiThreadedDebug - ../../Common/DbgNew.h + + ProgramDatabase @@ -348,4 +352,4 @@ - + \ No newline at end of file diff --git a/headless/Headless.vcxproj b/headless/Headless.vcxproj index 24e733f3c0..e574c6a1f9 100644 --- a/headless/Headless.vcxproj +++ b/headless/Headless.vcxproj @@ -269,7 +269,8 @@ false false MultiThreadedDebug - Common/DbgNew.h + + ProgramDatabase @@ -498,4 +499,4 @@ - + \ No newline at end of file diff --git a/unittest/UnitTests.vcxproj b/unittest/UnitTests.vcxproj index cded0bf333..017509a1d2 100644 --- a/unittest/UnitTests.vcxproj +++ b/unittest/UnitTests.vcxproj @@ -235,7 +235,8 @@ false MultiThreadedDebug false - Common/DbgNew.h + + ProgramDatabase @@ -415,4 +416,4 @@ - + \ No newline at end of file From 2f26297062d820d5b7ab5e9ae2a1b7b94d223d9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 10 May 2019 23:25:57 +0200 Subject: [PATCH 08/14] Clean up some more ifdefs --- Common/ColorConvNEON.cpp | 2 +- Core/Config.cpp | 4 ++-- Core/HW/StereoResampler.cpp | 2 +- Core/MIPS/IR/IRInterpreter.cpp | 2 +- Core/MemMap.h | 4 ---- Core/Util/AudioFormatNEON.cpp | 2 +- GPU/Common/TextureCacheCommon.cpp | 3 ++- GPU/Common/TextureDecoderNEON.cpp | 2 +- GPU/GPU.cpp | 11 +++-------- GPU/GPUState.cpp | 2 +- UI/EmuScreen.cpp | 2 +- UI/GameSettingsScreen.cpp | 2 +- Windows/MainWindow.cpp | 7 ++++--- Windows/MainWindowMenu.cpp | 8 ++++---- Windows/WindowsHost.cpp | 4 ++-- Windows/main.cpp | 7 ++++--- Windows/main.h | 2 +- ext/native/gfx_es2/gpu_features.cpp | 8 +++----- ext/native/math/dataconv.h | 2 +- headless/Headless.cpp | 8 ++++++-- headless/WindowsHeadlessHost.cpp | 4 ++-- ppsspp_config.h | 13 +++++++++++++ 22 files changed, 55 insertions(+), 46 deletions(-) diff --git a/Common/ColorConvNEON.cpp b/Common/ColorConvNEON.cpp index 46a5cea5fd..375bcd0e75 100644 --- a/Common/ColorConvNEON.cpp +++ b/Common/ColorConvNEON.cpp @@ -18,7 +18,7 @@ #include "ppsspp_config.h" #if PPSSPP_ARCH(ARM_NEON) -#if defined(_MSC_VER) && defined(_M_ARM64) +#if defined(_MSC_VER) && PPSSPP_ARCH(ARM64) #include #else #include diff --git a/Core/Config.cpp b/Core/Config.cpp index 0ed26c391b..69b96c1ef1 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -566,12 +566,12 @@ int Config::NextValidBackend() { return (int)GPUBackend::DIRECT3D11; } #endif -#if !PPSSPP_PLATFORM(UWP) && !defined(_M_ARM64) && !defined(_M_ARM) +#if PPSSPP_API(ANY_GL) if (!failed.count((int)GPUBackend::OPENGL)) { return (int)GPUBackend::OPENGL; } #endif -#if PPSSPP_PLATFORM(WINDOWS) && !PPSSPP_PLATFORM(UWP) +#if PPSSPP_PLATFORM(D3D9) if (!failed.count((int)GPUBackend::DIRECT3D9)) { return (int)GPUBackend::DIRECT3D9; } diff --git a/Core/HW/StereoResampler.cpp b/Core/HW/StereoResampler.cpp index 843c89c009..89f860eeea 100644 --- a/Core/HW/StereoResampler.cpp +++ b/Core/HW/StereoResampler.cpp @@ -47,7 +47,7 @@ #include #endif #if PPSSPP_ARCH(ARM_NEON) -#if defined(_MSC_VER) && defined(_M_ARM64) +#if defined(_MSC_VER) && PPSSPP_ARCH(ARM64) #include #else #include diff --git a/Core/MIPS/IR/IRInterpreter.cpp b/Core/MIPS/IR/IRInterpreter.cpp index 29e34249a9..51724a80ef 100644 --- a/Core/MIPS/IR/IRInterpreter.cpp +++ b/Core/MIPS/IR/IRInterpreter.cpp @@ -10,7 +10,7 @@ #endif #if PPSSPP_ARCH(ARM_NEON) -#if defined(_MSC_VER) && defined(_M_ARM64) +#if defined(_MSC_VER) && PPSSPP_ARCH(ARM64) #include #else #include diff --git a/Core/MemMap.h b/Core/MemMap.h index 5c41f1e683..39cb86109f 100644 --- a/Core/MemMap.h +++ b/Core/MemMap.h @@ -157,10 +157,6 @@ u16 Read_U16(const u32 _Address); u32 Read_U32(const u32 _Address); u64 Read_U64(const u32 _Address); -#if (defined(ARM) || defined(_ARM)) && !defined(_M_ARM) -#define _M_ARM -#endif - inline u8* GetPointerUnchecked(const u32 address) { #ifdef MASKED_PSP_MEMORY return (u8 *)(base + (address & MEMVIEW32_MASK)); diff --git a/Core/Util/AudioFormatNEON.cpp b/Core/Util/AudioFormatNEON.cpp index 78c154c365..8a3bc61579 100644 --- a/Core/Util/AudioFormatNEON.cpp +++ b/Core/Util/AudioFormatNEON.cpp @@ -18,7 +18,7 @@ #include "ppsspp_config.h" #if PPSSPP_ARCH(ARM_NEON) -#if defined(_MSC_VER) && defined(_M_ARM64) +#if defined(_MSC_VER) && PPSSPP_ARCH(ARM64) #include #else #include diff --git a/GPU/Common/TextureCacheCommon.cpp b/GPU/Common/TextureCacheCommon.cpp index 971fdfb645..a5e6951559 100644 --- a/GPU/Common/TextureCacheCommon.cpp +++ b/GPU/Common/TextureCacheCommon.cpp @@ -16,6 +16,7 @@ // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. #include +#include "ppsspp_config.h" #include "profiler/profiler.h" #include "Common/ColorConv.h" #include "Common/MemoryUtil.h" @@ -35,7 +36,7 @@ #include #endif #if PPSSPP_ARCH(ARM_NEON) -#if defined(_MSC_VER) && defined(_M_ARM64) +#if defined(_MSC_VER) && PPSSPP_ARCH(ARM64) #include #else #include diff --git a/GPU/Common/TextureDecoderNEON.cpp b/GPU/Common/TextureDecoderNEON.cpp index 481144015d..af56567a45 100644 --- a/GPU/Common/TextureDecoderNEON.cpp +++ b/GPU/Common/TextureDecoderNEON.cpp @@ -21,7 +21,7 @@ #include "ext/xxhash.h" -#if defined(_MSC_VER) && defined(_M_ARM64) +#if defined(_MSC_VER) && PPSSPP_ARCH(ARM64) #include #else #include diff --git a/GPU/GPU.cpp b/GPU/GPU.cpp index 5681fd442d..47944003a7 100644 --- a/GPU/GPU.cpp +++ b/GPU/GPU.cpp @@ -24,10 +24,7 @@ #include "GPU/GPU.h" #include "GPU/GPUInterface.h" -#if PPSSPP_PLATFORM(UWP) -#include "GPU/D3D11/GPU_D3D11.h" -#else -#if !PPSSPP_PLATFORM(WINDOWS) || (!defined(_M_ARM64) && !defined(_M_ARM)) +#if PPSSPP_API(ANY_GL) #include "GPU/GLES/GPU_GLES.h" #endif #include "GPU/Vulkan/GPU_Vulkan.h" @@ -39,8 +36,6 @@ #include "GPU/D3D11/GPU_D3D11.h" #endif -#endif - GPUStatistics gpuStats; GPUInterface *gpu; GPUDebugInterface *gpuDebug; @@ -73,7 +68,7 @@ bool GPU_Init(GraphicsContext *ctx, Draw::DrawContext *draw) { break; case GPUCORE_GLES: // Disable GLES on ARM Windows (but leave it enabled on other ARM platforms). -#if !PPSSPP_PLATFORM(WINDOWS) || (!defined(_M_ARM64) && !defined(_M_ARM)) +#if PPSSPP_API(ANY_GL) SetGPU(new GPU_GLES(ctx, draw)); break; #else @@ -90,7 +85,7 @@ bool GPU_Init(GraphicsContext *ctx, Draw::DrawContext *draw) { return false; #endif case GPUCORE_DIRECTX11: -#if defined(_WIN32) +#if PPSSPP_API(D3D11) SetGPU(new GPU_D3D11(ctx, draw)); break; #else diff --git a/GPU/GPUState.cpp b/GPU/GPUState.cpp index 5ac8b8013a..44c9419cb9 100644 --- a/GPU/GPUState.cpp +++ b/GPU/GPUState.cpp @@ -28,7 +28,7 @@ #include #endif #if PPSSPP_ARCH(ARM_NEON) -#if defined(_MSC_VER) && defined(_M_ARM64) +#if defined(_MSC_VER) && PPSSPP_ARCH(ARM64) #include #else #include diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index ccd4e58225..e6be9b4956 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -219,7 +219,7 @@ void EmuScreen::bootGame(const std::string &filename) { coreParam.gpuCore = GPUCORE_DIRECTX11; break; #if !PPSSPP_PLATFORM(UWP) -#if !defined(_M_ARM) && !defined(_M_ARM64) +#if PPSSPP_API(ANY_GL) case GPUBackend::OPENGL: coreParam.gpuCore = GPUCORE_GLES; break; diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 6fb2784622..c747c627dd 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -203,7 +203,7 @@ void GameSettingsScreen::CreateViews() { renderingBackendChoice->HideChoice(1); // D3D9 renderingBackendChoice->HideChoice(2); // D3D11 #else -#if defined(_M_ARM) || defined(_M_ARM64) +#if !PPSSPP_API(ANY_GL) renderingBackendChoice->HideChoice(0); // OpenGL #endif if (!DoesVersionMatchWindows(6, 0, 0, 0, true)) { diff --git a/Windows/MainWindow.cpp b/Windows/MainWindow.cpp index d46553743f..f52506da4a 100644 --- a/Windows/MainWindow.cpp +++ b/Windows/MainWindow.cpp @@ -24,6 +24,7 @@ #include "Common/CommonWindows.h" #include "Common/KeyMap.h" #include "Common/OSVersion.h" +#include "ppsspp_config.h" #include #include @@ -48,7 +49,7 @@ #include "Core/MIPS/JitCommon/JitBlockCache.h" #include "Windows/InputBox.h" #include "Windows/InputDevice.h" -#if !defined(_M_ARM64) && !defined(_M_ARM) +#if PPSSPP_API(ANY_GL) #include "Windows/GPU/WindowsGLContext.h" #include "Windows/GEDebugger/GEDebugger.h" #endif @@ -519,7 +520,7 @@ namespace MainWindow DialogManager::AddDlg(disasmWindow[0]); disasmWindow[0]->Show(g_Config.bShowDebuggerOnLoad); -#if !defined(_M_ARM64) && !defined(_M_ARM) +#if PPSSPP_API(ANY_GL) geDebuggerWindow = new CGEDebugger(MainWindow::GetHInstance(), MainWindow::GetHWND()); DialogManager::AddDlg(geDebuggerWindow); #endif @@ -533,7 +534,7 @@ namespace MainWindow delete disasmWindow[0]; disasmWindow[0] = 0; -#if !defined(_M_ARM64) && !defined(_M_ARM) +#if PPSSPP_API(ANY_GL) DialogManager::RemoveDlg(geDebuggerWindow); if (geDebuggerWindow) delete geDebuggerWindow; diff --git a/Windows/MainWindowMenu.cpp b/Windows/MainWindowMenu.cpp index bf869c6823..24b3b7c571 100644 --- a/Windows/MainWindowMenu.cpp +++ b/Windows/MainWindowMenu.cpp @@ -16,7 +16,7 @@ #include "Common/ConsoleListener.h" #include "Common/OSVersion.h" #include "Common/Vulkan/VulkanLoader.h" -#if !defined(_M_ARM64) && !defined(_M_ARM) +#if PPSSPP_API(ANY_GL) #include "GPU/GLES/TextureScalerGLES.h" #include "GPU/GLES/TextureCacheGLES.h" #include "GPU/GLES/FramebufferManagerGLES.h" @@ -887,7 +887,7 @@ namespace MainWindow { break; case ID_DEBUG_GEDEBUGGER: -#if !defined(_M_ARM64) && !defined(_M_ARM) +#if PPSSPP_API(ANY_GL) if (geDebuggerWindow) geDebuggerWindow->Show(true); #endif @@ -1287,7 +1287,7 @@ namespace MainWindow { bool allowD3D11 = DoesVersionMatchWindows(6, 0, 0, 0, true); bool allowVulkan = VulkanMayBeAvailable(); -#if !defined(_M_ARM64) && !defined(_M_ARM) +#if PPSSPP_API(ANY_GL) bool allowOpenGL = true; #else bool allowOpenGL = false; @@ -1335,7 +1335,7 @@ namespace MainWindow { break; } -#if defined(_M_ARM64) || defined(_M_ARM) +#if PPSSPP_API(ANY_GL) EnableMenuItem(menu, ID_DEBUG_GEDEBUGGER, MF_GRAYED); #endif diff --git a/Windows/WindowsHost.cpp b/Windows/WindowsHost.cpp index 194503d11e..0195caf18b 100644 --- a/Windows/WindowsHost.cpp +++ b/Windows/WindowsHost.cpp @@ -51,7 +51,7 @@ #include "Windows/WindowsHost.h" #include "Windows/MainWindow.h" -#if !defined(_M_ARM64) && !defined(_M_ARM) +#if PPSSPP_API(ANY_GL) #include "Windows/GPU/WindowsGLContext.h" #endif #include "Windows/GPU/WindowsVulkanContext.h" @@ -121,7 +121,7 @@ void WindowsHost::UpdateConsolePosition() { bool WindowsHost::InitGraphics(std::string *error_message, GraphicsContext **ctx) { WindowsGraphicsContext *graphicsContext = nullptr; switch (g_Config.iGPUBackend) { -#if !defined(_M_ARM64) && !defined(_M_ARM) +#if PPSSPP_API(ANY_GL) case (int)GPUBackend::OPENGL: graphicsContext = new WindowsGLContext(); break; diff --git a/Windows/main.cpp b/Windows/main.cpp index 00aa3a2969..d59eb688a2 100644 --- a/Windows/main.cpp +++ b/Windows/main.cpp @@ -22,6 +22,7 @@ #include "Common/CommonWindows.h" #include "Common/OSVersion.h" #include "Common/Vulkan/VulkanLoader.h" +#include "ppsspp_config.h" #include #include @@ -56,7 +57,7 @@ #include "Windows/Debugger/Debugger_Disasm.h" #include "Windows/Debugger/Debugger_MemoryDlg.h" #include "Windows/Debugger/Debugger_VFPUDlg.h" -#if !defined(_M_ARM64) && !defined(_M_ARM) +#if PPSSPP_API(ANY_GL) #include "Windows/GEDebugger/GEDebugger.h" #endif #include "Windows/W32Util/DialogManager.h" @@ -82,7 +83,7 @@ extern "C" { extern "C" { __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; } -#if !defined(_M_ARM64) && !defined(_M_ARM) +#if PPSSPP_API(ANY_GL) CGEDebugger* geDebuggerWindow = 0; #endif @@ -595,7 +596,7 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin CtrlDisAsmView::init(); CtrlMemView::init(); CtrlRegisterList::init(); -#if !defined(_M_ARM64) && !defined(_M_ARM) +#if PPSSPP_API(ANY_GL) CGEDebugger::Init(); #endif DialogManager::AddDlg(vfpudlg = new CVFPUDlg(_hInstance, hwndMain, currentDebugMIPS)); diff --git a/Windows/main.h b/Windows/main.h index 9018b41bc8..d25d8ed006 100644 --- a/Windows/main.h +++ b/Windows/main.h @@ -27,7 +27,7 @@ extern CDisasm *disasmWindow[MAX_CPUCOUNT]; extern CMemoryDlg *memoryWindow[MAX_CPUCOUNT]; -#if !defined(_M_ARM64) && !defined(_M_ARM) +#if PPSSPP_API(ANY_GL) #include "Windows/GEDebugger/GEDebugger.h" extern CGEDebugger* geDebuggerWindow; #endif diff --git a/ext/native/gfx_es2/gpu_features.cpp b/ext/native/gfx_es2/gpu_features.cpp index f23c310357..b51b550f6b 100644 --- a/ext/native/gfx_es2/gpu_features.cpp +++ b/ext/native/gfx_es2/gpu_features.cpp @@ -6,15 +6,13 @@ #include "base/logging.h" #include "base/stringutil.h" -#if !PPSSPP_PLATFORM(WINDOWS) || (!defined(_M_ARM64) && !defined(_M_ARM)) -#if !PPSSPP_PLATFORM(UWP) +#if PPSSPP_API(ANY_GL) #include "gfx/gl_common.h" #if defined(_WIN32) #include "GL/wglew.h" #endif #endif -#endif #include "gfx_es2/gpu_features.h" @@ -121,7 +119,7 @@ void ProcessGPUFeatures() { void CheckGLExtensions() { -#if !PPSSPP_PLATFORM(UWP) && !defined(_M_ARM64) && !defined(_M_ARM) +#if !PPSSPP_PLATFORM(UWP) && !PPSSPP_ARCH(ARM64) && !PPSSPP_ARCH(ARM) // Make sure to only do this once. It's okay to call CheckGLExtensions from wherever. if (extensionsDone) @@ -571,7 +569,7 @@ static const char *glsl_fragment_prelude = "#endif\n"; std::string ApplyGLSLPrelude(const std::string &source, uint32_t stage) { -#if !PPSSPP_PLATFORM(UWP) && !defined(_M_ARM64) && !defined(_M_ARM) +#if !PPSSPP_PLATFORM(UWP) && !PPSSPP_ARCH(ARM64) && !PPSSPP_ARCH(ARM) std::string temp; std::string version = ""; if (!gl_extensions.IsGLES && gl_extensions.IsCoreContext) { diff --git a/ext/native/math/dataconv.h b/ext/native/math/dataconv.h index fafe6a4a44..8852d9d4c5 100644 --- a/ext/native/math/dataconv.h +++ b/ext/native/math/dataconv.h @@ -10,7 +10,7 @@ #include #endif #if PPSSPP_PLATFORM(ARM_NEON) -#if defined(_MSC_VER) && defined(_M_ARM64) +#if defined(_MSC_VER) && PPSSPP_ARCH(ARM64) #include #else #include diff --git a/headless/Headless.cpp b/headless/Headless.cpp index e4bf824602..e438aa63a0 100644 --- a/headless/Headless.cpp +++ b/headless/Headless.cpp @@ -277,9 +277,13 @@ int main(int argc, const char* argv[]) return printUsage(argv[0], "Unknown gpu backend specified after --graphics=. Allowed: software, directx9, directx11, vulkan, gles, null."); } // Default to GLES if no value selected. - else if (!strcmp(argv[i], "--graphics")) + else if (!strcmp(argv[i], "--graphics")) { +#if PPSSPP_API(ANY_GL) gpuCore = GPUCORE_GLES; - else if (!strncmp(argv[i], "--screenshot=", strlen("--screenshot=")) && strlen(argv[i]) > strlen("--screenshot=")) +#else + gpuCore = GPUCORE_DIRECTX11; +#endif + } else if (!strncmp(argv[i], "--screenshot=", strlen("--screenshot=")) && strlen(argv[i]) > strlen("--screenshot=")) screenshotFilename = argv[i] + strlen("--screenshot="); else if (!strncmp(argv[i], "--timeout=", strlen("--timeout=")) && strlen(argv[i]) > strlen("--timeout=")) timeout = strtod(argv[i] + strlen("--timeout="), NULL); diff --git a/headless/WindowsHeadlessHost.cpp b/headless/WindowsHeadlessHost.cpp index f25c709629..dba04b79ad 100644 --- a/headless/WindowsHeadlessHost.cpp +++ b/headless/WindowsHeadlessHost.cpp @@ -26,7 +26,7 @@ #include "Core/System.h" #include "GPU/Common/GPUDebugInterface.h" #include "GPU/GPUState.h" -#if !defined(_M_ARM64) && !defined(_M_ARM) +#if PPSSPP_API(ANY_GL) #include "Windows/GPU/WindowsGLContext.h" #endif #include "Windows/GPU/D3D9Context.h" @@ -93,7 +93,7 @@ bool WindowsHeadlessHost::InitGraphics(std::string *error_message, GraphicsConte switch (gpuCore_) { case GPUCORE_NULL: case GPUCORE_GLES: -#if !defined(_M_ARM64) && !defined(_M_ARM) +#if PPSSPP_API(ANY_GL) case GPUCORE_SOFTWARE: graphicsContext = new WindowsGLContext(); needRenderThread = true; diff --git a/ppsspp_config.h b/ppsspp_config.h index 91150cbbe7..43e90da724 100644 --- a/ppsspp_config.h +++ b/ppsspp_config.h @@ -5,6 +5,7 @@ #define PPSSPP_ARCH(PPSSPP_FEATURE) (PPSSPP_ARCH_##PPSSPP_FEATURE) #define PPSSPP_PLATFORM(PPSSPP_FEATURE) (PPSSPP_PLATFORM_##PPSSPP_FEATURE) +#define PPSSPP_API(PPSSPP_FEATURE) (PPSSPP_API_##PPSSPP_FEATURE) // ARCH defines #if defined(_M_IX86) || defined(__i386__) @@ -115,3 +116,15 @@ #elif defined(__linux__) #define PPSSPP_PLATFORM_LINUX 1 #endif + +// Windows ARM/ARM64, and Windows UWP (all), are the only platform that don't do GL at all (until Apple finally removes it) +#if !PPSSPP_PLATFORM(WINDOWS) || ((!PPSSPP_ARCH(ARM) && !PPSSPP_ARCH(ARM64)) && !PPSSPP_PLATFORM(UWP)) +#define PPSSPP_API_ANY_GL 1 +#endif + +#if PPSSPP_PLATFORM(WINDOWS) +#if !PPSSPP_PLATFORM(UWP) +#define PPSSPP_API_D3D9 1 +#endif +#define PPSSPP_API_D3D11 1 +#endif From ff65b813d9a15884b9e72d22660d2a877a06abe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 10 May 2019 23:26:34 +0200 Subject: [PATCH 09/14] Assorted warning fixes --- Core/Compatibility.h | 2 +- Core/HLE/sceMp3.cpp | 2 +- Core/HW/SimpleAudioDec.h | 2 +- Windows/PPSSPP.vcxproj | 1 - ext/native/thin3d/VulkanQueueRunner.cpp | 2 +- 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Core/Compatibility.h b/Core/Compatibility.h index 1db5d52de8..c80f579994 100644 --- a/Core/Compatibility.h +++ b/Core/Compatibility.h @@ -84,5 +84,5 @@ private: void CheckSettings(IniFile &iniFile, const std::string &gameID); void CheckSetting(IniFile &iniFile, const std::string &gameID, const char *option, bool *flag); - CompatFlags flags_; + CompatFlags flags_{}; }; diff --git a/Core/HLE/sceMp3.cpp b/Core/HLE/sceMp3.cpp index b182ab54f6..3dab28d418 100644 --- a/Core/HLE/sceMp3.cpp +++ b/Core/HLE/sceMp3.cpp @@ -631,7 +631,7 @@ static u32 sceMp3ResetPlayPositionByFrame(u32 mp3, u32 frame) { return hleLogError(ME, ERROR_MP3_NOT_YET_INIT_HANDLE, "not yet init"); } - if (frame >= ctx->AuGetFrameNum()) { + if ((int)frame >= ctx->AuGetFrameNum()) { return hleLogError(ME, ERROR_MP3_BAD_RESET_FRAME, "bad frame position"); } diff --git a/Core/HW/SimpleAudioDec.h b/Core/HW/SimpleAudioDec.h index 1dc8aa28e5..5a21bfe330 100644 --- a/Core/HW/SimpleAudioDec.h +++ b/Core/HW/SimpleAudioDec.h @@ -119,7 +119,7 @@ public: void DoState(PointerWrap &p); void EatSourceBuff(int amount) { - if (amount > sourcebuff.size()) { + if (amount > (int)sourcebuff.size()) { amount = (int)sourcebuff.size(); } if (amount > 0) diff --git a/Windows/PPSSPP.vcxproj b/Windows/PPSSPP.vcxproj index 2a8f370250..af1504ad16 100644 --- a/Windows/PPSSPP.vcxproj +++ b/Windows/PPSSPP.vcxproj @@ -331,7 +331,6 @@ false _CRTDBG_MAP_ALLOC;USING_WIN_UI;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_ARCH_32=1;_WINDOWS;_UNICODE;UNICODE;%(PreprocessorDefinitions) - Sync Use Level3 ProgramDatabase diff --git a/ext/native/thin3d/VulkanQueueRunner.cpp b/ext/native/thin3d/VulkanQueueRunner.cpp index 630aeed89f..49d0aa70ab 100644 --- a/ext/native/thin3d/VulkanQueueRunner.cpp +++ b/ext/native/thin3d/VulkanQueueRunner.cpp @@ -522,7 +522,7 @@ void VulkanQueueRunner::ApplyMGSHack(std::vector &steps) { assert(steps[i + copies.size()]->stepType == VKRStepType::RENDER); // Combine the renders. for (int j = 1; j < (int)renders.size(); j++) { - for (int k = 0; k < renders[j]->commands.size(); k++) { + for (int k = 0; k < (int)renders[j]->commands.size(); k++) { steps[i + copies.size()]->commands.push_back(renders[j]->commands[k]); } steps[i + copies.size() + j]->stepType = VKRStepType::RENDER_SKIP; From a7ab5d5dba43e3b455e102c5b0426755c83c6185 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 10 May 2019 23:46:31 +0200 Subject: [PATCH 10/14] Oops, missed these two --- ext/native/gfx_es2/gpu_features.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/native/gfx_es2/gpu_features.cpp b/ext/native/gfx_es2/gpu_features.cpp index b51b550f6b..6843e87cad 100644 --- a/ext/native/gfx_es2/gpu_features.cpp +++ b/ext/native/gfx_es2/gpu_features.cpp @@ -119,7 +119,7 @@ void ProcessGPUFeatures() { void CheckGLExtensions() { -#if !PPSSPP_PLATFORM(UWP) && !PPSSPP_ARCH(ARM64) && !PPSSPP_ARCH(ARM) +#if PPSSPP_API(ANY_GL) // Make sure to only do this once. It's okay to call CheckGLExtensions from wherever. if (extensionsDone) @@ -569,7 +569,7 @@ static const char *glsl_fragment_prelude = "#endif\n"; std::string ApplyGLSLPrelude(const std::string &source, uint32_t stage) { -#if !PPSSPP_PLATFORM(UWP) && !PPSSPP_ARCH(ARM64) && !PPSSPP_ARCH(ARM) +#if PPSSPP_API(ANY_GL) std::string temp; std::string version = ""; if (!gl_extensions.IsGLES && gl_extensions.IsCoreContext) { From a59099e1bfc731d6a2b87ff892baec1b32817c02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sat, 11 May 2019 06:36:28 +0200 Subject: [PATCH 11/14] Oops, fix the D3D9 fallback --- Core/Config.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/Config.cpp b/Core/Config.cpp index 69b96c1ef1..4a035d6f8f 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -571,7 +571,7 @@ int Config::NextValidBackend() { return (int)GPUBackend::OPENGL; } #endif -#if PPSSPP_PLATFORM(D3D9) +#if PPSSPP_API(D3D9) if (!failed.count((int)GPUBackend::DIRECT3D9)) { return (int)GPUBackend::DIRECT3D9; } From fe77b836c7b9a83c28410c42f5e6eefd2f1ce63c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sat, 11 May 2019 06:41:45 +0200 Subject: [PATCH 12/14] Spacing fix --- headless/Headless.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headless/Headless.cpp b/headless/Headless.cpp index e438aa63a0..11a9e8843f 100644 --- a/headless/Headless.cpp +++ b/headless/Headless.cpp @@ -283,7 +283,7 @@ int main(int argc, const char* argv[]) #else gpuCore = GPUCORE_DIRECTX11; #endif - } else if (!strncmp(argv[i], "--screenshot=", strlen("--screenshot=")) && strlen(argv[i]) > strlen("--screenshot=")) + } else if (!strncmp(argv[i], "--screenshot=", strlen("--screenshot=")) && strlen(argv[i]) > strlen("--screenshot=")) screenshotFilename = argv[i] + strlen("--screenshot="); else if (!strncmp(argv[i], "--timeout=", strlen("--timeout=")) && strlen(argv[i]) > strlen("--timeout=")) timeout = strtod(argv[i] + strlen("--timeout="), NULL); From 268439dd4bac6fcefc3dff31c2bfdf01825c7ad4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sat, 11 May 2019 08:37:42 +0200 Subject: [PATCH 13/14] Fix issue with D3D9 vs UWP --- GPU/GPU.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/GPU/GPU.cpp b/GPU/GPU.cpp index 47944003a7..2a0bee4842 100644 --- a/GPU/GPU.cpp +++ b/GPU/GPU.cpp @@ -31,8 +31,11 @@ #include "GPU/Null/NullGpu.h" #include "GPU/Software/SoftGpu.h" -#if defined(_WIN32) +#if PPSSPP_API(D3D9) #include "GPU/Directx9/GPU_DX9.h" +#endif + +#if PPSSPP_API(D3D11) #include "GPU/D3D11/GPU_D3D11.h" #endif @@ -78,7 +81,7 @@ bool GPU_Init(GraphicsContext *ctx, Draw::DrawContext *draw) { SetGPU(new SoftGPU(ctx, draw)); break; case GPUCORE_DIRECTX9: -#if defined(_WIN32) +#if PPSSPP_API(D3D9) SetGPU(new DIRECTX9_GPU(ctx, draw)); break; #else From e010d06c5cabb8cade15195eb02545eaad4cf0d1 Mon Sep 17 00:00:00 2001 From: driver1998 Date: Sat, 11 May 2019 19:22:20 +0800 Subject: [PATCH 14/14] Add CPU string in Windows ARM --- Common/ArmCPUDetect.cpp | 35 +++++++++++++++++++++++++- UWP/PPSSPP_UWPMain.cpp | 56 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+), 1 deletion(-) diff --git a/Common/ArmCPUDetect.cpp b/Common/ArmCPUDetect.cpp index 4a166793d8..59f5440c1b 100644 --- a/Common/ArmCPUDetect.cpp +++ b/Common/ArmCPUDetect.cpp @@ -23,6 +23,39 @@ #include "CPUDetect.h" #include "StringUtils.h" #include "FileUtil.h" +#include "util/text/utf8.h" + +#if PPSSPP_PLATFORM(WINDOWS) +#if PPSSPP_PLATFORM(UWP) +// TODO: Maybe we can move the implementation here? +std::string GetCPUBrandString(); +#else +// No CPUID on ARM, so we'll have to read the registry +#include +std::string GetCPUBrandString() { + std::string cpu_string; + + HKEY key; + LSTATUS result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0", 0, KEY_READ, &key); + if (result == ERROR_SUCCESS) { + DWORD size = 0; + DWORD type = REG_SZ; + RegQueryValueEx(key, L"ProcessorNameString", NULL, &type, NULL, &size); + LPBYTE buff = (LPBYTE)malloc(size); + if (buff != NULL) { + RegQueryValueEx(key, L"ProcessorNameString", NULL, &type, buff, &size); + cpu_string = ConvertWStringToUTF8((wchar_t*)buff); + free(buff); + } + } + + if (cpu_string.empty()) + return "Unknown"; + else + return cpu_string; +} +#endif +#endif // Only Linux platforms have /proc/cpuinfo #if PPSSPP_PLATFORM(LINUX) @@ -209,7 +242,7 @@ void CPUInfo::Detect() strcpy(brand_string, "Apple A"); num_cores = 2; #elif PPSSPP_PLATFORM(WINDOWS) - strcpy(brand_string, "Unknown"); + truncate_cpy(brand_string, GetCPUBrandString().c_str()); isVFP3 = true; isVFP4 = false; SYSTEM_INFO sysInfo; diff --git a/UWP/PPSSPP_UWPMain.cpp b/UWP/PPSSPP_UWPMain.cpp index b7271d5288..214566a0f6 100644 --- a/UWP/PPSSPP_UWPMain.cpp +++ b/UWP/PPSSPP_UWPMain.cpp @@ -36,6 +36,7 @@ using namespace Windows::Storage; using namespace Windows::Storage::Streams; using namespace Windows::System::Threading; using namespace Windows::ApplicationModel::DataTransfer; +using namespace Windows::Devices::Enumeration; using namespace Concurrency; // UGLY! @@ -465,6 +466,61 @@ bool System_InputBoxGetWString(const wchar_t *title, const std::wstring &default return false; } +std::string GetCPUBrandString() { + Platform::String^ cpu_id = nullptr; + Platform::String^ cpu_name = nullptr; + + // GUID_DEVICE_PROCESSOR: {97FADB10-4E33-40AE-359C-8BEF029DBDD0} + Platform::String^ if_filter = L"System.Devices.InterfaceClassGuid:=\"{97FADB10-4E33-40AE-359C-8BEF029DBDD0}\""; + + // Enumerate all CPU DeviceInterfaces, and get DeviceInstanceID of the first one. + auto if_task = create_task( + DeviceInformation::FindAllAsync(if_filter)).then([&](DeviceInformationCollection ^ collection) { + if (collection->Size > 0) { + auto cpu = collection->GetAt(0); + auto id = cpu->Properties->Lookup(L"System.Devices.DeviceInstanceID"); + cpu_id = dynamic_cast(id); + } + }); + + try { + if_task.wait(); + } + catch (const std::exception & e) { + const char* what = e.what(); + ILOG("%s", what); + } + + if (cpu_id != nullptr) { + // Get the Device with the same ID as the DeviceInterface + // Then get the name (description) of that Device + // We have to do this because the DeviceInterface we get doesn't have a proper description. + Platform::String^ dev_filter = L"System.Devices.DeviceInstanceID:=\"" + cpu_id + L"\""; + + auto dev_task = create_task( + DeviceInformation::FindAllAsync(dev_filter, {}, DeviceInformationKind::Device)).then( + [&](DeviceInformationCollection ^ collection) { + if (collection->Size > 0) { + cpu_name = collection->GetAt(0)->Name; + } + }); + + try { + dev_task.wait(); + } + catch (const std::exception & e) { + const char* what = e.what(); + ILOG("%s", what); + } + } + + if (cpu_name != nullptr) { + return FromPlatformString(cpu_name); + } else { + return "Unknown"; + } +} + // Emulation of TlsAlloc for Windows 10. Used by glslang. Doesn't actually seem to work, other than fixing the linking errors? extern "C" {