Compare commits
560 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 40e9ee5af0 | |||
| 3fa1241ac0 | |||
| 62747bb40d | |||
| 44b33f1962 | |||
| cc999d4210 | |||
| 7c2bd56776 | |||
| 5fc7450865 | |||
| 4ca0f0b11d | |||
| 66de4022b1 | |||
| 2b9368abf5 | |||
| f8a5a6ad93 | |||
| fa1aa9dcf3 | |||
| 883a6889e0 | |||
| 1b5a895346 | |||
| 2187f8ae51 | |||
| 17f1fc31bc | |||
| ecf77ecef0 | |||
| db474c292f | |||
| b08e805020 | |||
| 7b540cdb20 | |||
| 059e70069d | |||
| 9c719a5857 | |||
| 375eb21c07 | |||
| 1bd246d2d3 | |||
| 8c82ce8bed | |||
| eafa6a9a25 | |||
| b9d027a76c | |||
| 0a45c84e16 | |||
| a88951baf3 | |||
| 66349fcb5b | |||
| c6602f673b | |||
| 7c6b3dcdb9 | |||
| c11979d124 | |||
| 3058a71d72 | |||
| b41b10a031 | |||
| a87d175295 | |||
| dff29a7864 | |||
| dd81c92a02 | |||
| 64ba0dd5e6 | |||
| 0a5b88ac38 | |||
| f63a34dcc2 | |||
| d8710c431d | |||
| 67464f97df | |||
| 190378bc33 | |||
| da599f7286 | |||
| 73c8c270a6 | |||
| d7da6a713b | |||
| 6a2ad0a0aa | |||
| 84b61e3850 | |||
| 7e436f9bf1 | |||
| 2613d7eee7 | |||
| 55e17ccd3b | |||
| f368a56c66 | |||
| 79cb35daa6 | |||
| b0c1791a0c | |||
| 61a2604824 | |||
| 08c926622d | |||
| b533a560e6 | |||
| e4a49cd425 | |||
| fdce82fc24 | |||
| 5f00b87a44 | |||
| 53180b8141 | |||
| 4cc0e4c7fc | |||
| 46364856ae | |||
| f5c420994d | |||
| c5ee48f54a | |||
| 6f50f0854f | |||
| 53d76db753 | |||
| c860aa2107 | |||
| a545fe92a0 | |||
| ee436307cf | |||
| 33016742f1 | |||
| 320e8d634a | |||
| e52b6ecbbf | |||
| a4712a283f | |||
| 6da3021158 | |||
| 0064ecb85b | |||
| 1d71854c7f | |||
| a9be80da6f | |||
| 2387af0854 | |||
| 021f16f775 | |||
| fb1c1eeaef | |||
| 6fa7efbcc3 | |||
| c534da86c3 | |||
| 6b5a2f781a | |||
| cd7cb1cc11 | |||
| c0b358003f | |||
| 29b4577fdb | |||
| b34eba2fb3 | |||
| 6850e2e5a8 | |||
| 3c2815e89c | |||
| 4312221498 | |||
| c102d1ec0d | |||
| 98e9b3cf30 | |||
| f9ffce76f2 | |||
| e2e1cf02f4 | |||
| 026297334f | |||
| 4f47fee360 | |||
| 9c143d3d45 | |||
| 58eb7d2c04 | |||
| 2bb533274c | |||
| 3fc41b6d66 | |||
| c350c02592 | |||
| 9dde2bf04e | |||
| 4e160320ef | |||
| ca762d5b84 | |||
| d93f5f9f84 | |||
| ac28c391f6 | |||
| d519571e18 | |||
| 99e6b19025 | |||
| 3d6773dd25 | |||
| d36a4bd858 | |||
| 26db44b3b3 | |||
| a6c3ef350a | |||
| f3d0c3ba28 | |||
| 97c7d069ac | |||
| af7ae45888 | |||
| 5c4b0a165b | |||
| af2af23306 | |||
| 59f54caf08 | |||
| b3ac8127ea | |||
| 90ea92d93b | |||
| f694000454 | |||
| b2daaff29f | |||
| d93d9b2c5a | |||
| 4f23f5505a | |||
| 69bc124930 | |||
| 056a8ba1b1 | |||
| 350e7b09f5 | |||
| 1899b61fa5 | |||
| 773808169e | |||
| a6fb0c8931 | |||
| 155883ea2a | |||
| ca87d103fd | |||
| 5dd7792c3d | |||
| e8cd6f4ef6 | |||
| b6ed4201df | |||
| c25e3e33ac | |||
| a8dd053593 | |||
| 66d2bc3dd5 | |||
| d773a3f94e | |||
| 4e0995744a | |||
| 80c1c5dd6d | |||
| 91a8c56c37 | |||
| 5144a999b3 | |||
| 3b1abec405 | |||
| 8b02f46e67 | |||
| 41e6cbbb5a | |||
| ed7f1aa17c | |||
| 5839ad9c70 | |||
| 9c725935dc | |||
| 108276c076 | |||
| 82a4ff051e | |||
| d1c8073106 | |||
| 3829802699 | |||
| 46bbbd2056 | |||
| cbbf52878a | |||
| 278daddd2a | |||
| 48e2d808c9 | |||
| 28ab991302 | |||
| d40a4ee04e | |||
| 7ea0a96d02 | |||
| 985703058b | |||
| 14ca11fdf4 | |||
| 7bc08d05c6 | |||
| 79d0e0eb3c | |||
| 570b2bddca | |||
| f3cf1da7b7 | |||
| 3c9a4417f2 | |||
| b212935c70 | |||
| e05d359721 | |||
| 74bcbd9816 | |||
| b14c76c1c5 | |||
| 6d058586c4 | |||
| 771837ee55 | |||
| d2fc5a5b81 | |||
| 3b21833b8e | |||
| ed02f3a2ce | |||
| 7028e85fac | |||
| 96f73f4497 | |||
| 3ff4f188f4 | |||
| 61e1c0f1fb | |||
| 631e7ef979 | |||
| 7dce197ec4 | |||
| 9e0824112f | |||
| e1734b51c3 | |||
| 4cac76caad | |||
| 077f2a73e1 | |||
| a60734e27b | |||
| 3574677b66 | |||
| b3cc01387f | |||
| e26c80c129 | |||
| 80b6faef10 | |||
| 7d0df300ea | |||
| 1ca8ab393a | |||
| 3cca094d2d | |||
| a088b18e95 | |||
| e5af69d7b2 | |||
| 814821d760 | |||
| 7a8c88056a | |||
| b6b043b23d | |||
| c5db9899e4 | |||
| 081c094c5a | |||
| b6c8374aa5 | |||
| 06a6880c6c | |||
| bd5c10fd48 | |||
| d3804de243 | |||
| 36cd81fb5f | |||
| 7a4d7aa936 | |||
| aff082e0c1 | |||
| 2b144101ab | |||
| d4b7c31ec8 | |||
| 6c9445ff28 | |||
| 2d6ca912fe | |||
| 3b9cc0bc3a | |||
| 88175aa84f | |||
| a7c606c8ac | |||
| 48acbbe4f5 | |||
| b729772041 | |||
| ea0d8a0d78 | |||
| e79f56bfdc | |||
| a543f38704 | |||
| 1cdc401cc5 | |||
| 50d6396f99 | |||
| 7d41bbdd2b | |||
| d53a6a87f6 | |||
| 1e63385dfc | |||
| 4ffeee0344 | |||
| 0b9c53e254 | |||
| 27f857a8fe | |||
| c340eb2f17 | |||
| e43435e152 | |||
| ac3d14cf5c | |||
| 426f3c445b | |||
| bbeb7c4cd7 | |||
| 6c87413f48 | |||
| b10c742f10 | |||
| 9e3e01d8f6 | |||
| bcd9663349 | |||
| 72fa4098dc | |||
| 6dc95dd078 | |||
| 11050a7032 | |||
| f826f95c70 | |||
| 934bc34685 | |||
| f463c128e3 | |||
| 7168cd566a | |||
| 110c786d80 | |||
| fb194241d5 | |||
| 09554c43ba | |||
| 1b1143094e | |||
| 8121bd443c | |||
| a1a140db91 | |||
| e9fb3572f9 | |||
| 1d85de6236 | |||
| 6981e308a0 | |||
| 8e80ddd99f | |||
| beac01d5d1 | |||
| d7f8e25cca | |||
| e0c3df5328 | |||
| 59468f1e1e | |||
| 8ab0ceaa67 | |||
| b9f05ba71b | |||
| 5311f004d0 | |||
| cb276f0da7 | |||
| 34c26eff68 | |||
| b700a7abd9 | |||
| c279583f1f | |||
| ce12c29441 | |||
| e95a980651 | |||
| 87fc45d661 | |||
| 93a2f1edc8 | |||
| 22fe8648ef | |||
| f42b09d1fc | |||
| b8e6785789 | |||
| afdb57bee9 | |||
| b22d0a0b4a | |||
| ec989781a3 | |||
| 110ef818b3 | |||
| aa841ac332 | |||
| ceb2168375 | |||
| 02eb549208 | |||
| 13de8233b0 | |||
| ff4444b18e | |||
| 555ace0955 | |||
| a03a78dbd2 | |||
| f63b1b5dc1 | |||
| ac104a519e | |||
| bd95c728f0 | |||
| 122ccca50e | |||
| 83bfbc1399 | |||
| 80f972cd38 | |||
| 615f416af3 | |||
| 1c37f64a58 | |||
| 7c9261a461 | |||
| cb3a83cba7 | |||
| b0dbac9a07 | |||
| f92677fa7e | |||
| 789bab97be | |||
| 3e60bd2aa6 | |||
| 6dc06b3ff5 | |||
| a10390e52a | |||
| 433110b4d8 | |||
| b94e6d4864 | |||
| 44dc29e52b | |||
| ab03d76ed6 | |||
| bd2b2c2747 | |||
| aa7cf5ea15 | |||
| f8fe64ff77 | |||
| 1791876eda | |||
| e6204d3c1d | |||
| f0f9ef6f30 | |||
| 51ea735cb5 | |||
| 069821a2e7 | |||
| 0052108e87 | |||
| 64c24959cb | |||
| b57390d3cd | |||
| 91c136b6d0 | |||
| c00fa2cc8c | |||
| fe3cbde1d3 | |||
| e2dff6bbf8 | |||
| 976cd1ce66 | |||
| a4523651c7 | |||
| 2702417192 | |||
| 72b872df66 | |||
| bb3e2689d4 | |||
| 4ced11e533 | |||
| 9a0a5a1735 | |||
| e83034624b | |||
| 619fe7b14e | |||
| 37a07ae545 | |||
| e1eae3ee49 | |||
| 49abd6d8e5 | |||
| fbdbf8addf | |||
| 2e4ee9c9b6 | |||
| a863e94c25 | |||
| 9b6bc7c1b4 | |||
| 86b7ea6bf3 | |||
| 18bd6d681e | |||
| 2dd194d381 | |||
| a8b603dd92 | |||
| a03d4f69f8 | |||
| 99bb042bea | |||
| 2bcc27d581 | |||
| 53c33cd812 | |||
| 1d05cf9ce5 | |||
| 07f5b0aa5b | |||
| 36e1d664ea | |||
| 90e2c39015 | |||
| 5a90dc0059 | |||
| c19d22ce88 | |||
| 5acc263b73 | |||
| bc6e01c422 | |||
| a2eb4fec53 | |||
| 32c9c6f515 | |||
| 04f7dd02fd | |||
| 35907bcfc8 | |||
| 61b1bd7ead | |||
| 2bad4f47f1 | |||
| 5a94adcf26 | |||
| 57e37862f4 | |||
| 45bae0046a | |||
| a0c91bf96a | |||
| b607993b7b | |||
| 1eb72e4b71 | |||
| e5840ab868 | |||
| 54999d1507 | |||
| 51514f9dc8 | |||
| 40229adb14 | |||
| 33f8deffbe | |||
| c80e08a642 | |||
| 62b2ffd7ca | |||
| cd1d6282b4 | |||
| 67f69bb4b3 | |||
| 2ba7756c0e | |||
| c6407b37a5 | |||
| 410660627d | |||
| 852317a071 | |||
| 6590f1b55d | |||
| 84277f41a1 | |||
| b73c45f1fb | |||
| ddd226f0ea | |||
| 3c68c36fa0 | |||
| d54e54b66d | |||
| 2f3b66985e | |||
| 43799762c7 | |||
| cb501e32ca | |||
| 7a7e25f901 | |||
| e690e7e458 | |||
| 253d4565f1 | |||
| 1f2a935458 | |||
| 0c27b63ab4 | |||
| 4c106960c5 | |||
| f076d1e1e6 | |||
| 7b58340a60 | |||
| 5578edf9e4 | |||
| 704d8764af | |||
| 6523afa69a | |||
| 5416f432b5 | |||
| 43f3a4816d | |||
| bc0c42b025 | |||
| 9f3adb3fc7 | |||
| df6cba6582 | |||
| 8cdad0af98 | |||
| 801a1e6c38 | |||
| 9da088fe29 | |||
| d96f31eda4 | |||
| a5cce58225 | |||
| 39e6fc5918 | |||
| 2ea344ce3e | |||
| 358fbb3ce3 | |||
| aaf441005a | |||
| 6e6dd603cb | |||
| 22fe14d31d | |||
| 2eba7da8e6 | |||
| ca2b7f9b9f | |||
| 4780e7c8da | |||
| a318384142 | |||
| 53d3f49f45 | |||
| 25581ce52f | |||
| 6c0c80b7bb | |||
| f9af53f215 | |||
| 2fd5b1b4be | |||
| 3acf1f6470 | |||
| 37f1533dad | |||
| bb652ed840 | |||
| 281706fdae | |||
| 198fe71cc4 | |||
| b8e2c7060b | |||
| dbb6c87a10 | |||
| 7240cbfdab | |||
| 7866c7195c | |||
| e26978e664 | |||
| 63ed8881a4 | |||
| 1be7b9f983 | |||
| 471ed347f4 | |||
| cff9b5b65e | |||
| 5d28ff5df1 | |||
| 7fd0aa95fb | |||
| 27ecfaee9c | |||
| ce2afa1d54 | |||
| 984c562500 | |||
| f880a00cba | |||
| 6cf2cc67d3 | |||
| 9e6fecb4ca | |||
| 3194bd3fb4 | |||
| fcb5a5c5f8 | |||
| 3988eceb8d | |||
| 2b2b13273b | |||
| 88278ec7c9 | |||
| 7d92198ef0 | |||
| 23eb67badc | |||
| d5928d99d7 | |||
| 3c16105c3b | |||
| 5cb688f309 | |||
| 7859a5f9d2 | |||
| 8b74ea8757 | |||
| 2c2ec6e109 | |||
| 6c48bd8f93 | |||
| b422cb86f2 | |||
| 1fb97734a0 | |||
| 7221012593 | |||
| 297db8713f | |||
| 477ae6c6df | |||
| 74fbca8c80 | |||
| 433816148a | |||
| 5714eb0ba5 | |||
| 315f88b0e4 | |||
| 8587fca5db | |||
| e2a26f937f | |||
| 90ebc7f319 | |||
| 67a67feb68 | |||
| 9bdacc64aa | |||
| 5a921bca46 | |||
| 86f453f677 | |||
| 7712584bd4 | |||
| bc58dff715 | |||
| 0bb6299e39 | |||
| b24524fc75 | |||
| 60eb1ce2ec | |||
| 9733d8c857 | |||
| 5274210ba8 | |||
| 1627757608 | |||
| 4542020c86 | |||
| b734ceb2e7 | |||
| 951d47c94c | |||
| 6f07e8453a | |||
| e6cf05cfb7 | |||
| 6b6dd6c432 | |||
| ee01d1186f | |||
| 2934641237 | |||
| fecb53f86c | |||
| 9811e1cc3b | |||
| 234f2b4648 | |||
| 9e573a9ff2 | |||
| 3803c864f7 | |||
| 8afa40eaa7 | |||
| c7a576edce | |||
| c72d54bd6a | |||
| 040a79ddd1 | |||
| aa094ca948 | |||
| 7917520633 | |||
| 8651875e59 | |||
| ef70a6e825 | |||
| 0869ef421d | |||
| 5f86315ae0 | |||
| ab72ce418e | |||
| 36cdaac327 | |||
| 6d52415d50 | |||
| 0603d24a91 | |||
| 71f0d5c602 | |||
| 763001ee91 | |||
| 0f92ea2578 | |||
| e0a0d736c4 | |||
| 65320446f0 | |||
| 5f6822042d | |||
| 302e87c920 | |||
| 77cbdd82ab | |||
| 41db06b53f | |||
| eeda9c7738 | |||
| c38bf70464 | |||
| 43b295892f | |||
| 2573cc5fd0 | |||
| 4828d4d2d6 | |||
| c5f278ed37 | |||
| b839d4d1a6 | |||
| 3616424b26 | |||
| 4d6da6542e | |||
| f2aa347608 | |||
| bd7d5faa9f | |||
| a3d09a7427 | |||
| 7dad9663b2 | |||
| cae8ae63e3 | |||
| 728d84b1fe | |||
| 4a51302c58 | |||
| 0ea692e9ab | |||
| 1e16b338b4 | |||
| 14789b536f | |||
| ac30feeddb | |||
| 0d80e300a0 | |||
| 69384d7bb4 | |||
| 4fd2409b8b | |||
| d97851376d | |||
| 1c5e30e83f | |||
| 414df8432e | |||
| 92f63ccc0b | |||
| d75e8b24f7 | |||
| a1af15b907 | |||
| cf5eb22591 | |||
| 2f9f79eea2 | |||
| c57d6110c4 | |||
| 2a292d1e2e | |||
| f2c8b157ef | |||
| ec00a06caf | |||
| ae6172d86b | |||
| 5605cf2141 | |||
| d46ddcee5d | |||
| 3750fb2c1f | |||
| 86b2773c28 | |||
| 11a9011510 | |||
| e66f1fa306 |
@@ -35,7 +35,7 @@ cmake .. \
|
||||
-DUSE_SYSTEM_CURL=ON \
|
||||
-DUSE_SDL=ON \
|
||||
-DUSE_SYSTEM_SDL=ON \
|
||||
-DUSE_SYSTEM_FFMPEG=OFF \
|
||||
-DUSE_SYSTEM_FFMPEG=ON \
|
||||
-DUSE_SYSTEM_OPENCV=ON \
|
||||
-DUSE_DISCORD_RPC=ON \
|
||||
-DOpenGL_GL_PREFERENCE=LEGACY \
|
||||
|
||||
@@ -46,7 +46,7 @@ cmake .. \
|
||||
-DUSE_SYSTEM_CURL=ON \
|
||||
-DUSE_SDL=ON \
|
||||
-DUSE_SYSTEM_SDL=ON \
|
||||
-DUSE_SYSTEM_FFMPEG=OFF \
|
||||
-DUSE_SYSTEM_FFMPEG=ON \
|
||||
-DUSE_SYSTEM_OPENCV=ON \
|
||||
-DUSE_DISCORD_RPC=ON \
|
||||
-DOpenGL_GL_PREFERENCE=LEGACY \
|
||||
|
||||
@@ -13,15 +13,16 @@ export HOMEBREW_NO_AUTO_UPDATE=1
|
||||
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
|
||||
export HOMEBREW_NO_ENV_HINTS=1
|
||||
export HOMEBREW_NO_INSTALL_CLEANUP=1
|
||||
brew update
|
||||
brew install -f --overwrite --quiet ccache "llvm@$LLVM_COMPILER_VER"
|
||||
brew link -f --overwrite --quiet "llvm@$LLVM_COMPILER_VER"
|
||||
if [ "$AARCH64" -eq 1 ]; then
|
||||
brew install -f --overwrite --quiet googletest opencv@4 sdl3 vulkan-headers vulkan-loader molten-vk
|
||||
brew unlink --quiet ffmpeg fmt qtbase qtsvg qtdeclarative protobuf
|
||||
brew install -f --overwrite --quiet googletest opencv@4 sdl3 vulkan-headers vulkan-loader molten-vk
|
||||
brew unlink --quiet ffmpeg fmt qtbase qtsvg qtdeclarative protobuf || true
|
||||
else
|
||||
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||
arch -x86_64 /usr/local/bin/brew install -f --overwrite --quiet python@3.14 opencv@4 "llvm@$LLVM_COMPILER_VER" sdl3 vulkan-headers vulkan-loader molten-vk
|
||||
arch -x86_64 /usr/local/bin/brew unlink --quiet ffmpeg qtbase qtsvg qtdeclarative
|
||||
arch -x86_64 /usr/local/bin/brew unlink --quiet ffmpeg qtbase qtsvg qtdeclarative protobuf || true
|
||||
fi
|
||||
|
||||
export CXX=clang++
|
||||
|
||||
@@ -19,6 +19,9 @@ if [ "$DEPLOY_APPIMAGE" = "true" ]; then
|
||||
|
||||
APPIMAGE_EXTRACT_AND_RUN=1 linuxdeploy --appdir AppDir --plugin qt --plugin checkrt
|
||||
|
||||
# Restore App Icon
|
||||
ln -sr ./AppDir/rpcs3.svg ./AppDir/.DirIcon
|
||||
|
||||
# Remove libwayland-client because it has platform-dependent exports and breaks other OSes
|
||||
rm -f ./AppDir/usr/lib/libwayland-client.so*
|
||||
|
||||
|
||||
@@ -4,11 +4,16 @@
|
||||
cd build || exit 1
|
||||
|
||||
cd bin
|
||||
git clone --revision=a075e5e417f87675ea3137b7365f3e5a99608d72 https://github.com/KhronosGroup/MoltenVK.git
|
||||
cd MoltenVK
|
||||
./fetchDependencies --macos
|
||||
sudo xcode-select -switch /Applications/Xcode_16.2.app/Contents/Developer
|
||||
make macos MVK_USE_METAL_PRIVATE_API=1
|
||||
cd ../
|
||||
|
||||
mkdir -p "rpcs3.app/Contents/Resources/vulkan/icd.d" || true
|
||||
wget https://github.com/KhronosGroup/MoltenVK/releases/download/v1.4.1/MoltenVK-macos-privateapi.tar
|
||||
tar -xvf MoltenVK-macos-privateapi.tar
|
||||
cp "MoltenVK/MoltenVK/dynamic/dylib/macOS/libMoltenVK.dylib" "rpcs3.app/Contents/Frameworks/libMoltenVK.dylib"
|
||||
cp "MoltenVK/MoltenVK/dynamic/dylib/macOS/MoltenVK_icd.json" "rpcs3.app/Contents/Resources/vulkan/icd.d/MoltenVK_icd.json"
|
||||
cp "MoltenVK/Package/Release/MoltenVK/dynamic/dylib/macOS/libMoltenVK.dylib" "rpcs3.app/Contents/Frameworks/libMoltenVK.dylib"
|
||||
cp "MoltenVK/Package/Release/MoltenVK/dynamic/dylib/macOS/MoltenVK_icd.json" "rpcs3.app/Contents/Resources/vulkan/icd.d/MoltenVK_icd.json"
|
||||
sed -i '' "s/.\//..\/..\/..\/Frameworks\//g" "rpcs3.app/Contents/Resources/vulkan/icd.d/MoltenVK_icd.json"
|
||||
|
||||
cp "$(realpath $BREW_PATH/opt/llvm@$LLVM_COMPILER_VER/lib/c++/libc++abi.1.0.dylib)" "rpcs3.app/Contents/Frameworks/libc++abi.1.dylib"
|
||||
@@ -21,27 +26,24 @@ rm -rf "rpcs3.app/Contents/Frameworks/QtPdf.framework" \
|
||||
"rpcs3.app/Contents/Frameworks/QtVirtualKeyboard.framework" \
|
||||
"rpcs3.app/Contents/Plugins/platforminputcontexts" \
|
||||
"rpcs3.app/Contents/Plugins/virtualkeyboard" \
|
||||
"rpcs3.app/Contents/Resources/git"
|
||||
"rpcs3.app/Contents/Resources/git" || true
|
||||
|
||||
../../.ci/optimize-mac.sh rpcs3.app
|
||||
|
||||
# Download translations
|
||||
mkdir -p "rpcs3.app/Contents/translations"
|
||||
ZIP_URL=$(curl -fsSL "https://api.github.com/repos/RPCS3/rpcs3_translations/releases/latest" \
|
||||
| grep "browser_download_url" \
|
||||
| grep "RPCS3-languages.zip" \
|
||||
| cut -d '"' -f 4)
|
||||
if [ -z "$ZIP_URL" ]; then
|
||||
echo "Failed to find RPCS3-languages.zip in the latest release. Continuing without translations."
|
||||
else
|
||||
echo "Downloading translations from: $ZIP_URL"
|
||||
curl -L -o translations.zip "$ZIP_URL" || {
|
||||
echo "Failed to download translations.zip. Continuing without translations."
|
||||
exit 0
|
||||
}
|
||||
unzip -o translations.zip -d "rpcs3.app/Contents/translations" >/dev/null 2>&1 || \
|
||||
ZIP_URL="https://github.com/RPCS3/rpcs3_translations/releases/latest/download/RPCS3-languages.zip"
|
||||
echo "Downloading translations from: $ZIP_URL"
|
||||
if curl -fsSL "$ZIP_URL" -o "translations.zip"; then
|
||||
echo "Successfully downloaded translations."
|
||||
if unzip -o translations.zip -d "rpcs3.app/Contents/translations" >/dev/null 2>&1; then
|
||||
rm -f translations.zip
|
||||
else
|
||||
echo "Failed to extract translations.zip. Continuing without translations."
|
||||
rm -f translations.zip
|
||||
rm -f translations.zip
|
||||
fi
|
||||
else
|
||||
echo "Warning: Failed to download translations. Skipping..."
|
||||
fi
|
||||
|
||||
# Copy Qt translations manually
|
||||
@@ -49,15 +51,31 @@ QT_TRANS="$WORKDIR/qt-downloader/$QT_VER/clang_64/translations"
|
||||
cp $QT_TRANS/qt_*.qm rpcs3.app/Contents/translations
|
||||
cp $QT_TRANS/qtbase_*.qm rpcs3.app/Contents/translations
|
||||
cp $QT_TRANS/qtmultimedia_*.qm rpcs3.app/Contents/translations
|
||||
rm -f rpcs3.app/Contents/translations/qt_help_*.qm
|
||||
rm -f rpcs3.app/Contents/translations/qt_help_*.qm || true
|
||||
|
||||
# Need to do this rename hack due to case insensitive filesystem
|
||||
mv rpcs3.app RPCS3_.app
|
||||
mv RPCS3_.app RPCS3.app
|
||||
|
||||
# Hack
|
||||
install_name_tool -delete_rpath /opt/homebrew/lib RPCS3.app/Contents/MacOS/rpcs3 || true
|
||||
install_name_tool -delete_rpath /usr/local/lib RPCS3.app/Contents/MacOS/rpcs3 || true
|
||||
# Hack to fix rpath issues
|
||||
BIN="RPCS3.app/Contents/MacOS/rpcs3"
|
||||
install_name_tool -delete_rpath /opt/homebrew/lib $BIN || true
|
||||
install_name_tool -delete_rpath /usr/local/lib $BIN || true
|
||||
|
||||
# Fix dylib IDs
|
||||
for lib in RPCS3.app/Contents/Frameworks/*.dylib; do
|
||||
name=$(basename "$lib")
|
||||
install_name_tool -id "@rpath/$name" "$lib"
|
||||
done
|
||||
|
||||
# Rewrite any hardcoded Homebrew paths to use @rpath
|
||||
find "RPCS3.app/Contents/" -type f \( -perm +111 -o -name "*.dylib" \) | while read -r bin; do
|
||||
otool -L "$bin" | grep -E "/opt/homebrew|/usr/local" | awk '{print $1}' | while read -r dep; do
|
||||
base=$(basename "$dep")
|
||||
echo "Fixing $dep -> @rpath/$base in $bin"
|
||||
install_name_tool -change "$dep" "@rpath/$base" "$bin"
|
||||
done
|
||||
done
|
||||
|
||||
# NOTE: "--deep" is deprecated
|
||||
codesign --deep -fs - RPCS3.app
|
||||
|
||||
@@ -24,6 +24,7 @@ mkdir ./bin/config
|
||||
mkdir ./bin/config/input_configs
|
||||
curl -fsSL 'https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt' 1> ./bin/config/input_configs/gamecontrollerdb.txt
|
||||
curl -fsSL 'https://rpcs3.net/compatibility?api=v1&export' | iconv -f ISO-8859-1 -t UTF-8 1> ./bin/GuiConfigs/compat_database.dat
|
||||
curl -fsSL 'https://api.rpcs3.net/config/?api=v1' | iconv -f ISO-8859-1 -t UTF-8 1> ./bin/GuiConfigs/config_database.dat
|
||||
|
||||
# Download translations
|
||||
mkdir -p ./bin/share/qt6/translations
|
||||
|
||||
@@ -14,6 +14,7 @@ mkdir ./bin/config
|
||||
mkdir ./bin/config/input_configs
|
||||
curl -fsSL 'https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt' 1> ./bin/config/input_configs/gamecontrollerdb.txt
|
||||
curl -fsSL 'https://rpcs3.net/compatibility?api=v1&export' | iconv -t UTF-8 1> ./bin/GuiConfigs/compat_database.dat
|
||||
curl -fsSL 'https://api.rpcs3.net/config/?api=v1' | iconv -t UTF-8 1> ./bin/GuiConfigs/config_database.dat
|
||||
|
||||
# Download translations
|
||||
mkdir -p ./bin/qt6/translations
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
QT_HOST="http://qt.mirror.constant.com/"
|
||||
QT_URL_VER=$(echo "$QT_VER" | sed "s/\.//g")
|
||||
QT_VER_MSVC_UP=$(echo "${QT_VER_MSVC}" | tr '[:lower:]' '[:upper:]')
|
||||
QT_PREFIX="online/qtsdkrepository/windows_x86/desktop/qt${QT_VER_MAIN}_${QT_URL_VER}/qt${QT_VER_MAIN}_${QT_URL_VER}/qt.qt${QT_VER_MAIN}.${QT_URL_VER}."
|
||||
QT_PREFIX="online/qtsdkrepository/windows_x86/desktop/qt${QT_VER_MAIN}_${QT_URL_VER}/qt${QT_VER_MAIN}_${QT_URL_VER}_${QT_VER_MSVC}_64/qt.qt${QT_VER_MAIN}.${QT_URL_VER}."
|
||||
QT_PREFIX_2="win64_${QT_VER_MSVC}_64/${QT_VER}-0-${QT_DATE}"
|
||||
QT_SUFFIX="-Windows-Windows_11_24H2-${QT_VER_MSVC_UP}-Windows-Windows_11_24H2-X86_64.7z"
|
||||
QT_BASE_URL="${QT_HOST}${QT_PREFIX}${QT_PREFIX_2}qtbase${QT_SUFFIX}"
|
||||
@@ -16,7 +16,7 @@ QT_MM_URL="${QT_HOST}${QT_PREFIX}addons.qtmultimedia.${QT_PREFIX_2}qtmultimedia$
|
||||
QT_SVG_URL="${QT_HOST}${QT_PREFIX}${QT_PREFIX_2}qtsvg${QT_SUFFIX}"
|
||||
QT_TRANSLATIONS_URL="${QT_HOST}${QT_PREFIX}${QT_PREFIX_2}qttranslations${QT_SUFFIX}"
|
||||
LLVMLIBS_URL="https://github.com/RPCS3/llvm-mirror/releases/download/custom-build-win-${LLVM_VER}/llvmlibs_mt.7z"
|
||||
VULKAN_SDK_URL="https://www.dropbox.com/scl/fi/sjjh0fc4ld281pjbl2xzu/VulkanSDK-${VULKAN_VER}-Installer.exe?rlkey=f6wzc0lvms5vwkt2z3qabfv9d&dl=1"
|
||||
VULKAN_SDK_URL="https://www.dropbox.com/scl/fi/olpvqk4346ig7i8btadk5/vulkansdk-windows-X64-${VULKAN_VER}.exe?rlkey=huvssch6sy904qkg8ti9p65br&st=pztptdin&dl=1"
|
||||
CCACHE_URL="https://github.com/ccache/ccache/releases/download/v4.12.3/ccache-4.12.3-windows-x86_64.zip"
|
||||
|
||||
DEP_URLS=" \
|
||||
@@ -88,7 +88,7 @@ for url in $DEP_URLS; do
|
||||
*qt*) checksum=$(curl -fL "${url}.sha1"); algo="sha1"; outDir="$QTDIR/" ;;
|
||||
*llvm*) checksum=$(curl -fL "${url}.sha256"); algo="sha256"; outDir="./build/lib_ext/Release-x64" ;;
|
||||
*ccache*) checksum=$CCACHE_SHA; algo="sha256"; outDir="$CCACHE_BIN_DIR" ;;
|
||||
*Vulkan*)
|
||||
*vulkansdk*)
|
||||
# Vulkan setup needs to be run in batch environment
|
||||
# Need to subshell this or else it doesn't wait
|
||||
download_and_verify "$url" "$VULKAN_SDK_SHA" "sha256" "$fileName"
|
||||
|
||||
@@ -17,7 +17,7 @@ jobs:
|
||||
Windows_Build:
|
||||
if: github.event_name == 'workflow_dispatch'
|
||||
name: LLVM Windows (MSVC)
|
||||
runs-on: windows-2025
|
||||
runs-on: windows-2025-vs2026
|
||||
env:
|
||||
COMPILER: msvc
|
||||
CCACHE_SHA: '859141059ac950e1e8cd042c66f842f26b9e3a62a1669a69fe6ba180cb58bbdf'
|
||||
|
||||
@@ -30,23 +30,23 @@ jobs:
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-24.04
|
||||
docker_img: "rpcs3/rpcs3-ci-jammy:1.9"
|
||||
docker_img: "rpcs3/rpcs3-ci-jammy:1.13"
|
||||
build_sh: "/rpcs3/.ci/build-linux.sh"
|
||||
compiler: clang
|
||||
UPLOAD_COMMIT_HASH: d812f1254a1157c80fd402f94446310560f54e5f
|
||||
UPLOAD_REPO_FULL_NAME: "rpcs3/rpcs3-binaries-linux"
|
||||
- os: ubuntu-24.04
|
||||
docker_img: "rpcs3/rpcs3-ci-jammy:1.9"
|
||||
docker_img: "rpcs3/rpcs3-ci-jammy:1.13"
|
||||
build_sh: "/rpcs3/.ci/build-linux.sh"
|
||||
compiler: gcc
|
||||
- os: ubuntu-24.04-arm
|
||||
docker_img: "rpcs3/rpcs3-ci-jammy-aarch64:1.9"
|
||||
docker_img: "rpcs3/rpcs3-ci-jammy-aarch64:1.13"
|
||||
build_sh: "/rpcs3/.ci/build-linux-aarch64.sh"
|
||||
compiler: clang
|
||||
UPLOAD_COMMIT_HASH: a1d35836e8d45bfc6f63c26f0a3e5d46ef622fe1
|
||||
UPLOAD_REPO_FULL_NAME: "rpcs3/rpcs3-binaries-linux-arm64"
|
||||
- os: ubuntu-24.04-arm
|
||||
docker_img: "rpcs3/rpcs3-ci-jammy-aarch64:1.9"
|
||||
docker_img: "rpcs3/rpcs3-ci-jammy-aarch64:1.13"
|
||||
build_sh: "/rpcs3/.ci/build-linux-aarch64.sh"
|
||||
compiler: gcc
|
||||
name: RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }}
|
||||
@@ -134,7 +134,7 @@ jobs:
|
||||
runs-on: macos-14
|
||||
env:
|
||||
CCACHE_DIR: /tmp/ccache_dir
|
||||
QT_VER: '6.10.2'
|
||||
QT_VER: '6.11.1'
|
||||
QT_VER_MAIN: '6'
|
||||
LLVM_COMPILER_VER: '21'
|
||||
RELEASE_MESSAGE: ../GitHubReleaseMessage.txt
|
||||
@@ -209,16 +209,16 @@ jobs:
|
||||
# Only run push event on master branch of main repo, but run all PRs
|
||||
if: github.event_name != 'push' || (github.repository == 'RPCS3/rpcs3' && github.ref_name == 'master')
|
||||
name: RPCS3 Windows
|
||||
runs-on: windows-2025
|
||||
runs-on: windows-2025-vs2026
|
||||
env:
|
||||
COMPILER: msvc
|
||||
QT_VER_MAIN: '6'
|
||||
QT_VER: '6.10.2'
|
||||
QT_VER: '6.11.1'
|
||||
QT_VER_MSVC: 'msvc2022'
|
||||
QT_DATE: '202601261212'
|
||||
QT_DATE: '202605090529'
|
||||
LLVM_VER: '19.1.7'
|
||||
VULKAN_VER: '1.3.268.0'
|
||||
VULKAN_SDK_SHA: '8459ef49bd06b697115ddd3d97c9aec729e849cd775f5be70897718a9b3b9db5'
|
||||
VULKAN_VER: '1.4.341.1'
|
||||
VULKAN_SDK_SHA: 'bcf2d75aa9556889ab974858666e20b3655b6055a0db704ccb47279ff33b5bfe'
|
||||
CCACHE_SHA: '859141059ac950e1e8cd042c66f842f26b9e3a62a1669a69fe6ba180cb58bbdf'
|
||||
CCACHE_BIN_DIR: 'C:\ccache_bin'
|
||||
CCACHE_DIR: 'C:\ccache'
|
||||
@@ -235,7 +235,7 @@ jobs:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup NuGet
|
||||
uses: nuget/setup-nuget@v2
|
||||
uses: nuget/setup-nuget@v4
|
||||
|
||||
- name: Restore NuGet packages
|
||||
run: nuget restore rpcs3.sln
|
||||
|
||||
@@ -69,6 +69,9 @@ CMakeSettings.json
|
||||
*PVS-Studio*
|
||||
PVS/*
|
||||
|
||||
# Zed Editor files
|
||||
.zed/*
|
||||
|
||||
# Ignore other system generated files
|
||||
x64/*
|
||||
rpcs3/x64/*
|
||||
|
||||
@@ -7,27 +7,24 @@ if(USE_SYSTEM_CURL)
|
||||
target_link_libraries(3rdparty_libcurl INTERFACE CURL::libcurl)
|
||||
else()
|
||||
message(STATUS "RPCS3: building libcurl + wolfssl submodules")
|
||||
set(BUILD_CURL_EXE OFF CACHE BOOL "Set to ON to build curl executable.")
|
||||
set(BUILD_STATIC_CURL OFF CACHE BOOL "Set to ON to build curl executable with static libcurl.")
|
||||
set(BUILD_STATIC_LIBS ON CACHE BOOL "Set to ON to build static libcurl.")
|
||||
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Set to ON to build shared libcurl.")
|
||||
set(BUILD_CURL_EXE OFF CACHE INTERNAL "")
|
||||
set(BUILD_STATIC_CURL OFF CACHE INTERNAL "")
|
||||
set(BUILD_STATIC_LIBS ON CACHE INTERNAL "")
|
||||
set(BUILD_SHARED_LIBS OFF CACHE INTERNAL "")
|
||||
find_package(WolfSSL REQUIRED)
|
||||
set(CURL_USE_WOLFSSL ON CACHE BOOL "enable wolfSSL for SSL/TLS")
|
||||
set(CURL_USE_OPENSSL OFF CACHE BOOL "Use OpenSSL code. Experimental")
|
||||
set(HTTP_ONLY ON CACHE BOOL "disables all protocols except HTTP (This overrides all CURL_DISABLE_* options)")
|
||||
set(USE_LIBIDN2 OFF CACHE BOOL "Use libidn2 for IDN support") # Disabled because MacOS CI doesn't work otherwise
|
||||
set(CURL_CA_PATH "none" CACHE STRING "Location of default CA path. Set 'none' to disable or 'auto' for auto-detection. Defaults to 'auto'.")
|
||||
option(CURL_DISABLE_INSTALL "Disable installation targets" ON)
|
||||
if(USE_MSVC_STATIC_CRT)
|
||||
set(CURL_STATIC_CRT ON CACHE BOOL "Use static crt to build curl")
|
||||
endif()
|
||||
set(CURL_USE_WOLFSSL ON CACHE INTERNAL "")
|
||||
set(CURL_USE_OPENSSL OFF CACHE INTERNAL "")
|
||||
set(HTTP_ONLY ON CACHE INTERNAL "")
|
||||
set(USE_LIBIDN2 OFF CACHE INTERNAL "") # Disabled because MacOS CI doesn't work otherwise
|
||||
set(CURL_CA_PATH "none" CACHE INTERNAL "")
|
||||
set(CURL_DISABLE_INSTALL ON CACHE INTERNAL "")
|
||||
if(WIN32)
|
||||
set(ENABLE_UNICODE ON CACHE BOOL "enable Unicode")
|
||||
set(ENABLE_UNICODE ON CACHE INTERNAL "")
|
||||
endif()
|
||||
set(CURL_USE_LIBSSH2 OFF CACHE BOOL "Use libSSH2")
|
||||
set(CURL_USE_LIBPSL OFF CACHE BOOL "Use libPSL")
|
||||
option(BUILD_TESTING "Build tests" OFF)
|
||||
option(BUILD_EXAMPLES "Build libcurl examples" OFF)
|
||||
set(CURL_USE_LIBSSH2 OFF CACHE INTERNAL "")
|
||||
set(CURL_USE_LIBPSL OFF CACHE INTERNAL "")
|
||||
set(BUILD_TESTING OFF CACHE INTERNAL "")
|
||||
set(BUILD_EXAMPLES OFF CACHE INTERNAL "")
|
||||
|
||||
add_subdirectory(curl EXCLUDE_FROM_ALL)
|
||||
|
||||
|
||||
@@ -66,6 +66,7 @@
|
||||
<ClCompile Include="curl\lib\asyn-thrdd.c" />
|
||||
<ClCompile Include="curl\lib\bufq.c" />
|
||||
<ClCompile Include="curl\lib\bufref.c" />
|
||||
<ClCompile Include="curl\lib\cf-dns.c" />
|
||||
<ClCompile Include="curl\lib\cf-h1-proxy.c" />
|
||||
<ClCompile Include="curl\lib\cf-h2-proxy.c" />
|
||||
<ClCompile Include="curl\lib\cf-haproxy.c" />
|
||||
@@ -79,12 +80,16 @@
|
||||
<ClCompile Include="curl\lib\cookie.c" />
|
||||
<ClCompile Include="curl\lib\cshutdn.c" />
|
||||
<ClCompile Include="curl\lib\curlx\base64.c" />
|
||||
<ClCompile Include="curl\lib\curlx\basename.c" />
|
||||
<ClCompile Include="curl\lib\curlx\dynbuf.c" />
|
||||
<ClCompile Include="curl\lib\curlx\fopen.c" />
|
||||
<ClCompile Include="curl\lib\curlx\inet_ntop.c" />
|
||||
<ClCompile Include="curl\lib\curlx\inet_pton.c" />
|
||||
<ClCompile Include="curl\lib\curlx\multibyte.c" />
|
||||
<ClCompile Include="curl\lib\curlx\nonblock.c" />
|
||||
<ClCompile Include="curl\lib\curlx\snprintf.c" />
|
||||
<ClCompile Include="curl\lib\curlx\strcopy.c" />
|
||||
<ClCompile Include="curl\lib\curlx\strdup.c" />
|
||||
<ClCompile Include="curl\lib\curlx\strerr.c" />
|
||||
<ClCompile Include="curl\lib\curlx\strparse.c" />
|
||||
<ClCompile Include="curl\lib\curlx\timediff.c" />
|
||||
@@ -103,9 +108,9 @@
|
||||
<ClCompile Include="curl\lib\curl_memrchr.c" />
|
||||
<ClCompile Include="curl\lib\curl_ntlm_core.c" />
|
||||
<ClCompile Include="curl\lib\curl_range.c" />
|
||||
<ClCompile Include="curl\lib\curl_rtmp.c" />
|
||||
<ClCompile Include="curl\lib\curl_sasl.c" />
|
||||
<ClCompile Include="curl\lib\curl_sha512_256.c" />
|
||||
<ClCompile Include="curl\lib\curl_share.c" />
|
||||
<ClCompile Include="curl\lib\curl_sspi.c" />
|
||||
<ClCompile Include="curl\lib\curl_threads.c" />
|
||||
<ClCompile Include="curl\lib\curl_trc.c" />
|
||||
@@ -113,6 +118,7 @@
|
||||
<ClCompile Include="curl\lib\cw-pause.c" />
|
||||
<ClCompile Include="curl\lib\dict.c" />
|
||||
<ClCompile Include="curl\lib\dllmain.c" />
|
||||
<ClCompile Include="curl\lib\dnscache.c" />
|
||||
<ClCompile Include="curl\lib\doh.c" />
|
||||
<ClCompile Include="curl\lib\dynhds.c" />
|
||||
<ClCompile Include="curl\lib\easy.c" />
|
||||
@@ -167,16 +173,16 @@
|
||||
<ClCompile Include="curl\lib\pingpong.c" />
|
||||
<ClCompile Include="curl\lib\pop3.c" />
|
||||
<ClCompile Include="curl\lib\progress.c" />
|
||||
<ClCompile Include="curl\lib\protocol.c" />
|
||||
<ClCompile Include="curl\lib\psl.c" />
|
||||
<ClCompile Include="curl\lib\rand.c" />
|
||||
<ClCompile Include="curl\lib\rename.c" />
|
||||
<ClCompile Include="curl\lib\ratelimit.c" />
|
||||
<ClCompile Include="curl\lib\request.c" />
|
||||
<ClCompile Include="curl\lib\rtsp.c" />
|
||||
<ClCompile Include="curl\lib\select.c" />
|
||||
<ClCompile Include="curl\lib\sendf.c" />
|
||||
<ClCompile Include="curl\lib\setopt.c" />
|
||||
<ClCompile Include="curl\lib\sha256.c" />
|
||||
<ClCompile Include="curl\lib\share.c" />
|
||||
<ClCompile Include="curl\lib\slist.c" />
|
||||
<ClCompile Include="curl\lib\smb.c" />
|
||||
<ClCompile Include="curl\lib\smtp.c" />
|
||||
@@ -184,15 +190,15 @@
|
||||
<ClCompile Include="curl\lib\socks.c" />
|
||||
<ClCompile Include="curl\lib\socks_gssapi.c" />
|
||||
<ClCompile Include="curl\lib\socks_sspi.c" />
|
||||
<ClCompile Include="curl\lib\speedcheck.c" />
|
||||
<ClCompile Include="curl\lib\splay.c" />
|
||||
<ClCompile Include="curl\lib\strcase.c" />
|
||||
<ClCompile Include="curl\lib\strdup.c" />
|
||||
<ClCompile Include="curl\lib\strequal.c" />
|
||||
<ClCompile Include="curl\lib\strerror.c" />
|
||||
<ClCompile Include="curl\lib\system_win32.c" />
|
||||
<ClCompile Include="curl\lib\telnet.c" />
|
||||
<ClCompile Include="curl\lib\tftp.c" />
|
||||
<ClCompile Include="curl\lib\thrdpool.c" />
|
||||
<ClCompile Include="curl\lib\thrdqueue.c" />
|
||||
<ClCompile Include="curl\lib\transfer.c" />
|
||||
<ClCompile Include="curl\lib\uint-bset.c" />
|
||||
<ClCompile Include="curl\lib\uint-hash.c" />
|
||||
@@ -204,6 +210,7 @@
|
||||
<ClCompile Include="curl\lib\version.c" />
|
||||
<ClCompile Include="curl\lib\vquic\curl_ngtcp2.c" />
|
||||
<ClCompile Include="curl\lib\vquic\curl_quiche.c" />
|
||||
<ClCompile Include="curl\lib\vssh\vssh.c" />
|
||||
<ClCompile Include="curl\lib\vtls\apple.c" />
|
||||
<ClCompile Include="curl\lib\vtls\cipher_suite.c" />
|
||||
<ClCompile Include="curl\lib\vtls\hostcheck.c" />
|
||||
@@ -224,13 +231,11 @@
|
||||
<ClCompile Include="curl\lib\vauth\spnego_sspi.c" />
|
||||
<ClCompile Include="curl\lib\vauth\vauth.c" />
|
||||
<ClCompile Include="curl\lib\vquic\vquic.c" />
|
||||
<ClCompile Include="curl\lib\vssh\curl_path.c" />
|
||||
<ClCompile Include="curl\lib\vssh\libssh.c" />
|
||||
<ClCompile Include="curl\lib\vssh\libssh2.c" />
|
||||
<ClCompile Include="curl\lib\vtls\gtls.c" />
|
||||
<ClCompile Include="curl\lib\vtls\keylog.c" />
|
||||
<ClCompile Include="curl\lib\vtls\mbedtls.c" />
|
||||
<ClCompile Include="curl\lib\vtls\mbedtls_threadlock.c" />
|
||||
<ClCompile Include="curl\lib\vtls\openssl.c" />
|
||||
<ClCompile Include="curl\lib\vtls\schannel.c" />
|
||||
<ClCompile Include="curl\lib\vtls\schannel_verify.c" />
|
||||
@@ -254,6 +259,7 @@
|
||||
<ClInclude Include="curl\lib\asyn.h" />
|
||||
<ClInclude Include="curl\lib\bufq.h" />
|
||||
<ClInclude Include="curl\lib\bufref.h" />
|
||||
<ClInclude Include="curl\lib\cf-dns.h" />
|
||||
<ClInclude Include="curl\lib\cf-h1-proxy.h" />
|
||||
<ClInclude Include="curl\lib\cf-h2-proxy.h" />
|
||||
<ClInclude Include="curl\lib\cf-haproxy.h" />
|
||||
@@ -272,14 +278,17 @@
|
||||
<ClInclude Include="curl\lib\cookie.h" />
|
||||
<ClInclude Include="curl\lib\cshutdn.h" />
|
||||
<ClInclude Include="curl\lib\curlx\base64.h" />
|
||||
<ClInclude Include="curl\lib\curlx\basename.h" />
|
||||
<ClInclude Include="curl\lib\curlx\binmode.h" />
|
||||
<ClInclude Include="curl\lib\curlx\curlx.h" />
|
||||
<ClInclude Include="curl\lib\curlx\dynbuf.h" />
|
||||
<ClInclude Include="curl\lib\curlx\fopen.h" />
|
||||
<ClInclude Include="curl\lib\curlx\inet_ntop.h" />
|
||||
<ClInclude Include="curl\lib\curlx\inet_pton.h" />
|
||||
<ClInclude Include="curl\lib\curlx\multibyte.h" />
|
||||
<ClInclude Include="curl\lib\curlx\nonblock.h" />
|
||||
<ClInclude Include="curl\lib\curlx\snprintf.h" />
|
||||
<ClInclude Include="curl\lib\curlx\strcopy.h" />
|
||||
<ClInclude Include="curl\lib\curlx\strdup.h" />
|
||||
<ClInclude Include="curl\lib\curlx\strerr.h" />
|
||||
<ClInclude Include="curl\lib\curlx\strparse.h" />
|
||||
<ClInclude Include="curl\lib\curlx\timediff.h" />
|
||||
@@ -300,24 +309,23 @@
|
||||
<ClInclude Include="curl\lib\curl_ldap.h" />
|
||||
<ClInclude Include="curl\lib\curl_md4.h" />
|
||||
<ClInclude Include="curl\lib\curl_md5.h" />
|
||||
<ClInclude Include="curl\lib\curl_memory.h" />
|
||||
<ClInclude Include="curl\lib\curl_memrchr.h" />
|
||||
<ClInclude Include="curl\lib\curl_mem_undef.h" />
|
||||
<ClInclude Include="curl\lib\curl_ntlm_core.h" />
|
||||
<ClInclude Include="curl\lib\curl_printf.h" />
|
||||
<ClInclude Include="curl\lib\curl_range.h" />
|
||||
<ClInclude Include="curl\lib\curl_rtmp.h" />
|
||||
<ClInclude Include="curl\lib\curl_sasl.h" />
|
||||
<ClInclude Include="curl\lib\curl_setup.h" />
|
||||
<ClInclude Include="curl\lib\curl_setup_once.h" />
|
||||
<ClInclude Include="curl\lib\curl_sha256.h" />
|
||||
<ClInclude Include="curl\lib\curl_sha512_256.h" />
|
||||
<ClInclude Include="curl\lib\curl_share.h" />
|
||||
<ClInclude Include="curl\lib\curl_sspi.h" />
|
||||
<ClInclude Include="curl\lib\curl_threads.h" />
|
||||
<ClInclude Include="curl\lib\curl_trc.h" />
|
||||
<ClInclude Include="curl\lib\cw-out.h" />
|
||||
<ClInclude Include="curl\lib\cw-pause.h" />
|
||||
<ClInclude Include="curl\lib\dict.h" />
|
||||
<ClInclude Include="curl\lib\dnscache.h" />
|
||||
<ClInclude Include="curl\lib\doh.h" />
|
||||
<ClInclude Include="curl\lib\dynhds.h" />
|
||||
<ClInclude Include="curl\lib\easyif.h" />
|
||||
@@ -328,6 +336,7 @@
|
||||
<ClInclude Include="curl\lib\file.h" />
|
||||
<ClInclude Include="curl\lib\fileinfo.h" />
|
||||
<ClInclude Include="curl\lib\formdata.h" />
|
||||
<ClInclude Include="curl\lib\ftp-int.h" />
|
||||
<ClInclude Include="curl\lib\ftp.h" />
|
||||
<ClInclude Include="curl\lib\ftplistparser.h" />
|
||||
<ClInclude Include="curl\lib\functypes.h" />
|
||||
@@ -352,7 +361,6 @@
|
||||
<ClInclude Include="curl\lib\imap.h" />
|
||||
<ClInclude Include="curl\lib\llist.h" />
|
||||
<ClInclude Include="curl\lib\macos.h" />
|
||||
<ClInclude Include="curl\lib\memdebug.h" />
|
||||
<ClInclude Include="curl\lib\mime.h" />
|
||||
<ClInclude Include="curl\lib\mqtt.h" />
|
||||
<ClInclude Include="curl\lib\multihandle.h" />
|
||||
@@ -365,9 +373,10 @@
|
||||
<ClInclude Include="curl\lib\pingpong.h" />
|
||||
<ClInclude Include="curl\lib\pop3.h" />
|
||||
<ClInclude Include="curl\lib\progress.h" />
|
||||
<ClInclude Include="curl\lib\protocol.h" />
|
||||
<ClInclude Include="curl\lib\psl.h" />
|
||||
<ClInclude Include="curl\lib\rand.h" />
|
||||
<ClInclude Include="curl\lib\rename.h" />
|
||||
<ClInclude Include="curl\lib\ratelimit.h" />
|
||||
<ClInclude Include="curl\lib\request.h" />
|
||||
<ClInclude Include="curl\lib\rtsp.h" />
|
||||
<ClInclude Include="curl\lib\select.h" />
|
||||
@@ -376,7 +385,6 @@
|
||||
<ClInclude Include="curl\lib\setup-os400.h" />
|
||||
<ClInclude Include="curl\lib\setup-vms.h" />
|
||||
<ClInclude Include="curl\lib\setup-win32.h" />
|
||||
<ClInclude Include="curl\lib\share.h" />
|
||||
<ClInclude Include="curl\lib\sigpipe.h" />
|
||||
<ClInclude Include="curl\lib\slist.h" />
|
||||
<ClInclude Include="curl\lib\smb.h" />
|
||||
@@ -384,7 +392,6 @@
|
||||
<ClInclude Include="curl\lib\sockaddr.h" />
|
||||
<ClInclude Include="curl\lib\socketpair.h" />
|
||||
<ClInclude Include="curl\lib\socks.h" />
|
||||
<ClInclude Include="curl\lib\speedcheck.h" />
|
||||
<ClInclude Include="curl\lib\splay.h" />
|
||||
<ClInclude Include="curl\lib\strcase.h" />
|
||||
<ClInclude Include="curl\lib\strdup.h" />
|
||||
@@ -394,6 +401,8 @@
|
||||
<ClInclude Include="curl\lib\system_win32.h" />
|
||||
<ClInclude Include="curl\lib\telnet.h" />
|
||||
<ClInclude Include="curl\lib\tftp.h" />
|
||||
<ClInclude Include="curl\lib\thrdpool.h" />
|
||||
<ClInclude Include="curl\lib\thrdqueue.h" />
|
||||
<ClInclude Include="curl\lib\transfer.h" />
|
||||
<ClInclude Include="curl\lib\uint-bset.h" />
|
||||
<ClInclude Include="curl\lib\uint-hash.h" />
|
||||
@@ -405,6 +414,7 @@
|
||||
<ClInclude Include="curl\lib\vquic\curl_ngtcp2.h" />
|
||||
<ClInclude Include="curl\lib\vquic\curl_quiche.h" />
|
||||
<ClInclude Include="curl\lib\vquic\vquic_int.h" />
|
||||
<ClInclude Include="curl\lib\vssh\vssh.h" />
|
||||
<ClInclude Include="curl\lib\vtls\apple.h" />
|
||||
<ClInclude Include="curl\lib\vtls\cipher_suite.h" />
|
||||
<ClInclude Include="curl\lib\vtls\hostcheck.h" />
|
||||
@@ -418,12 +428,10 @@
|
||||
<ClInclude Include="curl\lib\vauth\ntlm.h" />
|
||||
<ClInclude Include="curl\lib\vauth\vauth.h" />
|
||||
<ClInclude Include="curl\lib\vquic\vquic.h" />
|
||||
<ClInclude Include="curl\lib\vssh\curl_path.h" />
|
||||
<ClInclude Include="curl\lib\vssh\ssh.h" />
|
||||
<ClInclude Include="curl\lib\vtls\gtls.h" />
|
||||
<ClInclude Include="curl\lib\vtls\keylog.h" />
|
||||
<ClInclude Include="curl\lib\vtls\mbedtls.h" />
|
||||
<ClInclude Include="curl\lib\vtls\mbedtls_threadlock.h" />
|
||||
<ClInclude Include="curl\lib\vtls\openssl.h" />
|
||||
<ClInclude Include="curl\lib\vtls\schannel.h" />
|
||||
<ClInclude Include="curl\lib\vtls\vtls.h" />
|
||||
|
||||
@@ -66,9 +66,6 @@
|
||||
<ClCompile Include="curl\lib\curl_range.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\curl_rtmp.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\curl_sasl.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
@@ -204,9 +201,6 @@
|
||||
<ClCompile Include="curl\lib\rand.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\rename.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\rtsp.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
@@ -222,9 +216,6 @@
|
||||
<ClCompile Include="curl\lib\sha256.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\share.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\slist.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
@@ -246,18 +237,12 @@
|
||||
<ClCompile Include="curl\lib\socks_sspi.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\speedcheck.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\splay.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\strcase.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\strdup.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\strerror.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
@@ -318,9 +303,6 @@
|
||||
<ClCompile Include="curl\lib\vauth\vauth.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\vssh\curl_path.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\vssh\libssh.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
@@ -333,9 +315,6 @@
|
||||
<ClCompile Include="curl\lib\vtls\mbedtls.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\vtls\mbedtls_threadlock.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\vtls\openssl.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
@@ -549,6 +528,42 @@
|
||||
<ClCompile Include="curl\lib\curlx\strerr.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\curlx\strcopy.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\vssh\vssh.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\curl_share.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\ratelimit.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\curlx\basename.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\curlx\snprintf.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\curlx\strdup.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\cf-dns.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\dnscache.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\protocol.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\thrdpool.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\thrdqueue.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="curl\include\curl\curl.h">
|
||||
@@ -653,9 +668,6 @@
|
||||
<ClInclude Include="curl\lib\curl_md5.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\curl_memory.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\curl_memrchr.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
@@ -668,9 +680,6 @@
|
||||
<ClInclude Include="curl\lib\curl_range.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\curl_rtmp.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\curl_sasl.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
@@ -758,9 +767,6 @@
|
||||
<ClInclude Include="curl\lib\llist.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\memdebug.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\mime.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
@@ -791,9 +797,6 @@
|
||||
<ClInclude Include="curl\lib\rand.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\rename.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\rtsp.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
@@ -812,9 +815,6 @@
|
||||
<ClInclude Include="curl\lib\setup-vms.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\share.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\sigpipe.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
@@ -836,9 +836,6 @@
|
||||
<ClInclude Include="curl\lib\socks.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\speedcheck.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\splay.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
@@ -887,9 +884,6 @@
|
||||
<ClInclude Include="curl\lib\vauth\vauth.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\vssh\curl_path.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\vssh\ssh.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
@@ -899,9 +893,6 @@
|
||||
<ClInclude Include="curl\lib\vtls\mbedtls.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\vtls\mbedtls_threadlock.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\vtls\openssl.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
@@ -1058,9 +1049,6 @@
|
||||
<ClInclude Include="curl\lib\curlx\base64.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\curlx\curlx.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\curlx\dynbuf.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
@@ -1103,9 +1091,6 @@
|
||||
<ClInclude Include="curl\lib\cf-ip-happy.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\curl_mem_undef.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\curl_fopen.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
@@ -1121,6 +1106,45 @@
|
||||
<ClInclude Include="curl\lib\curlx\strerr.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\curlx\snprintf.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\curlx\strcopy.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\vssh\vssh.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\curl_share.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\ratelimit.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\curlx\basename.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\curlx\strdup.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\cf-dns.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\dnscache.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\ftp-int.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\protocol.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\thrdpool.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\thrdqueue.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="curl\lib\libcurl.rc">
|
||||
|
||||
@@ -54,6 +54,9 @@
|
||||
<ClCompile Condition="'$(Configuration)'=='Release'">
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Condition="'$(EnableLibUsbWindowsHotplug)' == 'true'">
|
||||
<PreprocessorDefinitions>LIBUSB_WINDOWS_HOTPLUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Lib>
|
||||
<OutputFile>$(OutDir)libusb-1.0.lib</OutputFile>
|
||||
</Lib>
|
||||
@@ -64,6 +67,7 @@
|
||||
<ClCompile Include="libusb\libusb\hotplug.c" />
|
||||
<ClCompile Include="libusb\libusb\io.c" />
|
||||
<ClCompile Include="libusb\libusb\os\events_windows.c" />
|
||||
<ClCompile Condition="'$(EnableLibUsbWindowsHotplug)' == 'true'" Include="libusb\libusb\os\windows_hotplug.c" />
|
||||
<ClCompile Include="libusb\libusb\strerror.c" />
|
||||
<ClCompile Include="libusb\libusb\sync.c" />
|
||||
<ClCompile Include="libusb\libusb\os\threads_windows.c" />
|
||||
@@ -72,6 +76,7 @@
|
||||
<ClCompile Include="libusb\libusb\os\windows_winusb.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Condition="'$(EnableLibUsbWindowsHotplug)' == 'true'" Include="libusb\libusb\os\windows_hotplug.h" />
|
||||
<ClInclude Include="libusb\msvc\config.h" />
|
||||
<ClInclude Include="libusb\libusb\hotplug.h" />
|
||||
<ClInclude Include="libusb\libusb\libusb.h" />
|
||||
|
||||
@@ -20,6 +20,8 @@ else()
|
||||
option(protobuf_DISABLE_RTTI "Remove runtime type information in the binaries" OFF)
|
||||
option(protobuf_FORCE_FETCH_DEPENDENCIES "Force all dependencies to be downloaded from GitHub. Local installations will be ignored." OFF)
|
||||
option(protobuf_LOCAL_DEPENDENCIES_ONLY "Prevent downloading any dependencies from GitHub. If this option is set, the dependency must be available locally as an installed package." OFF)
|
||||
option(protobuf_BUILD_SHARED_LIBS "Build Shared Libraries" OFF)
|
||||
option(protobuf_MSVC_STATIC_RUNTIME "Link static runtime libraries" OFF)
|
||||
|
||||
add_subdirectory(protobuf EXCLUDE_FROM_ALL)
|
||||
target_include_directories(3rdparty_protobuf SYSTEM INTERFACE protobuf/src)
|
||||
|
||||
@@ -6,15 +6,22 @@ find_package(Qt6 ${QT_MIN_VER} CONFIG COMPONENTS Widgets Concurrent Multimedia M
|
||||
if(WIN32)
|
||||
target_link_libraries(3rdparty_qt6 INTERFACE Qt6::Widgets Qt6::Concurrent Qt6::Multimedia Qt6::MultimediaWidgets Qt6::Svg Qt6::SvgWidgets)
|
||||
else()
|
||||
set(QT_NO_PRIVATE_MODULE_WARNING ON)
|
||||
find_package(Qt6 ${QT_MIN_VER} COMPONENTS DBus Gui GuiPrivate)
|
||||
find_package(Qt6 ${QT_MIN_VER} COMPONENTS DBus Gui)
|
||||
if(Qt6_VERSION VERSION_GREATER_EQUAL "6.10.0")
|
||||
set(QT_NO_PRIVATE_MODULE_WARNING ON)
|
||||
find_package(Qt6 ${QT_MIN_VER} COMPONENTS GuiPrivate)
|
||||
endif()
|
||||
if(Qt6DBus_FOUND)
|
||||
target_link_libraries(3rdparty_qt6 INTERFACE Qt6::Widgets Qt6::DBus Qt6::Concurrent Qt6::Multimedia Qt6::MultimediaWidgets Qt6::Svg Qt6::SvgWidgets)
|
||||
target_compile_definitions(3rdparty_qt6 INTERFACE -DHAVE_QTDBUS)
|
||||
else()
|
||||
target_link_libraries(3rdparty_qt6 INTERFACE Qt6::Widgets Qt6::Concurrent Qt6::Multimedia Qt6::MultimediaWidgets Qt6::Svg Qt6::SvgWidgets)
|
||||
endif()
|
||||
target_link_libraries(3rdparty_qt6 INTERFACE Qt6::GuiPrivate)
|
||||
if(Qt6_VERSION VERSION_GREATER_EQUAL "6.10.0")
|
||||
target_link_libraries(3rdparty_qt6 INTERFACE Qt6::GuiPrivate)
|
||||
else()
|
||||
target_include_directories(3rdparty_qt6 INTERFACE ${Qt6Gui_PRIVATE_INCLUDE_DIRS})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(Qt6Widgets_FOUND)
|
||||
|
||||
@@ -119,7 +119,8 @@ echo -e "\n\nResult:\n"
|
||||
|
||||
# Find the max length of the paths (before '->')
|
||||
max_len=0
|
||||
while IFS='->' read -r left _; do
|
||||
while read -r line; do
|
||||
left="${line%%->*}"
|
||||
len=$(echo -n "$left" | wc -c)
|
||||
if (( len > max_len )); then
|
||||
max_len=$len
|
||||
@@ -127,8 +128,10 @@ while IFS='->' read -r left _; do
|
||||
done < "$resultfile"
|
||||
|
||||
# Print with padding so '->' lines up
|
||||
while IFS='->' read -r left right; do
|
||||
right=$(echo "$right" | sed 's/^[[:space:]]*>*[[:space:]]*//')
|
||||
while read -r line; do
|
||||
left="${line%%->*}"
|
||||
right="${line#*->}"
|
||||
right=$(echo "$right" | sed 's/^[[:space:]]*//')
|
||||
printf "%-${max_len}s -> %s\n" "$left" "$right"
|
||||
done < "$resultfile"
|
||||
|
||||
|
||||
@@ -4,23 +4,22 @@ if(USE_SYSTEM_WOLFSSL)
|
||||
add_library(wolfssl INTERFACE)
|
||||
target_link_libraries(wolfssl INTERFACE PkgConfig::WolfSSL)
|
||||
else()
|
||||
option(WOLFSSL_TLS13 "Enable wolfSSL TLS v1.3 (default: enabled)" OFF)
|
||||
set(WOLFSSL_SHA3 ON CACHE STRING "Enable wolfSSL SHA-3 support (default: enabled on x86_64/aarch64)")
|
||||
set(WOLFSSL_SHAKE256 ON CACHE STRING "Enable wolfSSL SHAKE256 support (default: enabled on x86_64/aarch64)")
|
||||
option(WOLFSSL_BASE64_ENCODE "Enable Base64 encoding (default: enabled on x86_64)" OFF)
|
||||
option(WOLFSSL_DES3 "Enable DES3 (default: disabled)" ON)
|
||||
option(WOLFSSL_PWDBASED "Enable PWDBASED (default: disabled)" ON)
|
||||
option(WOLFSSL_FAST_MATH "Enable fast math ops (default: disabled)" ON)
|
||||
option(WOLFSSL_EXAMPLES "Enable examples (default: enabled)" OFF)
|
||||
option(WOLFSSL_CRYPT_TESTS "Enable Crypt Bench/Test (default: enabled)" OFF)
|
||||
option(WOLFSSL_ASYNC_THREADS "Enable Asynchronous Threading (default: enabled)" OFF)
|
||||
option(WOLFSSL_BUILD_OUT_OF_TREE "Don't generate files in the source tree (default: yes)" ON)
|
||||
option(WOLFSSL_SNI "Enable SNI (default: disabled)" ON)
|
||||
option(WOLFSSL_OPENSSLEXTRA "Enable extra OpenSSL API, size+ (default: disabled)" ON)
|
||||
option(WOLFSSL_HARDEN "Enable Hardened build, Enables Timing Resistance and Blinding (default: enabled)" OFF)
|
||||
option(WOLFSSL_ALT_CERT_CHAINS "Enable support for Alternate certification chains (default: disabled)" ON)
|
||||
set(WOLFSSL_TLS13 OFF CACHE INTERNAL "")
|
||||
set(WOLFSSL_SHA3 ON CACHE INTERNAL "")
|
||||
set(WOLFSSL_SHAKE256 ON CACHE INTERNAL "")
|
||||
set(WOLFSSL_BASE64_ENCODE OFF CACHE INTERNAL "")
|
||||
set(WOLFSSL_DES3 ON CACHE INTERNAL "")
|
||||
set(WOLFSSL_PWDBASED ON CACHE INTERNAL "")
|
||||
set(WOLFSSL_FAST_MATH ON CACHE INTERNAL "")
|
||||
set(WOLFSSL_EXAMPLES OFF CACHE INTERNAL "")
|
||||
set(WOLFSSL_CRYPT_TESTS OFF CACHE INTERNAL "")
|
||||
set(WOLFSSL_ASYNC_THREADS OFF CACHE INTERNAL "")
|
||||
set(WOLFSSL_BUILD_OUT_OF_TREE ON CACHE INTERNAL "")
|
||||
set(WOLFSSL_SNI ON CACHE INTERNAL "")
|
||||
set(WOLFSSL_OPENSSLEXTRA ON CACHE INTERNAL "")
|
||||
set(WOLFSSL_ALT_CERT_CHAINS ON CACHE INTERNAL "")
|
||||
|
||||
add_subdirectory(wolfssl EXCLUDE_FROM_ALL)
|
||||
|
||||
target_compile_definitions(wolfssl PUBLIC WOLFSSL_DES_ECB HAVE_WRITE_DUP FP_MAX_BITS=8192 WOLFSSL_NO_OPTIONS_H)
|
||||
target_compile_definitions(wolfssl PUBLIC WOLFSSL_DES_ECB HAVE_WRITE_DUP FP_MAX_BITS=8192 WOLFSSL_USE_OPTIONS_H)
|
||||
endif()
|
||||
|
||||
@@ -6,7 +6,8 @@ if (USE_SYSTEM_ZLIB)
|
||||
target_link_libraries(3rdparty_zlib INTERFACE ZLIB::ZLIB)
|
||||
target_compile_definitions(3rdparty_zlib INTERFACE -DZLIB_CONST=1)
|
||||
else()
|
||||
option(ZLIB_BUILD_EXAMPLES "Enable Zlib Examples" OFF)
|
||||
option(ZLIB_BUILD_TESTING "Enable Zlib Examples as tests" OFF)
|
||||
option(ZLIB_BUILD_SHARED "Enable building zlib shared library" OFF)
|
||||
message(STATUS "RPCS3: Using builtin ZLIB")
|
||||
set(SKIP_INSTALL_ALL ON)
|
||||
add_subdirectory(zlib EXCLUDE_FROM_ALL)
|
||||
|
||||
@@ -20,27 +20,27 @@ The following tools are required to build RPCS3 on Windows 10 or later:
|
||||
with standalone **CMake** tool.
|
||||
|
||||
- [Python 3.6+](https://www.python.org/downloads/) (add to PATH)
|
||||
- [Qt 6.10.2](https://www.qt.io/download-qt-installer) In case you can't download from the official installer, you can use [Another Qt installer](https://github.com/miurahr/aqtinstall) (In that case you will need to manually add the "qtmultimedia" module when installing Qt)
|
||||
- [Vulkan SDK 1.3.268.0](https://vulkan.lunarg.com/sdk/home) (see "Install the SDK" [here](https://vulkan.lunarg.com/doc/sdk/latest/windows/getting_started.html)) for now future SDKs don't work. You need precisely 1.3.268.0.
|
||||
- [Qt 6.11.1](https://www.qt.io/download-qt-installer) In case you can't download from the official installer, you can use [Another Qt installer](https://github.com/miurahr/aqtinstall) (In that case you will need to manually add the "qtmultimedia" module when installing Qt)
|
||||
- [Vulkan SDK 1.4.341.1](https://vulkan.lunarg.com/sdk/home) (see "Install the SDK" [here](https://vulkan.lunarg.com/doc/sdk/latest/windows/getting_started.html)). Note that future SDKs may not work.
|
||||
|
||||
The `sln` solution available only on **Visual Studio** is the preferred building solution. It easily allows to build the **RPCS3** application in `Release` and `Debug` mode.
|
||||
|
||||
In order to build **RPCS3** with the `sln` solution (with **Visual Studio**), **Qt** libs need to be detected. To detect the libs:
|
||||
- add and set the `QTDIR` environment variable, e.g. `<QtInstallFolder>\6.10.2\msvc2022_64\`
|
||||
- add and set the `QTDIR` environment variable, e.g. `<QtInstallFolder>\6.11.1\msvc2022_64\`
|
||||
- or use the [Visual Studio Qt Plugin](https://marketplace.visualstudio.com/items?itemName=TheQtCompany.QtVisualStudioTools2022)
|
||||
|
||||
**NOTE:** If you have issues with the **Visual Studio Qt Plugin**, you may want to uninstall it and install the [Legacy Qt Plugin](https://marketplace.visualstudio.com/items?itemName=TheQtCompany.LEGACYQtVisualStudioTools2022) instead.
|
||||
|
||||
In order to build **RPCS3** with the `CMake` solution (with both **Visual Studio** and standalone **CMake** tool):
|
||||
- add and set the `Qt6_ROOT` environment variable to the **Qt** libs path, e.g. `<QtInstallFolder>\6.10.2\msvc2022_64\`
|
||||
- add and set the `Qt6_ROOT` environment variable to the **Qt** libs path, e.g. `<QtInstallFolder>\6.11.1\msvc2022_64\`
|
||||
|
||||
### Linux
|
||||
|
||||
These are the essentials tools to build RPCS3 on Linux. Some of them can be installed through your favorite package manager:
|
||||
- Clang 17+ or GCC 13+
|
||||
- [CMake 3.28.0+](https://www.cmake.org/download/)
|
||||
- [Qt 6.10.2](https://www.qt.io/download-qt-installer)
|
||||
- [Vulkan SDK 1.3.268.0](https://vulkan.lunarg.com/sdk/home) (See "Install the SDK" [here](https://vulkan.lunarg.com/doc/sdk/latest/linux/getting_started.html)) for now future SDKs don't work. You need precisely 1.3.268.0.
|
||||
- [Qt 6.11.1](https://www.qt.io/download-qt-installer)
|
||||
- [Vulkan SDK 1.4.341.1](https://vulkan.lunarg.com/sdk/home) (See "Install the SDK" [here](https://vulkan.lunarg.com/doc/sdk/latest/linux/getting_started.html)). Note that future SDKs may not work.
|
||||
- [SDL3](https://github.com/libsdl-org/SDL/releases) (for the FAudio backend)
|
||||
|
||||
**If you have an NVIDIA GPU, you may need to install the libglvnd package.**
|
||||
@@ -123,7 +123,7 @@ Start **Visual Studio**, click on `Open a project or solution` and select the `r
|
||||
##### Configuring the Qt Plugin (if used)
|
||||
|
||||
1) go to `Extensions->Qt VS Tools->Qt Versions`
|
||||
2) add the path to your Qt installation with compiler e.g. `<QtInstallFolder>\6.10.2\msvc2022_64`, version will fill in automatically
|
||||
2) add the path to your Qt installation with compiler e.g. `<QtInstallFolder>\6.11.1\msvc2022_64`, version will fill in automatically
|
||||
3) go to `Extensions->Qt VS Tools->Options->Legacy Project Format`. (Only available in the **Legacy Qt Plugin**)
|
||||
4) set `Build: Run pre-build setup` to `true`. (Only available in the **Legacy Qt Plugin**)
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ option(USE_LIBEVDEV "libevdev-based joystick support" ON)
|
||||
option(USE_DISCORD_RPC "Discord rich presence integration" OFF)
|
||||
option(USE_VULKAN "Vulkan render backend" ON)
|
||||
option(USE_PRECOMPILED_HEADERS "Use precompiled headers" OFF)
|
||||
option(USE_SDL "Enables SDL input handler" OFF)
|
||||
option(USE_SDL "Enables SDL input handler" ON)
|
||||
option(USE_SYSTEM_CUBEB "Prefer system cubeb instead of the builtin one" OFF)
|
||||
option(USE_SYSTEM_CURL "Prefer system Curl instead of the prebuild one" ON)
|
||||
option(USE_SYSTEM_FAUDIO "Prefer system FAudio instead of the builtin one" OFF)
|
||||
@@ -86,50 +86,7 @@ if(CMAKE_BUILD_TYPE MATCHES "Debug" AND NOT MSVC)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
option(USE_MSVC_STATIC_CRT "Use static MSVC C runtime" OFF)
|
||||
|
||||
# TODO(cjj19970505@live.cn)
|
||||
# DiscordRPC binary in 3rdparty is compiled /MT
|
||||
# So theoretically we should enable DiscordRPC in Release and static CRT build
|
||||
# since we might encounter some rumtime issues when more than one CRT version are presented.
|
||||
# https://docs.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features?view=msvc-160#what-problems-exist-if-an-application-uses-more-than-one-crt-version
|
||||
# Add other DiscordRPC binaries(compiled with /MTd, /MD, /MDd) or compile it from source may address this issue.
|
||||
if(NOT IS_MULTI_CONFIG)
|
||||
if(NOT(CMAKE_BUILD_TYPE MATCHES "Release" AND USE_MSVC_STATIC_CRT))
|
||||
set(USE_DISCORD_RPC OFF CACHE BOOL "Discord RPC is only available in Release and static CRT build." FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(USE_MSVC_STATIC_CRT)
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
else()
|
||||
# though doc ( https://cmake.org/cmake/help/latest/variable/CMAKE_MSVC_RUNTIME_LIBRARY.html )
|
||||
# says if that property is not set then CMake uses the default value MultiThreaded$<$<CONFIG:Debug>:Debug>DLL
|
||||
# to select a MSVC runtime library.
|
||||
# But yaml-cpp set /MT(d) if CMAKE_MSVC_RUNTIME_LIBRARY is undefined
|
||||
# So we have to define it explicitly
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
|
||||
endif()
|
||||
|
||||
# TODO(cjj19970505@live.cn)
|
||||
# offical QT uses dynamic CRT.
|
||||
# When building our lib with static CRT and debug build type
|
||||
# and linking with Qt with dynamic CRT and debug build,
|
||||
# error is encountered in runtime (which is expected).
|
||||
# But building our lib with static CRT and release build type,
|
||||
# and linking with Qt with dynamic CRT and release build seems to be working,
|
||||
# which is the same config with VS solution.
|
||||
# (though technically it might still have some hidden errors).
|
||||
# So we allow static CRT in both relase and debug build, but prompt warning in debug build.
|
||||
# For more info:
|
||||
# https://docs.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features?view=msvc-160#what-problems-exist-if-an-application-uses-more-than-one-crt-version
|
||||
# https://wiki.qt.io/Technical_FAQ#Why_does_a_statically_built_Qt_use_the_dynamic_Visual_Studio_runtime_libraries_.3F_Do_I_need_to_deploy_those_with_my_application_.3F
|
||||
if(USE_MSVC_STATIC_CRT)
|
||||
if(IS_MULTI_CONFIG OR CMAKE_BUILD_TYPE MATCHES "Debug")
|
||||
message(AUTHOR_WARNING "Debug build currently can not work with static CRT.")
|
||||
endif()
|
||||
endif()
|
||||
add_compile_options(/MP)
|
||||
add_compile_options("$<$<COMPILE_LANGUAGE:C,CXX>:/MP>")
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
@@ -137,12 +94,12 @@ if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
endif()
|
||||
|
||||
if(APPLE AND CMAKE_OSX_ARCHITECTURES STREQUAL "arm64")
|
||||
include_directories(/opt/homebrew/include)
|
||||
link_directories(/opt/homebrew/lib)
|
||||
list(APPEND CMAKE_PREFIX_PATH "/opt/homebrew")
|
||||
list(APPEND CMAKE_SYSTEM_PREFIX_PATH "/opt/homebrew")
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
add_compile_options(/wd4530 /utf-8) # C++ exception handler used, but unwind semantics are not enabled
|
||||
add_compile_options("$<$<COMPILE_LANGUAGE:C,CXX>:/wd4530;/utf-8>") # C++ exception handler used, but unwind semantics are not enabled
|
||||
endif()
|
||||
|
||||
add_subdirectory(3rdparty)
|
||||
@@ -161,10 +118,6 @@ if (NOT FOUND_LTO EQUAL -1)
|
||||
message(FATAL_ERROR "RPCS3 doesn't support building with LTO, use -DDISABLE_LTO=TRUE to force-disable it")
|
||||
endif()
|
||||
|
||||
if(NOT WIN32)
|
||||
add_compile_options(-pthread)
|
||||
endif()
|
||||
|
||||
## Look for Gamemode if its installed on Linux
|
||||
if(LINUX)
|
||||
## User chooses whether to Enable GameMode features or not
|
||||
|
||||
@@ -23,6 +23,16 @@ If you want to contribute as a developer, please take a look at the following pa
|
||||
|
||||
You should also contact any of the developers in the forums or in the Discord server to learn more about the current state of the emulator.
|
||||
|
||||
### AI Use
|
||||
|
||||
Use of AI tools for research and reverse engineering purposes is permitted. However, contributors are expected to fully own and understand all code they submit. Any communication with the team — including code, code comments, and GitHub comments — must come from the human contributor, not an AI agent acting autonomously.
|
||||
|
||||
We have unfortunately seen a rise in untested and unverified AI-generated slop being submitted to this project. This wastes maintainer time and, in worse cases, such changes get merged and break functionality for all users. Repeated violations will result in a ban from the repository. Please be respectful of everyone's time.
|
||||
|
||||
**Pull requests opened by AI agents or automated tools must include a disclosure in the PR description** stating the scope of AI involvement — which parts were AI-generated and what human testing or review was performed prior to submission. PRs that omit this disclosure may be closed without review.
|
||||
|
||||
If you are unsure about your work, open a discussion issue to talk it through with the team, or reach out to a maintainer on [Discord](https://discord.gg/RPCS3).
|
||||
|
||||
## Building
|
||||
|
||||
See [BUILDING.md](BUILDING.md) for more information about how to setup an environment to build RPCS3.
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace cfg
|
||||
owner->m_nodes.emplace_back(this);
|
||||
}
|
||||
|
||||
bool _base::from_string(std::string_view, bool)
|
||||
bool _base::from_string(std::string_view /*value*/, bool /*dynamic*/)
|
||||
{
|
||||
cfg_log.fatal("cfg::_base::from_string() purecall");
|
||||
return false;
|
||||
@@ -68,7 +68,7 @@ namespace cfg
|
||||
|
||||
// Incrementally load config entries from YAML::Node.
|
||||
// The config value is preserved if the corresponding YAML node doesn't exist.
|
||||
static void decode(const YAML::Node& data, class _base& rhs, bool dynamic = false);
|
||||
[[nodiscard]] static bool decode(const YAML::Node& data, class _base& rhs, bool dynamic, bool strict);
|
||||
}
|
||||
|
||||
std::vector<std::string> cfg::make_int_range(s64 min, s64 max)
|
||||
@@ -76,11 +76,11 @@ std::vector<std::string> cfg::make_int_range(s64 min, s64 max)
|
||||
return {std::to_string(min), std::to_string(max)};
|
||||
}
|
||||
|
||||
bool try_to_int64(s64* out, std::string_view value, s64 min, s64 max)
|
||||
bool try_to_int64(s64* out, std::string_view value, s64 min, s64 max, std::string_view name)
|
||||
{
|
||||
if (value.empty())
|
||||
{
|
||||
if (out) cfg_log.error("cfg::try_to_int64(): called with an empty string");
|
||||
if (out) cfg_log.error("cfg::try_to_int64('%s'): called with an empty string", name);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ bool try_to_int64(s64* out, std::string_view value, s64 min, s64 max)
|
||||
|
||||
if (ret.ec != std::errc() || ret.ptr != end || (start[0] == '-' && sign < 0))
|
||||
{
|
||||
if (out) cfg_log.error("cfg::try_to_int64('%s'): invalid integer", value);
|
||||
if (out) cfg_log.error("cfg::try_to_int64('%s', '%s'): invalid integer", value, name);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ bool try_to_int64(s64* out, std::string_view value, s64 min, s64 max)
|
||||
|
||||
if (result < min || result > max)
|
||||
{
|
||||
if (out) cfg_log.error("cfg::try_to_int64('%s'): out of bounds (val=%d, min=%d, max=%d)", value, result, min, max);
|
||||
if (out) cfg_log.error("cfg::try_to_int64('%s', '%s'): out of bounds (val=%d, min=%d, max=%d)", value, name, result, min, max);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -128,11 +128,11 @@ std::vector<std::string> cfg::make_uint_range(u64 min, u64 max)
|
||||
return {std::to_string(min), std::to_string(max)};
|
||||
}
|
||||
|
||||
bool try_to_uint64(u64* out, std::string_view value, u64 min, u64 max)
|
||||
bool try_to_uint64(u64* out, std::string_view value, u64 min, u64 max, std::string_view name)
|
||||
{
|
||||
if (value.empty())
|
||||
{
|
||||
if (out) cfg_log.error("cfg::try_to_uint64(): called with an empty string");
|
||||
if (out) cfg_log.error("cfg::try_to_uint64('%s'): called with an empty string", name);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -152,13 +152,13 @@ bool try_to_uint64(u64* out, std::string_view value, u64 min, u64 max)
|
||||
|
||||
if (ret.ec != std::errc() || ret.ptr != end)
|
||||
{
|
||||
if (out) cfg_log.error("cfg::try_to_uint64('%s'): invalid integer", value);
|
||||
if (out) cfg_log.error("cfg::try_to_uint64('%s', '%s'): invalid integer", value, name);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (result < min || result > max)
|
||||
{
|
||||
if (out) cfg_log.error("cfg::try_to_uint64('%s'): out of bounds (val=%u, min=%u, max=%u)", value, result, min, max);
|
||||
if (out) cfg_log.error("cfg::try_to_uint64('%s', '%s'): out of bounds (val=%u, min=%u, max=%u)", value, name, result, min, max);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -166,11 +166,11 @@ bool try_to_uint64(u64* out, std::string_view value, u64 min, u64 max)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool try_to_uint128(u128* out, std::string_view value)
|
||||
bool try_to_uint128(u128* out, std::string_view value, std::string_view name)
|
||||
{
|
||||
if (value.empty())
|
||||
{
|
||||
if (out) cfg_log.error("cfg::try_to_uint128(): called with an empty string");
|
||||
if (out) cfg_log.error("cfg::try_to_uint128('%s'): called with an empty string", name);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ bool try_to_uint128(u128* out, std::string_view value)
|
||||
|
||||
if (ret.ec != std::errc() || ret.ptr != end)
|
||||
{
|
||||
if (out) cfg_log.error("cfg::try_to_uint128('%s'): invalid integer", value);
|
||||
if (out) cfg_log.error("cfg::try_to_uint128('%s', '%s'): invalid integer", value, name);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -207,7 +207,7 @@ bool try_to_uint128(u128* out, std::string_view value)
|
||||
|
||||
if (ret.ec != std::errc() || ret.ptr != start_low64)
|
||||
{
|
||||
if (out) cfg_log.error("cfg::try_to_uint128('%s'): invalid integer", value);
|
||||
if (out) cfg_log.error("cfg::try_to_uint128('%s', '%s'): invalid integer", value, name);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -220,11 +220,11 @@ std::vector<std::string> cfg::make_float_range(f64 min, f64 max)
|
||||
return {std::to_string(min), std::to_string(max)};
|
||||
}
|
||||
|
||||
bool try_to_float(f64* out, std::string_view value, f64 min, f64 max)
|
||||
bool try_to_float(f64* out, std::string_view value, f64 min, f64 max, std::string_view name)
|
||||
{
|
||||
if (value.empty())
|
||||
{
|
||||
if (out) cfg_log.error("cfg::try_to_float(): called with an empty string");
|
||||
if (out) cfg_log.error("cfg::try_to_float('%s'): called with an empty string", name);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -237,13 +237,13 @@ bool try_to_float(f64* out, std::string_view value, f64 min, f64 max)
|
||||
|
||||
if (end_check != str.data() + str.size())
|
||||
{
|
||||
if (out) cfg_log.error("cfg::try_to_float('%s'): invalid float", value);
|
||||
if (out) cfg_log.error("cfg::try_to_float('%s', '%s'): invalid float", value, name);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (result < min || result > max)
|
||||
{
|
||||
if (out) cfg_log.error("cfg::try_to_float('%s'): out of bounds (val=%f, min=%f, max=%f)", value, result, min, max);
|
||||
if (out) cfg_log.error("cfg::try_to_float('%s', '%s'): out of bounds (val=%f, min=%f, max=%f)", value, name, result, min, max);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -251,12 +251,8 @@ bool try_to_float(f64* out, std::string_view value, f64 min, f64 max)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool try_to_string(std::string* out, const f64& value)
|
||||
bool try_to_string(std::string* out, f64 value, std::string_view name)
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
if (out) *out = std::to_string(value);
|
||||
return true;
|
||||
#else
|
||||
std::array<char, 32> str{};
|
||||
|
||||
if (auto [ptr, ec] = std::to_chars(str.data(), str.data() + str.size(), value, std::chars_format::fixed); ec == std::errc())
|
||||
@@ -266,14 +262,15 @@ bool try_to_string(std::string* out, const f64& value)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (out) cfg_log.error("cfg::try_to_string(): could not convert value '%f' to string. error='%s'", value, std::make_error_code(ec).message());
|
||||
if (out) cfg_log.error("cfg::try_to_string('%s'): could not convert value '%f' to string. error='%s'", name, value, std::make_error_code(ec).message());
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool cfg::try_to_enum_value(u64* out, decltype(&fmt_class_string<int>::format) func, std::string_view value)
|
||||
bool cfg::try_to_enum_value(u64* out, decltype(&fmt_class_string<int>::format) func, std::string_view value, std::string_view name)
|
||||
{
|
||||
ensure(func);
|
||||
|
||||
u64 max = umax;
|
||||
|
||||
for (u64 i = 0;; i++)
|
||||
@@ -302,7 +299,7 @@ bool cfg::try_to_enum_value(u64* out, decltype(&fmt_class_string<int>::format) f
|
||||
const char* end = start + value.size();
|
||||
int base = 10;
|
||||
|
||||
if (start[0] == '0' && (start[1] == 'x' || start[1] == 'X'))
|
||||
if (value.size() >= 2 && start[0] == '0' && (start[1] == 'x' || start[1] == 'X'))
|
||||
{
|
||||
// Limited hex support
|
||||
base = 16;
|
||||
@@ -313,13 +310,13 @@ bool cfg::try_to_enum_value(u64* out, decltype(&fmt_class_string<int>::format) f
|
||||
|
||||
if (ret.ec != std::errc() || ret.ptr != end)
|
||||
{
|
||||
if (out) cfg_log.error("cfg::try_to_enum_value('%s'): invalid enum or integer", value);
|
||||
if (out) cfg_log.error("cfg::try_to_enum_value('%s', '%s'): invalid enum or integer", value, name);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (result > max)
|
||||
{
|
||||
if (out) cfg_log.error("cfg::try_to_enum_value('%s'): out of bounds(val=%u, min=0, max=%u)", value, result, max);
|
||||
if (out) cfg_log.error("cfg::try_to_enum_value('%s', '%s'): out of bounds(val=%u, min=0, max=%u)", value, name, result, max);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -362,6 +359,27 @@ std::vector<std::string> cfg::try_to_enum_list(decltype(&fmt_class_string<int>::
|
||||
return result;
|
||||
}
|
||||
|
||||
size_t cfg::try_to_enum_size(decltype(&fmt_class_string<int>::format) func)
|
||||
{
|
||||
size_t result = 0;
|
||||
for (u64 i = 0;; i++)
|
||||
{
|
||||
std::string var;
|
||||
func(var, i);
|
||||
|
||||
std::string hex;
|
||||
fmt_class_string<u64>::format(hex, i);
|
||||
if (var == hex)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
result++;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void cfg::encode(YAML::Emitter& out, const cfg::_base& rhs)
|
||||
{
|
||||
switch (rhs.get_type())
|
||||
@@ -416,7 +434,7 @@ void cfg::encode(YAML::Emitter& out, const cfg::_base& rhs)
|
||||
out << YAML::BeginMap;
|
||||
for (const auto& np : static_cast<const log_entry&>(rhs).get_map())
|
||||
{
|
||||
if (np.second == logs::level::notice) continue;
|
||||
if (np.second == logs::level::_default) continue;
|
||||
out << YAML::Key << np.first;
|
||||
out << YAML::Value << fmt::format("%s", np.second);
|
||||
}
|
||||
@@ -447,37 +465,50 @@ void cfg::encode(YAML::Emitter& out, const cfg::_base& rhs)
|
||||
}
|
||||
}
|
||||
|
||||
void cfg::decode(const YAML::Node& data, cfg::_base& rhs, bool dynamic)
|
||||
bool cfg::decode(const YAML::Node& data, cfg::_base& rhs, bool dynamic, bool strict)
|
||||
{
|
||||
if (dynamic && !rhs.get_is_dynamic())
|
||||
{
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (rhs.get_type())
|
||||
{
|
||||
case type::node:
|
||||
{
|
||||
if (data.IsScalar() || data.IsSequence())
|
||||
if (!data.IsMap())
|
||||
{
|
||||
return; // ???
|
||||
cfg_log.error("node node is not a map");
|
||||
return false;
|
||||
}
|
||||
|
||||
bool success = true;
|
||||
|
||||
for (const auto& pair : data)
|
||||
{
|
||||
if (!pair.first.IsScalar()) continue;
|
||||
|
||||
// Find the key among existing nodes
|
||||
for (const auto& node : static_cast<node&>(rhs).get_nodes())
|
||||
const auto& nodes = static_cast<node&>(rhs).get_nodes();
|
||||
const auto it = std::find_if(nodes.cbegin(), nodes.cend(), [&pair](const auto& node) { return ensure(node)->get_name() == pair.first.Scalar(); });
|
||||
|
||||
if (it == nodes.cend())
|
||||
{
|
||||
if (node->get_name() == pair.first.Scalar())
|
||||
if (strict)
|
||||
{
|
||||
decode(pair.second, *node, dynamic);
|
||||
cfg_log.error("Unknown key found: '%s'", pair.first.Scalar());
|
||||
success = false;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!decode(pair.second, *ensure(*it), dynamic, strict) && strict)
|
||||
{
|
||||
success = false;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
return success;
|
||||
}
|
||||
case type::set:
|
||||
{
|
||||
@@ -485,7 +516,10 @@ void cfg::decode(const YAML::Node& data, cfg::_base& rhs, bool dynamic)
|
||||
|
||||
if (YAML::convert<decltype(values)>::decode(data, values))
|
||||
{
|
||||
rhs.from_list(std::move(values));
|
||||
if (!rhs.from_list(std::move(values)) && strict)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -495,7 +529,8 @@ void cfg::decode(const YAML::Node& data, cfg::_base& rhs, bool dynamic)
|
||||
{
|
||||
if (!data.IsMap())
|
||||
{
|
||||
return;
|
||||
cfg_log.error("map node is not a map");
|
||||
return false;
|
||||
}
|
||||
|
||||
map_of_type<std::string> values;
|
||||
@@ -512,22 +547,36 @@ void cfg::decode(const YAML::Node& data, cfg::_base& rhs, bool dynamic)
|
||||
}
|
||||
case type::log:
|
||||
{
|
||||
if (data.IsScalar() || data.IsSequence())
|
||||
if (!data.IsMap())
|
||||
{
|
||||
return; // ???
|
||||
cfg_log.error("log node is not a map");
|
||||
return false;
|
||||
}
|
||||
|
||||
map_of_type<logs::level> values;
|
||||
|
||||
for (const auto& pair : data)
|
||||
{
|
||||
if (!pair.first.IsScalar() || !pair.second.IsScalar()) continue;
|
||||
if (!pair.first.IsScalar() || !pair.second.IsScalar())
|
||||
{
|
||||
if (strict)
|
||||
{
|
||||
if (!pair.first.IsScalar())
|
||||
cfg_log.error("Key in map is not a scalar");
|
||||
else
|
||||
cfg_log.error("Value in map is not a scalar. key='%s'", pair.first.Scalar());
|
||||
return false;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
u64 value;
|
||||
if (cfg::try_to_enum_value(&value, &fmt_class_string<logs::level>::format, pair.second.Scalar()))
|
||||
if (!cfg::try_to_enum_value(&value, &fmt_class_string<logs::level>::format, pair.second.Scalar(), pair.first.Scalar()) && strict)
|
||||
{
|
||||
values.emplace(pair.first.Scalar(), static_cast<logs::level>(static_cast<int>(value)));
|
||||
return false;
|
||||
}
|
||||
|
||||
values.emplace(pair.first.Scalar(), static_cast<logs::level>(static_cast<int>(value)));
|
||||
}
|
||||
|
||||
static_cast<log_entry&>(rhs).set_map(std::move(values));
|
||||
@@ -537,20 +586,43 @@ void cfg::decode(const YAML::Node& data, cfg::_base& rhs, bool dynamic)
|
||||
{
|
||||
if (!data.IsMap())
|
||||
{
|
||||
return; // ???
|
||||
cfg_log.error("device node is not a map");
|
||||
return false;
|
||||
}
|
||||
|
||||
map_of_type<device_info> values;
|
||||
|
||||
for (const auto& pair : data)
|
||||
{
|
||||
if (!pair.first.IsScalar() || !pair.second.IsMap()) continue;
|
||||
if (!pair.first.IsScalar() || !pair.second.IsMap())
|
||||
{
|
||||
if (strict)
|
||||
{
|
||||
if (!pair.first.IsScalar())
|
||||
cfg_log.error("Key in device map is not a scalar");
|
||||
else
|
||||
cfg_log.error("Value in device map is not a map. key='%s'", pair.first.Scalar());
|
||||
return false;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
device_info info{};
|
||||
|
||||
for (const auto& key_value : pair.second)
|
||||
{
|
||||
if (!key_value.first.IsScalar() || !key_value.second.IsScalar()) continue;
|
||||
if (!key_value.first.IsScalar() || !key_value.second.IsScalar())
|
||||
{
|
||||
if (strict)
|
||||
{
|
||||
if (!key_value.first.IsScalar())
|
||||
cfg_log.error("Key in device info map is not a scalar");
|
||||
else
|
||||
cfg_log.error("Value in device map is not a scalar. key='%s'", key_value.first.Scalar());
|
||||
return false;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (key_value.first.Scalar() == "Path")
|
||||
info.path = key_value.second.Scalar();
|
||||
@@ -577,12 +649,17 @@ void cfg::decode(const YAML::Node& data, cfg::_base& rhs, bool dynamic)
|
||||
|
||||
if (YAML::convert<std::string>::decode(data, value))
|
||||
{
|
||||
rhs.from_string(value, dynamic);
|
||||
if (!rhs.from_string(value, dynamic) && strict)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
break; // ???
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string cfg::node::to_string() const
|
||||
@@ -599,8 +676,7 @@ bool cfg::node::from_string(std::string_view value, bool dynamic)
|
||||
|
||||
if (error.empty())
|
||||
{
|
||||
cfg::decode(result, *this, dynamic);
|
||||
return true;
|
||||
return cfg::decode(result, *this, dynamic, false);
|
||||
}
|
||||
|
||||
cfg_log.error("Failed to load node: %s", error);
|
||||
@@ -623,6 +699,19 @@ void cfg::node::restore_defaults()
|
||||
}
|
||||
}
|
||||
|
||||
bool cfg::node::validate(std::string_view value)
|
||||
{
|
||||
auto [result, error] = yaml_load(std::string(value));
|
||||
|
||||
if (error.empty())
|
||||
{
|
||||
return cfg::decode(result, *this, false, true);
|
||||
}
|
||||
|
||||
cfg_log.error("Failed to load node: %s", error);
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string cfg::map_entry::get_value(std::string_view key)
|
||||
{
|
||||
if (auto it = m_map.find(key); it != m_map.end())
|
||||
|
||||
@@ -25,11 +25,14 @@ namespace cfg
|
||||
std::vector<std::string> make_float_range(f64 min, f64 max);
|
||||
|
||||
// Internal hack
|
||||
bool try_to_enum_value(u64* out, decltype(&fmt_class_string<int>::format) func, std::string_view);
|
||||
bool try_to_enum_value(u64* out, decltype(&fmt_class_string<int>::format) func, std::string_view value, std::string_view name = {});
|
||||
|
||||
// Internal hack
|
||||
std::vector<std::string> try_to_enum_list(decltype(&fmt_class_string<int>::format) func);
|
||||
|
||||
// Internal hack
|
||||
size_t try_to_enum_size(decltype(&fmt_class_string<int>::format) func);
|
||||
|
||||
// Config tree entry type.
|
||||
enum class type : unsigned
|
||||
{
|
||||
@@ -107,7 +110,7 @@ namespace cfg
|
||||
}
|
||||
|
||||
// Try to convert from string (optional)
|
||||
virtual bool from_string(std::string_view, bool /*dynamic*/ = false);
|
||||
virtual bool from_string(std::string_view value, bool dynamic = false);
|
||||
|
||||
// Get string list (optional)
|
||||
virtual std::vector<std::string> to_list() const
|
||||
@@ -158,6 +161,9 @@ namespace cfg
|
||||
|
||||
// Restore default members
|
||||
void restore_defaults() override;
|
||||
|
||||
// Try to convert from string and validate
|
||||
bool validate(std::string_view value);
|
||||
};
|
||||
|
||||
class _bool final : public _base
|
||||
@@ -298,7 +304,7 @@ namespace cfg
|
||||
{
|
||||
u64 result;
|
||||
|
||||
if (try_to_enum_value(&result, &fmt_class_string<T>::format, value))
|
||||
if (try_to_enum_value(&result, &fmt_class_string<T>::format, value, m_name))
|
||||
{
|
||||
// No narrowing check, it's hard to do right there
|
||||
m_value = static_cast<T>(static_cast<std::underlying_type_t<T>>(result));
|
||||
@@ -312,6 +318,11 @@ namespace cfg
|
||||
{
|
||||
return try_to_enum_list(&fmt_class_string<T>::format);
|
||||
}
|
||||
|
||||
size_t size() const
|
||||
{
|
||||
return try_to_enum_size(&fmt_class_string<T>::format);
|
||||
}
|
||||
};
|
||||
|
||||
// Signed 32/64-bit integer entry with custom Min/Max range.
|
||||
@@ -374,7 +385,7 @@ namespace cfg
|
||||
bool from_string(std::string_view value, bool /*dynamic*/ = false) override
|
||||
{
|
||||
s64 result;
|
||||
if (try_to_int64(&result, value, Min, Max))
|
||||
if (try_to_int64(&result, value, Min, Max, m_name))
|
||||
{
|
||||
m_value = static_cast<int_type>(result);
|
||||
return true;
|
||||
@@ -385,7 +396,7 @@ namespace cfg
|
||||
|
||||
void set(const s64& value)
|
||||
{
|
||||
ensure(value >= Min && value <= Max);
|
||||
if (value < Min || value > Max) fmt::throw_exception("'%s': value %d out of bounds (min=%d, max=%d)", m_name, value, Min, Max);
|
||||
m_value = static_cast<int_type>(value);
|
||||
}
|
||||
|
||||
@@ -443,7 +454,7 @@ namespace cfg
|
||||
std::string to_string() const override
|
||||
{
|
||||
std::string result;
|
||||
if (try_to_string(&result, m_value))
|
||||
if (try_to_string(&result, m_value, m_name))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
@@ -454,7 +465,7 @@ namespace cfg
|
||||
std::string def_to_string() const override
|
||||
{
|
||||
std::string result;
|
||||
if (try_to_string(&result, def))
|
||||
if (try_to_string(&result, def, m_name))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
@@ -465,7 +476,7 @@ namespace cfg
|
||||
bool from_string(std::string_view value, bool /*dynamic*/ = false) override
|
||||
{
|
||||
f64 result;
|
||||
if (try_to_float(&result, value, Min, Max))
|
||||
if (try_to_float(&result, value, Min, Max, m_name))
|
||||
{
|
||||
m_value = static_cast<float_type>(result);
|
||||
return true;
|
||||
@@ -476,7 +487,7 @@ namespace cfg
|
||||
|
||||
void set(const f64& value)
|
||||
{
|
||||
ensure(value >= Min && value <= Max);
|
||||
if (value < Min || value > Max) fmt::throw_exception("'%s': value %d out of bounds (min=%d, max=%d)", m_name, value, Min, Max);
|
||||
m_value = static_cast<float_type>(value);
|
||||
}
|
||||
|
||||
@@ -552,7 +563,7 @@ namespace cfg
|
||||
bool from_string(std::string_view value, bool /*dynamic*/ = false) override
|
||||
{
|
||||
u64 result;
|
||||
if (try_to_uint64(&result, value, Min, Max))
|
||||
if (try_to_uint64(&result, value, Min, Max, m_name))
|
||||
{
|
||||
m_value = static_cast<int_type>(result);
|
||||
return true;
|
||||
@@ -563,7 +574,7 @@ namespace cfg
|
||||
|
||||
void set(const u64& value)
|
||||
{
|
||||
ensure(value >= Min && value <= Max);
|
||||
if (value < Min || value > Max) fmt::throw_exception("'%s': value %d out of bounds (min=%d, max=%d)", m_name, value, Min, Max);
|
||||
m_value = static_cast<int_type>(value);
|
||||
}
|
||||
|
||||
@@ -638,7 +649,7 @@ namespace cfg
|
||||
bool from_string(std::string_view value, bool /*dynamic*/ = false) override
|
||||
{
|
||||
u128 result;
|
||||
if (try_to_uint128(&result, value))
|
||||
if (try_to_uint128(&result, value, m_name))
|
||||
{
|
||||
m_value = result;
|
||||
return true;
|
||||
@@ -706,6 +717,11 @@ namespace cfg
|
||||
m_value = std::string(value);
|
||||
return true;
|
||||
}
|
||||
|
||||
void set(std::string_view value)
|
||||
{
|
||||
m_value = std::string(value);
|
||||
}
|
||||
};
|
||||
|
||||
// Simple set entry (TODO: template for various types)
|
||||
|
||||
@@ -38,6 +38,17 @@ static std::unique_ptr<wchar_t[]> to_wchar(std::string_view source)
|
||||
// Buffer for max possible output length
|
||||
std::unique_ptr<wchar_t[]> buffer(new wchar_t[buf_size + 8 + 32768]);
|
||||
|
||||
// If path points to an optical raw device, copy it AS IS
|
||||
if (fs::is_optical_raw_device(std::string(source)))
|
||||
{
|
||||
ensure(MultiByteToWideChar(CP_UTF8, 0, source.data(), size, buffer.get() + 32768, size)); // "to_wchar"
|
||||
|
||||
// Canonicalize wide path (replace '/', ".", "..", \\ repetitions, etc)
|
||||
ensure(GetFullPathNameW(buffer.get() + 32768, 32768, buffer.get(), nullptr) - 1 < 32768 - 1); // "to_wchar"
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
// Prepend wide path prefix (4 characters)
|
||||
std::memcpy(buffer.get() + 32768, L"\\\\\?\\", 4 * sizeof(wchar_t));
|
||||
|
||||
@@ -166,6 +177,7 @@ static fs::error to_error(int e)
|
||||
case ENOTEMPTY: return fs::error::notempty;
|
||||
case EROFS: return fs::error::readonly;
|
||||
case EISDIR: return fs::error::isdir;
|
||||
case ENOTDIR: return fs::error::notdir;
|
||||
case ENOSPC: return fs::error::nospace;
|
||||
case EXDEV: return fs::error::xdev;
|
||||
default: return fs::error::unknown;
|
||||
@@ -399,11 +411,12 @@ namespace fs
|
||||
class windows_file final : public file_base
|
||||
{
|
||||
HANDLE m_handle;
|
||||
bool m_raw_device;
|
||||
atomic_t<u64> m_pos {0};
|
||||
|
||||
public:
|
||||
windows_file(HANDLE handle)
|
||||
: m_handle(handle)
|
||||
windows_file(HANDLE handle, bool raw_device = false)
|
||||
: m_handle(handle), m_raw_device(raw_device)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -563,11 +576,20 @@ namespace fs
|
||||
|
||||
u64 size() override
|
||||
{
|
||||
// NOTE: this can fail if we access a mounted empty drive (e.g. after unmounting an iso).
|
||||
LARGE_INTEGER size;
|
||||
ensure(GetFileSizeEx(m_handle, &size)); // "file::size"
|
||||
if (!m_raw_device)
|
||||
{
|
||||
// NOTE: this can fail if we access a mounted empty drive (e.g. after unmounting an iso).
|
||||
LARGE_INTEGER size;
|
||||
|
||||
return size.QuadPart;
|
||||
ensure(GetFileSizeEx(m_handle, &size)); // "file::size"
|
||||
return size.QuadPart;
|
||||
}
|
||||
|
||||
// For a raw device, we need to use DeviceIoControl.
|
||||
DISK_GEOMETRY_EX geometry;
|
||||
|
||||
ensure(DeviceIoControl(m_handle, IOCTL_DISK_GET_DRIVE_GEOMETRY_EX, nullptr, 0, &geometry, sizeof(geometry), nullptr, nullptr));
|
||||
return geometry.DiskSize.QuadPart;
|
||||
}
|
||||
|
||||
native_handle get_handle() override
|
||||
@@ -1090,6 +1112,55 @@ bool fs::is_symlink(const std::string& path)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool fs::is_optical_raw_device([[maybe_unused]] const std::string& path)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
if (path.starts_with("\\\\.\\"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
bool fs::get_optical_raw_device(const std::string& path, std::string* raw_device)
|
||||
{
|
||||
if (fs::is_optical_raw_device(path))
|
||||
{
|
||||
if (raw_device)
|
||||
{
|
||||
*raw_device = path;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
// Skip a useless check to detect an optical raw device if navigating on subfolders (e.g. C:\subfolder_1\subfolder_2\),
|
||||
// it means we are on a HDD/SSD. A path for an optical drive should include only the drive letter (e.g. E:\)
|
||||
const size_t drive_delim_pos = path.find_first_of(":");
|
||||
|
||||
if (drive_delim_pos != 1 || drive_delim_pos != path.find_last_not_of(delim))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const std::string drive_letter = path.substr(0, drive_delim_pos + 1); // e.g. "E:"
|
||||
const std::string drive_path = drive_letter + "\\"; // e.g. "E:\"
|
||||
|
||||
if (GetDriveTypeA(drive_path.c_str()) == DRIVE_CDROM)
|
||||
{
|
||||
if (raw_device)
|
||||
{
|
||||
*raw_device = "\\\\.\\" + drive_letter;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
bool fs::statfs(const std::string& path, fs::device_stat& info)
|
||||
{
|
||||
if (auto device = get_virtual_device(path))
|
||||
@@ -1657,9 +1728,29 @@ fs::file::file(const std::string& path, bs_t<open_mode> mode)
|
||||
return;
|
||||
}
|
||||
|
||||
// If path points to an optical raw device, complete the file opening
|
||||
// (the following GetFileInformationByHandle() would always fail on a raw device).
|
||||
if (is_optical_raw_device(path))
|
||||
{
|
||||
DISK_GEOMETRY_EX geometry;
|
||||
|
||||
// Try to retrieve information on content. If it fails, no disc is probably mounted so abort the file opening
|
||||
if (!DeviceIoControl(handle, IOCTL_DISK_GET_DRIVE_GEOMETRY_EX, nullptr, 0, &geometry, sizeof(geometry), nullptr, nullptr))
|
||||
{
|
||||
const DWORD last_error = GetLastError();
|
||||
CloseHandle(handle);
|
||||
g_tls_error = to_error(last_error);
|
||||
return;
|
||||
}
|
||||
|
||||
m_file = std::make_unique<windows_file>(handle, true);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if the handle is actually valid.
|
||||
// This can fail on empty mounted drives (e.g. with ERROR_NOT_READY or ERROR_INVALID_FUNCTION).
|
||||
BY_HANDLE_FILE_INFORMATION info{};
|
||||
|
||||
if (!GetFileInformationByHandle(handle, &info))
|
||||
{
|
||||
const DWORD last_error = GetLastError();
|
||||
@@ -1670,7 +1761,7 @@ fs::file::file(const std::string& path, bs_t<open_mode> mode)
|
||||
g_tls_error = fs::error::isdir;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
g_tls_error = to_error(last_error);
|
||||
return;
|
||||
}
|
||||
@@ -2833,6 +2924,7 @@ void fmt_class_string<fs::error>::format(std::string& out, u64 arg)
|
||||
case fs::error::notempty: return "Not empty";
|
||||
case fs::error::readonly: return "Read only";
|
||||
case fs::error::isdir: return "Is a directory";
|
||||
case fs::error::notdir: return "Not a directory";
|
||||
case fs::error::toolong: return "Path too long";
|
||||
case fs::error::nospace: return "Not enough space on the device";
|
||||
case fs::error::xdev: return "Device mismatch";
|
||||
|
||||
@@ -213,6 +213,12 @@ namespace fs
|
||||
// Check whether the path points to an existing symlink
|
||||
bool is_symlink(const std::string& path);
|
||||
|
||||
// Check whether the path points to a raw device
|
||||
bool is_optical_raw_device(const std::string& path);
|
||||
|
||||
// Check whether the path points to an optical drive. If so, provide the raw device in "raw_device" if requested
|
||||
bool get_optical_raw_device(const std::string& path, std::string* raw_device = nullptr);
|
||||
|
||||
// Get filesystem information
|
||||
bool statfs(const std::string& path, device_stat& info);
|
||||
|
||||
@@ -683,6 +689,7 @@ namespace fs
|
||||
notempty,
|
||||
readonly,
|
||||
isdir,
|
||||
notdir,
|
||||
toolong,
|
||||
nospace,
|
||||
xdev,
|
||||
|
||||
@@ -493,6 +493,10 @@ inline FT build_function_asm(std::string_view name, F&& builder, ::jit_runtime*
|
||||
return reinterpret_cast<FT>(uptr(result));
|
||||
}
|
||||
|
||||
#if defined(__INTELLISENSE__) && !defined(LLVM_AVAILABLE)
|
||||
#define LLVM_AVAILABLE
|
||||
#endif
|
||||
|
||||
#ifdef LLVM_AVAILABLE
|
||||
|
||||
namespace llvm
|
||||
@@ -539,9 +543,15 @@ public:
|
||||
// Add module (path to obj cache dir)
|
||||
void add(std::unique_ptr<llvm::Module> _module, const std::string& path);
|
||||
|
||||
// Returns false after LLVM fatal recovery. The compiler must be discarded.
|
||||
bool try_add(std::unique_ptr<llvm::Module> _module, const std::string& path, std::string& error);
|
||||
|
||||
// Add module (not cached)
|
||||
void add(std::unique_ptr<llvm::Module> _module);
|
||||
|
||||
// Returns false after LLVM fatal recovery. The compiler must be discarded.
|
||||
bool try_add(std::unique_ptr<llvm::Module> _module, std::string& error);
|
||||
|
||||
// Add object (path to obj file)
|
||||
bool add(const std::string& path);
|
||||
|
||||
@@ -554,6 +564,9 @@ public:
|
||||
// Finalize
|
||||
void fin();
|
||||
|
||||
// Returns false after LLVM fatal recovery. The compiler must be discarded.
|
||||
bool try_fin(std::string& error);
|
||||
|
||||
// Get compiled function address
|
||||
u64 get(const std::string& name);
|
||||
|
||||
|
||||
@@ -12,6 +12,10 @@
|
||||
|
||||
#include <charconv>
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
|
||||
LOG_CHANNEL(jit_log, "JIT");
|
||||
|
||||
#ifdef LLVM_AVAILABLE
|
||||
@@ -50,6 +54,44 @@ LOG_CHANNEL(jit_log, "JIT");
|
||||
#include "Emu/CPU/Backends/AArch64/AArch64Common.h"
|
||||
#endif
|
||||
|
||||
namespace
|
||||
{
|
||||
thread_local std::string* g_llvm_fatal_message = nullptr;
|
||||
|
||||
template <typename F>
|
||||
bool run_recoverable_llvm(F&& func, std::string& error)
|
||||
{
|
||||
error.clear();
|
||||
|
||||
// Run LLVM codegen in a disposable thread. If LLVM invokes the fatal
|
||||
// handler, only this helper thread exits.
|
||||
named_thread worker("LLVM JIT", [&]()
|
||||
{
|
||||
#if defined(__APPLE__)
|
||||
pthread_jit_write_protect_np(false);
|
||||
#endif
|
||||
g_llvm_fatal_message = &error;
|
||||
|
||||
std::forward<F>(func)();
|
||||
|
||||
g_llvm_fatal_message = nullptr;
|
||||
#if defined(__APPLE__)
|
||||
pthread_jit_write_protect_np(true);
|
||||
#endif
|
||||
});
|
||||
|
||||
worker();
|
||||
const bool result = static_cast<thread_state>(worker) == thread_state::finished;
|
||||
|
||||
if (!result && error.empty())
|
||||
{
|
||||
error = "LLVM crash recovery invoked";
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
const bool jit_initialize = []() -> bool
|
||||
{
|
||||
llvm::InitializeNativeTarget();
|
||||
@@ -649,6 +691,13 @@ jit_compiler::jit_compiler(const std::unordered_map<std::string, u64>& _link, co
|
||||
llvm::install_fatal_error_handler([](void*, const char* msg, bool)
|
||||
{
|
||||
const std::string_view out = msg ? msg : "";
|
||||
|
||||
if (g_llvm_fatal_message)
|
||||
{
|
||||
*g_llvm_fatal_message = out;
|
||||
thread_ctrl::silent_exit();
|
||||
}
|
||||
|
||||
fmt::throw_exception("LLVM Emergency Exit Invoked: '%s'", out);
|
||||
}, nullptr);
|
||||
|
||||
@@ -788,6 +837,33 @@ void jit_compiler::add(std::unique_ptr<llvm::Module> _module, const std::string&
|
||||
}
|
||||
}
|
||||
|
||||
bool jit_compiler::try_add(std::unique_ptr<llvm::Module> _module, const std::string& path, std::string& error)
|
||||
{
|
||||
ObjectCache cache{path, this};
|
||||
m_engine->setObjectCache(&cache);
|
||||
|
||||
const auto ptr = _module.get();
|
||||
m_engine->addModule(std::move(_module));
|
||||
|
||||
if (!run_recoverable_llvm([&]()
|
||||
{
|
||||
m_engine->generateCodeForModule(ptr);
|
||||
}, error))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
m_engine->setObjectCache(nullptr);
|
||||
|
||||
for (auto& func : ptr->functions())
|
||||
{
|
||||
// Delete IR to lower memory consumption
|
||||
func.deleteBody();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void jit_compiler::add(std::unique_ptr<llvm::Module> _module)
|
||||
{
|
||||
const auto ptr = _module.get();
|
||||
@@ -801,6 +877,28 @@ void jit_compiler::add(std::unique_ptr<llvm::Module> _module)
|
||||
}
|
||||
}
|
||||
|
||||
bool jit_compiler::try_add(std::unique_ptr<llvm::Module> _module, std::string& error)
|
||||
{
|
||||
const auto ptr = _module.get();
|
||||
m_engine->addModule(std::move(_module));
|
||||
|
||||
if (!run_recoverable_llvm([&]()
|
||||
{
|
||||
m_engine->generateCodeForModule(ptr);
|
||||
}, error))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for (auto& func : ptr->functions())
|
||||
{
|
||||
// Delete IR to lower memory consumption
|
||||
func.deleteBody();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool jit_compiler::add(const std::string& path)
|
||||
{
|
||||
auto cache = ObjectCache::load(path);
|
||||
@@ -852,6 +950,14 @@ void jit_compiler::fin()
|
||||
m_engine->finalizeObject();
|
||||
}
|
||||
|
||||
bool jit_compiler::try_fin(std::string& error)
|
||||
{
|
||||
return run_recoverable_llvm([&]()
|
||||
{
|
||||
m_engine->finalizeObject();
|
||||
}, error);
|
||||
}
|
||||
|
||||
u64 jit_compiler::get(const std::string& name)
|
||||
{
|
||||
return m_engine->getGlobalValueAddress(name);
|
||||
|
||||
@@ -16,12 +16,12 @@
|
||||
#include <errno.h>
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4996)
|
||||
#elif defined(__clang__)
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#elif defined(_MSC_VER)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4996)
|
||||
#else
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
|
||||
@@ -23,19 +23,19 @@ inline void strcpy_trunc(D&& dst, const T& src)
|
||||
}
|
||||
|
||||
// Convert string to signed integer
|
||||
bool try_to_int64(s64* out, std::string_view value, s64 min, s64 max);
|
||||
bool try_to_int64(s64* out, std::string_view value, s64 min, s64 max, std::string_view name = {});
|
||||
|
||||
// Convert string to unsigned integer
|
||||
bool try_to_uint64(u64* out, std::string_view value, u64 min, u64 max);
|
||||
bool try_to_uint64(u64* out, std::string_view value, u64 min, u64 max, std::string_view name = {});
|
||||
|
||||
// Convert string to unsigned int128_t
|
||||
bool try_to_uint128(u128* out, std::string_view value);
|
||||
bool try_to_uint128(u128* out, std::string_view value, std::string_view name = {});
|
||||
|
||||
// Convert string to float
|
||||
bool try_to_float(f64* out, std::string_view value, f64 min, f64 max);
|
||||
bool try_to_float(f64* out, std::string_view value, f64 min, f64 max, std::string_view name = {});
|
||||
|
||||
// Convert float to string locale independent
|
||||
bool try_to_string(std::string* out, const f64& value);
|
||||
bool try_to_string(std::string* out, f64 value, std::string_view name = {});
|
||||
|
||||
// Get the file extension of a file path ("png", "jpg", etc.)
|
||||
std::string get_file_extension(const std::string& file_path);
|
||||
|
||||
@@ -14,12 +14,18 @@
|
||||
#include "Emu/CPU/Backends/AArch64/AArch64Signal.h"
|
||||
#endif
|
||||
|
||||
#ifdef __cpp_lib_stacktrace
|
||||
#include "rpcs3_version.h"
|
||||
#include <stacktrace>
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
#include <Psapi.h>
|
||||
#include <process.h>
|
||||
#include <sysinfoapi.h>
|
||||
|
||||
#include "stack_trace.h"
|
||||
#include "util/dyn_lib.hpp"
|
||||
|
||||
DYNAMIC_IMPORT_RENAME("Kernel32.dll", SetThreadDescriptionImport, "SetThreadDescription", HRESULT(HANDLE hThread, PCWSTR lpThreadDescription));
|
||||
@@ -102,7 +108,7 @@ thread_local u64 g_tls_fault_rsx = 0;
|
||||
thread_local u64 g_tls_fault_spu = 0;
|
||||
thread_local u64 g_tls_wait_time = 0;
|
||||
thread_local u64 g_tls_wait_fail = 0;
|
||||
thread_local bool g_tls_access_violation_recovered = false;
|
||||
thread_local u64 g_tls_access_violation_recovered = umax;
|
||||
extern thread_local std::string(*g_tls_log_prefix)();
|
||||
|
||||
namespace stx
|
||||
@@ -1264,7 +1270,7 @@ namespace rsx
|
||||
extern std::function<bool(u32 addr, bool is_writing)> g_access_violation_handler;
|
||||
}
|
||||
|
||||
bool handle_access_violation(u32 addr, bool is_writing, ucontext_t* context) noexcept
|
||||
bool handle_access_violation(u32 addr, bool is_writing, bool is_exec, ucontext_t* context) noexcept
|
||||
{
|
||||
g_tls_fault_all++;
|
||||
|
||||
@@ -1300,7 +1306,7 @@ bool handle_access_violation(u32 addr, bool is_writing, ucontext_t* context) noe
|
||||
}
|
||||
} spu_protection{cpu};
|
||||
|
||||
if (addr < RAW_SPU_BASE_ADDR && vm::check_addr(addr) && rsx::g_access_violation_handler)
|
||||
if (!is_exec && addr < RAW_SPU_BASE_ADDR && vm::check_addr(addr) && rsx::g_access_violation_handler)
|
||||
{
|
||||
bool state_changed = false;
|
||||
|
||||
@@ -1366,7 +1372,7 @@ bool handle_access_violation(u32 addr, bool is_writing, ucontext_t* context) noe
|
||||
{
|
||||
auto thread = idm::get_unlocked<named_thread<spu_thread>>(spu_thread::find_raw_spu((addr - RAW_SPU_BASE_ADDR) / RAW_SPU_OFFSET));
|
||||
|
||||
if (!thread)
|
||||
if (!thread || is_exec)
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -1378,11 +1384,7 @@ bool handle_access_violation(u32 addr, bool is_writing, ucontext_t* context) noe
|
||||
return false;
|
||||
}
|
||||
|
||||
if (a_size != 4)
|
||||
{
|
||||
// Might be unimplemented, such as writing MFC proxy EAL+EAH using 64-bit store
|
||||
break;
|
||||
}
|
||||
bool handled = true;
|
||||
|
||||
switch (op)
|
||||
{
|
||||
@@ -1392,14 +1394,37 @@ bool handle_access_violation(u32 addr, bool is_writing, ucontext_t* context) noe
|
||||
case X64OP_LOAD_TEST:
|
||||
{
|
||||
u32 value;
|
||||
if (is_writing || !thread->read_reg(addr, value))
|
||||
const u32 addr_aligned = addr & -4;
|
||||
|
||||
if (addr % 4 + a_size > 4)
|
||||
{
|
||||
handled = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (is_writing || !thread->read_reg(addr_aligned, value))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Adjust value for 8-bit and 16-bit reads
|
||||
value >>= ((4 - a_size) * 8) - ((addr % 4) * 8);
|
||||
value &= a_size == 4 ? u32{umax} : ((1u << (a_size * 8)) - 1);
|
||||
|
||||
if (op != X64OP_LOAD_BE)
|
||||
{
|
||||
value = stx::se_storage<u32>::swap(value);
|
||||
if (a_size == 4)
|
||||
{
|
||||
value = stx::se_storage<u32>::swap(value);
|
||||
}
|
||||
else if (a_size == 2)
|
||||
{
|
||||
value = stx::se_storage<u16>::swap(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
ensure(a_size == 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (op == X64OP_LOAD_CMP)
|
||||
@@ -1434,12 +1459,35 @@ bool handle_access_violation(u32 addr, bool is_writing, ucontext_t* context) noe
|
||||
case X64OP_BEXTR:
|
||||
{
|
||||
u32 value;
|
||||
if (is_writing || !thread->read_reg(addr, value))
|
||||
const u32 addr_aligned = addr & -4;
|
||||
|
||||
if (addr % 4 + a_size > 4)
|
||||
{
|
||||
handled = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (is_writing || !thread->read_reg(addr_aligned, value))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
value = stx::se_storage<u32>::swap(value);
|
||||
// Adjust value for 8-bit and 16-bit reads
|
||||
value >>= ((4 - a_size) * 8) - ((addr % 4) * 8);
|
||||
value &= a_size == 4 ? u32{umax} : ((1u << (a_size * 8)) - 1);
|
||||
|
||||
if (a_size == 4)
|
||||
{
|
||||
value = stx::se_storage<u32>::swap(value);
|
||||
}
|
||||
else if (a_size == 2)
|
||||
{
|
||||
value = stx::se_storage<u16>::swap(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
ensure(a_size == 1);
|
||||
}
|
||||
|
||||
u64 ctrl;
|
||||
if (!get_x64_reg_value(context, s_tls_reg3, d_size, i_size, ctrl))
|
||||
@@ -1465,6 +1513,13 @@ bool handle_access_violation(u32 addr, bool is_writing, ucontext_t* context) noe
|
||||
case X64OP_STORE:
|
||||
case X64OP_STORE_BE:
|
||||
{
|
||||
if (a_size != 4)
|
||||
{
|
||||
// Might be unimplemented, such as writing MFC proxy EAL+EAH using 64-bit store
|
||||
handled = false;
|
||||
break;
|
||||
}
|
||||
|
||||
u64 reg_value;
|
||||
if (!is_writing || !get_x64_reg_value(context, reg, d_size, i_size, reg_value))
|
||||
{
|
||||
@@ -1483,12 +1538,19 @@ bool handle_access_violation(u32 addr, bool is_writing, ucontext_t* context) noe
|
||||
case X64OP_STOS:
|
||||
default:
|
||||
{
|
||||
sig_log.error("Invalid or unsupported operation (op=%d, reg=%d, d_size=%lld, i_size=%lld)", +op, +reg, d_size, i_size);
|
||||
sig_log.error("Invalid or unsupported operation (op=%d, addr=0x%x, reg=%d, d_size=%lld, i_size=%lld, a_size=%d)", +op, addr, +reg, d_size, i_size, a_size);
|
||||
report_opcode();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!handled)
|
||||
{
|
||||
sig_log.error("Invalid or unsupported operation (op=%d, addr=0x%x, reg=%d, d_size=%lld, i_size=%lld, a_size=%d)", +op, addr, +reg, d_size, i_size, a_size);
|
||||
report_opcode();
|
||||
break;
|
||||
}
|
||||
|
||||
// skip processed instruction
|
||||
RIP(context) += i_size;
|
||||
g_tls_fault_spu++;
|
||||
@@ -1498,7 +1560,9 @@ bool handle_access_violation(u32 addr, bool is_writing, ucontext_t* context) noe
|
||||
static_cast<void>(context);
|
||||
#endif /* ARCH_ */
|
||||
|
||||
if (vm::check_addr(addr, is_writing ? vm::page_writable : vm::page_readable))
|
||||
const auto required_page_perms = (is_writing ? vm::page_writable : vm::page_readable) + (is_exec ? vm::page_executable : 0);
|
||||
|
||||
if (vm::check_addr(addr, required_page_perms))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -1506,9 +1570,7 @@ bool handle_access_violation(u32 addr, bool is_writing, ucontext_t* context) noe
|
||||
// Hack: allocate memory in case the emulator is stopping
|
||||
const auto hack_alloc = [&]()
|
||||
{
|
||||
g_tls_access_violation_recovered = true;
|
||||
|
||||
if (vm::check_addr(addr, is_writing ? vm::page_writable : vm::page_readable))
|
||||
if (vm::check_addr(addr, required_page_perms))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -1520,17 +1582,45 @@ bool handle_access_violation(u32 addr, bool is_writing, ucontext_t* context) noe
|
||||
return false;
|
||||
}
|
||||
|
||||
extern void ppu_register_range(u32 addr, u32 size);
|
||||
|
||||
bool reprotected = false;
|
||||
|
||||
if (vm::writer_lock mlock; area->flags & vm::preallocated || vm::check_addr(addr, 0))
|
||||
{
|
||||
// For allocated memory with protection lower than required (such as protection::no or read-only while writing to it)
|
||||
utils::memory_protect(vm::base(addr & -0x1000), 0x1000, utils::protection::rw);
|
||||
reprotected = true;
|
||||
}
|
||||
|
||||
if (reprotected)
|
||||
{
|
||||
if (is_exec && !vm::check_addr(addr, vm::page_executable))
|
||||
{
|
||||
ppu_register_range(addr & -0x10000, 0x10000);
|
||||
}
|
||||
|
||||
g_tls_access_violation_recovered = addr;
|
||||
return true;
|
||||
}
|
||||
|
||||
return area->falloc(addr & -0x10000, 0x10000) || vm::check_addr(addr, is_writing ? vm::page_writable : vm::page_readable);
|
||||
const bool allocated = area->falloc(addr & -0x10000, 0x10000);
|
||||
|
||||
if (allocated)
|
||||
{
|
||||
if (is_exec && !vm::check_addr(addr, vm::page_executable))
|
||||
{
|
||||
ppu_register_range(addr & -0x10000, 0x10000);
|
||||
}
|
||||
|
||||
g_tls_access_violation_recovered = addr;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
if (cpu && (cpu->get_class() == thread_class::ppu || cpu->get_class() == thread_class::spu))
|
||||
if (cpu && (cpu->get_class() == thread_class::ppu || cpu->get_class() == thread_class::spu) && !is_exec)
|
||||
{
|
||||
vm::temporary_unlock(*cpu);
|
||||
u32 pf_port_id = 0;
|
||||
@@ -1673,7 +1763,7 @@ bool handle_access_violation(u32 addr, bool is_writing, ucontext_t* context) noe
|
||||
|
||||
if (cpu->get_class() == thread_class::spu)
|
||||
{
|
||||
if (!g_tls_access_violation_recovered)
|
||||
if (g_tls_access_violation_recovered != addr)
|
||||
{
|
||||
vm_log.notice("\n%s", dump_useful_thread_info());
|
||||
vm_log.always()("[%s] Access violation %s location 0x%x (%s)", cpu->get_name(), is_writing ? "writing" : "reading", addr, (is_writing && vm::check_addr(addr)) ? "read-only memory" : "unmapped memory");
|
||||
@@ -1709,10 +1799,10 @@ bool handle_access_violation(u32 addr, bool is_writing, ucontext_t* context) noe
|
||||
|
||||
// Note: a thread may access violate more than once after hack_alloc recovery
|
||||
// Do not log any further access violations in this case.
|
||||
if (!g_tls_access_violation_recovered)
|
||||
if (g_tls_access_violation_recovered != addr)
|
||||
{
|
||||
vm_log.notice("\n%s", dump_useful_thread_info());
|
||||
vm_log.fatal("Access violation %s location 0x%x (%s)", is_writing ? "writing" : (cpu && cpu->get_class() == thread_class::ppu && cpu->get_pc() == addr ? "executing" : "reading"), addr, (is_writing && vm::check_addr(addr)) ? "read-only memory" : "unmapped memory");
|
||||
vm_log.fatal("Access violation %s location 0x%x (%s)", is_writing ? "writing" : (is_exec ? "executing" : "reading"), addr, (is_writing && vm::check_addr(addr)) ? "read-only memory" : "unmapped memory");
|
||||
}
|
||||
|
||||
while (Emu.IsPausedOrReady())
|
||||
@@ -1761,8 +1851,13 @@ bool handle_access_violation(u32 addr, bool is_writing, ucontext_t* context) noe
|
||||
}
|
||||
}
|
||||
|
||||
if (Emu.IsStopped() && !hack_alloc())
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
while (!hack_alloc())
|
||||
{
|
||||
thread_ctrl::wait_for(1000);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1801,6 +1896,7 @@ static LONG exception_handler(PEXCEPTION_POINTERS pExp) noexcept
|
||||
if (pExp->ExceptionRecord->ExceptionCode == EXCEPTION_ACCESS_VIOLATION && !is_executing)
|
||||
{
|
||||
u32 addr = 0;
|
||||
bool is_exec = false;
|
||||
|
||||
if (auto [addr0, ok] = vm::try_get_addr(ptr); ok)
|
||||
{
|
||||
@@ -1808,14 +1904,21 @@ static LONG exception_handler(PEXCEPTION_POINTERS pExp) noexcept
|
||||
}
|
||||
else if (const usz exec64 = (ptr - vm::g_exec_addr) / 2; exec64 <= u32{umax})
|
||||
{
|
||||
is_exec = true;
|
||||
addr = static_cast<u32>(exec64);
|
||||
}
|
||||
else
|
||||
else if (const usz exec64 = (ptr - vm::g_exec_addr - vm::g_exec_addr_seg_offset); exec64 <= u32{umax})
|
||||
{
|
||||
is_exec = true;
|
||||
addr = static_cast<u32>(exec64);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::this_thread::sleep_for(1ms);
|
||||
return EXCEPTION_CONTINUE_SEARCH;
|
||||
}
|
||||
|
||||
if (thread_ctrl::get_current() && handle_access_violation(addr, is_writing, pExp->ContextRecord))
|
||||
if (thread_ctrl::get_current() && handle_access_violation(addr, is_writing, is_exec, pExp->ContextRecord))
|
||||
{
|
||||
return EXCEPTION_CONTINUE_EXECUTION;
|
||||
}
|
||||
@@ -1935,9 +2038,39 @@ static LONG exception_filter(PEXCEPTION_POINTERS pExp) noexcept
|
||||
}
|
||||
|
||||
fmt::append(msg, "RPCS3 image base: %p.\n", GetModuleHandle(NULL));
|
||||
|
||||
#if defined(ARCH_X64)
|
||||
fmt::append(msg, "RAX: %016llX RBX: %016llX\n", pExp->ContextRecord->Rax, pExp->ContextRecord->Rbx);
|
||||
fmt::append(msg, "RCX: %016llX RDX: %016llX\n", pExp->ContextRecord->Rcx, pExp->ContextRecord->Rdx);
|
||||
fmt::append(msg, "RSI: %016llX RDI: %016llX\n", pExp->ContextRecord->Rsi, pExp->ContextRecord->Rdi);
|
||||
fmt::append(msg, "RBP: %016llX RSP: %016llX\n", pExp->ContextRecord->Rbp, pExp->ContextRecord->Rsp);
|
||||
fmt::append(msg, "R8: %016llX R9: %016llX\n", pExp->ContextRecord->R8, pExp->ContextRecord->R9);
|
||||
fmt::append(msg, "R10: %016llX R11: %016llX\n", pExp->ContextRecord->R10, pExp->ContextRecord->R11);
|
||||
fmt::append(msg, "R12: %016llX R13: %016llX\n", pExp->ContextRecord->R12, pExp->ContextRecord->R13);
|
||||
fmt::append(msg, "R14: %016llX R15: %016llX\n", pExp->ContextRecord->R14, pExp->ContextRecord->R15);
|
||||
fmt::append(msg, "RFLAGS: %08X\n", pExp->ContextRecord->EFlags);
|
||||
#elif defined(ARCH_ARM64)
|
||||
for (int i = 0; i < 29; i += 2)
|
||||
{
|
||||
if (i + 1 < 29)
|
||||
fmt::append(msg, "X%-2d: %016llX X%-2d: %016llX\n", i, pExp->ContextRecord->X[i], i + 1, pExp->ContextRecord->X[i + 1]);
|
||||
else
|
||||
fmt::append(msg, "X%-2d: %016llX\n", i, pExp->ContextRecord->X[i]);
|
||||
}
|
||||
fmt::append(msg, "SP: %016llX FP: %016llX LR: %016llX\n", pExp->ContextRecord->Sp, pExp->ContextRecord->Fp, pExp->ContextRecord->Lr);
|
||||
fmt::append(msg, "CPSR: %08X\n", pExp->ContextRecord->Cpsr);
|
||||
#endif
|
||||
|
||||
// TODO: print registers and the callstack
|
||||
const auto stack_trace = utils::get_backtrace(64, pExp->ContextRecord);
|
||||
const auto stack_symbols = utils::get_backtrace_symbols(stack_trace);
|
||||
|
||||
msg += "Stack Trace:\n";
|
||||
|
||||
for (const auto& symbol : stack_symbols)
|
||||
{
|
||||
fmt::append(msg, "%s\n", symbol);
|
||||
}
|
||||
|
||||
sys_log.fatal("\n%s", msg);
|
||||
logs::listener::sync_all();
|
||||
|
||||
@@ -2022,12 +2155,13 @@ static void signal_handler(int /*sig*/, siginfo_t* info, void* uct) noexcept
|
||||
#endif
|
||||
|
||||
const u64 exec64 = (reinterpret_cast<u64>(info->si_addr) - reinterpret_cast<u64>(vm::g_exec_addr)) / 2;
|
||||
const u64 exec64_2 = (reinterpret_cast<u64>(info->si_addr) - reinterpret_cast<u64>(vm::g_exec_addr)) - vm::g_exec_addr_seg_offset;
|
||||
const auto cause = is_executing ? "executing" : is_writing ? "writing" : "reading";
|
||||
|
||||
if (auto [addr, ok] = vm::try_get_addr(info->si_addr); ok && !is_executing)
|
||||
{
|
||||
// Try to process access violation
|
||||
if (thread_ctrl::get_current() && handle_access_violation(addr, is_writing, context))
|
||||
if (thread_ctrl::get_current() && handle_access_violation(addr, is_writing, false, context))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -2035,7 +2169,14 @@ static void signal_handler(int /*sig*/, siginfo_t* info, void* uct) noexcept
|
||||
|
||||
if (exec64 < 0x100000000ull && !is_executing)
|
||||
{
|
||||
if (thread_ctrl::get_current() && handle_access_violation(static_cast<u32>(exec64), is_writing, context))
|
||||
if (thread_ctrl::get_current() && handle_access_violation(static_cast<u32>(exec64), is_writing, true, context))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (exec64_2 < 0x100000000ull && !is_executing)
|
||||
{
|
||||
if (thread_ctrl::get_current() && handle_access_violation(static_cast<u32>(exec64_2), is_writing, true, context))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -2354,7 +2495,7 @@ thread_base::native_entry thread_base::finalize(u64 _self) noexcept
|
||||
g_tls_fault_spu = 0;
|
||||
g_tls_wait_time = 0;
|
||||
g_tls_wait_fail = 0;
|
||||
g_tls_access_violation_recovered = false;
|
||||
g_tls_access_violation_recovered = umax;
|
||||
|
||||
g_tls_log_prefix = []() -> std::string { return {}; };
|
||||
|
||||
@@ -2798,8 +2939,25 @@ void thread_base::exec()
|
||||
}
|
||||
}
|
||||
|
||||
void thread_ctrl::set_name(std::string name)
|
||||
{
|
||||
ensure(g_tls_this_thread);
|
||||
g_tls_this_thread->m_tname.store(make_single<std::string>(name));
|
||||
g_tls_this_thread->set_name(std::move(name));
|
||||
}
|
||||
|
||||
[[noreturn]] void thread_ctrl::emergency_exit(std::string_view reason)
|
||||
{
|
||||
// Print stacktrace
|
||||
#ifdef __cpp_lib_stacktrace
|
||||
if (rpcs3::is_local_build())
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << std::stacktrace::current();
|
||||
sys_log.notice("StackTrace\n\n%s\n", oss.str());
|
||||
}
|
||||
#endif
|
||||
|
||||
if (const std::string info = dump_useful_thread_info(); !info.empty())
|
||||
{
|
||||
sys_log.notice("\n%s", info);
|
||||
@@ -2815,6 +2973,16 @@ void thread_base::exec()
|
||||
}
|
||||
}
|
||||
|
||||
if (auto [total, current] = utils::get_memory_usage(); total - current <= 256 * 1024 * 1024)
|
||||
{
|
||||
if (reason_buf.empty())
|
||||
{
|
||||
reason_buf = std::string{reason};
|
||||
}
|
||||
|
||||
fmt::append(reason_buf, " (Possible RAM deficiency: free RAM: %dMB)", (total - current) / (1024 * 1024));
|
||||
}
|
||||
|
||||
if (!reason_buf.empty())
|
||||
{
|
||||
reason = reason_buf;
|
||||
@@ -2876,6 +3044,32 @@ void thread_base::exec()
|
||||
report_fatal_error(reason);
|
||||
}
|
||||
|
||||
void thread_ctrl::silent_exit() noexcept
|
||||
{
|
||||
if (const auto _this = g_tls_this_thread)
|
||||
{
|
||||
g_tls_error_callback();
|
||||
|
||||
u64 _self = _this->finalize(thread_state::errored);
|
||||
|
||||
if (_self == umax)
|
||||
{
|
||||
// Unused, detached thread support remnant
|
||||
delete _this;
|
||||
}
|
||||
|
||||
thread_base::finalize(umax);
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
_endthreadex(0);
|
||||
#else
|
||||
pthread_exit(nullptr);
|
||||
#endif
|
||||
|
||||
std::abort();
|
||||
}
|
||||
|
||||
void thread_ctrl::detect_cpu_layout()
|
||||
{
|
||||
if (!g_native_core_layout.compare_and_swap_test(native_core_arrangement::undefined, native_core_arrangement::generic))
|
||||
|
||||
@@ -129,7 +129,7 @@ public:
|
||||
const native_entry entry_point;
|
||||
|
||||
// Set name for debugger
|
||||
static void set_name(std::string);
|
||||
static void set_name(std::string name);
|
||||
|
||||
private:
|
||||
// Thread handle (platform-specific)
|
||||
@@ -232,11 +232,7 @@ public:
|
||||
}
|
||||
|
||||
// Set current thread name (not recommended)
|
||||
static void set_name(std::string name)
|
||||
{
|
||||
g_tls_this_thread->m_tname.store(make_single<std::string>(name));
|
||||
g_tls_this_thread->set_name(std::move(name));
|
||||
}
|
||||
static void set_name(std::string name);
|
||||
|
||||
// Set thread name (not recommended)
|
||||
template <typename T>
|
||||
@@ -319,6 +315,9 @@ public:
|
||||
// Exit.
|
||||
[[noreturn]] static void emergency_exit(std::string_view reason);
|
||||
|
||||
// Exit the current named thread as errored without reporting a fatal error.
|
||||
[[noreturn]] static void silent_exit() noexcept;
|
||||
|
||||
// Get current thread (may be nullptr)
|
||||
static thread_base* get_current()
|
||||
{
|
||||
@@ -801,31 +800,30 @@ public:
|
||||
m_count = 0;
|
||||
|
||||
// Create all threads
|
||||
for (u32 i = 0; i < count - 1; i++)
|
||||
for (; m_count < count - 1; m_count++)
|
||||
{
|
||||
// Copy the context
|
||||
std::remove_cvref_t<Context> context(static_cast<const Context&>(f));
|
||||
|
||||
// Perform the check and additional preparations for each context
|
||||
if (!std::invoke(std::forward<CheckAndPrepare>(check), i, context))
|
||||
if (!std::invoke(std::forward<CheckAndPrepare>(check), m_count, context))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_count++;
|
||||
new (static_cast<void*>(m_threads + i)) Thread(std::string(name) + std::to_string(i + 1), std::move(context));
|
||||
new (static_cast<void*>(m_threads + m_count)) Thread(std::string(name) + std::to_string(m_count + 1), std::move(context));
|
||||
}
|
||||
|
||||
// Move the context (if movable)
|
||||
std::remove_cvref_t<Context> context(std::forward<Context>(f));
|
||||
|
||||
if (!std::invoke(std::forward<CheckAndPrepare>(check), m_count - 1, context))
|
||||
if (!std::invoke(std::forward<CheckAndPrepare>(check), m_count, context))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
new (static_cast<void*>(m_threads + m_count)) Thread(std::string(name) + std::to_string(m_count + 1), std::move(context));
|
||||
m_count++;
|
||||
new (static_cast<void*>(m_threads + m_count - 1)) Thread(std::string(name) + std::to_string(m_count - 1), std::move(context));
|
||||
}
|
||||
|
||||
// Default constructor
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <cmath>
|
||||
#include <type_traits>
|
||||
|
||||
@@ -1027,3 +1028,6 @@ using color1u = color1_base<unsigned int>;
|
||||
using color1i = color1_base<int>;
|
||||
using color1f = color1_base<float>;
|
||||
using color1d = color1_base<double>;
|
||||
|
||||
using mat3f = color3_base<float>[3];
|
||||
static_assert(sizeof(mat3f) == sizeof(float) * 3 * 3);
|
||||
|
||||
@@ -10,6 +10,19 @@ rXmlNode::rXmlNode(const pugi::xml_node& node)
|
||||
handle = node;
|
||||
}
|
||||
|
||||
std::shared_ptr<rXmlNode> rXmlNode::GetChild(std::string_view name)
|
||||
{
|
||||
if (handle)
|
||||
{
|
||||
if (const pugi::xml_node child = handle.child(name))
|
||||
{
|
||||
return std::make_shared<rXmlNode>(child);
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<rXmlNode> rXmlNode::GetChildren()
|
||||
{
|
||||
if (handle)
|
||||
|
||||
@@ -20,6 +20,7 @@ struct rXmlNode
|
||||
{
|
||||
rXmlNode();
|
||||
rXmlNode(const pugi::xml_node& node);
|
||||
std::shared_ptr<rXmlNode> GetChild(std::string_view name);
|
||||
std::shared_ptr<rXmlNode> GetChildren();
|
||||
std::shared_ptr<rXmlNode> GetNext();
|
||||
std::string GetName();
|
||||
|
||||
@@ -30,42 +30,61 @@ namespace utils
|
||||
return out.data();
|
||||
}
|
||||
|
||||
std::vector<void*> get_backtrace(int max_depth)
|
||||
std::vector<void*> get_backtrace(int max_depth, PCONTEXT ctx)
|
||||
{
|
||||
static struct sym_initer_t
|
||||
{
|
||||
sym_initer_t() noexcept
|
||||
{
|
||||
SymInitialize(GetCurrentProcess(), NULL, TRUE);
|
||||
}
|
||||
~sym_initer_t() noexcept
|
||||
{
|
||||
SymCleanup(GetCurrentProcess());
|
||||
}
|
||||
} s_initer{};
|
||||
|
||||
std::vector<void*> result = {};
|
||||
|
||||
const auto hProcess = ::GetCurrentProcess();
|
||||
const auto hThread = ::GetCurrentThread();
|
||||
|
||||
CONTEXT context{};
|
||||
RtlCaptureContext(&context);
|
||||
if (ctx)
|
||||
context = *ctx;
|
||||
else
|
||||
RtlCaptureContext(&context);
|
||||
|
||||
STACKFRAME64 stack = {};
|
||||
stack.AddrPC.Mode = AddrModeFlat;
|
||||
stack.AddrStack.Mode = AddrModeFlat;
|
||||
stack.AddrFrame.Mode = AddrModeFlat;
|
||||
#if defined(ARCH_X64)
|
||||
const DWORD machineType = IMAGE_FILE_MACHINE_AMD64;
|
||||
stack.AddrPC.Offset = context.Rip;
|
||||
stack.AddrStack.Offset = context.Rsp;
|
||||
stack.AddrFrame.Offset = context.Rbp;
|
||||
#elif defined(ARCH_ARM64)
|
||||
const DWORD machineType = IMAGE_FILE_MACHINE_ARM64;
|
||||
stack.AddrPC.Offset = context.Pc;
|
||||
stack.AddrStack.Offset = context.Sp;
|
||||
stack.AddrFrame.Offset = context.Fp;
|
||||
#else
|
||||
#error "Unsupported architecture"
|
||||
#endif
|
||||
|
||||
while (max_depth--)
|
||||
{
|
||||
if (!StackWalk64(
|
||||
IMAGE_FILE_MACHINE_AMD64,
|
||||
hProcess,
|
||||
hThread,
|
||||
&stack,
|
||||
&context,
|
||||
NULL,
|
||||
SymFunctionTableAccess64,
|
||||
SymGetModuleBase64,
|
||||
NULL))
|
||||
machineType,
|
||||
hProcess,
|
||||
hThread,
|
||||
&stack,
|
||||
&context,
|
||||
NULL,
|
||||
SymFunctionTableAccess64,
|
||||
SymGetModuleBase64,
|
||||
NULL))
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -116,7 +135,7 @@ namespace utils
|
||||
}
|
||||
else
|
||||
{
|
||||
result.push_back(fmt::format("rpcs3@0xp", pointer));
|
||||
result.push_back(fmt::format("rpcs3@0x%p", pointer));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,11 @@
|
||||
#include <util/types.hpp>
|
||||
#include <util/logs.hpp>
|
||||
|
||||
#ifdef _WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <Windows.h>
|
||||
#endif
|
||||
|
||||
namespace utils
|
||||
{
|
||||
namespace stack_trace
|
||||
@@ -30,7 +35,12 @@ namespace utils
|
||||
};
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
std::vector<void*> get_backtrace(int max_depth = 255, PCONTEXT ctx = nullptr);
|
||||
#else
|
||||
std::vector<void*> get_backtrace(int max_depth = 255);
|
||||
#endif
|
||||
|
||||
std::vector<std::string> get_backtrace_symbols(const std::vector<void*>& stack);
|
||||
|
||||
FORCE_INLINE void print_trace(stack_trace::Logger auto& logger, int max_depth = 255)
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
#include "stdafx.h"
|
||||
#include "stereo_config.h"
|
||||
#include "Emu/system_config.h"
|
||||
|
||||
stereo_config::stereo_matrices::stereo_matrices(const std::array<color3_base<f32>, 3>& l, const std::array<color3_base<f32>, 3>& r)
|
||||
{
|
||||
for (usz i = 0; i < 3; i++)
|
||||
{
|
||||
left[i] = l[i];
|
||||
right[i] = r[i];
|
||||
}
|
||||
}
|
||||
|
||||
atomic_t<bool> stereo_config::s_live_preview_enabled = false;
|
||||
stereo_config::stereo_matrices stereo_config::m_live_matrices = {};
|
||||
|
||||
const std::unordered_map<stereo_render_mode_options, stereo_config::stereo_matrices> stereo_config::m_matrices =
|
||||
{
|
||||
{stereo_render_mode_options::anaglyph_red_cyan, stereo_matrices(
|
||||
{
|
||||
color3_base<f32>(1, 0, 0),
|
||||
color3_base<f32>(0, 0, 0),
|
||||
color3_base<f32>(0, 0, 0)
|
||||
},
|
||||
{
|
||||
color3_base<f32>(0, 0, 0),
|
||||
color3_base<f32>(0, 1, 0),
|
||||
color3_base<f32>(0, 0, 1)
|
||||
}
|
||||
)},
|
||||
{stereo_render_mode_options::anaglyph_red_green, stereo_matrices(
|
||||
{
|
||||
color3_base<f32>(1, 0, 0),
|
||||
color3_base<f32>(0, 0, 0),
|
||||
color3_base<f32>(0, 0, 0)
|
||||
},
|
||||
{
|
||||
color3_base<f32>(0, 0, 0),
|
||||
color3_base<f32>(0, 1, 0),
|
||||
color3_base<f32>(0, 0, 0)
|
||||
}
|
||||
)},
|
||||
{stereo_render_mode_options::anaglyph_red_blue, stereo_matrices(
|
||||
{
|
||||
color3_base<f32>(1, 0, 0),
|
||||
color3_base<f32>(0, 0, 0),
|
||||
color3_base<f32>(0, 0, 0)
|
||||
},
|
||||
{
|
||||
color3_base<f32>(0, 0, 0),
|
||||
color3_base<f32>(0, 0, 0),
|
||||
color3_base<f32>(0, 0, 1)
|
||||
}
|
||||
)},
|
||||
{stereo_render_mode_options::anaglyph_magenta_cyan, stereo_matrices(
|
||||
{
|
||||
color3_base<f32>(1, 0, 0),
|
||||
color3_base<f32>(0, 0, 0),
|
||||
color3_base<f32>(0, 0, 0.5f)
|
||||
},
|
||||
{
|
||||
color3_base<f32>(0, 0, 0),
|
||||
color3_base<f32>(0, 1, 0),
|
||||
color3_base<f32>(0, 0, 0.5f)
|
||||
}
|
||||
)},
|
||||
{stereo_render_mode_options::anaglyph_trioscopic, stereo_matrices(
|
||||
{
|
||||
color3_base<f32>(0, 0, 0),
|
||||
color3_base<f32>(0, 1, 0),
|
||||
color3_base<f32>(0, 0, 0)
|
||||
},
|
||||
{
|
||||
color3_base<f32>(1, 0, 0),
|
||||
color3_base<f32>(0, 0, 0),
|
||||
color3_base<f32>(0, 0, 1)
|
||||
}
|
||||
)},
|
||||
{stereo_render_mode_options::anaglyph_amber_blue, stereo_matrices(
|
||||
{
|
||||
color3_base<f32>(1, 0, 0),
|
||||
color3_base<f32>(0, 1, 0),
|
||||
color3_base<f32>(0, 0, 0)
|
||||
},
|
||||
{
|
||||
color3_base<f32>(0, 0, 1.0f / 3.0f),
|
||||
color3_base<f32>(0, 0, 1.0f / 3.0f),
|
||||
color3_base<f32>(0, 0, 1.0f / 3.0f)
|
||||
}
|
||||
)},
|
||||
};
|
||||
|
||||
void stereo_config::update_from_config(bool stereo_enabled)
|
||||
{
|
||||
m_stereo_mode = stereo_enabled ? g_cfg.video.stereo_render_mode.get() : stereo_render_mode_options::disabled;
|
||||
|
||||
if (m_stereo_mode == stereo_render_mode_options::anaglyph_custom)
|
||||
{
|
||||
stereo_config::convert_matrix(m_custom_matrices.left, g_cfg.video.custom_anaglyph_matrices.left.get_map());
|
||||
stereo_config::convert_matrix(m_custom_matrices.right, g_cfg.video.custom_anaglyph_matrices.right.get_map());
|
||||
}
|
||||
}
|
||||
|
||||
const stereo_config::stereo_matrices& stereo_config::matrices() const
|
||||
{
|
||||
if (m_in_emulation && s_live_preview_enabled)
|
||||
{
|
||||
return m_live_matrices;
|
||||
}
|
||||
|
||||
switch (m_stereo_mode)
|
||||
{
|
||||
case stereo_render_mode_options::disabled:
|
||||
case stereo_render_mode_options::side_by_side:
|
||||
case stereo_render_mode_options::over_under:
|
||||
case stereo_render_mode_options::interlaced:
|
||||
break;
|
||||
case stereo_render_mode_options::anaglyph_red_green:
|
||||
case stereo_render_mode_options::anaglyph_red_blue:
|
||||
case stereo_render_mode_options::anaglyph_red_cyan:
|
||||
case stereo_render_mode_options::anaglyph_magenta_cyan:
|
||||
case stereo_render_mode_options::anaglyph_trioscopic:
|
||||
case stereo_render_mode_options::anaglyph_amber_blue:
|
||||
return ::at32(m_matrices, m_stereo_mode);
|
||||
case stereo_render_mode_options::anaglyph_custom:
|
||||
return m_custom_matrices;
|
||||
}
|
||||
|
||||
static const stereo_matrices s_left_only_matrices = stereo_matrices(
|
||||
{
|
||||
color3_base<float>(1, 0, 0),
|
||||
color3_base<float>(0, 1, 0),
|
||||
color3_base<float>(0, 0, 1)
|
||||
},
|
||||
{
|
||||
color3_base<float>(0, 0, 0),
|
||||
color3_base<float>(0, 0, 0),
|
||||
color3_base<float>(0, 0, 0)
|
||||
});
|
||||
return s_left_only_matrices;
|
||||
}
|
||||
|
||||
std::map<std::string, std::string> stereo_config::get_custom_matrix(bool is_left) const
|
||||
{
|
||||
return convert_matrix(is_left ? m_custom_matrices.left : m_custom_matrices.right);
|
||||
}
|
||||
|
||||
std::map<std::string, std::string> stereo_config::convert_matrix(const mat3f& mat)
|
||||
{
|
||||
std::map<std::string, std::string> values {};
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
for (int j = 0; j < 3; j++)
|
||||
{
|
||||
values[fmt::format("%d%d", i, j)] = fmt::format("%f", mat[i].rgb[j]);
|
||||
}
|
||||
}
|
||||
return values;
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
#pragma once
|
||||
|
||||
#include "geometry.h"
|
||||
#include "Emu/system_config_types.h"
|
||||
#include "util/atomic.hpp"
|
||||
#include "Utilities/StrFmt.h"
|
||||
#include "Utilities/StrUtil.h"
|
||||
#include <map>
|
||||
#include <mutex>
|
||||
|
||||
struct stereo_config
|
||||
{
|
||||
public:
|
||||
struct stereo_matrices
|
||||
{
|
||||
stereo_matrices() = default;
|
||||
stereo_matrices(const std::array<color3_base<f32>, 3>& l, const std::array<color3_base<f32>, 3>& r);
|
||||
|
||||
mat3f left {};
|
||||
mat3f right {};
|
||||
};
|
||||
|
||||
stereo_config(bool in_emulation) : m_in_emulation(in_emulation) {}
|
||||
|
||||
void set_stereo_mode(stereo_render_mode_options mode) { m_stereo_mode = mode; }
|
||||
stereo_render_mode_options stereo_mode() const { return m_stereo_mode; }
|
||||
|
||||
const stereo_matrices& matrices() const;
|
||||
|
||||
void update_from_config(bool stereo_enabled);
|
||||
|
||||
void set_custom_matrices(const stereo_matrices& matrices) { m_custom_matrices = matrices; }
|
||||
static void set_live_matrices(const stereo_matrices& matrices) { m_live_matrices = matrices; }
|
||||
|
||||
std::map<std::string, std::string> get_custom_matrix(bool is_left) const;
|
||||
|
||||
template <typename T>
|
||||
static void convert_matrix(mat3f& mat, const T& values)
|
||||
{
|
||||
mat[0] = {};
|
||||
mat[1] = {};
|
||||
mat[2] = {};
|
||||
|
||||
if (values.empty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
for (int j = 0; j < 3; j++)
|
||||
{
|
||||
const std::string key = fmt::format("%d%d", i, j);
|
||||
const auto it = values.find(key);
|
||||
if (it == values.cend()) continue;
|
||||
|
||||
const std::string& val_s = it->second;
|
||||
if (val_s.empty()) continue;
|
||||
|
||||
if (f64 val = 0.0f; try_to_float(&val, val_s, -10.0f, 10.0f))
|
||||
{
|
||||
mat[i].rgb[j] = static_cast<f32>(val);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static std::map<std::string, std::string> convert_matrix(const mat3f& mat);
|
||||
|
||||
static atomic_t<bool> s_live_preview_enabled;
|
||||
|
||||
private:
|
||||
stereo_matrices m_custom_matrices {};
|
||||
stereo_render_mode_options m_stereo_mode = stereo_render_mode_options::disabled;
|
||||
bool m_in_emulation = false;
|
||||
|
||||
static stereo_matrices m_live_matrices;
|
||||
static const std::unordered_map<stereo_render_mode_options, stereo_matrices> m_matrices;
|
||||
};
|
||||
@@ -74,7 +74,7 @@ enum
|
||||
};
|
||||
#endif
|
||||
|
||||
inline int futex(volatile void* uaddr, int futex_op, uint val, const timespec* timeout = nullptr, uint mask = 0)
|
||||
inline int futex(volatile void* uaddr, int futex_op, uint val, const timespec* timeout = nullptr, [[maybe_unused]] uint mask = 0)
|
||||
{
|
||||
#ifdef __linux__
|
||||
return syscall(SYS_futex, uaddr, futex_op, static_cast<int>(val), timeout, nullptr, static_cast<int>(mask));
|
||||
|
||||
@@ -37,10 +37,6 @@ QSlider#sizeSlider::handle:horizontal {
|
||||
QLabel#toolbar_icon_color {
|
||||
color: rgba(64,64,64,255);
|
||||
}
|
||||
/* thumbnail icon color stylesheet */
|
||||
QLabel#thumbnail_icon_color {
|
||||
color: rgba(0,100,231,255);
|
||||
}
|
||||
/* gamelist icon color stylesheet */
|
||||
QLabel#gamelist_icon_background_color {
|
||||
color: rgba(209,209,209,255);
|
||||
|
||||
@@ -237,11 +237,6 @@ QLabel#gamelist_icon_background_color {
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
/* Set Windows Taskbar Thumbnail colors */
|
||||
QLabel#thumbnail_icon_color {
|
||||
color: #262626;
|
||||
}
|
||||
|
||||
/* Set Log colors */
|
||||
QPlainTextEdit#log_frame {
|
||||
background-color: #000; /* Black */
|
||||
|
||||
@@ -573,11 +573,6 @@ QLabel#gamelist_icon_background_color {
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
/* Set Windows Taskbar Thumbnail colors */
|
||||
QLabel#thumbnail_icon_color {
|
||||
color: #23262d;
|
||||
}
|
||||
|
||||
/* Log colors */
|
||||
QPlainTextEdit#log_frame {
|
||||
background-color: #23262d;
|
||||
|
||||
@@ -265,11 +265,6 @@ QLabel#gamelist_icon_background_color {
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
/* Set Taskbar Thumbnail colors */
|
||||
QLabel#thumbnail_icon_color {
|
||||
color: #444444;
|
||||
}
|
||||
|
||||
/* Memory Viewer */
|
||||
QLabel#memory_viewer_address_panel {
|
||||
color: #00cbff; /* Font Color: Blue */
|
||||
|
||||
@@ -244,11 +244,6 @@ QLabel#gamelist_icon_background_color {
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
/* Set Windows Taskbar Thumbnail colors */
|
||||
QLabel#thumbnail_icon_color {
|
||||
color: #262626;
|
||||
}
|
||||
|
||||
/* Set Log colors */
|
||||
QPlainTextEdit#log_frame {
|
||||
background-color: #181d24; /* Black */
|
||||
|
||||
@@ -397,12 +397,6 @@ QLabel#gamelist_icon_background_color {
|
||||
}
|
||||
|
||||
|
||||
/* Set Windows Taskbar Thumbnail colors */
|
||||
QLabel#thumbnail_icon_color {
|
||||
color: #ffd785;
|
||||
}
|
||||
|
||||
|
||||
QLabel#log_level_always {
|
||||
color: #00ffff; /* Cyan */
|
||||
}
|
||||
|
||||
@@ -656,11 +656,6 @@ QLabel#color_button {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
/* Set Windows Taskbar Thumbnail colors */
|
||||
QLabel#thumbnail_icon_color {
|
||||
color: #370048;
|
||||
}
|
||||
|
||||
/* Debugger colors */
|
||||
QLabel#debugger_frame_breakpoint {
|
||||
color: #000; /* Font Color: Black */
|
||||
|
||||
@@ -664,11 +664,6 @@ QLabel#color_button {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
/* Set Windows Taskbar Thumbnail colors */
|
||||
QLabel#thumbnail_icon_color {
|
||||
color: #8500ae;
|
||||
}
|
||||
|
||||
/* Debugger colors */
|
||||
QLabel#debugger_frame_breakpoint {
|
||||
color: #000; /* Font Color: Black */
|
||||
|
||||
@@ -349,24 +349,24 @@ QPushButton:disabled {
|
||||
}
|
||||
|
||||
|
||||
QDialog QDialogButtonBox QPushButton {
|
||||
QDialog QDialogButtonBox QPushButton:default {
|
||||
color: #000000;
|
||||
background-color: #4CC2FF;
|
||||
border-color: #5AC7FF;
|
||||
}
|
||||
|
||||
QDialog QDialogButtonBox QPushButton:hover {
|
||||
QDialog QDialogButtonBox QPushButton:default:hover {
|
||||
background-color: #48B2E9;
|
||||
border-color: #56B8EB;
|
||||
}
|
||||
|
||||
QDialog QDialogButtonBox QPushButton:pressed {
|
||||
QDialog QDialogButtonBox QPushButton:default:pressed {
|
||||
color: #22526A;
|
||||
background-color: #45A4D5;
|
||||
border-color: #45A4D5;
|
||||
}
|
||||
|
||||
QDialog QDialogButtonBox QPushButton:disabled {
|
||||
QDialog QDialogButtonBox QPushButton:default:disabled {
|
||||
color: #ABABAB;
|
||||
background-color: #4C4C4C;
|
||||
border-color: #4C4C4C;
|
||||
@@ -614,10 +614,15 @@ QComboBox QAbstractItemView {
|
||||
QComboBox QAbstractItemView::item {
|
||||
color: #FFFFFF;
|
||||
padding: 4px 6px;
|
||||
margin: 2px 0px;
|
||||
background-color: transparent;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
QComboBox QAbstractItemView::item:hover {
|
||||
background-color: #383838;
|
||||
}
|
||||
|
||||
QComboBox QAbstractItemView::item:selected {
|
||||
background-color: #383838;
|
||||
}
|
||||
@@ -642,7 +647,7 @@ QDoubleSpinBox::up-button, QDoubleSpinBox::down-button {
|
||||
border-radius: 4px;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
padding: 3px 4px;
|
||||
padding: 3px 4px;
|
||||
}
|
||||
|
||||
QSpinBox::up-button:hover, QSpinBox::down-button:hover,
|
||||
@@ -709,6 +714,16 @@ QSlider::handle:horizontal:disabled {
|
||||
image: url("GuiConfigs/dark/slider-handle-disabled.svg");
|
||||
}
|
||||
|
||||
QSlider::sub-page:horizontal {
|
||||
background-color: #4CC2FF;
|
||||
border-radius: 2px;
|
||||
height: 4px;
|
||||
}
|
||||
|
||||
QSlider::sub-page:horizontal:disabled {
|
||||
background-color: #767A7D;
|
||||
}
|
||||
|
||||
|
||||
/* LINE EDIT */
|
||||
QLineEdit {
|
||||
@@ -791,7 +806,7 @@ QMenuBar::item:pressed {
|
||||
|
||||
QMenu {
|
||||
background-color: #2C2C2C;
|
||||
border: 1px solid #131313;
|
||||
border: 1px solid #3E3E3E;
|
||||
padding: 4px 0px;
|
||||
}
|
||||
|
||||
@@ -799,12 +814,12 @@ QMenu::item {
|
||||
color: #FFFFFF;
|
||||
background-color: transparent;
|
||||
border-radius: 4px;
|
||||
padding: 8px 20px;
|
||||
padding: 4px 20px;
|
||||
margin: 0px 4px;
|
||||
}
|
||||
|
||||
QMenu::item:selected {
|
||||
background-color: #383838;
|
||||
background-color: #353535;
|
||||
}
|
||||
|
||||
QMenu::item:disabled {
|
||||
@@ -814,8 +829,8 @@ QMenu::item:disabled {
|
||||
|
||||
QMenu::separator {
|
||||
height: 1px;
|
||||
background: #131313;
|
||||
margin: 4px 0px;
|
||||
background: #3E3E3E;
|
||||
margin: 4px 8px;
|
||||
}
|
||||
|
||||
QMenu::indicator, QMenu::right-arrow {
|
||||
|
||||
@@ -349,24 +349,24 @@ QPushButton:disabled {
|
||||
}
|
||||
|
||||
|
||||
QDialog QDialogButtonBox QPushButton {
|
||||
QDialog QDialogButtonBox QPushButton:default {
|
||||
color: #FFFFFF;
|
||||
background-color: #0067C0;
|
||||
border-color: #1473C5;
|
||||
}
|
||||
|
||||
QDialog QDialogButtonBox QPushButton:hover {
|
||||
QDialog QDialogButtonBox QPushButton:default:hover {
|
||||
background-color: #1A76C6;
|
||||
border-color: #2C80CA;
|
||||
}
|
||||
|
||||
QDialog QDialogButtonBox QPushButton:pressed {
|
||||
QDialog QDialogButtonBox QPushButton:default:pressed {
|
||||
color: #C2DAEF;
|
||||
background-color: #3284CB;
|
||||
border-color: #3284CB;
|
||||
}
|
||||
|
||||
QDialog QDialogButtonBox QPushButton:disabled {
|
||||
QDialog QDialogButtonBox QPushButton:default:disabled {
|
||||
color: #FFFFFF;
|
||||
background-color: #C5C5C5;
|
||||
border-color: #C5C5C5;
|
||||
@@ -614,10 +614,15 @@ QComboBox QAbstractItemView {
|
||||
QComboBox QAbstractItemView::item {
|
||||
color: #1B1B1B;
|
||||
padding: 4px 6px;
|
||||
margin: 2px 0px;
|
||||
background-color: transparent;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
QComboBox QAbstractItemView::item:hover {
|
||||
background-color: #F0F0F0;
|
||||
}
|
||||
|
||||
QComboBox QAbstractItemView::item:selected {
|
||||
background-color: #F0F0F0;
|
||||
}
|
||||
@@ -642,7 +647,7 @@ QDoubleSpinBox::up-button, QDoubleSpinBox::down-button {
|
||||
border-radius: 4px;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
padding: 3px 4px;
|
||||
padding: 3px 4px;
|
||||
}
|
||||
|
||||
QSpinBox::up-button:hover, QSpinBox::down-button:hover,
|
||||
@@ -709,6 +714,16 @@ QSlider::handle:horizontal:disabled {
|
||||
image: url("GuiConfigs/light/slider-handle-disabled.svg");
|
||||
}
|
||||
|
||||
QSlider::sub-page:horizontal {
|
||||
background-color: #1A76C6;
|
||||
border-radius: 2px;
|
||||
height: 4px;
|
||||
}
|
||||
|
||||
QSlider::sub-page:horizontal:disabled {
|
||||
background-color: #868788;
|
||||
}
|
||||
|
||||
|
||||
/* LINE EDIT */
|
||||
QLineEdit {
|
||||
@@ -791,7 +806,7 @@ QMenuBar::item:pressed {
|
||||
|
||||
QMenu {
|
||||
background-color: #F9F9F9;
|
||||
border: 1px solid #EEEEEE;
|
||||
border: 1px solid #E5E5E5;
|
||||
padding: 4px 0px;
|
||||
}
|
||||
|
||||
@@ -799,7 +814,7 @@ QMenu::item {
|
||||
color: #1B1B1B;
|
||||
background-color: transparent;
|
||||
border-radius: 4px;
|
||||
padding: 8px 20px;
|
||||
padding: 4px 20px;
|
||||
margin: 0px 4px;
|
||||
}
|
||||
|
||||
@@ -814,8 +829,8 @@ QMenu::item:disabled {
|
||||
|
||||
QMenu::separator {
|
||||
height: 1px;
|
||||
background: #EEEEEE;
|
||||
margin: 4px 0px;
|
||||
background: #E5E5E5;
|
||||
margin: 4px 8px;
|
||||
}
|
||||
|
||||
QMenu::indicator, QMenu::right-arrow {
|
||||
|
||||
@@ -379,11 +379,6 @@ QLabel#gamelist_icon_background_color {
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
/* Set Windows Taskbar Thumbnail colors */
|
||||
QLabel#thumbnail_icon_color {
|
||||
color: #4d4940;
|
||||
}
|
||||
|
||||
QLabel#log_level_always {
|
||||
color: #00ffff; /* Cyan */
|
||||
}
|
||||
|
||||
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 4.3 KiB |
|
After Width: | Height: | Size: 5.5 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 5.6 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 8.0 KiB |
|
After Width: | Height: | Size: 8.0 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 6.9 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 618 B |
|
After Width: | Height: | Size: 497 B |
|
After Width: | Height: | Size: 360 B |
|
After Width: | Height: | Size: 561 B |
|
After Width: | Height: | Size: 472 B |
|
After Width: | Height: | Size: 473 B |
|
After Width: | Height: | Size: 489 B |
|
After Width: | Height: | Size: 384 B |
|
After Width: | Height: | Size: 721 B |
|
After Width: | Height: | Size: 509 B |
|
After Width: | Height: | Size: 702 B |
|
After Width: | Height: | Size: 672 B |
|
After Width: | Height: | Size: 447 B |
|
After Width: | Height: | Size: 587 B |
|
After Width: | Height: | Size: 332 B |
|
After Width: | Height: | Size: 668 B |
|
After Width: | Height: | Size: 659 B |