Compare commits
587 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 33558d14e5 | |||
| c37fc73a02 | |||
| d152537e50 | |||
| 5d4e87373f | |||
| 1c36156594 | |||
| 300701a06b | |||
| a776f15557 | |||
| 1c89f8a855 | |||
| 81e4d9c2ee | |||
| 49be6be8f4 | |||
| b861a9c5d0 | |||
| 9828e6cafc | |||
| 3d8d9ef61c | |||
| 5d13978bbf | |||
| b844aecb9e | |||
| f57c8c1c35 | |||
| bbbc5f6e6c | |||
| ac0c60b740 | |||
| f2f95a20a3 | |||
| 12f213ffad | |||
| 66e1cf96e2 | |||
| c3b7229fbb | |||
| f96a0ce9d2 | |||
| ba592070f7 | |||
| 6a2ea62f82 | |||
| 6cfd817b5a | |||
| c99ef4b09f | |||
| 7e131f8fb6 | |||
| 10171c19c3 | |||
| e0853095e3 | |||
| 5a365506f7 | |||
| 4aee1b378a | |||
| 9f5e3ecb8c | |||
| 7b9614fcf3 | |||
| 8e62a0e22d | |||
| f89d3d5077 | |||
| 145e059cdf | |||
| 22916a7e8d | |||
| 07f458f991 | |||
| 6180a58d7a | |||
| 5cc2a7c09e | |||
| e584653b72 | |||
| f4b346a6f8 | |||
| cb1b71bc57 | |||
| 95060efb7d | |||
| b82dd61a0c | |||
| c84d10686f | |||
| d652a81078 | |||
| fc76d2df38 | |||
| 1a98682ea0 | |||
| 64437a531b | |||
| 4d26170bd6 | |||
| 36831a3d6a | |||
| e7c0df4eac | |||
| a296c19633 | |||
| 8b5f7a0770 | |||
| 7b9a36be7d | |||
| cbe1628cf2 | |||
| d482c078bc | |||
| 38f9332905 | |||
| 96f1f9e45e | |||
| f031cd9b42 | |||
| 3aa15c8a23 | |||
| a3cc3aa8b8 | |||
| 29f67448e9 | |||
| 976a3ed3bf | |||
| 98c0944419 | |||
| bf78b197a3 | |||
| 427960fee8 | |||
| 75da7d80dc | |||
| 7eb730ee03 | |||
| 4b9fa7a417 | |||
| 6163acc8c5 | |||
| 4add5b6bf0 | |||
| 1ae3b37fbe | |||
| 23c710cf53 | |||
| e29b81c444 | |||
| 73dba6d6e0 | |||
| 09e845a539 | |||
| e1744ceab2 | |||
| cbb1b1f28e | |||
| 59f9938849 | |||
| 8db318094f | |||
| 5a4206e05d | |||
| 6794ae35a1 | |||
| 8676913e73 | |||
| 2ef120fdcd | |||
| 08c1a14b13 | |||
| 4a138aa918 | |||
| 793a21a825 | |||
| 6fd76054b4 | |||
| c80be9e54b | |||
| 56ebae773c | |||
| fad6647255 | |||
| edb2b60f2f | |||
| d894ccb4ea | |||
| bd09dc8ea8 | |||
| a1e19e1cf8 | |||
| 799dbfc2c5 | |||
| 54e6cf95d7 | |||
| 3ea0e391db | |||
| 4fd21f7764 | |||
| f8009451a9 | |||
| f5c48a00b4 | |||
| c70338a9a9 | |||
| e83540d80c | |||
| 24dde5d42b | |||
| 8e15afb2c4 | |||
| 911cd678ff | |||
| f11770b88b | |||
| 514ef9a9c5 | |||
| 57070aa8ff | |||
| e06c6b5ac8 | |||
| a6dada6c36 | |||
| a058cf2ff0 | |||
| 142d25c0d7 | |||
| 4e6231a321 | |||
| 29d87a3743 | |||
| 9a2b06f35f | |||
| 4e2f3a289c | |||
| db70cd058a | |||
| b6cdf18165 | |||
| 7d710cbf8c | |||
| 654c4e3c06 | |||
| a3271b08b7 | |||
| b0de5970ce | |||
| db7f84f9f8 | |||
| 58140e1d3a | |||
| 315d9c308b | |||
| d13c0ee393 | |||
| 7740cac6dd | |||
| ead8e5e0c3 | |||
| 195de818b6 | |||
| 5c0113ce59 | |||
| db2341c842 | |||
| b7b87096d8 | |||
| 6a41b22a1b | |||
| 5696065727 | |||
| e9281843bf | |||
| 43184a271f | |||
| a7e1bc34de | |||
| 98c46f7eb0 | |||
| 3de0f042c6 | |||
| f115032095 | |||
| 0b628cb50e | |||
| 751775a04c | |||
| 177bb3c569 | |||
| 3cf8c629fa | |||
| 3947250daa | |||
| 96be211c88 | |||
| b00b8ae71b | |||
| 45f416c4f1 | |||
| c58149f5b6 | |||
| 579a6c9311 | |||
| 08e7a23121 | |||
| bf190fd3d8 | |||
| ea3a73b598 | |||
| 9989fb4bbc | |||
| 0524f4a540 | |||
| 43febd392c | |||
| dea894161a | |||
| 710f07049d | |||
| fe977c4288 | |||
| f5b9d86e42 | |||
| 9ab4802d07 | |||
| f0828ebbc0 | |||
| 84b1624b23 | |||
| 47da39a2ff | |||
| 7bec3b30b7 | |||
| ad5a62b62d | |||
| f080798000 | |||
| 6af81d649f | |||
| 5f3f8eeec6 | |||
| 9b4302bc2f | |||
| fa618a2bf7 | |||
| 6915025c7e | |||
| 5cf80c05a5 | |||
| 711afeb688 | |||
| 96165cd21d | |||
| 1a07f40c4b | |||
| eb5ea82bb1 | |||
| cd9ff08235 | |||
| 957713015a | |||
| a639772dfe | |||
| 6c85d97d6c | |||
| 7feb13671a | |||
| 3f066cca4a | |||
| c86d221ba5 | |||
| 5870dad639 | |||
| 53a70c6e77 | |||
| 45fecf0059 | |||
| a6e4b77273 | |||
| f932cc4073 | |||
| 6bf77166e1 | |||
| 6b9d0d5df5 | |||
| 9778322d99 | |||
| 6ff04ec91b | |||
| c7700fcd72 | |||
| 027b1d5cab | |||
| ce65a1c2a7 | |||
| 650b0c7c30 | |||
| 823b23f800 | |||
| b47db88ded | |||
| 20b92f50d9 | |||
| b401ad85d1 | |||
| e9df63119b | |||
| caa6c9b471 | |||
| bb8e43f16c | |||
| 2c71d08ea2 | |||
| 500f7901ac | |||
| 5fb716fc21 | |||
| 31ef970f23 | |||
| a770eaf500 | |||
| e171f3af41 | |||
| 1041284384 | |||
| 6555de6ef5 | |||
| b81e77cffa | |||
| a1741f21cc | |||
| 76a36f45bf | |||
| a767beec60 | |||
| 183bea3b98 | |||
| 6981cbb985 | |||
| fdfcc6c5ea | |||
| b86ecf7441 | |||
| 5107d1b69b | |||
| e133c8c2c3 | |||
| 450ab7c289 | |||
| 32bfb808ae | |||
| 1f19804cab | |||
| 9ff6003dfc | |||
| f725ea7d0d | |||
| 39d17a94c6 | |||
| 8153e5338f | |||
| 999caea021 | |||
| b70665865f | |||
| 6a9e0c52c3 | |||
| 44b3709d1d | |||
| b060165817 | |||
| 98fc073f89 | |||
| ba29f0ccd1 | |||
| 3473e19508 | |||
| 22bd7dcc42 | |||
| 79d09d02ed | |||
| a6313fa46c | |||
| 2a7431bd61 | |||
| 90851459c8 | |||
| 27c9bf137c | |||
| 2205790dd4 | |||
| 0115c2f70a | |||
| 7bce99d77b | |||
| 47b65868f4 | |||
| 8735a06f3c | |||
| d35fecbeea | |||
| 0e388639cc | |||
| 17e6ad1fe8 | |||
| a3f077c783 | |||
| 86b3229746 | |||
| 06b0e35fb9 | |||
| 6fbca1acfd | |||
| f0e36c6365 | |||
| e9cb7000cc | |||
| 0e8b0e414a | |||
| ec3114d6d8 | |||
| 60fc51ed22 | |||
| 603b775f4a | |||
| 964ce3d6aa | |||
| fb88e1c1c9 | |||
| 7081b89e97 | |||
| c6ab1aa227 | |||
| 8a509afc20 | |||
| 6a95e0877b | |||
| 28c37ab465 | |||
| 842edbcbe7 | |||
| 3e556c710b | |||
| 4289ffef1c | |||
| 0c051a83a7 | |||
| 82dedb1fbb | |||
| 04c0f309be | |||
| 8408d51359 | |||
| a8ada492b2 | |||
| 55d6ee65ae | |||
| 69ecf8aea7 | |||
| f2b51668b4 | |||
| c2527c9e1b | |||
| 0bcd45c1d4 | |||
| ecf0022fd1 | |||
| 4d4a70ad0e | |||
| 0f45a8c180 | |||
| ad3e740c09 | |||
| 7e6cc02e09 | |||
| 7000ef4471 | |||
| 0beda6fa89 | |||
| a41d2e43fd | |||
| c98158b460 | |||
| 02a53c582c | |||
| 192f4825a2 | |||
| bcce3acd5f | |||
| 8cd6b9275a | |||
| 5fa9dfac6a | |||
| fe51c7b960 | |||
| cf5346c263 | |||
| 776b3b5efa | |||
| 520524285a | |||
| ec8cb1668c | |||
| 1b7b59466d | |||
| e45e9c20dd | |||
| 450cb1771c | |||
| f7a3d45c2c | |||
| 65eb625843 | |||
| c06b957a8a | |||
| 05064dfaf4 | |||
| 425610b98a | |||
| 0d34b97948 | |||
| c6426245e4 | |||
| 6fe41870ab | |||
| 2d4e02f277 | |||
| 6d7d3fff6d | |||
| cc145eaf2e | |||
| da6d1d359c | |||
| 92ae57c9ee | |||
| 8409979dc5 | |||
| 8bc92a2cbb | |||
| 2de4c03faa | |||
| 382a7c94a2 | |||
| 1d7a00666e | |||
| 14c0289542 | |||
| 69ebdfd689 | |||
| fc21ece784 | |||
| a3ededdcf1 | |||
| 0178b20983 | |||
| f9142a1c56 | |||
| b19209c45c | |||
| 73b5b9d7b7 | |||
| 0a9d646bd7 | |||
| 24edfe2190 | |||
| 0bb8127372 | |||
| 1b8a69154f | |||
| f2155b49e2 | |||
| 62c9b99e72 | |||
| 2a344e1d87 | |||
| ae14aa991d | |||
| 2885c8a4ab | |||
| 3d411431c6 | |||
| 1800faf0dd | |||
| 19ded3809f | |||
| 40cd255051 | |||
| ad4677a67c | |||
| d9e0d016c6 | |||
| c570fd03d1 | |||
| 1e0565f17b | |||
| 3ff464641a | |||
| 7cb3d305d4 | |||
| e46dba43ad | |||
| afad96a52a | |||
| 1a00341e6b | |||
| 3388c8ed09 | |||
| 6d4967ffef | |||
| b27366e1e6 | |||
| 95a29b5d1d | |||
| d320867569 | |||
| aabd388070 | |||
| 7db6594358 | |||
| 388ca1c645 | |||
| 7c04b00e2b | |||
| dac0644f07 | |||
| 7d103fe0f0 | |||
| 901d9f3f6e | |||
| ddc9e74aa8 | |||
| 12690de9de | |||
| 6b30cdac09 | |||
| ccb7528a59 | |||
| 01ed8a07af | |||
| a9f399d6cc | |||
| a527a485f8 | |||
| f0c8f6d47b | |||
| a29dc3893f | |||
| c6f392bf6c | |||
| f2ded2fdb7 | |||
| 080737fd1f | |||
| 1040757556 | |||
| 38d612e5ba | |||
| c20aa2ad5f | |||
| a7c3753c5a | |||
| ebf72eb126 | |||
| be49a80bc7 | |||
| 23da770364 | |||
| 6186ac0245 | |||
| 364c33060b | |||
| 3922f76ab5 | |||
| bb2c9196f5 | |||
| 1c8d3e0dca | |||
| 6b556a5206 | |||
| bbd308a908 | |||
| b5b8f7c35a | |||
| de592267fe | |||
| 5bb89328d0 | |||
| 75fbb3d551 | |||
| eb0fb2fef7 | |||
| b1b92e95ab | |||
| 3a68b7ac0d | |||
| 3976018980 | |||
| 1dac708323 | |||
| d4187242b9 | |||
| 61c0d81667 | |||
| c3e4b6da46 | |||
| 38c7cf474d | |||
| ec4cbe5380 | |||
| 465ca97531 | |||
| 2f7a2d5134 | |||
| c1b5af21f0 | |||
| cfb788941c | |||
| 69435dd951 | |||
| 3b09a39576 | |||
| 53f81ce9c7 | |||
| e064380a7d | |||
| 9375e255e1 | |||
| a56fc57a83 | |||
| 4f75dc06b9 | |||
| d3b7a5146c | |||
| bc487f43f7 | |||
| 088ac71930 | |||
| 27cad422b9 | |||
| 5a63271f0e | |||
| 9a35684507 | |||
| 0d2714a1d9 | |||
| 553e4b28bf | |||
| b579e45ed7 | |||
| 1662bcfae4 | |||
| 8652b7d358 | |||
| 1cf8aacc11 | |||
| 13ef4c1236 | |||
| 68dd25a4a5 | |||
| bcb1c6c080 | |||
| 2372116acc | |||
| 508dd2b509 | |||
| 61b69eeed2 | |||
| dc8652806e | |||
| af6db7d895 | |||
| 64ec99be33 | |||
| 53e906d0f3 | |||
| 780a6a7b40 | |||
| 737fbf661a | |||
| c0243a92d0 | |||
| 3a8fcd1b0b | |||
| 04d9693b51 | |||
| 0023716053 | |||
| 37b46df738 | |||
| ba06198012 | |||
| acf9caa4ae | |||
| d69e345bc0 | |||
| c5b25fa132 | |||
| 262ecda2bf | |||
| f243539362 | |||
| ec33891f6f | |||
| f007188fa0 | |||
| 170fd813f0 | |||
| 4c59359cf7 | |||
| ddf25b7869 | |||
| 4914f3b2c3 | |||
| 08faed7d86 | |||
| 989e0f28d6 | |||
| 54f41095e9 | |||
| faaa72d398 | |||
| 97b36eb53c | |||
| 2503525016 | |||
| e96fedfefe | |||
| f279d8d6d1 | |||
| 4bfba20877 | |||
| 504bd93007 | |||
| 2f2fe72808 | |||
| 5babf47e70 | |||
| 78a588cacb | |||
| 205f8a6479 | |||
| 34c1e1a9ad | |||
| 0885884839 | |||
| c471120a80 | |||
| 3202cc7021 | |||
| fc34b3f144 | |||
| fb974a4551 | |||
| 3d99fea575 | |||
| feb04c64a8 | |||
| d3dbf9e83f | |||
| 9b6d7a5275 | |||
| 754fd03750 | |||
| adfa5d63bb | |||
| 81ff956a48 | |||
| daefe27fec | |||
| 6106ff8b31 | |||
| 1e6c180690 | |||
| d1a950d59f | |||
| 641fadc1fb | |||
| 5299061282 | |||
| d0c029c83e | |||
| 5aced2e44b | |||
| 18ab42dc83 | |||
| a748508bc9 | |||
| 8b453e6a3b | |||
| 3196ada481 | |||
| 7c4734c24d | |||
| 813f7b50c1 | |||
| 6532d2b650 | |||
| e0baad417a | |||
| f6759de1e9 | |||
| 7648171fe2 | |||
| 71c3264ea7 | |||
| 49455965c0 | |||
| 5f0467b084 | |||
| 6adcabda29 | |||
| 52b67b46fc | |||
| a700e3b39e | |||
| 4fbbdf8732 | |||
| 9a91fef337 | |||
| 53cc067c17 | |||
| d3183708e8 | |||
| 44771150b7 | |||
| ac2b2d82d2 | |||
| 11c42eb8d4 | |||
| dc0230c476 | |||
| 0a8c343e6e | |||
| afdbef1a81 | |||
| f659338e5e | |||
| 4a82d81efe | |||
| 6b4208be9b | |||
| 3d78c7f43a | |||
| 34df4509af | |||
| 6c3b2b938a | |||
| 59588b12c8 | |||
| 3eaa29e7c2 | |||
| c3c2bb7ad8 | |||
| 0e64c74a78 | |||
| d2dc57585c | |||
| e0fe7989e9 | |||
| 709305df0e | |||
| 24445123fc | |||
| 450a64b58b | |||
| b3a9c8d83f | |||
| 35c92723c7 | |||
| 719e7a9d56 | |||
| eed9e56bf4 | |||
| 1d214ed26a | |||
| 2d9d92b7d7 | |||
| 240cb2d627 | |||
| bd69466e94 | |||
| e6a7597444 | |||
| 1852b370d7 | |||
| 12fa7c41f6 | |||
| fc85ed8730 | |||
| 65f10ff840 | |||
| 6809d84a00 | |||
| 2752cd1390 | |||
| 10b56415e8 | |||
| bd87c80943 | |||
| f71e7ef1cc | |||
| 756ad17c2c | |||
| 29c1b20b41 | |||
| aa5097e0d4 | |||
| 2ccfee2e45 | |||
| bf1311b902 | |||
| 71efb3bc84 | |||
| 439bdde849 | |||
| c7fed20f3c | |||
| 3dd6e5664c | |||
| d4ee308ffd | |||
| a272f3e3b9 | |||
| f6027719d2 | |||
| 38402e78c0 | |||
| eae1ac6558 | |||
| 0b019401bd | |||
| 73cda2324a | |||
| 3dba894369 | |||
| 659ee81e80 | |||
| 99c307a68e | |||
| d28eea342a | |||
| 29078bc428 | |||
| 6bcb5ae66b | |||
| cf1e68fb0e | |||
| 43288a6760 | |||
| 9ee7d04560 | |||
| 16bf215d8a | |||
| 99ed77da8c | |||
| b9f733c401 | |||
| 18966d424c | |||
| c725b886e1 | |||
| 9b7eaf5117 | |||
| 36a55660bf | |||
| 0946e5945f | |||
| 8ec1a5627d |
@@ -3,13 +3,13 @@
|
||||
# Pull all the submodules except llvm
|
||||
# Note: Tried to use git submodule status, but it takes over 20 seconds
|
||||
# shellcheck disable=SC2046
|
||||
git submodule -q update --init --depth 1 $(awk '/path/ && !/llvm/ { print $3 }' .gitmodules)
|
||||
git submodule -q update --init --depth 1 $(awk '/path/ && !/llvm/ && !/SPIRV/ { print $3 }' .gitmodules)
|
||||
|
||||
# Prefer newer Clang than in base system (see also .ci/install-freebsd.sh)
|
||||
# libc++ isn't in llvm* packages, so download manually
|
||||
fetch https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.6/llvm-project-15.0.6.src.tar.xz
|
||||
fetch https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.1/llvm-project-16.0.1.src.tar.xz
|
||||
tar xf llvm*.tar.xz
|
||||
export CC=clang15 CXX=clang++15
|
||||
export CC=clang16 CXX=clang++16
|
||||
cmake -B libcxx_build -G Ninja -S llvm*/libcxx \
|
||||
-DLLVM_CCACHE_BUILD=ON \
|
||||
-DLIBCXX_INCLUDE_BENCHMARKS=OFF \
|
||||
@@ -20,7 +20,7 @@ export CXXFLAGS="$CXXFLAGS -nostdinc++ -isystem$PWD/libcxx_prefix/include/c++/v1
|
||||
export LDFLAGS="$LDFLAGS -nostdlib++ -L$PWD/libcxx_prefix/lib -l:libc++.a -lcxxrt"
|
||||
|
||||
CONFIGURE_ARGS="
|
||||
-DWITH_LLVM=OFF
|
||||
-DWITH_LLVM=ON
|
||||
-DUSE_SDL=OFF
|
||||
-DUSE_PRECOMPILED_HEADERS=OFF
|
||||
-DUSE_NATIVE_INSTRUCTIONS=OFF
|
||||
|
||||
+5
-10
@@ -9,15 +9,10 @@ if [ -z "$CIRRUS_CI" ]; then
|
||||
cd rpcs3 || exit 1
|
||||
fi
|
||||
|
||||
# Pull all the submodules except llvm, since it is built separately and we just download that build
|
||||
# Pull all the submodules except llvm
|
||||
# Note: Tried to use git submodule status, but it takes over 20 seconds
|
||||
# shellcheck disable=SC2046
|
||||
git submodule -q update --init $(awk '/path/ && !/llvm/ { print $3 }' .gitmodules)
|
||||
|
||||
# Download pre-compiled llvm libs
|
||||
curl -sLO https://github.com/RPCS3/llvm-mirror/releases/download/custom-build/llvmlibs-linux.tar.gz
|
||||
mkdir llvmlibs
|
||||
tar -xzf ./llvmlibs-linux.tar.gz -C llvmlibs
|
||||
git submodule -q update --init $(awk '/path/ && !/llvm/ && !/SPIRV/ { print $3 }' .gitmodules)
|
||||
|
||||
mkdir build && cd build || exit 1
|
||||
|
||||
@@ -42,8 +37,6 @@ export CFLAGS="$CFLAGS -fuse-ld=${LINKER}"
|
||||
|
||||
cmake .. \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-DBUILD_LLVM_SUBMODULE=OFF \
|
||||
-DLLVM_DIR=llvmlibs/lib/cmake/llvm/ \
|
||||
-DUSE_NATIVE_INSTRUCTIONS=OFF \
|
||||
-DUSE_PRECOMPILED_HEADERS=OFF \
|
||||
-DCMAKE_C_FLAGS="$CFLAGS" \
|
||||
@@ -51,8 +44,10 @@ cmake .. \
|
||||
-DCMAKE_AR="$AR" \
|
||||
-DCMAKE_RANLIB="$RANLIB" \
|
||||
-DUSE_SYSTEM_CURL=ON \
|
||||
-DUSE_SDL=OFF \
|
||||
-DUSE_SDL=ON \
|
||||
-DOpenGL_GL_PREFERENCE=LEGACY \
|
||||
-DLLVM_DIR=/opt/llvm/lib/cmake/llvm \
|
||||
-DSTATIC_LINK_LLVM=ON \
|
||||
-G Ninja
|
||||
|
||||
ninja; build_status=$?;
|
||||
|
||||
+42
-11
@@ -1,15 +1,44 @@
|
||||
#!/bin/sh -ex
|
||||
|
||||
brew update
|
||||
brew install llvm@13 sdl2 nasm qt@5 ninja cmake glew git p7zip create-dmg ccache
|
||||
brew install -f --overwrite nasm ninja git p7zip create-dmg ccache pipenv
|
||||
|
||||
export MACOSX_DEPLOYMENT_TARGET=11.6
|
||||
#/usr/sbin/softwareupdate --install-rosetta --agree-to-license
|
||||
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||
arch -x86_64 /usr/local/homebrew/bin/brew update
|
||||
arch -x86_64 /usr/local/homebrew/bin/brew install -f --overwrite llvm@16 sdl2 glew cmake
|
||||
arch -x86_64 /usr/local/homebrew/bin/brew link -f llvm@16
|
||||
|
||||
#export MACOSX_DEPLOYMENT_TARGET=12.0
|
||||
export CXX=clang++
|
||||
export CC=clang
|
||||
export Qt5_DIR="/usr/local/opt/qt@5/lib/cmake/Qt5"
|
||||
export PATH="/usr/local/opt/llvm@13/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Apple/usr/bin"
|
||||
export LDFLAGS="-L/usr/local/opt/llvm@13/lib -Wl,-rpath,/usr/local/opt/llvm@13/lib"
|
||||
export CPPFLAGS="-I/usr/local/opt/llvm@13/include -msse -msse2 -mcx16 -no-pie"
|
||||
|
||||
export BREW_PATH;
|
||||
BREW_PATH="$(brew --prefix)"
|
||||
export BREW_X64_PATH;
|
||||
BREW_X64_PATH="$("/usr/local/homebrew/bin/brew" --prefix)"
|
||||
export BREW_BIN="/usr/local/bin"
|
||||
export BREW_SBIN="/usr/local/sbin"
|
||||
export CMAKE_EXTRA_OPTS='-DLLVM_TARGETS_TO_BUILD=X86'
|
||||
|
||||
export WORKDIR;
|
||||
WORKDIR="$(pwd)"
|
||||
|
||||
# Get Qt
|
||||
git clone https://github.com/engnr/qt-downloader.git
|
||||
cd qt-downloader
|
||||
git checkout f52efee0f18668c6d6de2dec0234b8c4bc54c597
|
||||
"/opt/homebrew/bin/pipenv" run pip3 install py7zr requests semantic_version lxml
|
||||
"/opt/homebrew/bin/pipenv" run ./qt-downloader macos desktop 5.15.2 clang_64 --opensource
|
||||
cd ..
|
||||
|
||||
export Qt5_DIR="$WORKDIR/qt-downloader/5.15.2/clang_64/lib/cmake/Qt5"
|
||||
export SDL2_DIR="$BREW_X64_PATH/opt/sdl2/lib/cmake/SDL2"
|
||||
|
||||
export PATH="$BREW_X64_PATH/opt/llvm@16/bin:$WORKDIR/qt-downloader/5.15.2/clang_64/bin:$BREW_BIN:$BREW_SBIN:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Apple/usr/bin:$PATH"
|
||||
export LDFLAGS="-L$BREW_X64_PATH/lib -Wl,-rpath,$BREW_X64_PATH/lib"
|
||||
export CPPFLAGS="-I$BREW_X64_PATH/include -msse -msse2 -mcx16 -no-pie"
|
||||
export LIBRARY_PATH="$BREW_X64_PATH/lib"
|
||||
export LD_LIBRARY_PATH="$BREW_X64_PATH/lib"
|
||||
|
||||
git submodule update --init --recursive --depth 1
|
||||
|
||||
@@ -18,16 +47,18 @@ sed -i '' "s/extern const double NSAppKitVersionNumber;/const double NSAppKitVer
|
||||
|
||||
mkdir build && cd build || exit 1
|
||||
|
||||
cmake .. \
|
||||
"$BREW_X64_PATH/bin/cmake" .. \
|
||||
-DUSE_SDL=ON -DUSE_DISCORD_RPC=OFF -DUSE_VULKAN=ON -DUSE_ALSA=OFF -DUSE_PULSE=OFF -DUSE_AUDIOUNIT=ON \
|
||||
-DLLVM_CCACHE_BUILD=OFF -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF \
|
||||
-DLLVM_CCACHE_BUILD=OFF -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF \
|
||||
-DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_TOOLS=OFF \
|
||||
-DLLVM_INCLUDE_UTILS=OFF -DLLVM_USE_PERF=OFF -DLLVM_ENABLE_Z3_SOLVER=OFF \
|
||||
-DUSE_NATIVE_INSTRUCTIONS=OFF \
|
||||
-DUSE_SYSTEM_MVK=OFF \
|
||||
$CMAKE_EXTRA_OPTS \
|
||||
-DLLVM_TARGET_ARCH=X86_64 -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_IGNORE_PATH="$BREW_PATH/lib" \
|
||||
-G Ninja
|
||||
|
||||
ninja; build_status=$?;
|
||||
"$BREW_PATH/bin/ninja"; build_status=$?;
|
||||
|
||||
cd ..
|
||||
|
||||
@@ -36,4 +67,4 @@ cd ..
|
||||
|
||||
if [ "$build_status" -eq 0 ] && [ "$SHOULD_DEPLOY" = "true" ]; then
|
||||
.ci/deploy-mac.sh
|
||||
fi
|
||||
fi
|
||||
|
||||
+15
-37
@@ -3,44 +3,27 @@
|
||||
cd build || exit 1
|
||||
|
||||
if [ "$DEPLOY_APPIMAGE" = "true" ]; then
|
||||
DESTDIR=appdir ninja install
|
||||
QT_APPIMAGE="linuxdeployqt.AppImage"
|
||||
DESTDIR=AppDir ninja install
|
||||
|
||||
curl -sL "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" > "$QT_APPIMAGE"
|
||||
chmod a+x "$QT_APPIMAGE"
|
||||
"./$QT_APPIMAGE" --appimage-extract
|
||||
./squashfs-root/AppRun ./appdir/usr/share/applications/*.desktop -bundle-non-qt-libs
|
||||
ls ./appdir/usr/lib/
|
||||
rm -r ./appdir/usr/share/doc
|
||||
cp "$(readlink -f /lib/x86_64-linux-gnu/libnsl.so.1)" ./appdir/usr/lib/libnsl.so.1
|
||||
export PATH=/rpcs3/build/squashfs-root/usr/bin/:"${PATH}"
|
||||
curl -sL -o /usr/bin/linuxdeploy https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
|
||||
chmod +x /usr/bin/linuxdeploy
|
||||
curl -sL -o /usr/bin/linuxdeploy-plugin-qt https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage
|
||||
chmod +x /usr/bin/linuxdeploy-plugin-qt
|
||||
curl -sL -o linuxdeploy-plugin-checkrt.sh https://github.com/linuxdeploy/linuxdeploy-plugin-checkrt/releases/download/continuous/linuxdeploy-plugin-checkrt-x86_64.sh
|
||||
chmod +x ./linuxdeploy-plugin-checkrt.sh
|
||||
|
||||
EXTRA_QT_PLUGINS="svg;" APPIMAGE_EXTRACT_AND_RUN=1 linuxdeploy --appdir AppDir --plugin qt
|
||||
|
||||
# Embed newer libstdc++ for distros that don't come with it (ubuntu 16.04)
|
||||
mkdir -p appdir/usr/optional/ ; mkdir -p appdir/usr/optional/libstdc++/
|
||||
cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6 ./appdir/usr/optional/libstdc++/
|
||||
|
||||
# Remove libwayland-client because it has platform-dependent exports and breaks other OSes
|
||||
rm -f ./appdir/usr/lib/libwayland-client.so*
|
||||
|
||||
# Install latest appimage runner
|
||||
rm ./appdir/AppRun
|
||||
curl -sL https://github.com/RPCS3/AppImageKit-checkrt/releases/download/continuous2/AppRun-patched-x86_64 -o ./appdir/AppRun
|
||||
chmod a+x ./appdir/AppRun
|
||||
curl -sL https://github.com/RPCS3/AppImageKit-checkrt/releases/download/continuous2/exec-x86_64.so -o ./appdir/usr/optional/exec.so
|
||||
rm -f ./AppDir/usr/lib/libwayland-client.so*
|
||||
|
||||
# Compile checker binary for AppImageKit-checkrt
|
||||
# Remove git directory containing local commit history file
|
||||
rm -rf ./AppDir/usr/share/rpcs3/git
|
||||
|
||||
# This may need updating if you update the compiler or rpcs3 uses newer c++ features
|
||||
# See https://github.com/gcc-mirror/gcc/blob/master/libstdc%2B%2B-v3/config/abi/pre/gnu.ver
|
||||
# for which definitions correlate to which CXXABI version.
|
||||
# Currently we target a minimum of GLIBCXX_3.4.29 and CXXABI_1.3.11
|
||||
printf "#include <sstream>\n#include <exception>\n#include <memory_resource>\nint main(){auto x = std::stringbuf();x.get_allocator();std::make_exception_ptr(0);std::pmr::get_default_resource();}" \
|
||||
| $CXX -x c++ -std=c++2a -o ./appdir/usr/optional/checker -
|
||||
./linuxdeploy-plugin-checkrt.sh --appdir AppDir
|
||||
|
||||
# Package it up and send it off
|
||||
./squashfs-root/usr/bin/appimagetool "$APPDIR"
|
||||
|
||||
ls
|
||||
linuxdeploy --appimage-extract
|
||||
./squashfs-root/plugins/linuxdeploy-plugin-appimage/usr/bin/appimagetool AppDir -g
|
||||
|
||||
COMM_TAG=$(awk '/version{.*}/ { printf("%d.%d.%d", $5, $6, $7) }' ../rpcs3/rpcs3_version.cpp)
|
||||
COMM_COUNT="$(git rev-list --count HEAD)"
|
||||
@@ -57,9 +40,4 @@ if [ "$DEPLOY_APPIMAGE" = "true" ]; then
|
||||
FILESIZE=$(stat -c %s ./rpcs3*.AppImage)
|
||||
SHA256SUM=$(sha256sum ./rpcs3*.AppImage | awk '{ print $1 }')
|
||||
echo "${SHA256SUM};${FILESIZE}B" > "$RELEASE_MESSAGE"
|
||||
|
||||
fi
|
||||
|
||||
if [ "$DEPLOY_PPA" = "true" ]; then
|
||||
export DEBFULLNAME="RPCS3 Build Bot"
|
||||
fi
|
||||
|
||||
+7
-4
@@ -14,14 +14,17 @@ echo "AVVER=$AVVER" >> ../.ci/ci-vars.env
|
||||
|
||||
cd bin
|
||||
mkdir "rpcs3.app/Contents/lib/"
|
||||
cp "/usr/local/opt/llvm@13/lib/c++/libc++abi.1.0.dylib" "rpcs3.app/Contents/lib/libc++abi.1.dylib"
|
||||
|
||||
cp "/usr/local/Homebrew/opt/llvm@16/lib/c++/libc++abi.1.0.dylib" "rpcs3.app/Contents/lib/libc++abi.1.dylib"
|
||||
|
||||
rm -rf "rpcs3.app/Contents/Frameworks/QtPdf.framework" \
|
||||
"rpcs3.app/Contents/Frameworks/QtQml.framework" \
|
||||
"rpcs3.app/Contents/Frameworks/QtQmlModels.framework" \
|
||||
"rpcs3.app/Contents/Frameworks/QtQuick.framework" \
|
||||
"rpcs3.app/Contents/Frameworks/QtVirtualKeyboard.framework" \
|
||||
"rpcs3.app/Contents/Plugins/platforminputcontexts" \
|
||||
"rpcs3.app/Contents/Plugins/virtualkeyboard"
|
||||
"rpcs3.app/Contents/Plugins/virtualkeyboard" \
|
||||
"rpcs3.app/Contents/Resources/git"
|
||||
|
||||
# Need to do this rename hack due to case insensitive filesystem
|
||||
mv rpcs3.app RPCS3_.app
|
||||
@@ -33,7 +36,7 @@ echo "IconIndex=0" >> Quickstart.url
|
||||
|
||||
DMG_FILEPATH="$BUILD_ARTIFACTSTAGINGDIRECTORY/rpcs3-v${COMM_TAG}-${COMM_COUNT}-${COMM_HASH}_macos.dmg"
|
||||
|
||||
create-dmg --volname RPCS3 \
|
||||
/opt/homebrew/bin/create-dmg --volname RPCS3 \
|
||||
--window-size 800 400 \
|
||||
--icon-size 100 \
|
||||
--icon rpcs3.app 200 190 \
|
||||
@@ -45,7 +48,7 @@ create-dmg --volname RPCS3 \
|
||||
"$DMG_FILEPATH" \
|
||||
RPCS3.app
|
||||
|
||||
7z a -mx9 rpcs3-v"${COMM_TAG}"-"${COMM_COUNT}"-"${COMM_HASH}"_macos.7z RPCS3.app
|
||||
/opt/homebrew/bin/7z a -mx9 rpcs3-v"${COMM_TAG}"-"${COMM_COUNT}"-"${COMM_HASH}"_macos.7z RPCS3.app
|
||||
|
||||
FILESIZE=$(stat -f %z "$DMG_FILEPATH")
|
||||
SHA256SUM=$(shasum -a 256 "$DMG_FILEPATH" | awk '{ print $1 }')
|
||||
|
||||
@@ -5,6 +5,7 @@ ARTIFACT_DIR="$BUILD_ARTIFACTSTAGINGDIRECTORY"
|
||||
|
||||
# Remove unecessary files
|
||||
rm -f ./bin/rpcs3.exp ./bin/rpcs3.lib ./bin/rpcs3.pdb ./bin/vc_redist.x64.exe
|
||||
rm -rf ./bin/git
|
||||
|
||||
# Prepare compatibility database for packaging, as well as
|
||||
# certificate for ssl (auto-updater)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh -ex
|
||||
|
||||
curl -L -o "./llvm.lock" "https://github.com/RPCS3/llvm-mirror/releases/download/custom-build-win/llvmlibs_mt.7z.sha256"
|
||||
curl -L -o "./llvm.lock" "https://github.com/RPCS3/llvm-mirror/releases/download/custom-build-win-16.0.1/llvmlibs_mt.7z.sha256"
|
||||
curl -L -o "./glslang.lock" "https://github.com/RPCS3/glslang/releases/download/custom-build-win/glslanglibs_mt.7z.sha256"
|
||||
|
||||
@@ -9,7 +9,7 @@ export ASSUME_ALWAYS_YES=true
|
||||
pkg info # debug
|
||||
|
||||
# Prefer newer Clang than in base system (see also .ci/build-freebsd.sh)
|
||||
pkg install llvm15
|
||||
pkg install llvm16
|
||||
|
||||
# Mandatory dependencies (qt5-dbus and qt5-gui are pulled via qt5-widgets)
|
||||
pkg install git ccache cmake ninja qt5-qmake qt5-buildtools qt5-widgets qt5-concurrent qt5-multimedia qt5-svg glew openal-soft ffmpeg
|
||||
|
||||
@@ -19,7 +19,7 @@ QT_DECL_URL="${QT_HOST}${QT_PREFIX}qtdeclarative${QT_SUFFIX}"
|
||||
QT_TOOL_URL="${QT_HOST}${QT_PREFIX}qttools${QT_SUFFIX}"
|
||||
QT_MM_URL="${QT_HOST}${QT_PREFIX}qtmultimedia${QT_SUFFIX}"
|
||||
QT_SVG_URL="${QT_HOST}${QT_PREFIX}qtsvg${QT_SUFFIX}"
|
||||
LLVMLIBS_URL='https://github.com/RPCS3/llvm-mirror/releases/download/custom-build-win/llvmlibs_mt.7z'
|
||||
LLVMLIBS_URL='https://github.com/RPCS3/llvm-mirror/releases/download/custom-build-win-16.0.1/llvmlibs_mt.7z'
|
||||
GLSLANG_URL='https://github.com/RPCS3/glslang/releases/download/custom-build-win/glslanglibs_mt.7z'
|
||||
VULKAN_SDK_URL="https://www.dropbox.com/s/cs77c3iv5mbo0bt/VulkanSDK-${VULKAN_VER}-Installer.exe"
|
||||
|
||||
@@ -40,7 +40,7 @@ DEP_URLS=" \
|
||||
# Pull all the submodules except llvm, since it is built separately and we just download that build
|
||||
# Note: Tried to use git submodule status, but it takes over 20 seconds
|
||||
# shellcheck disable=SC2046
|
||||
git submodule -q update --init --depth=1 --jobs=8 $(awk '/path/ && !/llvm/ { print $3 }' .gitmodules)
|
||||
git submodule -q update --init --depth=1 --jobs=8 $(awk '/path/ && !/llvm/ && !/SPIRV/ { print $3 }' .gitmodules)
|
||||
|
||||
# Git bash doesn't have rev, so here it is
|
||||
rev()
|
||||
@@ -79,7 +79,7 @@ for url in $DEP_URLS; do
|
||||
# shellcheck disable=SC1003
|
||||
case "$url" in
|
||||
*qt*) checksum=$(curl -L "${url}.sha1"); algo="sha1"; outDir='C:\Qt\' ;;
|
||||
*llvm*) checksum=$(curl -L "${url}.sha256"); algo="sha256"; outDir="." ;;
|
||||
*llvm*) checksum=$(curl -L "${url}.sha256"); algo="sha256"; outDir="./3rdparty/llvm" ;;
|
||||
*glslang*) checksum=$(curl -L "${url}.sha256"); algo="sha256"; outDir="./lib/Release-x64" ;;
|
||||
*Vulkan*)
|
||||
# Vulkan setup needs to be run in batch environment
|
||||
|
||||
+7
-5
@@ -61,7 +61,7 @@ windows_task:
|
||||
|
||||
linux_task:
|
||||
container:
|
||||
image: rpcs3/rpcs3-ci-bionic:1.6
|
||||
image: rpcs3/rpcs3-ci-bionic:1.8
|
||||
cpu: 4
|
||||
memory: 16G
|
||||
env:
|
||||
@@ -120,15 +120,17 @@ freebsd_task:
|
||||
script: "./.ci/build-freebsd.sh"
|
||||
|
||||
macos_task:
|
||||
timeout_in: 120m
|
||||
timeout_in: 12000m
|
||||
ccache_cache:
|
||||
folder: /tmp/ccache_dir
|
||||
matrix:
|
||||
- name: Cirrus macOS
|
||||
osx_instance:
|
||||
image: monterey-xcode-13.3
|
||||
macos_instance:
|
||||
image: ghcr.io/cirruslabs/macos-monterey-xcode:14
|
||||
mac_script:
|
||||
- mkdir artifacts
|
||||
- chmod +x ".ci/build-mac.sh"
|
||||
- chmod +x ".ci/deploy-mac.sh"
|
||||
- ".ci/build-mac.sh"
|
||||
env:
|
||||
BUILD_ARTIFACTSTAGINGDIRECTORY: ${CIRRUS_WORKING_DIR}/artifacts
|
||||
@@ -141,7 +143,7 @@ macos_task:
|
||||
RELEASE_MESSAGE: "../GitHubReleaseMessage.txt"
|
||||
artifacts:
|
||||
name: Artifact
|
||||
path: "artifacts/rpcs3-*_macos.*"
|
||||
path: "artifacts/*"
|
||||
push_script: |
|
||||
if [ "$CIRRUS_REPO_OWNER" = "RPCS3" ] && [ -z "$CIRRUS_PR" ] && [ "$CIRRUS_BRANCH" = "master" ]; then
|
||||
source './.ci/export-cirrus-vars.sh'
|
||||
|
||||
@@ -29,8 +29,8 @@ body:
|
||||
Please provide the _exact_ build (or commit) information that introduced the regression you're reporting.
|
||||
* Please see [How to find the build that caused a regression](https://wiki.rpcs3.net/index.php?title=Help:Using_different_versions_of_RPCS3#How_to_find_the_build_that_caused_a_regression.3F) in our wiki.
|
||||
* You can find [History of RPCS3 builds](https://rpcs3.net/compatibility?b) here.
|
||||
|
||||
Make sure you're running with settings as close to default as possible
|
||||
|
||||
Make sure you're running with settings as close to default as possible
|
||||
* **Do NOT enable any emulator game patches when reporting issues**
|
||||
* Only change settings that are required for the game to work
|
||||
- type: input
|
||||
@@ -48,7 +48,7 @@ body:
|
||||
Obtaining the log file:
|
||||
* Run the game until you find the regression.
|
||||
* Completely close RPCS3 and locate the log file.
|
||||
|
||||
|
||||
RPCS3's Log file will be ```RPCS3.log.gz``` (sometimes shows as RPCS3.log with zip icon) or ```RPCS3.log``` (sometimes shows as RPCS3 wtih notepad icon).
|
||||
* On Windows it will be in the RPCS3 directory near the executable
|
||||
* On Linux it will be in ```~/.cache/rpcs3/```
|
||||
@@ -70,21 +70,21 @@ body:
|
||||
* To create an RSX capture, use _Create_ _RSX_ _Capture_ under _Utilities_.
|
||||
* Captures will be stored in RPCS3 folder → captures.
|
||||
* To create a RenderDoc capture, please refer to [RenderDoc's documentation](https://renderdoc.org/docs/how/how_capture_frame.html).
|
||||
- type: textarea
|
||||
- type: textarea
|
||||
id: captures
|
||||
attributes:
|
||||
label: Attach capture files for visual issues
|
||||
description: Compress your capture with 7z, Rar etc. and attach it here, or upload it to the cloud (Dropbox, Mega etc) and add a link to it.
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
- type: textarea
|
||||
id: system-info
|
||||
attributes:
|
||||
label: System configuration
|
||||
description: Provide information about your system, such as operating system, CPU and GPU model, GPU driver version and other information that describes your system configuration.
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
- type: textarea
|
||||
id: other-details
|
||||
attributes:
|
||||
label: Other details
|
||||
|
||||
@@ -28,13 +28,13 @@ body:
|
||||
attributes:
|
||||
value: |
|
||||
# Log files
|
||||
|
||||
|
||||
Provide a log file that includes the bug you're reporting.
|
||||
|
||||
|
||||
Obtaining the log file:
|
||||
* Run the game until you find the regression.
|
||||
* Completely close RPCS3 and locate the log file.
|
||||
|
||||
|
||||
RPCS3's Log file will be ```RPCS3.log.gz``` (sometimes shows as RPCS3.log with zip icon) or ```RPCS3.log``` (sometimes shows as RPCS3 wtih notepad icon).
|
||||
* On Windows it will be in the RPCS3 directory near the executable
|
||||
* On Linux it will be in ```~/.cache/rpcs3/```
|
||||
@@ -55,21 +55,21 @@ body:
|
||||
* To create an RSX capture, use _Create_ _RSX_ _Capture_ under _Utilities_.
|
||||
* Captures will be stored in RPCS3 folder → captures.
|
||||
* To create a RenderDoc capture, please refer to [RenderDoc's documentation](https://renderdoc.org/docs/how/how_capture_frame.html).
|
||||
- type: textarea
|
||||
- type: textarea
|
||||
id: captures
|
||||
attributes:
|
||||
label: Attach capture files for visual issues
|
||||
description: Compress your capture with 7z, Rar etc. and attach it here, or upload it to the cloud (Dropbox, Mega etc) and add a link to it.
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
- type: textarea
|
||||
id: system-info
|
||||
attributes:
|
||||
label: System configuration
|
||||
description: Provide information about your system, such as operating system, CPU and GPU model, GPU driver version and other information that describes your system configuration.
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
- type: textarea
|
||||
id: other-details
|
||||
attributes:
|
||||
label: Other details
|
||||
|
||||
@@ -29,7 +29,7 @@ body:
|
||||
* Why your feature is important to RPCS3.
|
||||
* If the feature is implemented in other projects, attach screenshots.
|
||||
* If this feature is something that a game is trying to use, upload a log file for it.
|
||||
|
||||
|
||||
RPCS3's Log file will be ```RPCS3.log.gz``` (sometimes shows as RPCS3.log with zip icon) or ```RPCS3.log``` (sometimes shows as RPCS3 wtih notepad icon).
|
||||
* On Windows it will be in the RPCS3 directory near the executable
|
||||
* On Linux it will be in ```~/.cache/rpcs3/```
|
||||
|
||||
+10
-1
@@ -36,7 +36,6 @@
|
||||
/ipch
|
||||
/rpcs3/Debug
|
||||
/rpcs3/Release
|
||||
/llvm_build
|
||||
|
||||
!/bin
|
||||
/bin/*
|
||||
@@ -104,6 +103,7 @@ rpcs3/rpcs3_autogen/*
|
||||
|
||||
# QtCreator
|
||||
CMakeLists.txt.user
|
||||
*.autosave
|
||||
|
||||
# CLion
|
||||
/.idea/*
|
||||
@@ -122,6 +122,15 @@ yaml-cpp.pc
|
||||
/3rdparty/libusb_cmake/config.h
|
||||
/3rdparty/libusb_cmake/libusb-1.0.pc
|
||||
|
||||
# miniupnp
|
||||
/3rdparty/miniupnp/x64/*
|
||||
|
||||
# llvm
|
||||
/3rdparty/llvm/llvm_build
|
||||
|
||||
# legacy llvm
|
||||
/llvm_build
|
||||
|
||||
# ssl certificate
|
||||
cacert.pem
|
||||
|
||||
|
||||
+11
-4
@@ -7,9 +7,9 @@
|
||||
url = ../../RPCS3/asmjit.git
|
||||
branch = aarch64
|
||||
ignore = dirty
|
||||
[submodule "llvm"]
|
||||
path = llvm
|
||||
url = ../../RPCS3/llvm-mirror.git
|
||||
[submodule "3rdparty/llvm/llvm"]
|
||||
path = 3rdparty/llvm/llvm
|
||||
url = ../../llvm/llvm-project.git
|
||||
ignore = dirty
|
||||
[submodule "3rdparty/glslang"]
|
||||
path = 3rdparty/glslang/glslang
|
||||
@@ -78,5 +78,12 @@
|
||||
ignore = dirty
|
||||
[submodule "3rdparty/libsdl-org/SDL"]
|
||||
path = 3rdparty/libsdl-org/SDL
|
||||
url = https://github.com/libsdl-org/SDL.git
|
||||
url = ../../libsdl-org/SDL.git
|
||||
ignore = dirty
|
||||
[submodule "3rdparty/miniupnp/miniupnp"]
|
||||
path = 3rdparty/miniupnp/miniupnp
|
||||
url = ../../miniupnp/miniupnp.git
|
||||
ignore = dirty
|
||||
[submodule "3rdparty/rtmidi/rtmidi"]
|
||||
path = 3rdparty/rtmidi/rtmidi
|
||||
url = ../../thestk/rtmidi
|
||||
|
||||
Vendored
+29
-12
@@ -78,7 +78,7 @@ add_subdirectory(hidapi)
|
||||
|
||||
# Vulkan
|
||||
add_subdirectory(glslang EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(SPIRV EXCLUDE_FROM_ALL)
|
||||
#add_subdirectory(SPIRV EXCLUDE_FROM_ALL)
|
||||
|
||||
|
||||
# yaml-cpp
|
||||
@@ -142,7 +142,7 @@ add_subdirectory(SoundTouch EXCLUDE_FROM_ALL)
|
||||
# libevdev
|
||||
set(LIBEVDEV_TARGET 3rdparty_dummy_lib)
|
||||
if(USE_LIBEVDEV)
|
||||
pkg_check_modules(LIBEVDEV libevdev)
|
||||
pkg_check_modules(LIBEVDEV libevdev libudev)
|
||||
if(LIBEVDEV_FOUND)
|
||||
add_library(3rdparty_libevdev INTERFACE)
|
||||
target_compile_definitions(3rdparty_libevdev INTERFACE -DHAVE_LIBEVDEV)
|
||||
@@ -189,7 +189,7 @@ if(USE_VULKAN)
|
||||
if(VULKAN_FOUND)
|
||||
add_library(3rdparty_vulkan INTERFACE)
|
||||
target_compile_definitions(3rdparty_vulkan INTERFACE -DHAVE_VULKAN)
|
||||
target_link_libraries(3rdparty_vulkan INTERFACE SPIRV SPIRV-Tools-opt Vulkan::Vulkan)
|
||||
target_link_libraries(3rdparty_vulkan INTERFACE SPIRV Vulkan::Vulkan)
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
find_package(Wayland)
|
||||
@@ -222,21 +222,28 @@ set(FAUDIO_TARGET 3rdparty_dummy_lib)
|
||||
if(USE_FAUDIO)
|
||||
# FAudio depends on SDL2
|
||||
find_package(SDL2)
|
||||
if (NOT SDL2_FOUND OR SDL2_VERSION VERSION_LESS 2.0.12)
|
||||
message(WARNING
|
||||
"-- RPCS3: FAudio requires SDL 2.0.9 or newer. Please note, this warning"
|
||||
"can also be displayed with SDL2 versions between 2.0.9-2.0.12, as the"
|
||||
"CMake config files are not correctly installed. Since a valid SDL2"
|
||||
">=2.0.9 version cannot be found, building with FAudio will be skipped.")
|
||||
set(USE_FAUDIO False)
|
||||
else()
|
||||
if (USE_SYSTEM_FAUDIO)
|
||||
if (USE_SYSTEM_FAUDIO)
|
||||
if (NOT SDL2_FOUND OR SDL2_VERSION VERSION_LESS 2.0.12)
|
||||
message(WARNING
|
||||
"-- RPCS3: System FAudio requires SDL 2.0.9 or newer. Please note, this warning"
|
||||
"can also be displayed with SDL2 versions between 2.0.9-2.0.12, as the"
|
||||
"CMake config files are not correctly installed. Since a valid SDL2"
|
||||
">=2.0.9 version cannot be found, building with FAudio will be skipped.")
|
||||
set(USE_FAUDIO OFF CACHE BOOL "Disabled using system FAudio with SDL < 2.0.12" FORCE)
|
||||
else()
|
||||
message(STATUS "RPCS3: Using system FAudio")
|
||||
find_package(FAudio REQUIRED CONFIGS FAudioConfig.cmake FAudio-config.cmake)
|
||||
add_library(3rdparty_FAudio INTERFACE)
|
||||
target_link_libraries(3rdparty_FAudio INTERFACE FAudio)
|
||||
target_compile_definitions(3rdparty_FAudio INTERFACE -DHAVE_FAUDIO)
|
||||
set(FAUDIO_TARGET 3rdparty_FAudio)
|
||||
endif()
|
||||
else()
|
||||
if (NOT SDL2_FOUND OR SDL2_VERSION VERSION_LESS 2.24.0)
|
||||
message(WARNING
|
||||
"-- RPCS3: 3rdparty FAudio requires SDL 2.24.0 or newer. Since a valid SDL2"
|
||||
">=2.24.0 version cannot be found, building with FAudio will be skipped.")
|
||||
set(USE_FAUDIO OFF CACHE BOOL "Disabled FAudio with SDL < 2.24.0" FORCE)
|
||||
else()
|
||||
message(STATUS "RPCS3: Using builtin FAudio")
|
||||
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared library")
|
||||
@@ -338,6 +345,8 @@ if(USE_SDL)
|
||||
message(STATUS "Using system SDL2")
|
||||
add_library(3rdparty_sdl2 INTERFACE)
|
||||
target_compile_definitions(3rdparty_sdl2 INTERFACE -DHAVE_SDL2=1)
|
||||
target_include_directories(3rdparty_sdl2 INTERFACE ${SDL2_INCLUDE_DIRS})
|
||||
target_link_libraries(3rdparty_sdl2 INTERFACE ${SDL2_LIBRARIES})
|
||||
set(SDL2_TARGET 3rdparty_sdl2)
|
||||
else()
|
||||
message(FATAL_ERROR "SDL2 is not available on this system")
|
||||
@@ -351,6 +360,12 @@ if(USE_SDL)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# MINIUPNP
|
||||
add_subdirectory(miniupnp EXCLUDE_FROM_ALL)
|
||||
|
||||
# RTMIDI
|
||||
add_subdirectory(rtmidi EXCLUDE_FROM_ALL)
|
||||
|
||||
# add nice ALIAS targets for ease of use
|
||||
if(USE_SYSTEM_LIBUSB)
|
||||
add_library(3rdparty::libusb ALIAS usb-1.0-shared)
|
||||
@@ -378,3 +393,5 @@ add_library(3rdparty::wolfssl ALIAS wolfssl)
|
||||
add_library(3rdparty::libcurl ALIAS libcurl)
|
||||
add_library(3rdparty::soundtouch ALIAS soundtouch)
|
||||
add_library(3rdparty::sdl2 ALIAS ${SDL2_TARGET})
|
||||
add_library(3rdparty::miniupnpc ALIAS libminiupnpc-static)
|
||||
add_library(3rdparty::rtmidi ALIAS rtmidi)
|
||||
|
||||
Vendored
+1
-1
Submodule 3rdparty/FAudio updated: e787ed7655...cac0aca5f7
Vendored
+1
-1
@@ -4,7 +4,7 @@ include(ExternalProject)
|
||||
|
||||
ExternalProject_Add(moltenvk
|
||||
GIT_REPOSITORY https://github.com/KhronosGroup/MoltenVK.git
|
||||
GIT_TAG a307b24
|
||||
GIT_TAG 4c6bfbe
|
||||
BUILD_IN_SOURCE 1
|
||||
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/MoltenVK
|
||||
CONFIGURE_COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/MoltenVK/fetchDependencies" --macos
|
||||
|
||||
+1
@@ -70,6 +70,7 @@
|
||||
<PreprocessorDefinitions>SOUNDTOUCH_ALLOW_SSE;ST_NO_EXCEPTION_HANDLING;USE_MULTICH_ALWAYS;SOUNDTOUCH_FLOAT_SAMPLES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>./soundtouch/source/SoundTouch;./soundtouch/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DebugInformationFormat Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">ProgramDatabase</DebugInformationFormat>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
|
||||
Vendored
+1
-1
Submodule 3rdparty/asmjit/asmjit updated: 06d0badec5...c59847629d
Vendored
+1
@@ -187,6 +187,7 @@
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PreprocessorDefinitions>ASMJIT_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release'">MaxSpeed</Optimization>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
|
||||
Vendored
+1
-1
Submodule 3rdparty/cubeb/cubeb updated: dc511c6b35...70b4e3db78
Vendored
+1
@@ -79,6 +79,7 @@
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<PreprocessorDefinitions>OUTSIDE_SPEEX;RANDOM_PREFIX=speex;FLOATING_POINT;_USE_SSE;_USE_SSE2;EXPORT=;USE_WASAPI;USE_WINMM;CUBEB_WASAPI_USE_IAUDIOSTREAMVOLUME;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>./cubeb/subprojects/;./extra/;./cubeb/src/;./cubeb/include/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
|
||||
Vendored
+1
-1
Submodule 3rdparty/curl/curl updated: c12fb3ddaf...1561d06752
Vendored
+25
-9
@@ -64,8 +64,14 @@
|
||||
<ClCompile Include="curl\lib\asyn-ares.c" />
|
||||
<ClCompile Include="curl\lib\asyn-thread.c" />
|
||||
<ClCompile Include="curl\lib\base64.c" />
|
||||
<ClCompile Include="curl\lib\bufq.c" />
|
||||
<ClCompile Include="curl\lib\bufref.c" />
|
||||
<ClCompile Include="curl\lib\c-hyper.c" />
|
||||
<ClCompile Include="curl\lib\cf-h1-proxy.c" />
|
||||
<ClCompile Include="curl\lib\cf-h2-proxy.c" />
|
||||
<ClCompile Include="curl\lib\cf-haproxy.c" />
|
||||
<ClCompile Include="curl\lib\cf-https-connect.c" />
|
||||
<ClCompile Include="curl\lib\cf-socket.c" />
|
||||
<ClCompile Include="curl\lib\cfilters.c" />
|
||||
<ClCompile Include="curl\lib\conncache.c" />
|
||||
<ClCompile Include="curl\lib\connect.c" />
|
||||
@@ -78,6 +84,7 @@
|
||||
<ClCompile Include="curl\lib\curl_gethostname.c" />
|
||||
<ClCompile Include="curl\lib\curl_get_line.c" />
|
||||
<ClCompile Include="curl\lib\curl_gssapi.c" />
|
||||
<ClCompile Include="curl\lib\curl_log.c" />
|
||||
<ClCompile Include="curl\lib\curl_memrchr.c" />
|
||||
<ClCompile Include="curl\lib\curl_multibyte.c" />
|
||||
<ClCompile Include="curl\lib\curl_ntlm_core.c" />
|
||||
@@ -91,6 +98,7 @@
|
||||
<ClCompile Include="curl\lib\dict.c" />
|
||||
<ClCompile Include="curl\lib\doh.c" />
|
||||
<ClCompile Include="curl\lib\dynbuf.c" />
|
||||
<ClCompile Include="curl\lib\dynhds.c" />
|
||||
<ClCompile Include="curl\lib\easy.c" />
|
||||
<ClCompile Include="curl\lib\easygetopt.c" />
|
||||
<ClCompile Include="curl\lib\easyoptions.c" />
|
||||
@@ -104,7 +112,6 @@
|
||||
<ClCompile Include="curl\lib\getenv.c" />
|
||||
<ClCompile Include="curl\lib\getinfo.c" />
|
||||
<ClCompile Include="curl\lib\gopher.c" />
|
||||
<ClCompile Include="curl\lib\h2h3.c" />
|
||||
<ClCompile Include="curl\lib\hash.c" />
|
||||
<ClCompile Include="curl\lib\headers.c" />
|
||||
<ClCompile Include="curl\lib\hmac.c" />
|
||||
@@ -115,6 +122,7 @@
|
||||
<ClCompile Include="curl\lib\hostsyn.c" />
|
||||
<ClCompile Include="curl\lib\hsts.c" />
|
||||
<ClCompile Include="curl\lib\http.c" />
|
||||
<ClCompile Include="curl\lib\http1.c" />
|
||||
<ClCompile Include="curl\lib\http2.c" />
|
||||
<ClCompile Include="curl\lib\http_aws_sigv4.c" />
|
||||
<ClCompile Include="curl\lib\http_chunks.c" />
|
||||
@@ -179,11 +187,13 @@
|
||||
<ClCompile Include="curl\lib\vauth\gsasl.c" />
|
||||
<ClCompile Include="curl\lib\version.c" />
|
||||
<ClCompile Include="curl\lib\version_win32.c" />
|
||||
<ClCompile Include="curl\lib\vquic\curl_msh3.c" />
|
||||
<ClCompile Include="curl\lib\vquic\curl_ngtcp2.c" />
|
||||
<ClCompile Include="curl\lib\vquic\curl_quiche.c" />
|
||||
<ClCompile Include="curl\lib\vtls\hostcheck.c" />
|
||||
<ClCompile Include="curl\lib\vtls\rustls.c" />
|
||||
<ClCompile Include="curl\lib\vtls\x509asn1.c" />
|
||||
<ClCompile Include="curl\lib\warnless.c" />
|
||||
<ClCompile Include="curl\lib\wildcard.c" />
|
||||
<ClCompile Include="curl\lib\vauth\cleartext.c" />
|
||||
<ClCompile Include="curl\lib\vauth\cram.c" />
|
||||
<ClCompile Include="curl\lib\vauth\digest.c" />
|
||||
@@ -196,8 +206,6 @@
|
||||
<ClCompile Include="curl\lib\vauth\spnego_gssapi.c" />
|
||||
<ClCompile Include="curl\lib\vauth\spnego_sspi.c" />
|
||||
<ClCompile Include="curl\lib\vauth\vauth.c" />
|
||||
<ClCompile Include="curl\lib\vquic\ngtcp2.c" />
|
||||
<ClCompile Include="curl\lib\vquic\quiche.c" />
|
||||
<ClCompile Include="curl\lib\vquic\vquic.c" />
|
||||
<ClCompile Include="curl\lib\vssh\libssh.c" />
|
||||
<ClCompile Include="curl\lib\vssh\libssh2.c" />
|
||||
@@ -231,8 +239,14 @@
|
||||
<ClInclude Include="curl\lib\amigaos.h" />
|
||||
<ClInclude Include="curl\lib\arpa_telnet.h" />
|
||||
<ClInclude Include="curl\lib\asyn.h" />
|
||||
<ClInclude Include="curl\lib\bufq.h" />
|
||||
<ClInclude Include="curl\lib\bufref.h" />
|
||||
<ClInclude Include="curl\lib\c-hyper.h" />
|
||||
<ClInclude Include="curl\lib\cf-h1-proxy.h" />
|
||||
<ClInclude Include="curl\lib\cf-h2-proxy.h" />
|
||||
<ClInclude Include="curl\lib\cf-haproxy.h" />
|
||||
<ClInclude Include="curl\lib\cf-https-connect.h" />
|
||||
<ClInclude Include="curl\lib\cf-socket.h" />
|
||||
<ClInclude Include="curl\lib\cfilters.h" />
|
||||
<ClInclude Include="curl\lib\config-amigaos.h" />
|
||||
<ClInclude Include="curl\lib\config-dos.h" />
|
||||
@@ -259,6 +273,7 @@
|
||||
<ClInclude Include="curl\lib\curl_hmac.h" />
|
||||
<ClInclude Include="curl\lib\curl_krb5.h" />
|
||||
<ClInclude Include="curl\lib\curl_ldap.h" />
|
||||
<ClInclude Include="curl\lib\curl_log.h" />
|
||||
<ClInclude Include="curl\lib\curl_md4.h" />
|
||||
<ClInclude Include="curl\lib\curl_md5.h" />
|
||||
<ClInclude Include="curl\lib\curl_memory.h" />
|
||||
@@ -280,6 +295,7 @@
|
||||
<ClInclude Include="curl\lib\doh.h" />
|
||||
<ClInclude Include="curl\lib\dotdot.h" />
|
||||
<ClInclude Include="curl\lib\dynbuf.h" />
|
||||
<ClInclude Include="curl\lib\dynhds.h" />
|
||||
<ClInclude Include="curl\lib\easyif.h" />
|
||||
<ClInclude Include="curl\lib\easyoptions.h" />
|
||||
<ClInclude Include="curl\lib\easy_lock.h" />
|
||||
@@ -293,12 +309,12 @@
|
||||
<ClInclude Include="curl\lib\functypes.h" />
|
||||
<ClInclude Include="curl\lib\getinfo.h" />
|
||||
<ClInclude Include="curl\lib\gopher.h" />
|
||||
<ClInclude Include="curl\lib\h2h3.h" />
|
||||
<ClInclude Include="curl\lib\hash.h" />
|
||||
<ClInclude Include="curl\lib\headers.h" />
|
||||
<ClInclude Include="curl\lib\hostip.h" />
|
||||
<ClInclude Include="curl\lib\hsts.h" />
|
||||
<ClInclude Include="curl\lib\http.h" />
|
||||
<ClInclude Include="curl\lib\http1.h" />
|
||||
<ClInclude Include="curl\lib\http2.h" />
|
||||
<ClInclude Include="curl\lib\http_aws_sigv4.h" />
|
||||
<ClInclude Include="curl\lib\http_chunks.h" />
|
||||
@@ -325,7 +341,6 @@
|
||||
<ClInclude Include="curl\lib\pop3.h" />
|
||||
<ClInclude Include="curl\lib\progress.h" />
|
||||
<ClInclude Include="curl\lib\psl.h" />
|
||||
<ClInclude Include="curl\lib\quic.h" />
|
||||
<ClInclude Include="curl\lib\rand.h" />
|
||||
<ClInclude Include="curl\lib\rename.h" />
|
||||
<ClInclude Include="curl\lib\rtsp.h" />
|
||||
@@ -360,16 +375,17 @@
|
||||
<ClInclude Include="curl\lib\urlapi-int.h" />
|
||||
<ClInclude Include="curl\lib\urldata.h" />
|
||||
<ClInclude Include="curl\lib\version_win32.h" />
|
||||
<ClInclude Include="curl\lib\vquic\curl_msh3.h" />
|
||||
<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\vtls\hostcheck.h" />
|
||||
<ClInclude Include="curl\lib\vtls\rustls.h" />
|
||||
<ClInclude Include="curl\lib\vtls\x509asn1.h" />
|
||||
<ClInclude Include="curl\lib\warnless.h" />
|
||||
<ClInclude Include="curl\lib\wildcard.h" />
|
||||
<ClInclude Include="curl\lib\vauth\digest.h" />
|
||||
<ClInclude Include="curl\lib\vauth\ntlm.h" />
|
||||
<ClInclude Include="curl\lib\vauth\vauth.h" />
|
||||
<ClInclude Include="curl\lib\vquic\ngtcp2.h" />
|
||||
<ClInclude Include="curl\lib\vquic\quiche.h" />
|
||||
<ClInclude Include="curl\lib\vquic\vquic.h" />
|
||||
<ClInclude Include="curl\lib\vssh\ssh.h" />
|
||||
<ClInclude Include="curl\lib\vssh\wolfssh.h" />
|
||||
|
||||
+75
-27
@@ -330,9 +330,6 @@
|
||||
<ClCompile Include="curl\lib\warnless.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\wildcard.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\vauth\cleartext.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
@@ -369,12 +366,6 @@
|
||||
<ClCompile Include="curl\lib\vauth\vauth.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\vquic\ngtcp2.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\vquic\quiche.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\vssh\libssh.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
@@ -456,9 +447,6 @@
|
||||
<ClCompile Include="curl\lib\vauth\gsasl.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\h2h3.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\vtls\hostcheck.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
@@ -486,6 +474,42 @@
|
||||
<ClCompile Include="curl\lib\idn.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\curl_log.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\cf-https-connect.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\cf-socket.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\vquic\curl_msh3.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\vquic\curl_ngtcp2.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\vquic\curl_quiche.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\http1.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\dynhds.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\bufq.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\cf-h1-proxy.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\cf-h2-proxy.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="curl\lib\cf-haproxy.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="curl\include\curl\curl.h">
|
||||
@@ -764,9 +788,6 @@
|
||||
<ClInclude Include="curl\lib\psl.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\quic.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\rand.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
@@ -863,9 +884,6 @@
|
||||
<ClInclude Include="curl\lib\warnless.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\wildcard.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\vauth\digest.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
@@ -875,12 +893,6 @@
|
||||
<ClInclude Include="curl\lib\vauth\vauth.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\vquic\ngtcp2.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\vquic\quiche.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\vssh\ssh.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
@@ -956,9 +968,6 @@
|
||||
<ClInclude Include="curl\lib\vtls\rustls.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\h2h3.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\vtls\hostcheck.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
@@ -992,6 +1001,45 @@
|
||||
<ClInclude Include="curl\lib\idn.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\curl_log.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\cf-https-connect.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\cf-socket.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\vquic\curl_msh3.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\vquic\curl_ngtcp2.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\vquic\curl_quiche.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\vquic\vquic_int.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\http1.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\dynhds.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\bufq.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\cf-h1-proxy.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\cf-h2-proxy.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="curl\lib\cf-haproxy.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="curl\lib\libcurl.rc">
|
||||
|
||||
Vendored
+1
-1
Submodule 3rdparty/hidapi/hidapi updated: a3ce129931...8b43a97a93
Vendored
+3
-3
@@ -1,11 +1,11 @@
|
||||
option(SDL2_DISABLE_SDL2MAIN "" ON)
|
||||
option(SDL2_DISABLE_INSTALL "" ON)
|
||||
option(SDL2_DISABLE_UNINSTALL "" ON)
|
||||
set(SDL_SHARED OFF)
|
||||
option(SDL_SHARED OFF)
|
||||
set(SDL_SHARED_ENABLED_BY_DEFAULT OFF)
|
||||
set(SDL_STATIC ON)
|
||||
option(SDL_STATIC ON)
|
||||
set(SDL_STATIC_ENABLED_BY_DEFAULT ON)
|
||||
set(SDL_TEST OFF)
|
||||
option(SDL_TEST OFF)
|
||||
set(SDL_TEST_ENABLED_BY_DEFAULT OFF)
|
||||
set(OPT_DEF_LIBC ON)
|
||||
add_subdirectory(SDL EXCLUDE_FROM_ALL)
|
||||
|
||||
Vendored
+1
-1
Submodule 3rdparty/libsdl-org/SDL updated: f070c83a60...ac13ca9ab6
Vendored
+1
@@ -453,6 +453,7 @@
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<AdditionalIncludeDirectories>SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DebugInformationFormat Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">ProgramDatabase</DebugInformationFormat>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
|
||||
Vendored
+35
-28
@@ -2,10 +2,10 @@ if(WITH_LLVM)
|
||||
CHECK_CXX_COMPILER_FLAG("-msse -msse2 -mcx16" COMPILER_X86)
|
||||
CHECK_CXX_COMPILER_FLAG("-march=armv8-a+lse" COMPILER_ARM)
|
||||
|
||||
if(BUILD_LLVM_SUBMODULE)
|
||||
if(BUILD_LLVM)
|
||||
message(STATUS "LLVM will be built from the submodule.")
|
||||
|
||||
set(LLVM_TARGETS_TO_BUILD "AArch64;X86")
|
||||
set(LLVM_TARGETS_TO_BUILD "AArch64;X86" CACHE STRING "Semicolon-separated list of targets to build, or \"all\".")
|
||||
option(LLVM_BUILD_RUNTIME OFF)
|
||||
option(LLVM_BUILD_TOOLS OFF)
|
||||
option(LLVM_INCLUDE_BENCHMARKS OFF)
|
||||
@@ -32,54 +32,61 @@ if(WITH_LLVM)
|
||||
endif()
|
||||
|
||||
# LLVM needs to be built out-of-tree
|
||||
add_subdirectory(${CMAKE_SOURCE_DIR}/llvm ${CMAKE_CURRENT_BINARY_DIR}/llvm_build EXCLUDE_FROM_ALL)
|
||||
set(LLVM_DIR "${CMAKE_CURRENT_BINARY_DIR}/llvm_build/lib/cmake/llvm/")
|
||||
add_subdirectory(${CMAKE_SOURCE_DIR}/3rdparty/llvm/llvm/llvm ${CMAKE_BINARY_DIR}/3rdparty/llvm/llvm_build EXCLUDE_FROM_ALL)
|
||||
set(LLVM_DIR "${CMAKE_BINARY_DIR}/3rdparty/llvm/llvm_build/lib/cmake/llvm/")
|
||||
|
||||
set(CMAKE_CXX_FLAGS ${CXX_FLAGS_OLD})
|
||||
set(STATIC_LINK_LLVM ON CACHE BOOL "Link against LLVM statically. This will get set to ON if you build LLVM from the submodule." FORCE)
|
||||
|
||||
# now tries to find LLVM again
|
||||
find_package(LLVM 13.0 CONFIG)
|
||||
find_package(LLVM 16.0 CONFIG)
|
||||
if(NOT LLVM_FOUND)
|
||||
message(FATAL_ERROR "Couldn't build LLVM from the submodule. You might need to run `git submodule update --init`")
|
||||
endif()
|
||||
|
||||
else()
|
||||
message(STATUS "Using prebuilt LLVM")
|
||||
message(STATUS "Using prebuilt or system LLVM")
|
||||
|
||||
if (LLVM_DIR AND NOT IS_ABSOLUTE "${LLVM_DIR}")
|
||||
# change relative LLVM_DIR to be relative to the source dir
|
||||
set(LLVM_DIR ${CMAKE_SOURCE_DIR}/${LLVM_DIR})
|
||||
endif()
|
||||
|
||||
find_package(LLVM 13.0 CONFIG)
|
||||
find_package(LLVM 16.0 CONFIG)
|
||||
|
||||
if (NOT LLVM_FOUND)
|
||||
if (LLVM_VERSION AND LLVM_VERSION_MAJOR LESS 11)
|
||||
message(FATAL_ERROR "Found LLVM version ${LLVM_VERSION}. Required version 11.0. \
|
||||
Enable BUILD_LLVM_SUBMODULE option to build LLVM from included as a git submodule.")
|
||||
if (LLVM_VERSION AND LLVM_VERSION_MAJOR LESS 16)
|
||||
message(FATAL_ERROR "Found LLVM version ${LLVM_VERSION}. Required version 16. \
|
||||
Enable BUILD_LLVM option to build LLVM from included as a git submodule.")
|
||||
endif()
|
||||
|
||||
message(FATAL_ERROR "Can't find LLVM libraries from the CMAKE_PREFIX_PATH path or LLVM_DIR. \
|
||||
Enable BUILD_LLVM_SUBMODULE option to build LLVM from included as a git submodule.")
|
||||
Enable BUILD_LLVM option to build LLVM from included as a git submodule.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(LLVM_LIBS LLVMMCJIT)
|
||||
|
||||
if(COMPILER_X86)
|
||||
set(LLVM_LIBS ${LLVM_LIBS} LLVMX86CodeGen LLVMX86AsmParser)
|
||||
endif()
|
||||
|
||||
if(COMPILER_ARM)
|
||||
set(LLVM_LIBS ${LLVM_LIBS} LLVMX86CodeGen LLVMX86AsmParser LLVMAArch64CodeGen LLVMAArch64AsmParser)
|
||||
endif()
|
||||
|
||||
if(WIN32 OR CMAKE_SYSTEM MATCHES "Linux")
|
||||
set(LLVM_LIBS ${LLVM_LIBS} LLVMIntelJITEvents)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM MATCHES "Linux")
|
||||
set(LLVM_LIBS ${LLVM_LIBS} LLVMPerfJITEvents)
|
||||
if (STATIC_LINK_LLVM)
|
||||
if (NOT DEFINED LLVM_TARGETS_TO_BUILD)
|
||||
if(COMPILER_ARM)
|
||||
set(LLVM_TARGETS_TO_BUILD "AArch64;X86" CACHE STRING "Semicolon-separated list of targets to build, or \"all\".")
|
||||
else()
|
||||
set(LLVM_TARGETS_TO_BUILD "X86" CACHE STRING "Semicolon-separated list of targets to build, or \"all\".")
|
||||
endif()
|
||||
endif()
|
||||
if(WIN32 OR CMAKE_SYSTEM MATCHES "Linux")
|
||||
set (LLVM_ADDITIONAL_LIBS ${LLVM_ADDITIONAL_LIBS} IntelJITEvents)
|
||||
endif()
|
||||
if(CMAKE_SYSTEM MATCHES "Linux")
|
||||
set (LLVM_ADDITIONAL_LIBS ${LLVM_ADDITIONAL_LIBS} PerfJITEvents)
|
||||
endif()
|
||||
llvm_map_components_to_libnames(LLVM_LIBS
|
||||
${LLVM_TARGETS_TO_BUILD}
|
||||
${LLVM_ADDITIONAL_LIBS}
|
||||
Core
|
||||
ExecutionEngine
|
||||
MCJIT
|
||||
)
|
||||
else()
|
||||
set(LLVM_LIBS LLVM)
|
||||
endif()
|
||||
|
||||
add_library(3rdparty_llvm INTERFACE)
|
||||
|
||||
+1
Submodule 3rdparty/llvm/llvm added at cd89023f79
+4
-4
@@ -14,9 +14,9 @@
|
||||
<ProjectGuid>{8BC303AB-25BE-4276-8E57-73F171B2D672}</ProjectGuid>
|
||||
<Keyword>MakeFileProj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\buildfiles\msvc\common_default.props" />
|
||||
<Import Project="$(SolutionDir)\buildfiles\msvc\common_default.props" />
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<Import Project="..\buildfiles\msvc\common_default_macros.props" />
|
||||
<Import Project="$(SolutionDir)\buildfiles\msvc\common_default_macros.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Makefile</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
@@ -39,9 +39,9 @@
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros">
|
||||
<CmakeReleaseCLI>call vsdevcmd.bat -arch=amd64
|
||||
cmake -G Ninja -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX="./Release" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_DEFAULT_TARGET_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_HOST_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_TOOLS=OFF -DLLVM_INCLUDE_UTILS=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_INTEL_JITEVENTS=ON ../llvm</CmakeReleaseCLI>
|
||||
cmake -G Ninja -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX="./Release" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_DEFAULT_TARGET_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_HOST_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_INCLUDE_UTILS=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_INTEL_JITEVENTS=ON ../llvm/llvm</CmakeReleaseCLI>
|
||||
<CmakeDebugCLI>call vsdevcmd.bat -arch=amd64
|
||||
cmake -G Ninja -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_INSTALL_PREFIX="./Debug" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_DEFAULT_TARGET_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_HOST_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_TOOLS=OFF -DLLVM_INCLUDE_UTILS=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_INTEL_JITEVENTS=ON ../llvm</CmakeDebugCLI>
|
||||
cmake -G Ninja -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_INSTALL_PREFIX="./Debug" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_DEFAULT_TARGET_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_HOST_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_INCLUDE_UTILS=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_INTEL_JITEVENTS=ON ../llvm/llvm</CmakeDebugCLI>
|
||||
<CmakeCleanCLI>echo Cleaning..
|
||||
for /F "delims= eol=|" %%f in ('
|
||||
dir /b ^| findstr /V "[^.]*\build[^.]*\.vcxproj"') do (
|
||||
Vendored
Vendored
+4
-4
@@ -14,9 +14,9 @@
|
||||
<ProjectGuid>{A37E4273-85DB-4217-B775-CE971B87D9DF}</ProjectGuid>
|
||||
<Keyword>MakeFileProj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\buildfiles\msvc\common_default_clang_cl.props" />
|
||||
<Import Project="$(SolutionDir)\buildfiles\msvc\common_default_clang_cl.props" />
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<Import Project="..\buildfiles\msvc\common_default_macros.props" />
|
||||
<Import Project="$(SolutionDir)\buildfiles\msvc\common_default_macros.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Makefile</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
@@ -39,9 +39,9 @@
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros">
|
||||
<CmakeReleaseCLI>call vsdevcmd.bat -arch=amd64
|
||||
cmake -G Ninja -DCMAKE_CXX_COMPILER="clang-cl.exe" -DCMAKE_C_COMPILER="clang-cl.exe" -DCMAKE_BUILD_TYPE="Release" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_DEFAULT_TARGET_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_HOST_TRIPLE:STRING=x86_64-pc-windows-msvc -DCMAKE_INSTALL_PREFIX="./Release" -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_TOOLS=OFF -DLLVM_INCLUDE_UTILS=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_INTEL_JITEVENTS=ON ../llvm</CmakeReleaseCLI>
|
||||
cmake -G Ninja -DCMAKE_CXX_COMPILER="clang-cl.exe" -DCMAKE_C_COMPILER="clang-cl.exe" -DCMAKE_BUILD_TYPE="Release" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_DEFAULT_TARGET_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_HOST_TRIPLE:STRING=x86_64-pc-windows-msvc -DCMAKE_INSTALL_PREFIX="./Release" -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_INCLUDE_UTILS=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_INTEL_JITEVENTS=ON ../llvm/llvm</CmakeReleaseCLI>
|
||||
<CmakeDebugCLI>call vsdevcmd.bat -arch=amd64
|
||||
cmake -G Ninja -DCMAKE_CXX_COMPILER="clang-cl.exe" -DCMAKE_C_COMPILER="clang-cl.exe" -DCMAKE_BUILD_TYPE="Debug" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_DEFAULT_TARGET_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_HOST_TRIPLE:STRING=x86_64-pc-windows-msvc -DCMAKE_INSTALL_PREFIX="./Debug" -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_TOOLS=OFF -DLLVM_INCLUDE_UTILS=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_INTEL_JITEVENTS=ON ../llvm</CmakeDebugCLI>
|
||||
cmake -G Ninja -DCMAKE_CXX_COMPILER="clang-cl.exe" -DCMAKE_C_COMPILER="clang-cl.exe" -DCMAKE_BUILD_TYPE="Debug" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_DEFAULT_TARGET_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_HOST_TRIPLE:STRING=x86_64-pc-windows-msvc -DCMAKE_INSTALL_PREFIX="./Debug" -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_INCLUDE_UTILS=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_INTEL_JITEVENTS=ON ../llvm/llvm</CmakeDebugCLI>
|
||||
<CmakeCleanCLI>echo Cleaning..
|
||||
for /F "delims= eol=|" %%f in ('
|
||||
dir /b ^| findstr /V "[^.]*\build[^.]*\.vcxproj"') do (
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
option (UPNPC_BUILD_STATIC "Build static library" TRUE)
|
||||
option (UPNPC_BUILD_SHARED "Build shared library" FALSE)
|
||||
option (UPNPC_BUILD_TESTS "Build test executables" FALSE)
|
||||
option (UPNPC_BUILD_SAMPLE "Build sample executables" FALSE)
|
||||
option (NO_GETADDRINFO "Define NO_GETADDRINFO" FALSE)
|
||||
option (UPNPC_NO_INSTALL "Disable installation" TRUE)
|
||||
|
||||
add_subdirectory(miniupnp/miniupnpc EXCLUDE_FROM_ALL)
|
||||
+1
Submodule 3rdparty/miniupnp/miniupnp added at e439318cf7
+138
@@ -0,0 +1,138 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{5228f863-e0dd-4de7-aa7b-5c52b14cd4d0}</ProjectGuid>
|
||||
<RootNamespace>miniupnpcstatic</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(SolutionDir)\buildfiles\msvc\common_default.props" />
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<Import Project="$(SolutionDir)\buildfiles\msvc\common_default_macros.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_WINSOCK_DEPRECATED_NO_WARNINGS; _CRT_SECURE_NO_WARNINGS;MINIUPNP_STATICLIB;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>generated;miniupnp\miniupnpc;miniupnp\miniupnpc\include</AdditionalIncludeDirectories>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>cd $(ProjectDir)miniupnp\miniupnpc\msvc
|
||||
cscript genminiupnpcstrings.vbs</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_WINSOCK_DEPRECATED_NO_WARNINGS; _CRT_SECURE_NO_WARNINGS;MINIUPNP_STATICLIB;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>generated;miniupnp\miniupnpc;miniupnp\miniupnpc\include</AdditionalIncludeDirectories>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>
|
||||
</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>cd $(ProjectDir)miniupnp\miniupnpc\msvc
|
||||
cscript genminiupnpcstrings.vbs</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="miniupnp\miniupnpc\src\addr_is_reserved.c" />
|
||||
<ClCompile Include="miniupnp\miniupnpc\src\connecthostport.c" />
|
||||
<ClCompile Include="miniupnp\miniupnpc\src\igd_desc_parse.c" />
|
||||
<ClCompile Include="miniupnp\miniupnpc\src\minisoap.c" />
|
||||
<ClCompile Include="miniupnp\miniupnpc\src\minissdpc.c" />
|
||||
<ClCompile Include="miniupnp\miniupnpc\src\miniupnpc.c" />
|
||||
<ClCompile Include="miniupnp\miniupnpc\src\miniwget.c" />
|
||||
<ClCompile Include="miniupnp\miniupnpc\src\minixml.c" />
|
||||
<ClCompile Include="miniupnp\miniupnpc\src\portlistingparse.c" />
|
||||
<ClCompile Include="miniupnp\miniupnpc\src\receivedata.c" />
|
||||
<ClCompile Include="miniupnp\miniupnpc\src\upnpcommands.c" />
|
||||
<ClCompile Include="miniupnp\miniupnpc\src\upnpdev.c" />
|
||||
<ClCompile Include="miniupnp\miniupnpc\src\upnperrors.c" />
|
||||
<ClCompile Include="miniupnp\miniupnpc\src\upnpreplyparse.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="miniupnp\miniupnpc\src\addr_is_reserved.h" />
|
||||
<ClInclude Include="miniupnp\miniupnpc\src\connecthostport.h" />
|
||||
<ClInclude Include="miniupnp\miniupnpc\include\igd_desc_parse.h" />
|
||||
<ClInclude Include="miniupnp\miniupnpc\src\minisoap.h" />
|
||||
<ClInclude Include="miniupnp\miniupnpc\src\minissdpc.h" />
|
||||
<ClInclude Include="miniupnp\miniupnpc\include\miniupnpc.h" />
|
||||
<ClInclude Include="miniupnp\miniupnpc\miniupnpcstrings.h" />
|
||||
<ClInclude Include="miniupnp\miniupnpc\include\miniupnpctypes.h" />
|
||||
<ClInclude Include="miniupnp\miniupnpc\include\miniupnpc_declspec.h" />
|
||||
<ClInclude Include="miniupnp\miniupnpc\include\miniwget.h" />
|
||||
<ClInclude Include="miniupnp\miniupnpc\src\miniwget_private.h" />
|
||||
<ClInclude Include="miniupnp\miniupnpc\src\minixml.h" />
|
||||
<ClInclude Include="miniupnp\miniupnpc\include\portlistingparse.h" />
|
||||
<ClInclude Include="miniupnp\miniupnpc\src\receivedata.h" />
|
||||
<ClInclude Include="miniupnp\miniupnpc\include\upnpcommands.h" />
|
||||
<ClInclude Include="miniupnp\miniupnpc\include\upnpdev.h" />
|
||||
<ClInclude Include="miniupnp\miniupnpc\include\upnperrors.h" />
|
||||
<ClInclude Include="miniupnp\miniupnpc\include\upnpreplyparse.h" />
|
||||
<ClInclude Include="miniupnp\miniupnpc\src\win32_snprintf.h" />
|
||||
<ClInclude Include="miniupnp\miniupnpc\rc_version.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
Vendored
+102
-103
@@ -12,18 +12,21 @@
|
||||
#include <thread>
|
||||
#include <sys/types.h>
|
||||
#if _WIN32
|
||||
#define read_portable(a, b, c) (recv(a, b, c, 0))
|
||||
#define write_portable(a, b, c) (send(a, b, c, 0))
|
||||
#define read_portable(a, b, c) (recv(a, b, ::narrow<int>(c), 0))
|
||||
#define write_portable(a, b, c) (send(a, b, ::narrow<int>(c), 0))
|
||||
#define close_portable(a) (closesocket(a))
|
||||
#define bzero(b, len) (memset((b), '\0', (len)), (void)0)
|
||||
#include <WinSock2.h>
|
||||
#include <windows.h>
|
||||
#include <ws2tcpip.h>
|
||||
#else
|
||||
#define read_portable(a, b, c) (read(a, b, c))
|
||||
#define write_portable(a, b, c) (write(a, b, c))
|
||||
#define close_portable(a) (close(a))
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <poll.h>
|
||||
#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
@@ -79,13 +82,13 @@ namespace pine
|
||||
* A preallocated buffer used to store all IPC replies.
|
||||
* to the size of 50.000 MsgWrite64 IPC calls.
|
||||
*/
|
||||
char* m_ret_buffer;
|
||||
std::vector<char> m_ret_buffer;
|
||||
|
||||
/**
|
||||
* IPC messages buffer.
|
||||
* A preallocated buffer used to store all IPC messages.
|
||||
*/
|
||||
char* m_ipc_buffer;
|
||||
std::vector<char> m_ipc_buffer;
|
||||
|
||||
/**
|
||||
* IPC Command messages opcodes.
|
||||
@@ -118,8 +121,8 @@ namespace pine
|
||||
*/
|
||||
struct IPCBuffer
|
||||
{
|
||||
int size; /**< Size of the buffer. */
|
||||
char* buffer; /**< Buffer. */
|
||||
usz size{}; /**< Size of the buffer. */
|
||||
char* buffer{}; /**< Buffer. */
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -144,13 +147,30 @@ namespace pine
|
||||
*/
|
||||
IPCBuffer ParseCommand(char* buf, char* ret_buffer, u32 buf_size)
|
||||
{
|
||||
u32 ret_cnt = 5;
|
||||
u32 buf_cnt = 0;
|
||||
usz ret_cnt = 5;
|
||||
usz buf_cnt = 0;
|
||||
|
||||
const auto error = [&]()
|
||||
{
|
||||
return IPCBuffer{ 5, MakeFailIPC(ret_buffer) };
|
||||
};
|
||||
|
||||
const auto write_string = [&](const std::string& str)
|
||||
{
|
||||
if (!SafetyChecks(buf_cnt, 0, ret_cnt, str.size() + 1 + sizeof(u32), buf_size))
|
||||
return false;
|
||||
ToArray(ret_buffer, ::narrow<u32>(str.size() + 1), ret_cnt);
|
||||
ret_cnt += sizeof(u32);
|
||||
memcpy(&ret_buffer[ret_cnt], str.data(), str.size());
|
||||
ret_cnt += str.size();
|
||||
ret_buffer[ret_cnt++] = '\0';
|
||||
return true;
|
||||
};
|
||||
|
||||
while (buf_cnt < buf_size)
|
||||
{
|
||||
if (!SafetyChecks(buf_cnt, 1, ret_cnt, 0, buf_size))
|
||||
return IPCBuffer{ 5, MakeFailIPC(ret_buffer) };
|
||||
return error();
|
||||
buf_cnt++;
|
||||
// example IPC messages: MsgRead/Write
|
||||
// refer to the client doc for more info on the format
|
||||
@@ -169,10 +189,10 @@ namespace pine
|
||||
case MsgRead8:
|
||||
{
|
||||
if (!SafetyChecks(buf_cnt, 4, ret_cnt, 1, buf_size))
|
||||
goto error;
|
||||
return error();
|
||||
const u32 a = FromArray<u32>(&buf[buf_cnt], 0);
|
||||
if (!Impl::template check_addr(a))
|
||||
goto error;
|
||||
return error();
|
||||
const u8 res = Impl::read8(a);
|
||||
ToArray(ret_buffer, res, ret_cnt);
|
||||
ret_cnt += 1;
|
||||
@@ -182,10 +202,10 @@ namespace pine
|
||||
case MsgRead16:
|
||||
{
|
||||
if (!SafetyChecks(buf_cnt, 4, ret_cnt, 2, buf_size))
|
||||
goto error;
|
||||
return error();
|
||||
const u32 a = FromArray<u32>(&buf[buf_cnt], 0);
|
||||
if (!Impl::template check_addr<2>(a))
|
||||
goto error;
|
||||
return error();
|
||||
const u16 res = Impl::read16(a);
|
||||
ToArray(ret_buffer, res, ret_cnt);
|
||||
ret_cnt += 2;
|
||||
@@ -195,10 +215,10 @@ namespace pine
|
||||
case MsgRead32:
|
||||
{
|
||||
if (!SafetyChecks(buf_cnt, 4, ret_cnt, 4, buf_size))
|
||||
goto error;
|
||||
return error();
|
||||
const u32 a = FromArray<u32>(&buf[buf_cnt], 0);
|
||||
if (!Impl::template check_addr<4>(a))
|
||||
goto error;
|
||||
return error();
|
||||
const u32 res = Impl::read32(a);
|
||||
ToArray(ret_buffer, res, ret_cnt);
|
||||
ret_cnt += 4;
|
||||
@@ -208,10 +228,10 @@ namespace pine
|
||||
case MsgRead64:
|
||||
{
|
||||
if (!SafetyChecks(buf_cnt, 4, ret_cnt, 8, buf_size))
|
||||
goto error;
|
||||
return error();
|
||||
const u32 a = FromArray<u32>(&buf[buf_cnt], 0);
|
||||
if (!Impl::template check_addr<8>(a))
|
||||
goto error;
|
||||
return error();
|
||||
u64 res = Impl::read64(a);
|
||||
ToArray(ret_buffer, res, ret_cnt);
|
||||
ret_cnt += 8;
|
||||
@@ -221,10 +241,10 @@ namespace pine
|
||||
case MsgWrite8:
|
||||
{
|
||||
if (!SafetyChecks(buf_cnt, 1 + 4, ret_cnt, 0, buf_size))
|
||||
goto error;
|
||||
return error();
|
||||
const u32 a = FromArray<u32>(&buf[buf_cnt], 0);
|
||||
if (!Impl::template check_addr(a, vm::page_writable))
|
||||
goto error;
|
||||
return error();
|
||||
Impl::write8(a, FromArray<u8>(&buf[buf_cnt], 4));
|
||||
buf_cnt += 5;
|
||||
break;
|
||||
@@ -232,10 +252,10 @@ namespace pine
|
||||
case MsgWrite16:
|
||||
{
|
||||
if (!SafetyChecks(buf_cnt, 2 + 4, ret_cnt, 0, buf_size))
|
||||
goto error;
|
||||
return error();
|
||||
const u32 a = FromArray<u32>(&buf[buf_cnt], 0);
|
||||
if (!Impl::template check_addr<2>(a, vm::page_writable))
|
||||
goto error;
|
||||
return error();
|
||||
Impl::write16(a, FromArray<u16>(&buf[buf_cnt], 4));
|
||||
buf_cnt += 6;
|
||||
break;
|
||||
@@ -243,10 +263,10 @@ namespace pine
|
||||
case MsgWrite32:
|
||||
{
|
||||
if (!SafetyChecks(buf_cnt, 4 + 4, ret_cnt, 0, buf_size))
|
||||
goto error;
|
||||
return error();
|
||||
const u32 a = FromArray<u32>(&buf[buf_cnt], 0);
|
||||
if (!Impl::template check_addr<4>(a, vm::page_writable))
|
||||
goto error;
|
||||
return error();
|
||||
Impl::write32(a, FromArray<u32>(&buf[buf_cnt], 4));
|
||||
buf_cnt += 8;
|
||||
break;
|
||||
@@ -254,31 +274,24 @@ namespace pine
|
||||
case MsgWrite64:
|
||||
{
|
||||
if (!SafetyChecks(buf_cnt, 8 + 4, ret_cnt, 0, buf_size))
|
||||
goto error;
|
||||
return error();
|
||||
const u32 a = FromArray<u32>(&buf[buf_cnt], 0);
|
||||
if (!Impl::template check_addr<8>(a, vm::page_writable))
|
||||
goto error;
|
||||
return error();
|
||||
Impl::write64(a, FromArray<u64>(&buf[buf_cnt], 4));
|
||||
buf_cnt += 12;
|
||||
break;
|
||||
}
|
||||
case MsgVersion:
|
||||
{
|
||||
char version[256] = {};
|
||||
snprintf(version, sizeof(version), "RPCS3 %s", Impl::get_version_and_branch().c_str());
|
||||
const u32 size = strlen(version) + 1;
|
||||
if (!SafetyChecks(buf_cnt, 0, ret_cnt, size + 4, buf_size))
|
||||
goto error;
|
||||
ToArray(ret_buffer, size, ret_cnt);
|
||||
ret_cnt += 4;
|
||||
memcpy(&ret_buffer[ret_cnt], version, size);
|
||||
ret_cnt += size;
|
||||
if (!write_string("RPCS3 " + Impl::get_version_and_branch()))
|
||||
return error();
|
||||
break;
|
||||
}
|
||||
case MsgStatus:
|
||||
{
|
||||
if (!SafetyChecks(buf_cnt, 0, ret_cnt, 4, buf_size))
|
||||
goto error;
|
||||
return error();
|
||||
EmuStatus status = Impl::get_status();
|
||||
ToArray(ret_buffer, status, ret_cnt);
|
||||
ret_cnt += 4;
|
||||
@@ -287,72 +300,35 @@ namespace pine
|
||||
}
|
||||
case MsgTitle:
|
||||
{
|
||||
const auto title_string = Impl::get_title();
|
||||
const auto size = title_string.size() + 1;
|
||||
char* title = new char[size];
|
||||
snprintf(title, size, "%s", title_string.c_str());
|
||||
if (!SafetyChecks(buf_cnt, 0, ret_cnt, size + 4, buf_size))
|
||||
goto error;
|
||||
ToArray(ret_buffer, size, ret_cnt);
|
||||
ret_cnt += 4;
|
||||
memcpy(&ret_buffer[ret_cnt], title, size);
|
||||
ret_cnt += size;
|
||||
delete[] title;
|
||||
if (!write_string(Impl::get_title()))
|
||||
return error();
|
||||
break;
|
||||
}
|
||||
case MsgID:
|
||||
{
|
||||
const auto title_id_string = Impl::get_title_ID();
|
||||
const auto size = title_id_string.size() + 1;
|
||||
char* title_id = new char[size];
|
||||
snprintf(title_id, size, "%s", title_id_string.c_str());
|
||||
if (!SafetyChecks(buf_cnt, 0, ret_cnt, size + 4, buf_size))
|
||||
goto error;
|
||||
ToArray(ret_buffer, size, ret_cnt);
|
||||
ret_cnt += 4;
|
||||
memcpy(&ret_buffer[ret_cnt], title_id, size);
|
||||
ret_cnt += size;
|
||||
delete[] title_id;
|
||||
if (!write_string(Impl::get_title_ID()))
|
||||
return error();
|
||||
break;
|
||||
}
|
||||
case MsgUUID:
|
||||
{
|
||||
const auto hash_string = Impl::get_executable_hash();
|
||||
const auto size = hash_string.size() + 1;
|
||||
char* hash = new char[size];
|
||||
snprintf(hash, size, "%s", hash_string.c_str());
|
||||
if (!SafetyChecks(buf_cnt, 0, ret_cnt, size + 4, buf_size))
|
||||
goto error;
|
||||
ToArray(ret_buffer, size, ret_cnt);
|
||||
ret_cnt += 4;
|
||||
memcpy(&ret_buffer[ret_cnt], hash, size);
|
||||
ret_cnt += size;
|
||||
delete[] hash;
|
||||
if (!write_string(Impl::get_executable_hash()))
|
||||
return error();
|
||||
break;
|
||||
}
|
||||
case MsgGameVersion:
|
||||
{
|
||||
const auto game_version_string = Impl::get_app_version();
|
||||
const auto size = game_version_string.size() + 1;
|
||||
char* game_version = new char[size];
|
||||
snprintf(game_version, size, "%s", game_version_string.c_str());
|
||||
if (!SafetyChecks(buf_cnt, 0, ret_cnt, size, buf_size))
|
||||
goto error;
|
||||
ToArray(ret_buffer, size, ret_cnt);
|
||||
ret_cnt += 4;
|
||||
memcpy(&ret_buffer[ret_cnt], game_version, size);
|
||||
ret_cnt += size;
|
||||
delete[] game_version;
|
||||
if (!write_string(Impl::get_app_version()))
|
||||
return error();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
error:
|
||||
return IPCBuffer{ 5, MakeFailIPC(ret_buffer) };
|
||||
return error();
|
||||
}
|
||||
}
|
||||
}
|
||||
return IPCBuffer{ static_cast<int>(ret_cnt), MakeOkIPC(ret_buffer, ret_cnt) };
|
||||
return IPCBuffer{ ret_cnt, MakeOkIPC(ret_buffer, ret_cnt) };
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -361,26 +337,48 @@ namespace pine
|
||||
* size: size of the IPC buffer.
|
||||
* return value: buffer containing the status code allocated of size
|
||||
*/
|
||||
static inline char* MakeOkIPC(char* ret_buffer, uint32_t size = 5)
|
||||
static inline char* MakeOkIPC(char* ret_buffer, usz size = 5)
|
||||
{
|
||||
ToArray<uint32_t>(ret_buffer, size, 0);
|
||||
ToArray(ret_buffer, ::narrow<u32>(size), 0);
|
||||
ret_buffer[4] = IPC_OK;
|
||||
return ret_buffer;
|
||||
}
|
||||
|
||||
static inline char* MakeFailIPC(char* ret_buffer, uint32_t size = 5)
|
||||
static inline char* MakeFailIPC(char* ret_buffer, usz size = 5)
|
||||
{
|
||||
ToArray<uint32_t>(ret_buffer, size, 0);
|
||||
ToArray(ret_buffer, ::narrow<u32>(size), 0);
|
||||
ret_buffer[4] = IPC_FAIL;
|
||||
return ret_buffer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes an open socket for IPC communication.
|
||||
* return value: -1 if a fatal failure happened, 0 otherwise.
|
||||
* return value: false if a fatal failure happened, true otherwise.
|
||||
*/
|
||||
int StartSocket()
|
||||
bool StartSocket()
|
||||
{
|
||||
::pollfd poll_fd{};
|
||||
|
||||
for (int pending_connection = 0; pending_connection != 1;)
|
||||
{
|
||||
if (thread_ctrl::state() == thread_state::aborting)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
std::memset(&poll_fd, 0, sizeof(poll_fd));
|
||||
poll_fd.events = POLLIN;
|
||||
poll_fd.revents = 0;
|
||||
poll_fd.fd = m_sock;
|
||||
|
||||
#ifdef _WIN32
|
||||
// Try to wait for an incoming connection
|
||||
pending_connection = ::WSAPoll(&poll_fd, 1, 10);
|
||||
#else
|
||||
pending_connection = ::poll(&poll_fd, 1, 10);
|
||||
#endif
|
||||
}
|
||||
|
||||
m_msgsock = accept(m_sock, 0, 0);
|
||||
|
||||
if (m_msgsock == -1)
|
||||
@@ -398,10 +396,10 @@ namespace pine
|
||||
{
|
||||
#endif
|
||||
Impl::error("IPC: An unrecoverable error happened! Shutting down...");
|
||||
return -1;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Thread used to relay IPC commands.
|
||||
@@ -409,10 +407,10 @@ namespace pine
|
||||
{
|
||||
// we allocate once buffers to not have to do mallocs for each IPC
|
||||
// request, as malloc is expansive when we optimize for µs.
|
||||
m_ret_buffer = new char[MAX_IPC_RETURN_SIZE];
|
||||
m_ipc_buffer = new char[MAX_IPC_SIZE];
|
||||
m_ret_buffer.resize(MAX_IPC_RETURN_SIZE);
|
||||
m_ipc_buffer.resize(MAX_IPC_SIZE);
|
||||
|
||||
if (StartSocket() < 0)
|
||||
if (!StartSocket())
|
||||
return;
|
||||
|
||||
while (thread_ctrl::state() != thread_state::aborting)
|
||||
@@ -432,7 +430,7 @@ namespace pine
|
||||
if (tmp_length <= 0)
|
||||
{
|
||||
receive_length = 0;
|
||||
if (StartSocket() < 0)
|
||||
if (!StartSocket())
|
||||
return;
|
||||
break;
|
||||
}
|
||||
@@ -442,7 +440,7 @@ namespace pine
|
||||
// if we got at least the final size then update
|
||||
if (end_length == 4 && receive_length >= 4)
|
||||
{
|
||||
end_length = FromArray<u32>(m_ipc_buffer, 0);
|
||||
end_length = FromArray<u32>(m_ipc_buffer.data(), 0);
|
||||
// we'd like to avoid a client trying to do OOB
|
||||
if (end_length > MAX_IPC_SIZE || end_length < 4)
|
||||
{
|
||||
@@ -459,12 +457,12 @@ namespace pine
|
||||
// disconnects
|
||||
if (receive_length != 0)
|
||||
{
|
||||
pine_server::IPCBuffer res = ParseCommand(&m_ipc_buffer[4], m_ret_buffer, static_cast<u32>(end_length) - 4);
|
||||
pine_server::IPCBuffer res = ParseCommand(&m_ipc_buffer[4], m_ret_buffer.data(), static_cast<u32>(end_length) - 4);
|
||||
|
||||
// if we cannot send back our answer restart the socket
|
||||
if (write_portable(m_msgsock, res.buffer, res.size) < 0)
|
||||
{
|
||||
if (StartSocket() < 0)
|
||||
if (!StartSocket())
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -480,9 +478,9 @@ namespace pine
|
||||
* NB: implicitely inlined
|
||||
*/
|
||||
template <typename T>
|
||||
static char* ToArray(char* res_array, T res, int i)
|
||||
static char* ToArray(char* res_array, T res, usz i)
|
||||
{
|
||||
memcpy((res_array + i), reinterpret_cast<char*>(&res), sizeof(T));
|
||||
memcpy(res_array + i, reinterpret_cast<char*>(&res), sizeof(T));
|
||||
return res_array;
|
||||
}
|
||||
|
||||
@@ -503,7 +501,7 @@ namespace pine
|
||||
* Ensures an IPC message isn't too big.
|
||||
* return value: false if checks failed, true otherwise.
|
||||
*/
|
||||
static inline bool SafetyChecks(u32 command_len, int command_size, u32 reply_len, int reply_size = 0, u32 buf_size = MAX_IPC_SIZE - 1)
|
||||
static inline bool SafetyChecks(usz command_len, usz command_size, usz reply_len, usz reply_size = 0, usz buf_size = MAX_IPC_SIZE - 1)
|
||||
{
|
||||
bool res = ((command_len + command_size) > buf_size ||
|
||||
(reply_len + reply_size) >= MAX_IPC_RETURN_SIZE);
|
||||
@@ -537,7 +535,10 @@ namespace pine
|
||||
// yes very good windows s/sun/sin/g sure is fine
|
||||
server.sin_family = AF_INET;
|
||||
// localhost only
|
||||
server.sin_addr.s_addr = inet_addr("127.0.0.1");
|
||||
if (!inet_pton(server.sin_family, "127.0.0.1", &server.sin_addr.s_addr))
|
||||
{
|
||||
fmt::throw_exception("IPC: Failed to convert localhost");
|
||||
}
|
||||
server.sin_port = htons(Impl::get_port());
|
||||
|
||||
if (bind(m_sock, (struct sockaddr*)&server, sizeof(server)) == SOCKET_ERROR)
|
||||
@@ -609,8 +610,6 @@ namespace pine
|
||||
~pine_server()
|
||||
{
|
||||
Cleanup();
|
||||
delete[] m_ret_buffer;
|
||||
delete[] m_ipc_buffer;
|
||||
}
|
||||
|
||||
}; // class pine_server
|
||||
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
add_subdirectory(rtmidi EXCLUDE_FROM_ALL)
|
||||
+1
Submodule 3rdparty/rtmidi/rtmidi added at 84a99422a3
Vendored
+61
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="rtmidi\RtMidi.h" />
|
||||
<ClInclude Include="rtmidi\rtmidi_c.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="rtmidi\RtMidi.cpp" />
|
||||
<ClCompile Include="rtmidi\rtmidi_c.cpp" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{2C902C67-985C-4BE0-94A3-E0FE2EB929A3}</ProjectGuid>
|
||||
<RootNamespace>rtmidi</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(SolutionDir)\buildfiles\msvc\common_default.props" />
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<Import Project="$(SolutionDir)\buildfiles\msvc\common_default_macros.props" />
|
||||
<PropertyGroup Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(SolutionDir)\buildfiles\msvc\rpcs3_default.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(SolutionDir)\buildfiles\msvc\rpcs3_debug.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(SolutionDir)\buildfiles\msvc\rpcs3_release.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<WarningLevel>TurnOffAllWarnings</WarningLevel>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<PreprocessorDefinitions>__WINDOWS_MM__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>./rtmidi/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DebugInformationFormat Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
Vendored
+1
-1
Submodule 3rdparty/wolfssl/wolfssl updated: 44f81f8bc0...979707380c
+4
-4
@@ -11,7 +11,7 @@ Other instructions may be found [here](https://wiki.rpcs3.net/index.php?title=Bu
|
||||
* [Python 3.6+](https://www.python.org/downloads/) (add to PATH)
|
||||
* [Qt 5.15.2](https://www.qt.io/download-qt-installer)
|
||||
* [Visual Studio 2019](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community)
|
||||
* [Vulkan SDK 1.2.224+](https://vulkan.lunarg.com/sdk/home) (See "Install the SDK" [here](https://vulkan.lunarg.com/doc/sdk/latest/windows/getting_started.html))
|
||||
* [Vulkan SDK 1.3.224+](https://vulkan.lunarg.com/sdk/home) (See "Install the SDK" [here](https://vulkan.lunarg.com/doc/sdk/latest/windows/getting_started.html))
|
||||
|
||||
**Either add the** `QTDIR` **environment variable, e.g.** `<QtInstallFolder>\5.15.2\msvc2019_64\` **, or use the [Visual Studio Qt Plugin](https://marketplace.visualstudio.com/items?itemName=TheQtCompany.QtVisualStudioTools2019)**
|
||||
|
||||
@@ -22,8 +22,8 @@ These are the essentials tools to build RPCS3 on Linux. Some of them can be inst
|
||||
* Clang 12+ or GCC 11+
|
||||
* [CMake 3.16.9+](https://www.cmake.org/download/)
|
||||
* [Qt 5.15.2](https://www.qt.io/download-qt-installer)
|
||||
* [Vulkan SDK 1.2.224+](https://vulkan.lunarg.com/sdk/home) (See "Install the SDK" [here](https://vulkan.lunarg.com/doc/sdk/latest/linux/getting_started.html))
|
||||
* [SDL2](https://www.libsdl.org/download-2.0.php) (for the FAudio backend)
|
||||
* [Vulkan SDK 1.3.224+](https://vulkan.lunarg.com/sdk/home) (See "Install the SDK" [here](https://vulkan.lunarg.com/doc/sdk/latest/linux/getting_started.html))
|
||||
* [SDL2](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.**
|
||||
|
||||
@@ -111,7 +111,7 @@ git submodule update --init
|
||||
|
||||
Open `rpcs3.sln`. The recommended build configuration is `Release`. (On older revisions: `Release - LLVM`)
|
||||
|
||||
You may want to download the precompiled [LLVM libs](https://github.com/RPCS3/llvm-mirror/releases/download/custom-build-win/llvmlibs_mt.7z) and extract them to the root rpcs3 folder (which contains `rpcs3.sln`), as well as download and extract the [additional libs](https://github.com/RPCS3/glslang/releases/download/custom-build-win/glslanglibs_mt.7z) to `lib\%CONFIGURATION%-x64\` to speed up compilation time (unoptimised/debug libs are currently not available precompiled).
|
||||
You may want to download the precompiled [LLVM libs](https://github.com/RPCS3/llvm-mirror/releases/download/custom-build-win-16.0.1/llvmlibs_mt.7z) and extract them to `3rdparty\llvm\`, as well as download and extract the [additional libs](https://github.com/RPCS3/glslang/releases/download/custom-build-win/glslanglibs_mt.7z) to `lib\%CONFIGURATION%-x64\` to speed up compilation time (unoptimised/debug libs are currently not available precompiled).
|
||||
|
||||
If you're not using the precompiled libs, build the following projects in *__BUILD_BEFORE* folder by right-clicking on a project > *Build*.:
|
||||
* glslang
|
||||
|
||||
+2
-1
@@ -14,7 +14,8 @@ endif()
|
||||
|
||||
option(USE_NATIVE_INSTRUCTIONS "USE_NATIVE_INSTRUCTIONS makes rpcs3 compile with -march=native, which is useful for local builds, but not good for packages." ON)
|
||||
option(WITH_LLVM "Enable usage of LLVM library" ON)
|
||||
option(BUILD_LLVM_SUBMODULE "Build LLVM from git submodule" ON)
|
||||
option(BUILD_LLVM "Build LLVM from git submodule" OFF)
|
||||
option(STATIC_LINK_LLVM "Link against LLVM statically. This will get set to ON if you build LLVM from the submodule." OFF)
|
||||
option(USE_FAUDIO "FAudio audio backend" ON)
|
||||
option(USE_LIBEVDEV "libevdev-based joystick support" ON)
|
||||
option(USE_DISCORD_RPC "Discord rich presence integration" OFF)
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
RPCS3
|
||||
=====
|
||||
|
||||
[](https://dev.azure.com/nekotekina/nekotekina/_build?definitionId=4&branchName=master)
|
||||
[&logo=cirrus-ci)](https://cirrus-ci.com/github/RPCS3/rpcs3)
|
||||
[](https://discord.me/rpcs3)
|
||||
[](https://cirrus-ci.com/github/RPCS3/rpcs3)
|
||||
[](https://discord.me/rpcs3)
|
||||
|
||||
The world's first free and open-source PlayStation 3 emulator/debugger, written in C++ for Windows, Linux, macOS and FreeBSD.
|
||||
|
||||
|
||||
+40
-8
@@ -1,7 +1,6 @@
|
||||
#include "stdafx.h"
|
||||
#include "Config.h"
|
||||
#include "util/types.hpp"
|
||||
|
||||
#include "util/yaml.hpp"
|
||||
|
||||
#include <charconv>
|
||||
@@ -24,9 +23,9 @@ namespace cfg
|
||||
{
|
||||
for (const auto& node : owner->m_nodes)
|
||||
{
|
||||
if (node->get_name() == name)
|
||||
if (node->get_name() == m_name)
|
||||
{
|
||||
cfg_log.fatal("Node already exists: %s", name);
|
||||
cfg_log.fatal("Node already exists: %s", m_name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +61,7 @@ bool try_to_int64(s64* out, std::string_view value, s64 min, s64 max)
|
||||
{
|
||||
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_int64(): called with an empty string");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -97,7 +96,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 (%d..%d)", value, min, max);
|
||||
if (out) cfg_log.error("cfg::try_to_int64('%s'): out of bounds (val=%d, min=%d, max=%d)", value, result, min, max);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -140,7 +139,7 @@ bool try_to_uint64(u64* out, std::string_view value, u64 min, u64 max)
|
||||
|
||||
if (result < min || result > max)
|
||||
{
|
||||
if (out) cfg_log.error("cfg::try_to_uint64('%s'): out of bounds (%u..%u)", value, min, max);
|
||||
if (out) cfg_log.error("cfg::try_to_uint64('%s'): out of bounds (val=%u, min=%u, max=%u)", value, result, min, max);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -176,7 +175,7 @@ bool try_to_float(f64* out, std::string_view value, f64 min, f64 max)
|
||||
|
||||
if (result < min || result > max)
|
||||
{
|
||||
if (out) cfg_log.error("cfg::try_to_float('%s'): out of bounds (%f..%f)", value, min, max);
|
||||
if (out) cfg_log.error("cfg::try_to_float('%s'): out of bounds (val=%f, min=%f, max=%f)", value, result, min, max);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -184,6 +183,27 @@ 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)
|
||||
{
|
||||
#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())
|
||||
{
|
||||
if (out) *out = std::string(str.data(), ptr);
|
||||
return true;
|
||||
}
|
||||
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());
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool cfg::try_to_enum_value(u64* out, decltype(&fmt_class_string<int>::format) func, std::string_view value)
|
||||
{
|
||||
u64 max = umax;
|
||||
@@ -231,7 +251,7 @@ bool cfg::try_to_enum_value(u64* out, decltype(&fmt_class_string<int>::format) f
|
||||
|
||||
if (result > max)
|
||||
{
|
||||
if (out) cfg_log.error("cfg::try_to_enum_value('%s'): out of bounds(0..%u)", value, max);
|
||||
if (out) cfg_log.error("cfg::try_to_enum_value('%s'): out of bounds(val=%u, min=0, max=%u)", value, result, max);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -559,6 +579,18 @@ void cfg::log_entry::from_default()
|
||||
set_map({});
|
||||
}
|
||||
|
||||
std::pair<u16, u16> cfg::device_info::get_usb_ids() const
|
||||
{
|
||||
auto string_to_hex = [](const std::string& str) -> u16
|
||||
{
|
||||
u16 value = 0x0000;
|
||||
if (!str.empty() && std::from_chars(str.data(), str.data() + str.size(), value, 16).ec != std::errc{})
|
||||
cfg_log.error("Failed to parse hex from string \"%s\"", str);
|
||||
return value;
|
||||
};
|
||||
return {string_to_hex(vid), string_to_hex(pid)};
|
||||
}
|
||||
|
||||
void cfg::device_entry::set_map(map_of_type<device_info>&& map)
|
||||
{
|
||||
m_map = std::move(map);
|
||||
|
||||
+27
-6
@@ -226,6 +226,11 @@ namespace cfg
|
||||
return m_value;
|
||||
}
|
||||
|
||||
T get_default() const
|
||||
{
|
||||
return def;
|
||||
}
|
||||
|
||||
void set(T value)
|
||||
{
|
||||
m_value = value;
|
||||
@@ -285,8 +290,8 @@ namespace cfg
|
||||
int_type def;
|
||||
|
||||
// Expose range
|
||||
static const s64 max = Max;
|
||||
static const s64 min = Min;
|
||||
static constexpr s64 max = Max;
|
||||
static constexpr s64 min = Min;
|
||||
|
||||
_int(node* owner, const std::string& name, int_type def = std::min<int_type>(Max, std::max<int_type>(Min, 0)), bool dynamic = false)
|
||||
: _base(type::_int, owner, name, dynamic)
|
||||
@@ -334,6 +339,7 @@ namespace cfg
|
||||
|
||||
void set(const s64& value)
|
||||
{
|
||||
ensure(value >= Min && value <= Max);
|
||||
m_value = static_cast<int_type>(value);
|
||||
}
|
||||
|
||||
@@ -383,12 +389,24 @@ namespace cfg
|
||||
|
||||
std::string to_string() const override
|
||||
{
|
||||
return std::to_string(m_value);
|
||||
std::string result;
|
||||
if (try_to_string(&result, m_value))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
return "0.0";
|
||||
}
|
||||
|
||||
std::string def_to_string() const override
|
||||
{
|
||||
return std::to_string(def);
|
||||
std::string result;
|
||||
if (try_to_string(&result, def))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
return "0.0";
|
||||
}
|
||||
|
||||
bool from_string(std::string_view value, bool /*dynamic*/ = false) override
|
||||
@@ -405,6 +423,7 @@ namespace cfg
|
||||
|
||||
void set(const f64& value)
|
||||
{
|
||||
ensure(value >= Min && value <= Max);
|
||||
m_value = static_cast<float_type>(value);
|
||||
}
|
||||
|
||||
@@ -435,8 +454,8 @@ namespace cfg
|
||||
int_type def;
|
||||
|
||||
// Expose range
|
||||
static const u64 max = Max;
|
||||
static const u64 min = Min;
|
||||
static constexpr u64 max = Max;
|
||||
static constexpr u64 min = Min;
|
||||
|
||||
uint(node* owner, const std::string& name, int_type def = std::max<int_type>(Min, 0), bool dynamic = false)
|
||||
: _base(type::uint, owner, name, dynamic)
|
||||
@@ -484,6 +503,7 @@ namespace cfg
|
||||
|
||||
void set(const u64& value)
|
||||
{
|
||||
ensure(value >= Min && value <= Max);
|
||||
m_value = static_cast<int_type>(value);
|
||||
}
|
||||
|
||||
@@ -644,6 +664,7 @@ namespace cfg
|
||||
std::string serial;
|
||||
std::string vid;
|
||||
std::string pid;
|
||||
std::pair<u16, u16> get_usb_ids() const;
|
||||
};
|
||||
|
||||
class device_entry final : public _base
|
||||
|
||||
+2
-2
@@ -1783,7 +1783,7 @@ const std::string& fs::get_config_dir()
|
||||
if (GetEnvironmentVariable(L"RPCS3_CONFIG_DIR", buf, size) - 1 >= size - 1 &&
|
||||
GetModuleFileName(nullptr, buf, size) - 1 >= size - 1)
|
||||
{
|
||||
MessageBoxA(nullptr, fmt::format("GetModuleFileName() failed: error %u.", GetLastError()).c_str(), "fs::get_config_dir()", MB_ICONERROR);
|
||||
MessageBoxA(nullptr, fmt::format("GetModuleFileName() failed: error: %s", fmt::win_error{GetLastError(), nullptr}).c_str(), "fs::get_config_dir()", MB_ICONERROR);
|
||||
return dir; // empty
|
||||
}
|
||||
|
||||
@@ -1868,7 +1868,7 @@ const std::string& fs::get_temp_dir()
|
||||
wchar_t buf[MAX_PATH + 2]{};
|
||||
if (GetTempPathW(MAX_PATH + 1, buf) - 1 > MAX_PATH)
|
||||
{
|
||||
MessageBoxA(nullptr, fmt::format("GetTempPath() failed: error %u.", GetLastError()).c_str(), "fs::get_temp_dir()", MB_ICONERROR);
|
||||
MessageBoxA(nullptr, fmt::format("GetTempPath() failed: error: %s", fmt::win_error{GetLastError(), nullptr}).c_str(), "fs::get_temp_dir()", MB_ICONERROR);
|
||||
return dir; // empty
|
||||
}
|
||||
|
||||
|
||||
+66
-22
@@ -198,6 +198,9 @@ static u8* add_jit_memory(usz size, uint align)
|
||||
});
|
||||
}
|
||||
|
||||
ensure(pointer + pos >= get_jit_memory() + Off);
|
||||
ensure(pointer + pos < get_jit_memory() + Off + 0x40000000);
|
||||
|
||||
return pointer + pos;
|
||||
}
|
||||
|
||||
@@ -795,7 +798,7 @@ void asmjit::simd_builder::vec_cmp_eq(u32 esize, const Operand& dst, const Opera
|
||||
}
|
||||
else
|
||||
{
|
||||
_vec_binary_op(kIdPcmpeqw, kIdVpcmpeqw, kIdNone, dst, lhs, rhs);
|
||||
_vec_binary_op(kIdPcmpeqd, kIdVpcmpeqd, kIdNone, dst, lhs, rhs);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1304,7 +1307,7 @@ std::string jit_compiler::cpu(const std::string& _cpu)
|
||||
|
||||
if (m_cpu.empty())
|
||||
{
|
||||
m_cpu = llvm::sys::getHostCPUName().operator std::string();
|
||||
m_cpu = llvm::sys::getHostCPUName().str();
|
||||
|
||||
if (m_cpu == "sandybridge" ||
|
||||
m_cpu == "ivybridge" ||
|
||||
@@ -1319,7 +1322,10 @@ std::string jit_compiler::cpu(const std::string& _cpu)
|
||||
m_cpu == "icelake-client" ||
|
||||
m_cpu == "icelake-server" ||
|
||||
m_cpu == "tigerlake" ||
|
||||
m_cpu == "rocketlake")
|
||||
m_cpu == "rocketlake" ||
|
||||
m_cpu == "alderlake" ||
|
||||
m_cpu == "raptorlake" ||
|
||||
m_cpu == "meteorlake")
|
||||
{
|
||||
// Downgrade if AVX is not supported by some chips
|
||||
if (!utils::has_avx())
|
||||
@@ -1350,11 +1356,51 @@ std::string jit_compiler::cpu(const std::string& _cpu)
|
||||
// Upgrade
|
||||
m_cpu = "znver2";
|
||||
}
|
||||
|
||||
if ((m_cpu == "znver3" || m_cpu == "goldmont" || m_cpu == "alderlake" || m_cpu == "raptorlake" || m_cpu == "meteorlake") && utils::has_avx512_icl())
|
||||
{
|
||||
// Upgrade
|
||||
m_cpu = "icelake-client";
|
||||
}
|
||||
|
||||
if (m_cpu == "goldmont" && utils::has_avx2())
|
||||
{
|
||||
// Upgrade
|
||||
m_cpu = "alderlake";
|
||||
}
|
||||
}
|
||||
|
||||
return m_cpu;
|
||||
}
|
||||
|
||||
std::string jit_compiler::triple1()
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
return llvm::Triple::normalize(llvm::sys::getProcessTriple());
|
||||
#elif defined(__APPLE__) && defined(ARCH_X64)
|
||||
return llvm::Triple::normalize("x86_64-unknown-linux-gnu");
|
||||
#elif defined(__APPLE__) && defined(ARCH_ARM64)
|
||||
return llvm::Triple::normalize("aarch64-unknown-linux-gnu");
|
||||
#else
|
||||
return llvm::Triple::normalize(llvm::sys::getProcessTriple());
|
||||
#endif
|
||||
}
|
||||
|
||||
std::string jit_compiler::triple2()
|
||||
{
|
||||
#if defined(_WIN32) && defined(ARCH_X64)
|
||||
return llvm::Triple::normalize("x86_64-unknown-linux-gnu");
|
||||
#elif defined(_WIN32) && defined(ARCH_ARM64)
|
||||
return llvm::Triple::normalize("aarch64-unknown-linux-gnu");
|
||||
#elif defined(__APPLE__) && defined(ARCH_X64)
|
||||
return llvm::Triple::normalize("x86_64-unknown-linux-gnu");
|
||||
#elif defined(__APPLE__) && defined(ARCH_ARM64)
|
||||
return llvm::Triple::normalize("aarch64-unknown-linux-gnu");
|
||||
#else
|
||||
return llvm::Triple::normalize(llvm::sys::getProcessTriple());
|
||||
#endif
|
||||
}
|
||||
|
||||
jit_compiler::jit_compiler(const std::unordered_map<std::string, u64>& _link, const std::string& _cpu, u32 flags)
|
||||
: m_context(new llvm::LLVMContext)
|
||||
, m_cpu(cpu(_cpu))
|
||||
@@ -1362,15 +1408,13 @@ jit_compiler::jit_compiler(const std::unordered_map<std::string, u64>& _link, co
|
||||
std::string result;
|
||||
|
||||
auto null_mod = std::make_unique<llvm::Module> ("null_", *m_context);
|
||||
#if defined(__APPLE__) && defined(ARCH_ARM64)
|
||||
// Force override triple on Apple arm64 or we'll get linking errors.
|
||||
null_mod->setTargetTriple(llvm::Triple::normalize(utils::c_llvm_default_triple));
|
||||
#endif
|
||||
null_mod->setTargetTriple(jit_compiler::triple1());
|
||||
|
||||
std::unique_ptr<llvm::RTDyldMemoryManager> mem;
|
||||
|
||||
if (_link.empty())
|
||||
{
|
||||
std::unique_ptr<llvm::RTDyldMemoryManager> mem;
|
||||
|
||||
// Auxiliary JIT (does not use custom memory manager, only writes the objects)
|
||||
if (flags & 0x1)
|
||||
{
|
||||
mem = std::make_unique<MemoryManager1>();
|
||||
@@ -1378,31 +1422,31 @@ jit_compiler::jit_compiler(const std::unordered_map<std::string, u64>& _link, co
|
||||
else
|
||||
{
|
||||
mem = std::make_unique<MemoryManager2>();
|
||||
null_mod->setTargetTriple(llvm::Triple::normalize(utils::c_llvm_default_triple));
|
||||
null_mod->setTargetTriple(jit_compiler::triple2());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mem = std::make_unique<MemoryManager1>();
|
||||
}
|
||||
|
||||
// Auxiliary JIT (does not use custom memory manager, only writes the objects)
|
||||
{
|
||||
m_engine.reset(llvm::EngineBuilder(std::move(null_mod))
|
||||
.setErrorStr(&result)
|
||||
.setEngineKind(llvm::EngineKind::JIT)
|
||||
.setMCJITMemoryManager(std::move(mem))
|
||||
.setOptLevel(llvm::CodeGenOpt::Aggressive)
|
||||
.setCodeModel(flags & 0x2 ? llvm::CodeModel::Large : llvm::CodeModel::Small)
|
||||
#ifdef __APPLE__
|
||||
//.setCodeModel(llvm::CodeModel::Large)
|
||||
#endif
|
||||
.setRelocationModel(llvm::Reloc::Model::PIC_)
|
||||
.setMCPU(m_cpu)
|
||||
.create());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Primary JIT
|
||||
m_engine.reset(llvm::EngineBuilder(std::move(null_mod))
|
||||
.setErrorStr(&result)
|
||||
.setEngineKind(llvm::EngineKind::JIT)
|
||||
.setMCJITMemoryManager(std::make_unique<MemoryManager1>())
|
||||
.setOptLevel(llvm::CodeGenOpt::Aggressive)
|
||||
.setCodeModel(flags & 0x2 ? llvm::CodeModel::Large : llvm::CodeModel::Small)
|
||||
.setMCPU(m_cpu)
|
||||
.create());
|
||||
|
||||
if (!_link.empty())
|
||||
{
|
||||
for (auto&& [name, addr] : _link)
|
||||
{
|
||||
m_engine->updateGlobalMapping(name, addr);
|
||||
|
||||
@@ -546,6 +546,12 @@ public:
|
||||
|
||||
// Get CPU info
|
||||
static std::string cpu(const std::string& _cpu);
|
||||
|
||||
// Get system triple (PPU)
|
||||
static std::string triple1();
|
||||
|
||||
// Get system triple (SPU)
|
||||
static std::string triple2();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+39
-2
@@ -37,6 +37,12 @@ std::string utf16_to_utf8(std::u16string_view src)
|
||||
return converter.to_bytes(src.data());
|
||||
}
|
||||
|
||||
std::u16string utf8_to_utf16(std::string_view src)
|
||||
{
|
||||
std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> converter{};
|
||||
return converter.from_bytes(src.data());
|
||||
}
|
||||
|
||||
std::wstring utf8_to_wchar(std::string_view src)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
@@ -73,6 +79,17 @@ std::string fmt::win_error_to_string(unsigned long error, void* module_handle)
|
||||
|
||||
return message;
|
||||
}
|
||||
|
||||
std::string fmt::win_error_to_string(const fmt::win_error& error)
|
||||
{
|
||||
return fmt::win_error_to_string(error.error, error.module_handle);
|
||||
}
|
||||
|
||||
template <>
|
||||
void fmt_class_string<fmt::win_error>::format(std::string& out, u64 arg)
|
||||
{
|
||||
fmt::append(out, "%s", fmt::win_error_to_string(get_object(arg)));
|
||||
}
|
||||
#endif
|
||||
|
||||
template <>
|
||||
@@ -197,6 +214,26 @@ void fmt_class_string<std::vector<char8_t>>::format(std::string& out, u64 arg)
|
||||
out.append(obj.cbegin(), obj.cend());
|
||||
}
|
||||
|
||||
template <>
|
||||
void fmt_class_string<fmt::buf_to_hexstring>::format(std::string& out, u64 arg)
|
||||
{
|
||||
const auto& _arg = get_object(arg);
|
||||
const std::vector<u8> buf(_arg.buf, _arg.buf + _arg.len);
|
||||
out.reserve(out.size() + (buf.size() * 3));
|
||||
static constexpr char hex[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
|
||||
|
||||
for (usz index = 0; index < buf.size(); index++)
|
||||
{
|
||||
out += hex[buf[index] >> 4];
|
||||
out += hex[buf[index] & 15];
|
||||
|
||||
if (((index + 1) % 16) == 0)
|
||||
out += '\n';
|
||||
else
|
||||
out += ' ';
|
||||
}
|
||||
}
|
||||
|
||||
void format_byte_array(std::string& out, const uchar* data, usz size)
|
||||
{
|
||||
if (!size)
|
||||
@@ -562,7 +599,7 @@ std::string fmt::trim(const std::string& source, const std::string& values)
|
||||
return source.substr(begin, source.find_last_not_of(values) + 1);
|
||||
}
|
||||
|
||||
std::string fmt::to_upper(const std::string& string)
|
||||
std::string fmt::to_upper(std::string_view string)
|
||||
{
|
||||
std::string result;
|
||||
result.resize(string.size());
|
||||
@@ -570,7 +607,7 @@ std::string fmt::to_upper(const std::string& string)
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string fmt::to_lower(const std::string& string)
|
||||
std::string fmt::to_lower(std::string_view string)
|
||||
{
|
||||
std::string result;
|
||||
result.resize(string.size());
|
||||
|
||||
@@ -10,8 +10,15 @@ namespace fmt
|
||||
static std::string format(const CharT(&)[N], const Args&...);
|
||||
|
||||
#ifdef _WIN32
|
||||
struct win_error
|
||||
{
|
||||
unsigned long error{};
|
||||
void* module_handle{};
|
||||
};
|
||||
|
||||
// Get a string for a windows error (DWORD). Optionally a module HANDLE can be passed.
|
||||
std::string win_error_to_string(unsigned long error, void* module_handle = nullptr);
|
||||
std::string win_error_to_string(const win_error& error);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -237,6 +244,29 @@ struct fmt_class_string<wchar_t*, void> : fmt_class_string<const wchar_t*>
|
||||
{
|
||||
};
|
||||
|
||||
namespace fmt
|
||||
{
|
||||
template <typename T>
|
||||
concept StringConvertible = requires (T & t)
|
||||
{
|
||||
{ t.to_string() } -> std::convertible_to<std::string>;
|
||||
};
|
||||
}
|
||||
|
||||
template <fmt::StringConvertible T>
|
||||
struct fmt_class_string<T, void>
|
||||
{
|
||||
static FORCE_INLINE SAFE_BUFFERS(const T&) get_object(u64 arg)
|
||||
{
|
||||
return *reinterpret_cast<const T*>(static_cast<uptr>(arg));
|
||||
}
|
||||
|
||||
static void format(std::string& out, u64 arg)
|
||||
{
|
||||
out += get_object(arg).to_string();
|
||||
}
|
||||
};
|
||||
|
||||
namespace fmt
|
||||
{
|
||||
// Both uchar and std::byte are allowed
|
||||
|
||||
+16
-3
@@ -11,10 +11,11 @@
|
||||
std::wstring utf8_to_wchar(std::string_view src);
|
||||
std::string wchar_to_utf8(std::wstring_view src);
|
||||
std::string utf16_to_utf8(std::u16string_view src);
|
||||
std::u16string utf8_to_utf16(std::string_view src);
|
||||
|
||||
// Copy null-terminated string from a std::string or a char array to a char array with truncation
|
||||
template <typename D, typename T>
|
||||
inline void strcpy_trunc(D& dst, const T& src)
|
||||
inline void strcpy_trunc(D&& dst, const T& src)
|
||||
{
|
||||
const usz count = std::size(src) >= std::size(dst) ? std::max<usz>(std::size(dst), 1) - 1 : std::size(src);
|
||||
std::memcpy(std::data(dst), std::data(src), count);
|
||||
@@ -30,6 +31,9 @@ bool try_to_uint64(u64* out, std::string_view value, u64 min, u64 max);
|
||||
// Convert string to float
|
||||
bool try_to_float(f64* out, std::string_view value, f64 min, f64 max);
|
||||
|
||||
// Convert float to string locale independent
|
||||
bool try_to_string(std::string* out, const f64& value);
|
||||
|
||||
// Get the file extension of a file path ("png", "jpg", etc.)
|
||||
std::string get_file_extension(const std::string& file_path);
|
||||
|
||||
@@ -169,8 +173,17 @@ namespace fmt
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string to_upper(const std::string& string);
|
||||
std::string to_lower(const std::string& string);
|
||||
std::string to_upper(std::string_view string);
|
||||
std::string to_lower(std::string_view string);
|
||||
|
||||
bool match(const std::string& source, const std::string& mask);
|
||||
|
||||
struct buf_to_hexstring
|
||||
{
|
||||
buf_to_hexstring(const u8* buf, usz len)
|
||||
: buf(buf), len(len) {}
|
||||
|
||||
const u8* buf;
|
||||
usz len;
|
||||
};
|
||||
}
|
||||
|
||||
+111
-38
@@ -4,6 +4,7 @@
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
#include "Emu/Cell/lv2/sys_mmapper.h"
|
||||
#include "Emu/Cell/lv2/sys_event.h"
|
||||
#include "Emu/Cell/lv2/sys_process.h"
|
||||
#include "Emu/RSX/RSXThread.h"
|
||||
#include "Thread.h"
|
||||
#include "Utilities/JIT.h"
|
||||
@@ -15,6 +16,11 @@
|
||||
#include <Psapi.h>
|
||||
#include <process.h>
|
||||
#include <sysinfoapi.h>
|
||||
|
||||
#include "util/dyn_lib.hpp"
|
||||
|
||||
DYNAMIC_IMPORT_RENAME("Kernel32.dll", SetThreadDescriptionImport, "SetThreadDescription", HRESULT(HANDLE hThread, PCWSTR lpThreadDescription));
|
||||
|
||||
#else
|
||||
#ifndef _GNU_SOURCE
|
||||
#define _GNU_SOURCE
|
||||
@@ -277,8 +283,11 @@ enum x64_op_t : u32
|
||||
X64OP_ADC, // lock adc [mem], ...
|
||||
X64OP_SUB, // lock sub [mem], ...
|
||||
X64OP_SBB, // lock sbb [mem], ...
|
||||
X64OP_BEXTR,
|
||||
};
|
||||
|
||||
static thread_local x64_reg_t s_tls_reg3{};
|
||||
|
||||
void decode_x64_reg_op(const u8* code, x64_op_t& out_op, x64_reg_t& out_reg, usz& out_size, usz& out_length)
|
||||
{
|
||||
// simple analysis of x64 code allows to reinterpret MOV or other instructions in any desired way
|
||||
@@ -739,10 +748,12 @@ void decode_x64_reg_op(const u8* code, x64_op_t& out_op, x64_reg_t& out_reg, usz
|
||||
const u8 vopm = op1 == 0xc5 ? 1 : op2 & 0x1f;
|
||||
const u8 vop1 = op1 == 0xc5 ? op3 : code[2];
|
||||
const u8 vlen = (opx & 0x4) ? 32 : 16;
|
||||
//const u8 vreg = (~opx >> 3) & 0xf;
|
||||
const u8 vreg = (~opx >> 3) & 0xf;
|
||||
out_length += op1 == 0xc5 ? 2 : 3;
|
||||
code += op1 == 0xc5 ? 2 : 3;
|
||||
|
||||
s_tls_reg3 = x64_reg_t{vreg};
|
||||
|
||||
if (vopm == 0x1) switch (vop1) // Implied leading byte 0x0F
|
||||
{
|
||||
case 0x11:
|
||||
@@ -772,6 +783,22 @@ void decode_x64_reg_op(const u8* code, x64_op_t& out_op, x64_reg_t& out_reg, usz
|
||||
}
|
||||
}
|
||||
|
||||
if (vopm == 0x2) switch (vop1) // Implied leading bytes 0x0F 0x38
|
||||
{
|
||||
case 0xf7:
|
||||
{
|
||||
if (!repe && !repne && vlen == 16) // BEXTR r32,mem,r32
|
||||
{
|
||||
out_op = X64OP_BEXTR;
|
||||
out_reg = get_modRM_reg_xmm(code, rex);
|
||||
out_size = opx & 0x80 ? 8 : 4;
|
||||
out_length += get_modRM_size(code);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case 0xc6:
|
||||
@@ -1367,6 +1394,37 @@ bool handle_access_violation(u32 addr, bool is_writing, ucontext_t* context) noe
|
||||
|
||||
break;
|
||||
}
|
||||
case X64OP_BEXTR:
|
||||
{
|
||||
u32 value;
|
||||
if (is_writing || !thread->read_reg(addr, value))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
value = stx::se_storage<u32>::swap(value);
|
||||
|
||||
u64 ctrl;
|
||||
if (!get_x64_reg_value(context, s_tls_reg3, d_size, i_size, ctrl))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
u8 start = ctrl & 0xff;
|
||||
u8 _len = (ctrl & 0xff00) >> 8;
|
||||
if (_len > 32)
|
||||
_len = 32;
|
||||
if (start > 32)
|
||||
start = 32;
|
||||
value = (u64{value} >> start) & ~(u64{umax} << _len);
|
||||
|
||||
if (!put_x64_reg_value(context, reg, d_size, value) || !set_x64_cmp_flags(context, d_size, value, 0))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case X64OP_STORE:
|
||||
case X64OP_STORE_BE:
|
||||
{
|
||||
@@ -1457,7 +1515,7 @@ bool handle_access_violation(u32 addr, bool is_writing, ucontext_t* context) noe
|
||||
}
|
||||
}
|
||||
|
||||
if (pf_port_id)
|
||||
if (auto pf_port = idm::get<lv2_obj, lv2_event_port>(pf_port_id); pf_port && pf_port->queue)
|
||||
{
|
||||
// We notify the game that a page fault occurred so it can rectify it.
|
||||
// Note, for data3, were the memory readable AND we got a page fault, it must be due to a write violation since reads are allowed.
|
||||
@@ -1495,21 +1553,34 @@ bool handle_access_violation(u32 addr, bool is_writing, ucontext_t* context) noe
|
||||
}
|
||||
}
|
||||
|
||||
// Deschedule
|
||||
if (cpu->id_type() == 1)
|
||||
{
|
||||
lv2_obj::sleep(*cpu);
|
||||
}
|
||||
|
||||
// Now, place the page fault event onto table so that other functions [sys_mmapper_free_address and pagefault recovery funcs etc]
|
||||
// know that this thread is page faulted and where.
|
||||
|
||||
auto& pf_events = g_fxo->get<page_fault_event_entries>();
|
||||
|
||||
// De-schedule
|
||||
if (cpu->id_type() == 1)
|
||||
{
|
||||
std::lock_guard pf_lock(pf_events.pf_mutex);
|
||||
pf_events.events.emplace(cpu, addr);
|
||||
cpu->state -= cpu_flag::signal; // Cannot use check_state here and signal must be removed if exists
|
||||
lv2_obj::sleep(*cpu);
|
||||
}
|
||||
|
||||
auto send_event = [&]() -> error_code
|
||||
{
|
||||
lv2_obj::notify_all_t notify_later{};
|
||||
|
||||
std::lock_guard pf_lock(pf_events.pf_mutex);
|
||||
|
||||
if (auto error = pf_port->queue->send(pf_port->name ? pf_port->name : ((u64{process_getpid() + 0u} << 32) | u64{pf_port_id}), data1, data2, data3))
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
pf_events.events.emplace(cpu, addr);
|
||||
return {};
|
||||
};
|
||||
|
||||
sig_log.warning("Page_fault %s location 0x%x because of %s memory", is_writing ? "writing" : "reading",
|
||||
addr, data3 == SYS_MEMORY_PAGE_FAULT_CAUSE_READ_ONLY ? "writing read-only" : "using unmapped");
|
||||
|
||||
@@ -1521,13 +1592,12 @@ bool handle_access_violation(u32 addr, bool is_writing, ucontext_t* context) noe
|
||||
}
|
||||
}
|
||||
|
||||
error_code sending_error = sys_event_port_send(pf_port_id, data1, data2, data3);
|
||||
error_code sending_error = not_an_error(CELL_EBUSY);
|
||||
|
||||
// If we fail due to being busy, wait a bit and try again.
|
||||
while (static_cast<u32>(sending_error) == CELL_EBUSY)
|
||||
for (; static_cast<u32>(sending_error) == CELL_EBUSY; thread_ctrl::wait_for(1000))
|
||||
{
|
||||
thread_ctrl::wait_for(1000);
|
||||
sending_error = sys_event_port_send(pf_port_id, data1, data2, data3);
|
||||
sending_error = send_event();
|
||||
|
||||
if (cpu->is_stopped())
|
||||
{
|
||||
@@ -1761,7 +1831,11 @@ static LONG exception_filter(PEXCEPTION_POINTERS pExp) noexcept
|
||||
|
||||
const bool s_exception_handler_set = []() -> bool
|
||||
{
|
||||
#ifdef USE_ASAN
|
||||
if (!AddVectoredExceptionHandler(FALSE, (PVECTORED_EXCEPTION_HANDLER)exception_handler))
|
||||
#else
|
||||
if (!AddVectoredExceptionHandler(1, (PVECTORED_EXCEPTION_HANDLER)exception_handler))
|
||||
#endif
|
||||
{
|
||||
report_fatal_error("AddVectoredExceptionHandler() failed.");
|
||||
}
|
||||
@@ -1796,7 +1870,7 @@ static void signal_handler(int /*sig*/, siginfo_t* info, void* uct) noexcept
|
||||
const bool is_executing = err & 0x10;
|
||||
const bool is_writing = err & 0x2;
|
||||
#elif defined(ARCH_ARM64)
|
||||
const bool is_executing = uptr(info->si_addr) == RIP(context);
|
||||
const bool is_executing = uptr(info->si_addr) == uptr(RIP(context));
|
||||
const u32 insn = is_executing ? 0 : *reinterpret_cast<u32*>(RIP(context));
|
||||
const bool is_writing = (insn & 0xbfff0000) == 0x0c000000
|
||||
|| (insn & 0xbfe00000) == 0x0c800000
|
||||
@@ -2018,6 +2092,13 @@ void thread_base::initialize(void (*error_cb)())
|
||||
|
||||
void thread_base::set_name(std::string name)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
if (SetThreadDescriptionImport)
|
||||
{
|
||||
SetThreadDescriptionImport(GetCurrentThread(), utf8_to_wchar(name).c_str());
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
struct THREADNAME_INFO
|
||||
{
|
||||
@@ -2351,10 +2432,9 @@ void thread_ctrl::wait_for(u64 usec, [[maybe_unused]] bool alert /* true */)
|
||||
{
|
||||
struct itimerspec timeout;
|
||||
u64 missed;
|
||||
u64 nsec = usec * 1000ull;
|
||||
|
||||
timeout.it_value.tv_nsec = (nsec % 1000000000ull);
|
||||
timeout.it_value.tv_sec = nsec / 1000000000ull;
|
||||
timeout.it_value.tv_nsec = usec * 1'000ull;
|
||||
timeout.it_value.tv_sec = 0;
|
||||
timeout.it_interval.tv_sec = 0;
|
||||
timeout.it_interval.tv_nsec = 0;
|
||||
timerfd_settime(fd_timer, 0, &timeout, NULL);
|
||||
@@ -2580,26 +2660,24 @@ void thread_base::exec()
|
||||
while (shared_ptr<thread_future> head = m_taskq.exchange(null_ptr))
|
||||
{
|
||||
// TODO: check if adapting reverse algorithm is feasible here
|
||||
shared_ptr<thread_future>* prev{};
|
||||
thread_future* prev_head{head.get()};
|
||||
|
||||
for (auto ptr = head.get(); ptr; ptr = ptr->next.get())
|
||||
for (thread_future* prev{};;)
|
||||
{
|
||||
utils::prefetch_exec(ptr->exec.load());
|
||||
utils::prefetch_exec(prev_head->exec.load());
|
||||
|
||||
ptr->prev = prev;
|
||||
|
||||
if (ptr->next)
|
||||
if (auto next = prev_head->next.get())
|
||||
{
|
||||
prev = &ptr->next;
|
||||
prev = std::exchange(prev_head, next);
|
||||
prev_head->prev = prev;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!prev)
|
||||
{
|
||||
prev = &head;
|
||||
}
|
||||
|
||||
for (auto ptr = prev->get(); ptr; ptr = ptr->prev->get())
|
||||
for (auto ptr = prev_head; ptr; ptr = ptr->prev)
|
||||
{
|
||||
if (auto task = ptr->exec.load()) [[likely]]
|
||||
{
|
||||
@@ -2623,11 +2701,6 @@ void thread_base::exec()
|
||||
// Partial cleanup
|
||||
ptr->next.reset();
|
||||
}
|
||||
|
||||
if (!ptr->prev)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!m_taskq) [[likely]]
|
||||
@@ -2710,7 +2783,7 @@ void thread_ctrl::detect_cpu_layout()
|
||||
if (!GetLogicalProcessorInformationEx(relationship,
|
||||
reinterpret_cast<SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *>(buffer.data()), &buffer_size))
|
||||
{
|
||||
sig_log.error("GetLogicalProcessorInformationEx failed (size=%u, error=%u)", buffer_size, GetLastError());
|
||||
sig_log.error("GetLogicalProcessorInformationEx failed (size=%u, error=%s)", buffer_size, fmt::win_error{GetLastError(), nullptr});
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2957,7 +3030,7 @@ void thread_ctrl::set_native_priority(int priority)
|
||||
|
||||
if (!SetThreadPriority(_this_thread, native_priority))
|
||||
{
|
||||
sig_log.error("SetThreadPriority() failed: 0x%x", GetLastError());
|
||||
sig_log.error("SetThreadPriority() failed: %s", fmt::win_error{GetLastError(), nullptr});
|
||||
}
|
||||
#else
|
||||
int policy;
|
||||
@@ -3009,7 +3082,7 @@ void thread_ctrl::set_thread_affinity_mask(u64 mask)
|
||||
HANDLE _this_thread = GetCurrentThread();
|
||||
if (!SetThreadAffinityMask(_this_thread, !mask ? process_affinity_mask : mask))
|
||||
{
|
||||
sig_log.error("Failed to set thread affinity 0x%x: error 0x%x.", mask, GetLastError());
|
||||
sig_log.error("Failed to set thread affinity 0x%x: error: %s", mask, fmt::win_error{GetLastError(), nullptr});
|
||||
}
|
||||
#elif __APPLE__
|
||||
// Supports only one core
|
||||
|
||||
+1
-1
@@ -95,7 +95,7 @@ class thread_future
|
||||
|
||||
shared_ptr<thread_future> next{};
|
||||
|
||||
shared_ptr<thread_future>* prev{};
|
||||
thread_future* prev{};
|
||||
|
||||
protected:
|
||||
atomic_t<void(*)(thread_base*, thread_future*)> exec{};
|
||||
|
||||
+522
-121
File diff suppressed because it is too large
Load Diff
+59
-1
@@ -18,6 +18,13 @@ namespace patch_key
|
||||
static const std::string patch = "Patch";
|
||||
static const std::string patch_version = "Patch Version";
|
||||
static const std::string version = "Version";
|
||||
static const std::string enabled = "Enabled";
|
||||
static const std::string config_values = "Configurable Values";
|
||||
static const std::string value = "Value";
|
||||
static const std::string type = "Type";
|
||||
static const std::string min = "Min";
|
||||
static const std::string max = "Max";
|
||||
static const std::string allowed_values = "Allowed Values";
|
||||
}
|
||||
|
||||
inline static const std::string patch_engine_version = "1.2";
|
||||
@@ -45,6 +52,21 @@ enum class patch_type
|
||||
bef32,
|
||||
bef64,
|
||||
utf8, // Text of string (not null-terminated automatically)
|
||||
move_file, // Move file
|
||||
hide_file, // Hide file
|
||||
};
|
||||
|
||||
static constexpr bool patch_type_uses_hex_offset(patch_type type)
|
||||
{
|
||||
return type >= patch_type::alloc && type <= patch_type::utf8;
|
||||
}
|
||||
|
||||
enum class patch_configurable_type
|
||||
{
|
||||
double_range,
|
||||
double_enum,
|
||||
long_range,
|
||||
long_enum
|
||||
};
|
||||
|
||||
class patch_engine
|
||||
@@ -54,6 +76,7 @@ public:
|
||||
{
|
||||
patch_type type = patch_type::load;
|
||||
u32 offset = 0;
|
||||
std::string original_offset{}; // Used for specifying paths
|
||||
std::string original_value{}; // Used for import consistency (avoid rounding etc.)
|
||||
union
|
||||
{
|
||||
@@ -63,7 +86,40 @@ public:
|
||||
mutable u32 alloc_addr = 0; // Used to save optional allocation address (if occured)
|
||||
};
|
||||
|
||||
using patch_app_versions = std::unordered_map<std::string /*app_version*/, bool /*enabled*/>;
|
||||
struct patch_allowed_value
|
||||
{
|
||||
std::string label;
|
||||
f64 value{};
|
||||
|
||||
bool operator==(const patch_allowed_value& other) const
|
||||
{
|
||||
return value == other.value && label == other.label;
|
||||
}
|
||||
};
|
||||
|
||||
struct patch_config_value
|
||||
{
|
||||
f64 value{};
|
||||
f64 min{};
|
||||
f64 max{};
|
||||
patch_configurable_type type{};
|
||||
std::vector<patch_allowed_value> allowed_values;
|
||||
|
||||
bool operator==(const patch_config_value& other) const
|
||||
{
|
||||
return value == other.value && min == other.min && max == other.max && type == other.type && allowed_values == other.allowed_values;
|
||||
}
|
||||
|
||||
void set_and_check_value(f64 new_value, const std::string& name);
|
||||
};
|
||||
|
||||
struct patch_config_values
|
||||
{
|
||||
bool enabled{};
|
||||
std::map<std::string, patch_config_value> config_values;
|
||||
};
|
||||
|
||||
using patch_app_versions = std::unordered_map<std::string /*app_version*/, patch_config_values>;
|
||||
using patch_serials = std::unordered_map<std::string /*serial*/, patch_app_versions>;
|
||||
using patch_titles = std::unordered_map<std::string /*serial*/, patch_serials>;
|
||||
|
||||
@@ -78,10 +134,12 @@ public:
|
||||
std::string author{};
|
||||
std::string notes{};
|
||||
std::string source_path{};
|
||||
std::map<std::string, patch_config_value> default_config_values;
|
||||
|
||||
// Redundant information for accessibility (see patch_container)
|
||||
std::string hash{};
|
||||
std::string version{};
|
||||
std::map<std::string, patch_config_value> actual_config_values;
|
||||
};
|
||||
|
||||
struct patch_container
|
||||
|
||||
+7
-5
@@ -42,6 +42,8 @@ public:
|
||||
// Underlying type
|
||||
using under = std::underlying_type_t<T>;
|
||||
|
||||
ENABLE_BITWISE_SERIALIZATION;
|
||||
|
||||
private:
|
||||
// Underlying value
|
||||
under m_data;
|
||||
@@ -49,7 +51,7 @@ private:
|
||||
friend class atomic_bs_t<T>;
|
||||
|
||||
// Value constructor
|
||||
constexpr explicit bs_t(int, under data)
|
||||
constexpr explicit bs_t(int, under data) noexcept
|
||||
: m_data(data)
|
||||
{
|
||||
}
|
||||
@@ -71,19 +73,19 @@ public:
|
||||
bs_t() = default;
|
||||
|
||||
// Construct from a single bit
|
||||
constexpr bs_t(T bit)
|
||||
constexpr bs_t(T bit) noexcept
|
||||
: m_data(shift(bit))
|
||||
{
|
||||
}
|
||||
|
||||
// Test for empty bitset
|
||||
constexpr explicit operator bool() const
|
||||
constexpr explicit operator bool() const noexcept
|
||||
{
|
||||
return m_data != 0;
|
||||
}
|
||||
|
||||
// Extract underlying data
|
||||
constexpr explicit operator under() const
|
||||
constexpr explicit operator under() const noexcept
|
||||
{
|
||||
return m_data;
|
||||
}
|
||||
@@ -138,7 +140,7 @@ public:
|
||||
return bs_t(0, lhs.m_data ^ rhs.m_data);
|
||||
}
|
||||
|
||||
constexpr bool operator ==(bs_t rhs) const
|
||||
constexpr bool operator ==(bs_t rhs) const noexcept
|
||||
{
|
||||
return m_data == rhs.m_data;
|
||||
}
|
||||
|
||||
@@ -777,9 +777,9 @@ struct color4_base
|
||||
};
|
||||
|
||||
constexpr color4_base()
|
||||
: x{}
|
||||
, y{}
|
||||
, z{}
|
||||
: x{ T{0} }
|
||||
, y{ T{0} }
|
||||
, z{ T{0} }
|
||||
, w{ T(1) }
|
||||
{
|
||||
}
|
||||
|
||||
@@ -359,6 +359,14 @@ public:
|
||||
return result;
|
||||
}
|
||||
|
||||
// Withdraw the list in reverse order (LIFO/FILO)
|
||||
lf_queue_slice<T> pop_all_reversed()
|
||||
{
|
||||
lf_queue_slice<T> result;
|
||||
result.m_head = m_head.exchange(nullptr);
|
||||
return result;
|
||||
}
|
||||
|
||||
// Apply func(data) to each element, return the total length
|
||||
template <typename F>
|
||||
usz apply(F func)
|
||||
|
||||
+63
-26
@@ -5,54 +5,81 @@ rXmlNode::rXmlNode()
|
||||
{
|
||||
}
|
||||
|
||||
rXmlNode::rXmlNode(const pugi::xml_node &node)
|
||||
rXmlNode::rXmlNode(const pugi::xml_node& node)
|
||||
{
|
||||
handle = node;
|
||||
}
|
||||
|
||||
std::shared_ptr<rXmlNode> rXmlNode::GetChildren()
|
||||
{
|
||||
// it.begin() returns node_iterator*, *it.begin() return node*.
|
||||
pugi::xml_object_range<pugi::xml_node_iterator> it = handle.children();
|
||||
pugi::xml_node begin = *it.begin();
|
||||
if (handle)
|
||||
{
|
||||
if (const pugi::xml_node child = handle.first_child())
|
||||
{
|
||||
return std::make_shared<rXmlNode>(child);
|
||||
}
|
||||
}
|
||||
|
||||
if (begin)
|
||||
{
|
||||
return std::make_shared<rXmlNode>(begin);
|
||||
}
|
||||
else
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<rXmlNode> rXmlNode::GetNext()
|
||||
{
|
||||
pugi::xml_node result = handle.next_sibling();
|
||||
if (result)
|
||||
if (handle)
|
||||
{
|
||||
return std::make_shared<rXmlNode>(result);
|
||||
}
|
||||
else
|
||||
{
|
||||
return nullptr;
|
||||
if (const pugi::xml_node result = handle.next_sibling())
|
||||
{
|
||||
return std::make_shared<rXmlNode>(result);
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::string rXmlNode::GetName()
|
||||
{
|
||||
return handle.name();
|
||||
if (handle)
|
||||
{
|
||||
if (const pugi::char_t* name = handle.name())
|
||||
{
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
std::string rXmlNode::GetAttribute(const std::string &name)
|
||||
std::string rXmlNode::GetAttribute(const std::string& name)
|
||||
{
|
||||
auto pred = [&name](pugi::xml_attribute attr) { return (name == attr.name()); };
|
||||
return handle.find_attribute(pred).value();
|
||||
if (handle)
|
||||
{
|
||||
const auto pred = [&name](const pugi::xml_attribute& attr) { return (name == attr.name()); };
|
||||
if (const pugi::xml_attribute attr = handle.find_attribute(pred))
|
||||
{
|
||||
if (const pugi::char_t* value = attr.value())
|
||||
{
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
std::string rXmlNode::GetNodeContent()
|
||||
{
|
||||
return handle.text().get();
|
||||
if (handle)
|
||||
{
|
||||
if (const pugi::xml_text text = handle.text())
|
||||
{
|
||||
if (const pugi::char_t* value = text.get())
|
||||
{
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
rXmlDocument::rXmlDocument()
|
||||
@@ -61,10 +88,20 @@ rXmlDocument::rXmlDocument()
|
||||
|
||||
pugi::xml_parse_result rXmlDocument::Read(const std::string& data)
|
||||
{
|
||||
return handle.load_buffer(data.data(), data.size());
|
||||
if (handle)
|
||||
{
|
||||
return handle.load_buffer(data.data(), data.size());
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
std::shared_ptr<rXmlNode> rXmlDocument::GetRoot()
|
||||
{
|
||||
return std::make_shared<rXmlNode>(handle.root());
|
||||
if (const pugi::xml_node root = handle.root())
|
||||
{
|
||||
return std::make_shared<rXmlNode>(root);
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
+2
-2
@@ -19,11 +19,11 @@
|
||||
struct rXmlNode
|
||||
{
|
||||
rXmlNode();
|
||||
rXmlNode(const pugi::xml_node &);
|
||||
rXmlNode(const pugi::xml_node& node);
|
||||
std::shared_ptr<rXmlNode> GetChildren();
|
||||
std::shared_ptr<rXmlNode> GetNext();
|
||||
std::string GetName();
|
||||
std::string GetAttribute(const std::string &name);
|
||||
std::string GetAttribute(const std::string& name);
|
||||
std::string GetNodeContent();
|
||||
|
||||
pugi::xml_node handle{};
|
||||
|
||||
@@ -43,20 +43,6 @@ QLabel#gamelist_icon_background_color {
|
||||
color: rgba(209,209,209,255);
|
||||
}
|
||||
|
||||
/* game grid stylesheet */
|
||||
QTableWidget#game_grid {
|
||||
font-weight:600;
|
||||
font-size:8pt;
|
||||
font-family:Lucida Grande;
|
||||
color: rgba(51,51,51,255);
|
||||
}
|
||||
QTableWidget#game_grid::item:selected:active {
|
||||
selection-background-color: #0078D7;
|
||||
}
|
||||
QTableWidget#game_grid::item:selected:!active {
|
||||
selection-background-color: #008cff;
|
||||
}
|
||||
|
||||
/* log stylesheet */
|
||||
QTextEdit#tty_frame {
|
||||
background-color:#ffffff;
|
||||
@@ -131,3 +117,33 @@ QLabel#rsx_debugger_display_buffer {
|
||||
QLabel#l_controller {
|
||||
color:#434343;
|
||||
}
|
||||
|
||||
/* Game Grid */
|
||||
#game_list_grid_item[selected="true"] {
|
||||
background: #0078D7;
|
||||
}
|
||||
#game_list_grid_item:hover {
|
||||
background: #008cff;
|
||||
}
|
||||
#game_list_grid_item:focus {
|
||||
background: #0078D7;
|
||||
}
|
||||
|
||||
/* Game Grid Font */
|
||||
#game_list_grid_item #game_list_grid_item_title_label {
|
||||
font-weight: 600;
|
||||
font-size: 8pt;
|
||||
font-family: Lucida Grande;
|
||||
color: rgba(51,51,51,255);
|
||||
}
|
||||
|
||||
/* Game Grid hover and focus: we need to handle properties differently when using descendants */
|
||||
#game_list_grid_item[selected="true"] #game_list_grid_item_title_label {
|
||||
color: #fff;
|
||||
}
|
||||
#game_list_grid_item[hover="true"] #game_list_grid_item_title_label {
|
||||
color: #fff;
|
||||
}
|
||||
#game_list_grid_item[focus="true"] #game_list_grid_item_title_label {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
TheMitoSan Dark-Theme for RPCS3
|
||||
/*
|
||||
TheMitoSan Dark-Theme for RPCS3
|
||||
Based on Kuroi (Dark) by Ani
|
||||
by themitosan @ twitter.com/themitosan
|
||||
Ani @ https://github.com/AniLeo
|
||||
@@ -135,7 +135,7 @@ QPushButton::disabled {
|
||||
}
|
||||
|
||||
QPushButton::pressed {
|
||||
background-color: #333;
|
||||
background-color: #333;
|
||||
}
|
||||
|
||||
/* Log and Debugger borders */
|
||||
@@ -193,21 +193,10 @@ QListWidget::item:hover {
|
||||
}
|
||||
|
||||
/* Pad Settings: Controller Image */
|
||||
QLabel#l_controller {
|
||||
QLabel#l_controller {
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
/* Game Grid Font */
|
||||
QTableWidget#game_grid {
|
||||
font-weight: 600;
|
||||
font-size: 8pt;
|
||||
font-family: Lucida Grande;
|
||||
color: #FFF;
|
||||
}
|
||||
QTableWidget#game_grid::item:selected:!active {
|
||||
selection-background-color: #313f4e;
|
||||
}
|
||||
|
||||
/* Slider on toolbar */
|
||||
QWidget#sizeSliderContainer {
|
||||
background: transparent;
|
||||
@@ -230,8 +219,8 @@ QLabel#color_button {
|
||||
}
|
||||
|
||||
/* Search bar on main toolbar */
|
||||
QLineEdit#mw_searchbar {
|
||||
margin-left: 0.7em;
|
||||
QLineEdit#mw_searchbar {
|
||||
margin-left: 0.7em;
|
||||
color: #ecf0f1;
|
||||
}
|
||||
|
||||
@@ -344,24 +333,54 @@ QLabel#debugger_frame_pc {
|
||||
/* Tree view changes*/
|
||||
QTreeView::branch:has-children:!has-siblings:closed,
|
||||
QTreeView::branch:closed:has-children:has-siblings {
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_white.png");
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_white.png");
|
||||
}
|
||||
|
||||
QTreeView::branch:open:has-children:!has-siblings,
|
||||
QTreeView::branch:open:has-children:has-siblings {
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_down_white.png");
|
||||
QTreeView::branch:open:has-children:has-siblings {
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_down_white.png");
|
||||
}
|
||||
|
||||
QTreeView::branch:has-children:!has-siblings:closed:hover,
|
||||
QTreeView::branch:closed:has-children:has-siblings:hover {
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_blue.png");
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_blue.png");
|
||||
}
|
||||
|
||||
QTreeView::branch:open:has-children:!has-siblings:hover,
|
||||
QTreeView::branch:open:has-children:has-siblings:hover {
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_down_blue.png");
|
||||
QTreeView::branch:open:has-children:has-siblings:hover {
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_down_blue.png");
|
||||
}
|
||||
|
||||
/* Game Grid */
|
||||
#game_list_grid_item[selected="true"] {
|
||||
background: #313f4e;
|
||||
}
|
||||
#game_list_grid_item:hover {
|
||||
background: #313f4e;
|
||||
}
|
||||
#game_list_grid_item:focus {
|
||||
background: #0078D7;
|
||||
}
|
||||
|
||||
/* Game Grid Font */
|
||||
#game_list_grid_item #game_list_grid_item_title_label {
|
||||
font-weight: 600;
|
||||
font-size: 8pt;
|
||||
font-family: Lucida Grande;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
/* Game Grid hover and focus: we need to handle properties differently when using descendants */
|
||||
#game_list_grid_item[selected="true"] #game_list_grid_item_title_label {
|
||||
background-color: #313f4e;
|
||||
}
|
||||
#game_list_grid_item[hover="true"] #game_list_grid_item_title_label {
|
||||
background-color: #313f4e;
|
||||
}
|
||||
#game_list_grid_item[focus="true"] #game_list_grid_item_title_label {
|
||||
background-color: #0078D7;
|
||||
}
|
||||
|
||||
+40
-22
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Envy theme for RPCS3 by drysalter (https://github.com/drysalter)
|
||||
03/04/2019
|
||||
*/
|
||||
@@ -19,7 +19,7 @@ Candy Red: #ff007a
|
||||
Yellow: #f2d571
|
||||
Fuchsia: #ff00ff
|
||||
Orange: #ff6000
|
||||
Cyan: #3498d8
|
||||
Cyan: #3498d8
|
||||
|
||||
*/
|
||||
|
||||
@@ -209,7 +209,7 @@ QRadioButton::indicator:unchecked {
|
||||
}
|
||||
|
||||
QRadioButton::indicator:disabled {
|
||||
background-color: #4d5058;
|
||||
background-color: #4d5058;
|
||||
}
|
||||
|
||||
/* Combo Boxes */
|
||||
@@ -272,7 +272,7 @@ QSlider::handle:horizontal {
|
||||
border: 1px solid #5c5c5c;
|
||||
border-radius: 0.1em;
|
||||
width: 18px;
|
||||
margin: -2px 2;
|
||||
margin: -2px 2;
|
||||
}
|
||||
|
||||
QSlider::handle:horizontal:hover {
|
||||
@@ -335,7 +335,7 @@ QPushButton:disabled {
|
||||
}
|
||||
|
||||
QPushButton::pressed {
|
||||
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #2d3038, stop: 1 #2d3038);
|
||||
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #2d3038, stop: 1 #2d3038);
|
||||
}
|
||||
|
||||
/* Spinboxes */
|
||||
@@ -454,7 +454,7 @@ QListWidget::item:selected {
|
||||
}
|
||||
|
||||
QListWidget::item:hover {
|
||||
background-color: #30333a;
|
||||
background-color: #30333a;
|
||||
color: #8cf944;
|
||||
border-radius: 0.25em;
|
||||
}
|
||||
@@ -479,7 +479,7 @@ QListWidget::indicator:disabled {
|
||||
}
|
||||
|
||||
/* Pad Settings: Controller Image */
|
||||
QLabel#l_controller {
|
||||
QLabel#l_controller {
|
||||
color: #8cf944;
|
||||
}
|
||||
|
||||
@@ -505,7 +505,7 @@ QLabel#color_button {
|
||||
}
|
||||
|
||||
/* Search bar on main toolbar */
|
||||
QLineEdit#mw_searchbar {
|
||||
QLineEdit#mw_searchbar {
|
||||
color: #ecf0f1;
|
||||
background-color: #2d3038;
|
||||
border: 1px solid #f8f8f8;
|
||||
@@ -513,14 +513,14 @@ QLineEdit#mw_searchbar {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
QLineEdit#mw_searchbar:hover {
|
||||
QLineEdit#mw_searchbar:hover {
|
||||
color: #ecf0f1;
|
||||
background-color: #2d3038;
|
||||
border: 1px solid #8cf944;
|
||||
margin: 15px;
|
||||
}
|
||||
|
||||
QLineEdit#mw_searchbar:focus {
|
||||
QLineEdit#mw_searchbar:focus {
|
||||
border: 1px solid #8cf944;
|
||||
}
|
||||
|
||||
@@ -565,8 +565,8 @@ QTableView {
|
||||
}
|
||||
|
||||
QTableView::item:hover {
|
||||
color: #8cf944;
|
||||
}
|
||||
color: #8cf944;
|
||||
}
|
||||
|
||||
/* Game Icon Background */
|
||||
QLabel#gamelist_icon_background_color {
|
||||
@@ -641,24 +641,42 @@ QLabel#debugger_frame_pc {
|
||||
/* Tree view changes*/
|
||||
QTreeView::branch:has-children:!has-siblings:closed,
|
||||
QTreeView::branch:closed:has-children:has-siblings {
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_white.png");
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_white.png");
|
||||
}
|
||||
|
||||
QTreeView::branch:open:has-children:!has-siblings,
|
||||
QTreeView::branch:open:has-children:has-siblings {
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_down_white.png");
|
||||
QTreeView::branch:open:has-children:has-siblings {
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_down_white.png");
|
||||
}
|
||||
|
||||
QTreeView::branch:has-children:!has-siblings:closed:hover,
|
||||
QTreeView::branch:closed:has-children:has-siblings:hover {
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_green.png");
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_green.png");
|
||||
}
|
||||
|
||||
QTreeView::branch:open:has-children:!has-siblings:hover,
|
||||
QTreeView::branch:open:has-children:has-siblings:hover {
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_down_green.png");
|
||||
QTreeView::branch:open:has-children:has-siblings:hover {
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_down_green.png");
|
||||
}
|
||||
|
||||
/* Game Grid */
|
||||
#game_list_grid_item[selected="true"] {
|
||||
background: #2d3038;
|
||||
}
|
||||
#game_list_grid_item:focus {
|
||||
background: #2d3038;
|
||||
}
|
||||
|
||||
/* Game Grid hover and focus: we need to handle properties differently when using descendants */
|
||||
#game_list_grid_item[selected="true"] #game_list_grid_item_title_label {
|
||||
background-color: #2d3038;
|
||||
color: #8cf944;
|
||||
}
|
||||
#game_list_grid_item[focus="true"] #game_list_grid_item_title_label {
|
||||
background-color: #2d3038;
|
||||
color: #8cf944;
|
||||
}
|
||||
|
||||
@@ -249,20 +249,6 @@ QWidget#trophy_notification_frame {
|
||||
color: #e6e6e6;
|
||||
}
|
||||
|
||||
/* Game Grid Font */
|
||||
QTableWidget#game_grid {
|
||||
font-weight: 600;
|
||||
font-size: 8pt;
|
||||
font-family: Lucida Grande;
|
||||
selection-color: #e6e6e6;
|
||||
}
|
||||
QTableWidget#game_grid::item:selected:active {
|
||||
selection-background-color: #4c4b4b;
|
||||
}
|
||||
QTableWidget#game_grid::item:selected:!active {
|
||||
selection-background-color: #3d3d3d;
|
||||
}
|
||||
|
||||
/* Set Toolbar Slider Size */
|
||||
QSlider#sizeSlider::groove:horizontal {
|
||||
border: 0em solid transparent;
|
||||
@@ -347,24 +333,54 @@ QLabel#tty_text {
|
||||
/* Tree view changes*/
|
||||
QTreeView::branch:has-children:!has-siblings:closed,
|
||||
QTreeView::branch:closed:has-children:has-siblings {
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_white.png");
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_white.png");
|
||||
}
|
||||
|
||||
QTreeView::branch:open:has-children:!has-siblings,
|
||||
QTreeView::branch:open:has-children:has-siblings {
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_down_white.png");
|
||||
QTreeView::branch:open:has-children:has-siblings {
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_down_white.png");
|
||||
}
|
||||
|
||||
QTreeView::branch:has-children:!has-siblings:closed:hover,
|
||||
QTreeView::branch:closed:has-children:has-siblings:hover {
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_blue.png");
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_blue.png");
|
||||
}
|
||||
|
||||
QTreeView::branch:open:has-children:!has-siblings:hover,
|
||||
QTreeView::branch:open:has-children:has-siblings:hover {
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_down_blue.png");
|
||||
QTreeView::branch:open:has-children:has-siblings:hover {
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_down_blue.png");
|
||||
}
|
||||
|
||||
/* Game Grid */
|
||||
#game_list_grid_item[selected="true"] {
|
||||
background: #3d3d3d;
|
||||
}
|
||||
#game_list_grid_item:hover {
|
||||
background: #3d3d3d;
|
||||
}
|
||||
#game_list_grid_item:focus {
|
||||
background: #4c4b4b;
|
||||
}
|
||||
|
||||
/* Game Grid Font */
|
||||
#game_list_grid_item #game_list_grid_item_title_label {
|
||||
font-weight: 600;
|
||||
font-size: 8pt;
|
||||
font-family: Lucida Grande;
|
||||
}
|
||||
|
||||
/* Game Grid hover and focus: we need to handle properties differently when using descendants */
|
||||
#game_list_grid_item[selected="true"] #game_list_grid_item_title_label {
|
||||
background-color: #3d3d3d;
|
||||
}
|
||||
#game_list_grid_item[hover="true"] #game_list_grid_item_title_label {
|
||||
background-color: #3d3d3d;
|
||||
}
|
||||
#game_list_grid_item[focus="true"] #game_list_grid_item_title_label {
|
||||
color: #e6e6e6;
|
||||
background-color: #4c4b4b;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
ModernBlue Theme for RPCS3
|
||||
/*
|
||||
ModernBlue Theme for RPCS3
|
||||
by themitosan @ twitter.com/themitosan
|
||||
(2017.12.12)
|
||||
*/
|
||||
@@ -124,7 +124,7 @@ QGroupBox::title {
|
||||
/* Buttons */
|
||||
QPushButton {
|
||||
background-color: #46598b;
|
||||
color: #fff;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
QPushButton::disabled {
|
||||
@@ -133,7 +133,7 @@ QPushButton::disabled {
|
||||
}
|
||||
|
||||
QPushButton::pressed {
|
||||
background-color: #172038;
|
||||
background-color: #172038;
|
||||
}
|
||||
|
||||
/* Log and Debugger borders */
|
||||
@@ -190,21 +190,10 @@ QListWidget::item:hover {
|
||||
}
|
||||
|
||||
/* Pad Settings: Controller Image */
|
||||
QLabel#l_controller {
|
||||
QLabel#l_controller {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/* Game Grid Font */
|
||||
QTableWidget#game_grid {
|
||||
font-weight: 600;
|
||||
font-size: 8pt;
|
||||
font-family: Lucida Grande;
|
||||
color: #fff;
|
||||
}
|
||||
QTableWidget#game_grid::item:selected:!active {
|
||||
selection-background-color: #354454;
|
||||
}
|
||||
|
||||
/* Slider on toolbar */
|
||||
QWidget#sizeSliderContainer {
|
||||
background: transparent;
|
||||
@@ -227,8 +216,8 @@ QLabel#color_button {
|
||||
}
|
||||
|
||||
/* Search bar on main toolbar */
|
||||
QLineEdit#mw_searchbar {
|
||||
margin-left: 0.7em;
|
||||
QLineEdit#mw_searchbar {
|
||||
margin-left: 0.7em;
|
||||
color: #ecf0f1;
|
||||
}
|
||||
|
||||
@@ -341,24 +330,54 @@ QLabel#debugger_frame_pc {
|
||||
/* Tree view changes*/
|
||||
QTreeView::branch:has-children:!has-siblings:closed,
|
||||
QTreeView::branch:closed:has-children:has-siblings {
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_white.png");
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_white.png");
|
||||
}
|
||||
|
||||
QTreeView::branch:open:has-children:!has-siblings,
|
||||
QTreeView::branch:open:has-children:has-siblings {
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_down_white.png");
|
||||
QTreeView::branch:open:has-children:has-siblings {
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_down_white.png");
|
||||
}
|
||||
|
||||
QTreeView::branch:has-children:!has-siblings:closed:hover,
|
||||
QTreeView::branch:closed:has-children:has-siblings:hover {
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_blue.png");
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_blue.png");
|
||||
}
|
||||
|
||||
QTreeView::branch:open:has-children:!has-siblings:hover,
|
||||
QTreeView::branch:open:has-children:has-siblings:hover {
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_down_blue.png");
|
||||
QTreeView::branch:open:has-children:has-siblings:hover {
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_down_blue.png");
|
||||
}
|
||||
|
||||
/* Game Grid */
|
||||
#game_list_grid_item[selected="true"] {
|
||||
background: #354454;
|
||||
}
|
||||
#game_list_grid_item:hover {
|
||||
background: #354454;
|
||||
}
|
||||
#game_list_grid_item:focus {
|
||||
background: #0078D7;
|
||||
}
|
||||
|
||||
/* Game Grid Font */
|
||||
#game_list_grid_item #game_list_grid_item_title_label {
|
||||
font-weight: 600;
|
||||
font-size: 8pt;
|
||||
font-family: Lucida Grande;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
/* Game Grid hover and focus: we need to handle properties differently when using descendants */
|
||||
#game_list_grid_item[selected="true"] #game_list_grid_item_title_label {
|
||||
background-color: #354454;
|
||||
}
|
||||
#game_list_grid_item[hover="true"] #game_list_grid_item_title_label {
|
||||
background-color: #354454;
|
||||
}
|
||||
#game_list_grid_item[focus="true"] #game_list_grid_item_title_label {
|
||||
background-color: #0078D7;
|
||||
}
|
||||
|
||||
@@ -367,21 +367,6 @@ QLabel#l_controller {
|
||||
}
|
||||
|
||||
|
||||
/* Game Grid Font */
|
||||
QTableWidget#game_grid {
|
||||
font-weight: 600;
|
||||
color: #ffd785;
|
||||
text-transform: uppercase;
|
||||
selection-color: #ffd785;
|
||||
}
|
||||
QTableWidget#game_grid::item:selected:active {
|
||||
selection-background-color: #4d4940;
|
||||
}
|
||||
QTableWidget#game_grid::item:selected:!active {
|
||||
selection-background-color: #615c51;
|
||||
}
|
||||
|
||||
|
||||
/* Debug UI Settings buttons */
|
||||
QLabel#color_button {
|
||||
background: transparent;
|
||||
@@ -489,3 +474,33 @@ QWidget#trophy_notification_frame {
|
||||
background-color: #b3ac98;
|
||||
color: #4d4940;
|
||||
}
|
||||
|
||||
/* Game Grid */
|
||||
#game_list_grid_item[selected="true"] {
|
||||
background: #615c51;
|
||||
}
|
||||
#game_list_grid_item:hover {
|
||||
background: #615c51;
|
||||
}
|
||||
#game_list_grid_item:focus {
|
||||
background: #4d4940;
|
||||
}
|
||||
|
||||
/* Game Grid Font */
|
||||
#game_list_grid_item #game_list_grid_item_title_label {
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
color: #ffd785;
|
||||
}
|
||||
|
||||
/* Game Grid hover and focus: we need to handle properties differently when using descendants */
|
||||
#game_list_grid_item[selected="true"] #game_list_grid_item_title_label {
|
||||
background-color: #615c51;
|
||||
}
|
||||
#game_list_grid_item[hover="true"] #game_list_grid_item_title_label {
|
||||
background-color: #615c51;
|
||||
}
|
||||
#game_list_grid_item[focus="true"] #game_list_grid_item_title_label {
|
||||
background-color: #4d4940;
|
||||
color: #ffd785;
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ QToolButton:hover {
|
||||
}
|
||||
|
||||
/* Search bar in Main Toolbar */
|
||||
QLineEdit#mw_searchbar {
|
||||
QLineEdit#mw_searchbar {
|
||||
color: #455971;
|
||||
background-color: #FFFFFF;
|
||||
border: 1px solid #999999;
|
||||
@@ -113,15 +113,15 @@ QLineEdit#mw_searchbar {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
QLineEdit#mw_searchbar:hover {
|
||||
margin-left: 0.7em;
|
||||
QLineEdit#mw_searchbar:hover {
|
||||
margin-left: 0.7em;
|
||||
color: #0074e7;
|
||||
background-color: #FFFFFF;
|
||||
border: 1px solid #0071ec;
|
||||
margin: 15px;
|
||||
}
|
||||
|
||||
QLineEdit#mw_searchbar:focus {
|
||||
QLineEdit#mw_searchbar:focus {
|
||||
border: 1px solid #0074e7;
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ QSlider::handle:horizontal {
|
||||
border: 1px solid #5c5c5c;
|
||||
border-radius: 0.1em;
|
||||
width: 18px;
|
||||
margin: -2px 2;
|
||||
margin: -2px 2;
|
||||
}
|
||||
|
||||
QSlider::handle:horizontal:hover {
|
||||
@@ -220,6 +220,17 @@ QScrollBar::up-arrow, QScrollBar::down-arrow, QScrollBar::up-button:vertical, QS
|
||||
border: none;
|
||||
}
|
||||
|
||||
#game_list_grid QScrollBar {
|
||||
width: 10px;
|
||||
height: 3px;
|
||||
}
|
||||
#game_list_grid QScrollBar::handle {
|
||||
background: #1c273d;
|
||||
}
|
||||
#game_list_grid QScrollBar::handle:hover, QScrollBar::handle:pressed {
|
||||
background: #0074e7;
|
||||
}
|
||||
|
||||
/* Radio Buttons */
|
||||
QRadioButton::indicator {
|
||||
border: 0.0625em solid #455971;
|
||||
@@ -242,7 +253,7 @@ QRadioButton::indicator:unchecked {
|
||||
}
|
||||
|
||||
QRadioButton::indicator:disabled {
|
||||
background-color: #455971;
|
||||
background-color: #455971;
|
||||
}
|
||||
|
||||
/* Checkboxes */
|
||||
@@ -533,7 +544,7 @@ QProgressBar::chunk {
|
||||
}
|
||||
|
||||
/* Pad Settings: Controller Image */
|
||||
QLabel#l_controller {
|
||||
QLabel#l_controller {
|
||||
color: #0074e7;
|
||||
}
|
||||
|
||||
@@ -554,7 +565,7 @@ QHeaderView::section {
|
||||
background-color: #111525;
|
||||
color: #FFFFFF;
|
||||
padding-top: 3px;
|
||||
padding-left: 3px;
|
||||
padding-left: 3px;
|
||||
height: 20px;
|
||||
border: none;
|
||||
}
|
||||
@@ -663,24 +674,49 @@ QLabel#debugger_frame_pc {
|
||||
/* Tree view changes*/
|
||||
QTreeView::branch:has-children:!has-siblings:closed,
|
||||
QTreeView::branch:closed:has-children:has-siblings {
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_white.png");
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_white.png");
|
||||
}
|
||||
|
||||
QTreeView::branch:open:has-children:!has-siblings,
|
||||
QTreeView::branch:open:has-children:has-siblings {
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_down_white.png");
|
||||
QTreeView::branch:open:has-children:has-siblings {
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_down_white.png");
|
||||
}
|
||||
|
||||
QTreeView::branch:has-children:!has-siblings:closed:hover,
|
||||
QTreeView::branch:closed:has-children:has-siblings:hover {
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_blue.png");
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_blue.png");
|
||||
}
|
||||
|
||||
QTreeView::branch:open:has-children:!has-siblings:hover,
|
||||
QTreeView::branch:open:has-children:has-siblings:hover {
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_down_blue.png");
|
||||
QTreeView::branch:open:has-children:has-siblings:hover {
|
||||
border-image: none;
|
||||
image: url("GuiConfigs/list_arrow_down_blue.png");
|
||||
}
|
||||
|
||||
/* Game Grid */
|
||||
#game_list_grid_item[selected="true"] {
|
||||
background: #0f1d36;
|
||||
}
|
||||
#game_list_grid_item:focus {
|
||||
background: #0f1d36;
|
||||
}
|
||||
|
||||
#game_list_grid_item #game_list_grid_item_title_label {
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
/* Game Grid hover and focus: we need to handle properties differently when using descendants */
|
||||
#game_list_grid_item[selected="true"] #game_list_grid_item_title_label {
|
||||
background-color: #0f1d36;
|
||||
color: #2397ff;
|
||||
}
|
||||
#game_list_grid_item[hover="true"] #game_list_grid_item_title_label {
|
||||
color: #2397ff;
|
||||
}
|
||||
#game_list_grid_item[focus="true"] #game_list_grid_item_title_label {
|
||||
background-color: #0f1d36;
|
||||
color: #2397ff;
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ QToolButton:hover {
|
||||
}
|
||||
|
||||
/* Search bar in Main Toolbar */
|
||||
QLineEdit#mw_searchbar {
|
||||
QLineEdit#mw_searchbar {
|
||||
color: #455971;
|
||||
background-color: #FFFFFF;
|
||||
border: 1px solid #999999;
|
||||
@@ -113,15 +113,15 @@ QLineEdit#mw_searchbar {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
QLineEdit#mw_searchbar:hover {
|
||||
margin-left: 0.7em;
|
||||
QLineEdit#mw_searchbar:hover {
|
||||
margin-left: 0.7em;
|
||||
color: #455971;
|
||||
background-color: #FFFFFF;
|
||||
border: 1px solid #0071ec;
|
||||
margin: 15px;
|
||||
}
|
||||
|
||||
QLineEdit#mw_searchbar:focus {
|
||||
QLineEdit#mw_searchbar:focus {
|
||||
border: 1px solid #0071ec;
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ QSlider::handle:horizontal {
|
||||
border: 1px solid #5c5c5c;
|
||||
border-radius: 0.1em;
|
||||
width: 18px;
|
||||
margin: -2px 2;
|
||||
margin: -2px 2;
|
||||
}
|
||||
|
||||
QSlider::handle:horizontal:disabled {
|
||||
@@ -254,7 +254,7 @@ QRadioButton::indicator:unchecked {
|
||||
}
|
||||
|
||||
QRadioButton::indicator:disabled {
|
||||
background-color: #455971;
|
||||
background-color: #455971;
|
||||
}
|
||||
|
||||
/* Checkboxes */
|
||||
@@ -552,7 +552,7 @@ QProgressBar::chunk {
|
||||
}
|
||||
|
||||
/* Pad Settings: Controller Image */
|
||||
QLabel#l_controller {
|
||||
QLabel#l_controller {
|
||||
color: #4343c1;
|
||||
}
|
||||
|
||||
@@ -573,7 +573,7 @@ QHeaderView::section {
|
||||
background-color: #FFFFFF;
|
||||
color: #455971;
|
||||
padding-top: 3px;
|
||||
padding-left: 3px;
|
||||
padding-left: 3px;
|
||||
height: 20px;
|
||||
border: none;
|
||||
}
|
||||
@@ -678,3 +678,24 @@ QLabel#debugger_frame_pc {
|
||||
color: #000; /* Font Color: Black */
|
||||
background-color: #00ff00; /* Green */
|
||||
}
|
||||
|
||||
/* Game Grid */
|
||||
#game_list_grid_item[selected="true"] {
|
||||
background: #4343c1;
|
||||
}
|
||||
#game_list_grid_item:focus {
|
||||
background: #4343c1;
|
||||
}
|
||||
|
||||
/* Game Grid hover and focus: we need to handle properties differently when using descendants */
|
||||
#game_list_grid_item[selected="true"] #game_list_grid_item_title_label {
|
||||
background-color: #4343c1;
|
||||
color: #FFF;
|
||||
}
|
||||
#game_list_grid_item[hover="true"] #game_list_grid_item_title_label {
|
||||
color: #4343c1;
|
||||
}
|
||||
#game_list_grid_item[focus="true"] #game_list_grid_item_title_label {
|
||||
background-color: #4343c1;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
@@ -358,14 +358,6 @@ QLabel#l_controller {
|
||||
color: #4d4940;
|
||||
}
|
||||
|
||||
/* Game Grid Font */
|
||||
QTableWidget#game_grid {
|
||||
font-weight: 600;
|
||||
color: #4d4940;
|
||||
text-transform: uppercase;
|
||||
selection-color: #aea993;
|
||||
}
|
||||
|
||||
/* Debug UI Settings buttons */
|
||||
QLabel#color_button {
|
||||
background: transparent;
|
||||
@@ -456,10 +448,33 @@ QSlider#sizeSlider::groove:horizontal {
|
||||
height: 1.5em;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
On Patch Creator, it's the patch validation label
|
||||
since we can't avoid repainting color, let's bold it instead
|
||||
*/
|
||||
QLabel#validLabel {
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
|
||||
/* Game Grid */
|
||||
#game_list_grid_item[selected="true"] {
|
||||
background: #4d4940;
|
||||
}
|
||||
#game_list_grid_item:focus {
|
||||
background: #4d4940;
|
||||
}
|
||||
|
||||
/* Game Grid Font */
|
||||
#game_list_grid_item #game_list_grid_item_title_label {
|
||||
font-weight: 600;
|
||||
color: #4d4940;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
/* Game Grid hover and focus: we need to handle properties differently when using descendants */
|
||||
#game_list_grid_item[selected="true"] #game_list_grid_item_title_label {
|
||||
color: #aea993;
|
||||
}
|
||||
#game_list_grid_item[focus="true"] #game_list_grid_item_title_label {
|
||||
color: #aea993;
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 34 KiB |
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<!-- Common default props for defining properties with macros. Import right after Microsoft.Cpp.Default.props -->
|
||||
<ImportGroup Label="PropertySheets" />
|
||||
@@ -8,4 +8,4 @@
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup />
|
||||
<ItemGroup />
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -14,56 +14,99 @@
|
||||
<PreprocessorDefinitions>LLVM_AVAILABLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalLibraryDirectories Condition="'$(Configuration)'=='Debug'">%(AdditionalLibraryDirectories);..\llvm_build\Debug\lib</AdditionalLibraryDirectories>
|
||||
<AdditionalLibraryDirectories Condition="'$(Configuration)'=='Debug'">%(AdditionalLibraryDirectories);..\3rdparty\llvm\llvm_build\Debug\lib</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>%(AdditionalDependencies);
|
||||
LLVMProfileData.lib;
|
||||
LLVMDebugInfoCodeView.lib;
|
||||
LLVMDebugInfoMSF.lib;
|
||||
LLVMInstrumentation.lib;
|
||||
LLVMMCJIT.lib;
|
||||
LLVMRuntimeDyld.lib;
|
||||
LLVMVectorize.lib;
|
||||
LLVMX86CodeGen.lib;
|
||||
LLVMGlobalISel.lib;
|
||||
LLVMX86Disassembler.lib;
|
||||
LLVMExecutionEngine.lib;
|
||||
LLVMAsmPrinter.lib;
|
||||
LLVMSelectionDAG.lib;
|
||||
LLVMCodeGen.lib;
|
||||
LLVMScalarOpts.lib;
|
||||
LLVMInstCombine.lib;
|
||||
LLVMTransformUtils.lib;
|
||||
LLVMAnalysis.lib;
|
||||
LLVMTarget.lib;
|
||||
LLVMX86Desc.lib;
|
||||
LLVMObject.lib;
|
||||
LLVMMCParser.lib;
|
||||
LLVMBitReader.lib;
|
||||
LLVMCore.lib;
|
||||
LLVMMC.lib;
|
||||
LLVMX86Info.lib;
|
||||
LLVMSupport.lib;
|
||||
LLVMMCDisassembler.lib;
|
||||
LLVMipo.lib;
|
||||
LLVMBinaryFormat.lib;
|
||||
LLVMPasses.lib;
|
||||
LLVMIRReader.lib;
|
||||
LLVMLinker.lib;
|
||||
LLVMAsmParser.lib;
|
||||
LLVMX86AsmParser.lib;
|
||||
LLVMDemangle.lib;
|
||||
LLVMDebugInfoDWARF.lib;
|
||||
LLVMRemarks.lib;
|
||||
LLVMBitstreamReader.lib;
|
||||
LLVMTextAPI.lib;
|
||||
LLVMCFGuard.lib;
|
||||
LLVMAggressiveInstCombine.lib;
|
||||
LLVMBitWriter.lib;
|
||||
LLVMCoroutines.lib;
|
||||
LLVMObjCARCOpts.lib;
|
||||
LLVMIntelJITEvents.lib;
|
||||
LLVMAggressiveInstCombine.lib;
|
||||
LLVMAnalysis.lib;
|
||||
LLVMAsmParser.lib;
|
||||
LLVMAsmPrinter.lib;
|
||||
LLVMBinaryFormat.lib;
|
||||
LLVMBitReader.lib;
|
||||
LLVMBitstreamReader.lib;
|
||||
LLVMBitWriter.lib;
|
||||
LLVMCFGuard.lib;
|
||||
LLVMCFIVerify.lib;
|
||||
LLVMCodeGen.lib;
|
||||
LLVMCore.lib;
|
||||
LLVMCoroutines.lib;
|
||||
LLVMCoverage.lib;
|
||||
LLVMDebugInfoCodeView.lib;
|
||||
LLVMDebuginfod.lib;
|
||||
LLVMDebugInfoDWARF.lib;
|
||||
LLVMDebugInfoGSYM.lib;
|
||||
LLVMDebugInfoLogicalView.lib;
|
||||
LLVMDebugInfoMSF.lib;
|
||||
LLVMDebugInfoPDB.lib;
|
||||
LLVMDemangle.lib;
|
||||
LLVMDiff.lib;
|
||||
LLVMDlltoolDriver.lib;
|
||||
LLVMDWARFLinker.lib;
|
||||
LLVMDWARFLinkerParallel.lib;
|
||||
LLVMDWP.lib;
|
||||
LLVMExecutionEngine.lib;
|
||||
LLVMExegesis.lib;
|
||||
LLVMExegesisX86.lib;
|
||||
LLVMExtensions.lib;
|
||||
LLVMFileCheck.lib;
|
||||
LLVMFrontendHLSL.lib;
|
||||
LLVMFrontendOpenACC.lib;
|
||||
LLVMFrontendOpenMP.lib;
|
||||
LLVMFuzzerCLI.lib;
|
||||
LLVMFuzzMutate.lib;
|
||||
LLVMGlobalISel.lib;
|
||||
LLVMInstCombine.lib;
|
||||
LLVMInstrumentation.lib;
|
||||
LLVMIntelJITEvents.lib;
|
||||
LLVMInterfaceStub.lib;
|
||||
LLVMInterpreter.lib;
|
||||
LLVMipo.lib;
|
||||
LLVMIRPrinter.lib;
|
||||
LLVMIRReader.lib;
|
||||
LLVMJITLink.lib;
|
||||
LLVMLibDriver.lib;
|
||||
LLVMLineEditor.lib;
|
||||
LLVMLinker.lib;
|
||||
LLVMLTO.lib;
|
||||
LLVMMCA.lib;
|
||||
LLVMMCDisassembler.lib;
|
||||
LLVMMCJIT.lib;
|
||||
LLVMMC.lib;
|
||||
LLVMMCParser.lib;
|
||||
LLVMMIRParser.lib;
|
||||
LLVMObjCARCOpts.lib;
|
||||
LLVMObjCopy.lib;
|
||||
LLVMObject.lib;
|
||||
LLVMObjectYAML.lib;
|
||||
LLVMOption.lib;
|
||||
LLVMOrcJIT.lib;
|
||||
LLVMOrcShared.lib;
|
||||
LLVMOrcTargetProcess.lib;
|
||||
LLVMPasses.lib;
|
||||
LLVMProfileData.lib;
|
||||
LLVMRemarks.lib;
|
||||
LLVMRuntimeDyld.lib;
|
||||
LLVMScalarOpts.lib;
|
||||
LLVMSelectionDAG.lib;
|
||||
LLVMSupport.lib;
|
||||
LLVMSymbolize.lib;
|
||||
LLVMTableGenGlobalISel.lib;
|
||||
LLVMTableGen.lib;
|
||||
LLVMTarget.lib;
|
||||
LLVMTargetParser.lib;
|
||||
LLVMTextAPI.lib;
|
||||
LLVMTransformUtils.lib;
|
||||
LLVMVectorize.lib;
|
||||
LLVMWindowsDriver.lib;
|
||||
LLVMWindowsManifest.lib;
|
||||
LLVMX86AsmParser.lib;
|
||||
LLVMX86CodeGen.lib;
|
||||
LLVMX86Desc.lib;
|
||||
LLVMX86Disassembler.lib;
|
||||
LLVMX86Info.lib;
|
||||
LLVMX86TargetMCA.lib;
|
||||
LLVMXRay.lib;
|
||||
</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup />
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -15,56 +15,99 @@
|
||||
<Link>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalLibraryDirectories Condition="'$(Configuration)'=='Release'">%(AdditionalLibraryDirectories);..\llvm_build\Release\lib</AdditionalLibraryDirectories>
|
||||
<AdditionalLibraryDirectories Condition="'$(Configuration)'=='Release'">%(AdditionalLibraryDirectories);..\3rdparty\llvm\llvm_build\Release\lib</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>%(AdditionalDependencies);
|
||||
LLVMProfileData.lib;
|
||||
LLVMDebugInfoCodeView.lib;
|
||||
LLVMDebugInfoMSF.lib;
|
||||
LLVMInstrumentation.lib;
|
||||
LLVMMCJIT.lib;
|
||||
LLVMRuntimeDyld.lib;
|
||||
LLVMVectorize.lib;
|
||||
LLVMX86CodeGen.lib;
|
||||
LLVMGlobalISel.lib;
|
||||
LLVMX86Disassembler.lib;
|
||||
LLVMExecutionEngine.lib;
|
||||
LLVMAsmPrinter.lib;
|
||||
LLVMSelectionDAG.lib;
|
||||
LLVMCodeGen.lib;
|
||||
LLVMScalarOpts.lib;
|
||||
LLVMInstCombine.lib;
|
||||
LLVMTransformUtils.lib;
|
||||
LLVMAnalysis.lib;
|
||||
LLVMTarget.lib;
|
||||
LLVMX86Desc.lib;
|
||||
LLVMObject.lib;
|
||||
LLVMMCParser.lib;
|
||||
LLVMBitReader.lib;
|
||||
LLVMCore.lib;
|
||||
LLVMMC.lib;
|
||||
LLVMX86Info.lib;
|
||||
LLVMSupport.lib;
|
||||
LLVMMCDisassembler.lib;
|
||||
LLVMipo.lib;
|
||||
LLVMBinaryFormat.lib;
|
||||
LLVMPasses.lib;
|
||||
LLVMIRReader.lib;
|
||||
LLVMLinker.lib;
|
||||
LLVMAsmParser.lib;
|
||||
LLVMX86AsmParser.lib;
|
||||
LLVMDemangle.lib;
|
||||
LLVMDebugInfoDWARF.lib;
|
||||
LLVMRemarks.lib;
|
||||
LLVMBitstreamReader.lib;
|
||||
LLVMTextAPI.lib;
|
||||
LLVMCFGuard.lib;
|
||||
LLVMAggressiveInstCombine.lib;
|
||||
LLVMBitWriter.lib;
|
||||
LLVMCoroutines.lib;
|
||||
LLVMObjCARCOpts.lib;
|
||||
LLVMIntelJITEvents.lib;
|
||||
LLVMAggressiveInstCombine.lib;
|
||||
LLVMAnalysis.lib;
|
||||
LLVMAsmParser.lib;
|
||||
LLVMAsmPrinter.lib;
|
||||
LLVMBinaryFormat.lib;
|
||||
LLVMBitReader.lib;
|
||||
LLVMBitstreamReader.lib;
|
||||
LLVMBitWriter.lib;
|
||||
LLVMCFGuard.lib;
|
||||
LLVMCFIVerify.lib;
|
||||
LLVMCodeGen.lib;
|
||||
LLVMCore.lib;
|
||||
LLVMCoroutines.lib;
|
||||
LLVMCoverage.lib;
|
||||
LLVMDebugInfoCodeView.lib;
|
||||
LLVMDebuginfod.lib;
|
||||
LLVMDebugInfoDWARF.lib;
|
||||
LLVMDebugInfoGSYM.lib;
|
||||
LLVMDebugInfoLogicalView.lib;
|
||||
LLVMDebugInfoMSF.lib;
|
||||
LLVMDebugInfoPDB.lib;
|
||||
LLVMDemangle.lib;
|
||||
LLVMDiff.lib;
|
||||
LLVMDlltoolDriver.lib;
|
||||
LLVMDWARFLinker.lib;
|
||||
LLVMDWARFLinkerParallel.lib;
|
||||
LLVMDWP.lib;
|
||||
LLVMExecutionEngine.lib;
|
||||
LLVMExegesis.lib;
|
||||
LLVMExegesisX86.lib;
|
||||
LLVMExtensions.lib;
|
||||
LLVMFileCheck.lib;
|
||||
LLVMFrontendHLSL.lib;
|
||||
LLVMFrontendOpenACC.lib;
|
||||
LLVMFrontendOpenMP.lib;
|
||||
LLVMFuzzerCLI.lib;
|
||||
LLVMFuzzMutate.lib;
|
||||
LLVMGlobalISel.lib;
|
||||
LLVMInstCombine.lib;
|
||||
LLVMInstrumentation.lib;
|
||||
LLVMIntelJITEvents.lib;
|
||||
LLVMInterfaceStub.lib;
|
||||
LLVMInterpreter.lib;
|
||||
LLVMipo.lib;
|
||||
LLVMIRPrinter.lib;
|
||||
LLVMIRReader.lib;
|
||||
LLVMJITLink.lib;
|
||||
LLVMLibDriver.lib;
|
||||
LLVMLineEditor.lib;
|
||||
LLVMLinker.lib;
|
||||
LLVMLTO.lib;
|
||||
LLVMMCA.lib;
|
||||
LLVMMCDisassembler.lib;
|
||||
LLVMMCJIT.lib;
|
||||
LLVMMC.lib;
|
||||
LLVMMCParser.lib;
|
||||
LLVMMIRParser.lib;
|
||||
LLVMObjCARCOpts.lib;
|
||||
LLVMObjCopy.lib;
|
||||
LLVMObject.lib;
|
||||
LLVMObjectYAML.lib;
|
||||
LLVMOption.lib;
|
||||
LLVMOrcJIT.lib;
|
||||
LLVMOrcShared.lib;
|
||||
LLVMOrcTargetProcess.lib;
|
||||
LLVMPasses.lib;
|
||||
LLVMProfileData.lib;
|
||||
LLVMRemarks.lib;
|
||||
LLVMRuntimeDyld.lib;
|
||||
LLVMScalarOpts.lib;
|
||||
LLVMSelectionDAG.lib;
|
||||
LLVMSupport.lib;
|
||||
LLVMSymbolize.lib;
|
||||
LLVMTableGenGlobalISel.lib;
|
||||
LLVMTableGen.lib;
|
||||
LLVMTarget.lib;
|
||||
LLVMTargetParser.lib;
|
||||
LLVMTextAPI.lib;
|
||||
LLVMTransformUtils.lib;
|
||||
LLVMVectorize.lib;
|
||||
LLVMWindowsDriver.lib;
|
||||
LLVMWindowsManifest.lib;
|
||||
LLVMX86AsmParser.lib;
|
||||
LLVMX86CodeGen.lib;
|
||||
LLVMX86Desc.lib;
|
||||
LLVMX86Disassembler.lib;
|
||||
LLVMX86Info.lib;
|
||||
LLVMX86TargetMCA.lib;
|
||||
LLVMXRay.lib;
|
||||
</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup />
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
-1
Submodule llvm deleted from 9b52b6c39a
@@ -6,10 +6,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asmjit", "3rdparty\asmjit\a
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "emucore", "rpcs3\emucore.vcxproj", "{C4A10229-4712-4BD2-B63E-50D93C67A038}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{2C902C67-985C-4BE0-94A3-E0FE2EB929A3} = {2C902C67-985C-4BE0-94A3-E0FE2EB929A3}
|
||||
{5228F863-E0DD-4DE7-AA7B-5C52B14CD4D0} = {5228F863-E0DD-4DE7-AA7B-5C52B14CD4D0}
|
||||
{939FE206-1182-ABC3-1234-FEAB88E98404} = {939FE206-1182-ABC3-1234-FEAB88E98404}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm_build", "llvm_build\llvm_build.vcxproj", "{8BC303AB-25BE-4276-8E57-73F171B2D672}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm_build", "3rdparty\llvm\llvm_build\llvm_build.vcxproj", "{8BC303AB-25BE-4276-8E57-73F171B2D672}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GLGSRender", "rpcs3\GLGSRender.vcxproj", "{3384223A-6D97-4799-9862-359F85312892}"
|
||||
EndProject
|
||||
@@ -40,6 +42,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yaml-cpp", "3rdparty\yaml-c
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rpcs3", "rpcs3\rpcs3.vcxproj", "{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{2C902C67-985C-4BE0-94A3-E0FE2EB929A3} = {2C902C67-985C-4BE0-94A3-E0FE2EB929A3}
|
||||
{3384223A-6D97-4799-9862-359F85312892} = {3384223A-6D97-4799-9862-359F85312892}
|
||||
{349EE8F9-7D25-4909-AAF5-FF3FADE72187} = {349EE8F9-7D25-4909-AAF5-FF3FADE72187}
|
||||
{3EE5F075-B546-42C4-B6A8-E3CCEF38B78D} = {3EE5F075-B546-42C4-B6A8-E3CCEF38B78D}
|
||||
@@ -74,11 +77,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcurl", "3rdparty\curl\li
|
||||
{73973223-5EE8-41CA-8E88-1D60E89A237B} = {73973223-5EE8-41CA-8E88-1D60E89A237B}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SPIRV", "3rdparty\SPIRV\spirv.vcxproj", "{4CBD3DDD-5555-49A4-A44D-DD3D8CB516A1}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "spirv", "3rdparty\SPIRV\spirv.vcxproj", "{4CBD3DDD-5555-49A4-A44D-DD3D8CB516A1}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "3rdParty", "3rdParty", "{6C3B64A0-8F8A-4DC4-8C0B-D71EBEED7FA8}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm_build_clang_cl", "llvm_build\llvm_build_clang_cl.vcxproj", "{A37E4273-85DB-4217-B775-CE971B87D9DF}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm_build_clang_cl", "3rdparty\llvm\llvm_build\llvm_build_clang_cl.vcxproj", "{A37E4273-85DB-4217-B775-CE971B87D9DF}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Cubeb", "rpcs3\Cubeb.vcxproj", "{9610627D-20FE-4B07-8CE3-9FF68A5F1EC2}"
|
||||
EndProject
|
||||
@@ -93,6 +96,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "pine", "pine", "{A55DA1B5-C
|
||||
3rdparty\pine\pine_server.h = 3rdparty\pine\pine_server.h
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "miniupnpc_static", "3rdparty\miniupnp\miniupnpc_static.vcxproj", "{5228F863-E0DD-4DE7-AA7B-5C52B14CD4D0}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rtmidi", "3rdparty\rtmidi\rtmidi.vcxproj", "{2C902C67-985C-4BE0-94A3-E0FE2EB929A3}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
@@ -187,6 +194,14 @@ Global
|
||||
{8DC244EE-A0BD-4038-BAF7-CFAFA5EB2BAA}.Debug|x64.Build.0 = Debug|x64
|
||||
{8DC244EE-A0BD-4038-BAF7-CFAFA5EB2BAA}.Release|x64.ActiveCfg = Release|x64
|
||||
{8DC244EE-A0BD-4038-BAF7-CFAFA5EB2BAA}.Release|x64.Build.0 = Release|x64
|
||||
{5228F863-E0DD-4DE7-AA7B-5C52B14CD4D0}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{5228F863-E0DD-4DE7-AA7B-5C52B14CD4D0}.Debug|x64.Build.0 = Debug|x64
|
||||
{5228F863-E0DD-4DE7-AA7B-5C52B14CD4D0}.Release|x64.ActiveCfg = Release|x64
|
||||
{5228F863-E0DD-4DE7-AA7B-5C52B14CD4D0}.Release|x64.Build.0 = Release|x64
|
||||
{2C902C67-985C-4BE0-94A3-E0FE2EB929A3}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{2C902C67-985C-4BE0-94A3-E0FE2EB929A3}.Debug|x64.Build.0 = Debug|x64
|
||||
{2C902C67-985C-4BE0-94A3-E0FE2EB929A3}.Release|x64.ActiveCfg = Release|x64
|
||||
{2C902C67-985C-4BE0-94A3-E0FE2EB929A3}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -216,6 +231,8 @@ Global
|
||||
{508C291A-3D18-49F5-B25D-F7C8DB92CB21} = {6C3B64A0-8F8A-4DC4-8C0B-D71EBEED7FA8}
|
||||
{8DC244EE-A0BD-4038-BAF7-CFAFA5EB2BAA} = {6C3B64A0-8F8A-4DC4-8C0B-D71EBEED7FA8}
|
||||
{A55DA1B5-CC17-4525-BE7F-1659CE17BB56} = {6C3B64A0-8F8A-4DC4-8C0B-D71EBEED7FA8}
|
||||
{5228F863-E0DD-4DE7-AA7B-5C52B14CD4D0} = {6C3B64A0-8F8A-4DC4-8C0B-D71EBEED7FA8}
|
||||
{2C902C67-985C-4BE0-94A3-E0FE2EB929A3} = {6C3B64A0-8F8A-4DC4-8C0B-D71EBEED7FA8}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {06CC7920-E085-4B81-9582-8DE8AAD42510}
|
||||
|
||||
@@ -187,13 +187,13 @@ elseif(WIN32)
|
||||
|
||||
# If Qt5 is installed from vcpkg
|
||||
list(APPEND _QT5_TOOLS_PATHS "${Qt5_DIR}/../../../tools/qt5$<$<CONFIG:Debug>:/debug>/bin/")
|
||||
|
||||
|
||||
add_custom_command(TARGET rpcs3 POST_BUILD
|
||||
COMMAND set PATH=${_QT5_TOOLS_PATHS}$<SEMICOLON>%PATH%
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_directory "${CMAKE_SOURCE_DIR}/bin" "$<TARGET_FILE_DIR:rpcs3>"
|
||||
# If Qt5 is installed from vcpkg, add binary path to PATH
|
||||
# otherwise windeployqt tool won't be able to locate necessary dlls
|
||||
COMMAND set PATH=${Qt5_DIR}/../../../$<$<CONFIG:Debug>:debug/>bin/$<SEMICOLON>%PATH%
|
||||
COMMAND set PATH=${Qt5_DIR}/../../../$<$<CONFIG:Debug>:debug/>bin/$<SEMICOLON>%PATH%
|
||||
COMMAND "${_WINDEPLOYQT}" --no-angle --no-compiler-runtime --no-opengl-sw --no-patchqt --no-translations --no-quick --plugindir "$<TARGET_FILE_DIR:rpcs3>/qt/plugins" $<$<CONFIG:Debug>:--debug> $<$<CONFIG:Release>:--release> "$<TARGET_FILE:rpcs3>")
|
||||
endif()
|
||||
|
||||
|
||||
+1
-1
@@ -124,7 +124,7 @@ int aes_crypt_cbc( aes_context *ctx,
|
||||
* both encryption and decryption. So a context initialized with
|
||||
* aes_setkey_enc() for both AES_ENCRYPT and AES_DECRYPT.
|
||||
*
|
||||
* both
|
||||
* both
|
||||
* \param ctx AES context
|
||||
* \param mode AES_ENCRYPT or AES_DECRYPT
|
||||
* \param length length of the input data
|
||||
|
||||
@@ -245,7 +245,7 @@ constexpr s64 PAID_30 = 0x1070000023000001L; // spu_token_processor.self; CoreOS
|
||||
constexpr s64 PAID_31 = 0x1070000024000001L; // sv_iso_spu_module.self; CoreOS; same for CEX DEX DECR
|
||||
constexpr s64 PAID_32 = 0x1070000025000001L; // aim_spu_module.self; CoreOS; same for CEX DEX DECR
|
||||
constexpr s64 PAID_33 = 0x1070000026000001L; // ss_sc_init.self; [2.43 JIG PUP]
|
||||
constexpr s64 PAID_34 = 0x1070000027000001L; // dispatcher.fself; lv1;
|
||||
constexpr s64 PAID_34 = 0x1070000027000001L; // dispatcher.fself; lv1;
|
||||
constexpr s64 PAID_35 = 0x1070000028000001L; // factory_data_mngr_server.fself; JIG lv1 proc
|
||||
constexpr s64 PAID_36 = 0x1070000029000001L; // fdm_spu_module.self; [2.43 JIG PUP]
|
||||
constexpr s64 PAID_37 = 0x107000002A000001L;
|
||||
|
||||
+193
-69
@@ -66,6 +66,7 @@ bool package_reader::read_header()
|
||||
return false;
|
||||
}
|
||||
|
||||
pkg_log.notice("Path: '%s'", m_path);
|
||||
pkg_log.notice("Header: pkg_magic = 0x%x = \"%s\"", +m_header.pkg_magic, std::string(reinterpret_cast<const char*>(&m_header.pkg_magic), 4));
|
||||
pkg_log.notice("Header: pkg_type = 0x%x = %d", m_header.pkg_type, m_header.pkg_type);
|
||||
pkg_log.notice("Header: pkg_platform = 0x%x = %d", m_header.pkg_platform, m_header.pkg_platform);
|
||||
@@ -515,7 +516,7 @@ bool package_reader::read_param_sfo()
|
||||
|
||||
std::memcpy(entries.data(), m_bufs.back().get(), entries.size() * sizeof(PKGEntry));
|
||||
|
||||
for (const auto& entry : entries)
|
||||
for (const PKGEntry& entry : entries)
|
||||
{
|
||||
if (entry.name_size > 256)
|
||||
{
|
||||
@@ -567,11 +568,9 @@ bool package_reader::read_param_sfo()
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
pkg_log.error("Failed to create temporary PARAM.SFO file");
|
||||
return false;
|
||||
}
|
||||
|
||||
pkg_log.error("Failed to create temporary PARAM.SFO file");
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -621,7 +620,7 @@ package_error package_reader::check_target_app_version() const
|
||||
if (!target_app_ver.empty())
|
||||
{
|
||||
// We are unable to compare anything with the target app version
|
||||
pkg_log.error("A target app version is required (%s), but no PARAM.SFO was found for %s", target_app_ver, title_id);
|
||||
pkg_log.error("A target app version is required (%s), but no PARAM.SFO was found for %s. (path='%s', error=%s)", target_app_ver, title_id, sfo_path, fs::g_tls_error);
|
||||
return package_error::app_version;
|
||||
}
|
||||
|
||||
@@ -691,20 +690,16 @@ package_error package_reader::check_target_app_version() const
|
||||
return package_error::app_version;
|
||||
}
|
||||
|
||||
bool package_reader::fill_data(std::map<std::string, install_entry*>& all_install_entries)
|
||||
bool package_reader::set_install_path()
|
||||
{
|
||||
if (!m_is_valid)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
m_install_entries.clear();
|
||||
m_install_path.clear();
|
||||
m_bootable_file_path.clear();
|
||||
m_entry_indexer = 0;
|
||||
m_written_bytes = 0;
|
||||
|
||||
// Get full path and create the directory
|
||||
// Get full path
|
||||
std::string dir = rpcs3::utils::get_hdd0_dir();
|
||||
|
||||
// Based on https://www.psdevwiki.com/ps3/PKG_files#ContentType
|
||||
@@ -741,13 +736,27 @@ bool package_reader::fill_data(std::map<std::string, install_entry*>& all_instal
|
||||
// If false, an existing directory is being overwritten: cannot cancel the operation
|
||||
m_was_null = !fs::is_dir(dir);
|
||||
|
||||
if (!fs::create_path(dir))
|
||||
m_install_path = dir;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool package_reader::fill_data(std::map<std::string, install_entry*>& all_install_entries)
|
||||
{
|
||||
if (!m_is_valid)
|
||||
{
|
||||
pkg_log.error("Could not create the installation directory %s", dir);
|
||||
return false;
|
||||
}
|
||||
|
||||
m_install_path = dir;
|
||||
if (!fs::create_path(m_install_path))
|
||||
{
|
||||
pkg_log.error("Could not create the installation directory %s (error=%s)", m_install_path, fs::g_tls_error);
|
||||
return false;
|
||||
}
|
||||
|
||||
m_install_entries.clear();
|
||||
m_bootable_file_path.clear();
|
||||
m_entry_indexer = 0;
|
||||
m_written_bytes = 0;
|
||||
|
||||
if (!decrypt_data())
|
||||
{
|
||||
@@ -774,13 +783,20 @@ bool package_reader::fill_data(std::map<std::string, install_entry*>& all_instal
|
||||
decrypt(entry.name_offset, entry.name_size, is_psp ? PKG_AES_KEY2 : m_dec_key.data());
|
||||
|
||||
const std::string name{reinterpret_cast<char*>(m_bufs.back().get()), entry.name_size};
|
||||
std::string path = dir + vfs::escape(name);
|
||||
std::string path = m_install_path + vfs::escape(name);
|
||||
|
||||
const bool log_error = entry.pad || (entry.type & ~PKG_FILE_ENTRY_KNOWN_BITS);
|
||||
if (entry.pad || (entry.type & ~PKG_FILE_ENTRY_KNOWN_BITS))
|
||||
{
|
||||
pkg_log.todo("Entry with unknown type or padding: type=0x%08x, pad=0x%x, name='%s'", entry.type, entry.pad, name);
|
||||
}
|
||||
else
|
||||
{
|
||||
pkg_log.notice("Entry: type=0x%08x, name='%s'", entry.type, name);
|
||||
}
|
||||
|
||||
(log_error ? pkg_log.error : pkg_log.notice)("Entry 0x%08x: %s (pad=0x%x)", entry.type, name, entry.pad);
|
||||
const u8 entry_type = entry.type & 0xff;
|
||||
|
||||
switch (const u8 entry_type = entry.type & 0xff)
|
||||
switch (entry_type)
|
||||
{
|
||||
case PKG_FILE_ENTRY_FOLDER:
|
||||
case 0x12:
|
||||
@@ -804,10 +820,25 @@ bool package_reader::fill_data(std::map<std::string, install_entry*>& all_instal
|
||||
}
|
||||
default:
|
||||
{
|
||||
const std::string true_path = std::filesystem::weakly_canonical(std::filesystem::u8path(path)).string();
|
||||
// TODO: check for valid utf8 characters
|
||||
const std::string true_path = std::filesystem::weakly_canonical(path).string();
|
||||
if (true_path.empty())
|
||||
{
|
||||
num_failures++;
|
||||
pkg_log.error("Failed to get weakly_canonical path for '%s'", path);
|
||||
break;
|
||||
}
|
||||
|
||||
auto map_ptr = &*all_install_entries.try_emplace(true_path).first;
|
||||
|
||||
m_install_entries.push_back({ map_ptr, name, entry.file_offset, entry.file_size, entry.type, entry.pad });
|
||||
m_install_entries.push_back({
|
||||
.weak_reference = map_ptr,
|
||||
.name = name,
|
||||
.file_offset = entry.file_offset,
|
||||
.file_size = entry.file_size,
|
||||
.type = entry.type,
|
||||
.pad = entry.pad
|
||||
});
|
||||
|
||||
if (map_ptr->second && !(entry.type & PKG_FILE_ENTRY_OVERWRITE))
|
||||
{
|
||||
@@ -824,7 +855,7 @@ bool package_reader::fill_data(std::map<std::string, install_entry*>& all_instal
|
||||
|
||||
if (num_failures != 0)
|
||||
{
|
||||
pkg_log.error("Package installation failed: %s", dir);
|
||||
pkg_log.error("Package installation failed: %s", m_install_path);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -833,20 +864,28 @@ bool package_reader::fill_data(std::map<std::string, install_entry*>& all_instal
|
||||
|
||||
fs::file DecryptEDAT(const fs::file& input, const std::string& input_file_name, int mode, u8 *custom_klic, bool verbose = false);
|
||||
|
||||
usz package_reader::extract_worker(thread_key thread_data_key, std::map<std::string, install_entry*>& all_install_entries)
|
||||
void package_reader::extract_worker(thread_key thread_data_key)
|
||||
{
|
||||
usz num_failures = 0;
|
||||
|
||||
while (true)
|
||||
while (m_num_failures == 0 && !m_aborted)
|
||||
{
|
||||
const usz maybe_index = m_entry_indexer++;
|
||||
// Make sure m_entry_indexer does not exceed m_install_entries
|
||||
const usz index = m_entry_indexer.fetch_op([this](usz& v)
|
||||
{
|
||||
if (v < m_install_entries.size())
|
||||
{
|
||||
v++;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (maybe_index >= m_install_entries.size())
|
||||
return false;
|
||||
}).first;
|
||||
|
||||
if (index >= m_install_entries.size())
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
const install_entry& entry = ::at32(m_install_entries, maybe_index);
|
||||
const install_entry& entry = ::at32(m_install_entries, index);
|
||||
|
||||
if (!entry.is_dominating())
|
||||
{
|
||||
@@ -860,8 +899,14 @@ usz package_reader::extract_worker(thread_key thread_data_key, std::map<std::str
|
||||
const std::string& path = entry.weak_reference->first;
|
||||
const std::string& name = entry.name;
|
||||
|
||||
const bool log_error = entry.pad || (entry.type & ~PKG_FILE_ENTRY_KNOWN_BITS);
|
||||
(log_error ? pkg_log.error : pkg_log.notice)("Entry 0x%08x: %s (pad=0x%x)", entry.type, name, entry.pad);
|
||||
if (entry.pad || (entry.type & ~PKG_FILE_ENTRY_KNOWN_BITS))
|
||||
{
|
||||
pkg_log.todo("Entry with unknown type or padding: type=0x%08x, pad=0x%x, name='%s'", entry.type, entry.pad, name);
|
||||
}
|
||||
else
|
||||
{
|
||||
pkg_log.notice("Entry: type=0x%08x, name='%s'", entry.type, name);
|
||||
}
|
||||
|
||||
switch (const u8 entry_type = entry.type & 0xff)
|
||||
{
|
||||
@@ -908,14 +953,14 @@ usz package_reader::extract_worker(thread_key thread_data_key, std::map<std::str
|
||||
if (data_span.size() != block_size)
|
||||
{
|
||||
extract_success = false;
|
||||
pkg_log.error("Failed to extract file %s", path);
|
||||
pkg_log.error("Failed to extract file %s (data_span.size=%d, block_size=%d)", path, data_span.size(), block_size);
|
||||
break;
|
||||
}
|
||||
|
||||
if (out.write(data_span.data(), block_size) != block_size)
|
||||
{
|
||||
extract_success = false;
|
||||
pkg_log.error("Failed to write file %s", path);
|
||||
pkg_log.error("Failed to write file %s (error=%s)", path, fs::g_tls_error);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -927,8 +972,8 @@ usz package_reader::extract_worker(thread_key thread_data_key, std::map<std::str
|
||||
out = DecryptEDAT(out, name, 1, reinterpret_cast<u8*>(&m_header.klicensee), true);
|
||||
if (!out || !fs::write_file(path, fs::rewrite, static_cast<fs::container_stream<std::vector<u8>>*>(out.release().get())->obj))
|
||||
{
|
||||
num_failures++;
|
||||
pkg_log.error("Failed to create file %s", path);
|
||||
m_num_failures++;
|
||||
pkg_log.error("Failed to create file %s (error=%s)", path, fs::g_tls_error);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -952,71 +997,133 @@ usz package_reader::extract_worker(thread_key thread_data_key, std::map<std::str
|
||||
}
|
||||
else
|
||||
{
|
||||
num_failures++;
|
||||
m_num_failures++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
num_failures++;
|
||||
pkg_log.error("Failed to create file %s", path);
|
||||
m_num_failures++;
|
||||
pkg_log.error("Failed to create file %s (is_buffered=%d, did_overwrite=%d, error=%s)", path, is_buffered, did_overwrite, fs::g_tls_error);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
num_failures++;
|
||||
m_num_failures++;
|
||||
pkg_log.error("Unknown PKG entry type (0x%x) %s", entry.type, name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return num_failures;
|
||||
}
|
||||
|
||||
bool package_reader::extract_data(std::deque<package_reader>& readers, std::deque<std::string>& bootable_paths)
|
||||
package_error package_reader::extract_data(std::deque<package_reader>& readers, std::deque<std::string>& bootable_paths)
|
||||
{
|
||||
std::map<std::string, install_entry*> all_install_entries;
|
||||
package_error error = package_error::no_error;
|
||||
usz num_failures = 0;
|
||||
|
||||
for (auto& reader : readers)
|
||||
// Set paths first in order to know if the install dir was empty before starting any installations.
|
||||
// This will also allow us to remove all the new packages in one path at once if any of them fail.
|
||||
for (package_reader& reader : readers)
|
||||
{
|
||||
if (!reader.fill_data(all_install_entries))
|
||||
reader.m_result = result::not_started;
|
||||
|
||||
if (!reader.set_install_path())
|
||||
{
|
||||
return false;
|
||||
error = package_error::other;
|
||||
reader.m_result = result::error; // We don't know if it's dirty yet.
|
||||
return error;
|
||||
}
|
||||
}
|
||||
|
||||
usz num_failures = 0;
|
||||
|
||||
for (auto& reader : readers)
|
||||
for (package_reader& reader : readers)
|
||||
{
|
||||
reader.m_bufs.resize(std::min<usz>(utils::get_thread_count(), reader.m_install_entries.size()));
|
||||
// Use a seperate map for each reader. We need to check if the target app version exists for each package in sequence.
|
||||
std::map<std::string, install_entry*> all_install_entries;
|
||||
|
||||
atomic_t<usz> thread_indexer = 0;
|
||||
|
||||
named_thread_group workers("PKG Installer "sv, std::max<usz>(reader.m_bufs.size(), 1) - 1, [&]()
|
||||
if (error != package_error::no_error || num_failures > 0)
|
||||
{
|
||||
num_failures += reader.extract_worker(thread_key{thread_indexer++}, all_install_entries);
|
||||
});
|
||||
ensure(reader.m_result == result::error || reader.m_result == result::error_dirty);
|
||||
return error;
|
||||
}
|
||||
|
||||
num_failures += reader.extract_worker(thread_key{thread_indexer++}, all_install_entries);
|
||||
workers.join();
|
||||
// Check if this package is allowed to be installed on top of the existing data
|
||||
error = reader.check_target_app_version();
|
||||
|
||||
reader.m_bufs.clear();
|
||||
reader.m_bufs.shrink_to_fit();
|
||||
|
||||
if (num_failures)
|
||||
if (error != package_error::no_error)
|
||||
{
|
||||
if (reader.m_was_null)
|
||||
reader.m_result = result::error; // We don't know if it's dirty yet.
|
||||
return error;
|
||||
}
|
||||
|
||||
reader.m_result = result::started;
|
||||
|
||||
// Parse the files to be installed and create all paths.
|
||||
if (!reader.fill_data(all_install_entries))
|
||||
{
|
||||
error = package_error::other;
|
||||
// Do not return yet. We may need to clean up down below.
|
||||
}
|
||||
|
||||
reader.m_num_failures = error == package_error::no_error ? 0 : 1;
|
||||
|
||||
if (reader.m_num_failures == 0)
|
||||
{
|
||||
reader.m_bufs.resize(std::min<usz>(utils::get_thread_count(), reader.m_install_entries.size()));
|
||||
|
||||
atomic_t<usz> thread_indexer = 0;
|
||||
|
||||
named_thread_group workers("PKG Installer "sv, std::max<u32>(::narrow<u32>(reader.m_bufs.size()), 1) - 1, [&]()
|
||||
{
|
||||
fs::remove_all(reader.m_install_path, true);
|
||||
reader.extract_worker(thread_key{thread_indexer++});
|
||||
});
|
||||
|
||||
reader.extract_worker(thread_key{thread_indexer++});
|
||||
workers.join();
|
||||
|
||||
reader.m_bufs.clear();
|
||||
reader.m_bufs.shrink_to_fit();
|
||||
}
|
||||
|
||||
num_failures += reader.m_num_failures;
|
||||
|
||||
// We don't count this package as aborted if all entries were processed.
|
||||
if (reader.m_num_failures || (reader.m_aborted && reader.m_entry_indexer < reader.m_install_entries.size()))
|
||||
{
|
||||
// Clear boot path. We don't want to propagate potentially broken paths to the caller.
|
||||
reader.m_bootable_file_path.clear();
|
||||
|
||||
bool cleaned = reader.m_was_null;
|
||||
|
||||
if (reader.m_was_null && fs::is_dir(reader.m_install_path))
|
||||
{
|
||||
pkg_log.notice("Removing partial installation ('%s')", reader.m_install_path);
|
||||
|
||||
if (!fs::remove_all(reader.m_install_path, true))
|
||||
{
|
||||
pkg_log.notice("Failed to remove partial installation ('%s') (error=%s)", reader.m_install_path, fs::g_tls_error);
|
||||
cleaned = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (reader.m_num_failures)
|
||||
{
|
||||
pkg_log.error("Package failed to install ('%s')", reader.m_install_path);
|
||||
reader.m_result = cleaned ? result::error : result::error_dirty;
|
||||
}
|
||||
else
|
||||
{
|
||||
pkg_log.warning("Package installation aborted ('%s')", reader.m_install_path);
|
||||
reader.m_result = cleaned ? result::aborted : result::aborted_dirty;
|
||||
}
|
||||
|
||||
pkg_log.success("Package failed to install ('%s')", reader.m_install_path);
|
||||
break;
|
||||
}
|
||||
else if (reader.get_progress(1) != 1)
|
||||
|
||||
reader.m_result = result::success;
|
||||
|
||||
if (reader.get_progress(1) != 1)
|
||||
{
|
||||
pkg_log.warning("Missing %d bytes from PKG total files size.", reader.m_header.data_size - reader.m_written_bytes);
|
||||
reader.m_written_bytes = reader.m_header.data_size; // Mark as completed anyway
|
||||
@@ -1026,13 +1133,18 @@ bool package_reader::extract_data(std::deque<package_reader>& readers, std::dequ
|
||||
bootable_paths.emplace_back(std::move(reader.m_bootable_file_path));
|
||||
}
|
||||
|
||||
return num_failures == 0;
|
||||
if (error == package_error::no_error && num_failures > 0)
|
||||
{
|
||||
error = package_error::other;
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
void package_reader::archive_seek(const s64 new_offset, const fs::seek_mode damode)
|
||||
{
|
||||
if (m_file) m_file.seek(new_offset, damode);
|
||||
};
|
||||
}
|
||||
|
||||
u64 package_reader::archive_read(void* data_ptr, const u64 num_bytes)
|
||||
{
|
||||
@@ -1128,4 +1240,16 @@ std::span<const char> package_reader::decrypt(u64 offset, u64 size, const uchar*
|
||||
|
||||
// Return the amount of data written in buf
|
||||
return data_span;
|
||||
};
|
||||
}
|
||||
|
||||
int package_reader::get_progress(int maximum) const
|
||||
{
|
||||
const usz wr = m_written_bytes;
|
||||
|
||||
return wr >= m_header.data_size ? maximum : ::narrow<int>(wr * maximum / m_header.data_size);
|
||||
}
|
||||
|
||||
void package_reader::abort_extract()
|
||||
{
|
||||
m_aborted = true;
|
||||
}
|
||||
|
||||
+20
-21
@@ -332,31 +332,26 @@ public:
|
||||
package_reader(const std::string& path);
|
||||
~package_reader();
|
||||
|
||||
enum result
|
||||
{
|
||||
not_started,
|
||||
started,
|
||||
success,
|
||||
aborted,
|
||||
aborted_dirty,
|
||||
error,
|
||||
error_dirty
|
||||
};
|
||||
|
||||
bool is_valid() const { return m_is_valid; }
|
||||
package_error check_target_app_version() const;
|
||||
static bool extract_data(std::deque<package_reader>& readers, std::deque<std::string>& bootable_paths);
|
||||
static package_error extract_data(std::deque<package_reader>& readers, std::deque<std::string>& bootable_paths);
|
||||
psf::registry get_psf() const { return m_psf; }
|
||||
result get_result() const { return m_result; };
|
||||
|
||||
int get_progress(int maximum = 100) const
|
||||
{
|
||||
const usz wr = m_written_bytes;
|
||||
int get_progress(int maximum = 100) const;
|
||||
|
||||
return wr >= m_header.data_size ? maximum : ::narrow<int>(wr * maximum / m_header.data_size);
|
||||
}
|
||||
|
||||
void abort_extract()
|
||||
{
|
||||
m_entry_indexer.fetch_op([this](usz& v)
|
||||
{
|
||||
if (v < m_install_entries.size())
|
||||
{
|
||||
v = m_install_entries.size();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
}
|
||||
void abort_extract();
|
||||
|
||||
private:
|
||||
bool read_header();
|
||||
@@ -365,13 +360,16 @@ private:
|
||||
bool decrypt_data();
|
||||
void archive_seek(s64 new_offset, const fs::seek_mode damode = fs::seek_set);
|
||||
u64 archive_read(void* data_ptr, u64 num_bytes);
|
||||
bool set_install_path();
|
||||
bool fill_data(std::map<std::string, install_entry*>& all_install_entries);
|
||||
std::span<const char> archive_read_block(u64 offset, void* data_ptr, u64 num_bytes);
|
||||
std::span<const char> decrypt(u64 offset, u64 size, const uchar* key, thread_key thread_data_key = {0});
|
||||
usz extract_worker(thread_key thread_data_key, std::map<std::string, install_entry*>& all_install_entries);
|
||||
void extract_worker(thread_key thread_data_key);
|
||||
|
||||
std::deque<install_entry> m_install_entries;
|
||||
std::string m_install_path;
|
||||
atomic_t<bool> m_aborted = false;
|
||||
atomic_t<usz> m_num_failures = 0;
|
||||
atomic_t<usz> m_entry_indexer = 0;
|
||||
atomic_t<usz> m_written_bytes = 0;
|
||||
bool m_was_null = false;
|
||||
@@ -379,6 +377,7 @@ private:
|
||||
static constexpr usz BUF_SIZE = 8192 * 1024; // 8 MB
|
||||
|
||||
bool m_is_valid = false;
|
||||
result m_result = result::not_started;
|
||||
|
||||
std::string m_path{};
|
||||
std::string m_install_dir{};
|
||||
|
||||
+121
-123
@@ -192,60 +192,58 @@ void WriteShdr(const fs::file& f, Elf32_Shdr& shdr)
|
||||
}
|
||||
|
||||
|
||||
void AppInfo::Load(const fs::file& f)
|
||||
void program_identification_header::Load(const fs::file& f)
|
||||
{
|
||||
authid = Read64(f);
|
||||
vendor_id = Read32(f);
|
||||
self_type = Read32(f);
|
||||
version = Read64(f);
|
||||
padding = Read64(f);
|
||||
program_authority_id = Read64(f);
|
||||
program_vendor_id = Read32(f);
|
||||
program_type = Read32(f);
|
||||
program_sceversion = Read64(f);
|
||||
padding = Read64(f);
|
||||
}
|
||||
|
||||
void AppInfo::Show() const
|
||||
void program_identification_header::Show() const
|
||||
{
|
||||
self_log.notice("AuthID: 0x%llx", authid);
|
||||
self_log.notice("VendorID: 0x%08x", vendor_id);
|
||||
self_log.notice("SELF type: 0x%08x", self_type);
|
||||
self_log.notice("Version: 0x%llx", version);
|
||||
self_log.notice("AuthID: 0x%llx", program_authority_id);
|
||||
self_log.notice("VendorID: 0x%08x", program_vendor_id);
|
||||
self_log.notice("SELF type: 0x%08x", program_type);
|
||||
self_log.notice("Version: 0x%llx", program_sceversion);
|
||||
}
|
||||
|
||||
void SectionInfo::Load(const fs::file& f)
|
||||
void segment_ext_header::Load(const fs::file& f)
|
||||
{
|
||||
offset = Read64(f);
|
||||
size = Read64(f);
|
||||
compressed = Read32(f);
|
||||
unknown1 = Read32(f);
|
||||
unknown2 = Read32(f);
|
||||
encrypted = Read32(f);
|
||||
offset = Read64(f);
|
||||
size = Read64(f);
|
||||
compression = Read32(f);
|
||||
unknown = Read32(f);
|
||||
encryption = Read64(f);
|
||||
}
|
||||
|
||||
void SectionInfo::Show() const
|
||||
void segment_ext_header::Show() const
|
||||
{
|
||||
self_log.notice("Offset: 0x%llx", offset);
|
||||
self_log.notice("Size: 0x%llx", size);
|
||||
self_log.notice("Compressed: 0x%08x", compressed);
|
||||
self_log.notice("Unknown1: 0x%08x", unknown1);
|
||||
self_log.notice("Unknown2: 0x%08x", unknown2);
|
||||
self_log.notice("Encrypted: 0x%08x", encrypted);
|
||||
self_log.notice("Compression: 0x%08x", compression);
|
||||
self_log.notice("Unknown: 0x%08x", unknown);
|
||||
self_log.notice("Encryption: 0x%08x", encryption);
|
||||
}
|
||||
|
||||
void SCEVersionInfo::Load(const fs::file& f)
|
||||
void version_header::Load(const fs::file& f)
|
||||
{
|
||||
subheader_type = Read32(f);
|
||||
present = Read32(f);
|
||||
size = Read32(f);
|
||||
unknown = Read32(f);
|
||||
unknown4 = Read32(f);
|
||||
}
|
||||
|
||||
void SCEVersionInfo::Show() const
|
||||
void version_header::Show() const
|
||||
{
|
||||
self_log.notice("Sub-header type: 0x%08x", subheader_type);
|
||||
self_log.notice("Present: 0x%08x", present);
|
||||
self_log.notice("Size: 0x%08x", size);
|
||||
self_log.notice("Unknown: 0x%08x", unknown);
|
||||
self_log.notice("Unknown: 0x%08x", unknown4);
|
||||
}
|
||||
|
||||
void ControlInfo::Load(const fs::file& f)
|
||||
void supplemental_header::Load(const fs::file& f)
|
||||
{
|
||||
type = Read32(f);
|
||||
size = Read32(f);
|
||||
@@ -253,45 +251,45 @@ void ControlInfo::Load(const fs::file& f)
|
||||
|
||||
if (type == 1)
|
||||
{
|
||||
control_flags.ctrl_flag1 = Read32(f);
|
||||
control_flags.unknown1 = Read32(f);
|
||||
control_flags.unknown2 = Read32(f);
|
||||
control_flags.unknown3 = Read32(f);
|
||||
control_flags.unknown4 = Read32(f);
|
||||
control_flags.unknown5 = Read32(f);
|
||||
control_flags.unknown6 = Read32(f);
|
||||
control_flags.unknown7 = Read32(f);
|
||||
PS3_plaintext_capability_header.ctrl_flag1 = Read32(f);
|
||||
PS3_plaintext_capability_header.unknown1 = Read32(f);
|
||||
PS3_plaintext_capability_header.unknown2 = Read32(f);
|
||||
PS3_plaintext_capability_header.unknown3 = Read32(f);
|
||||
PS3_plaintext_capability_header.unknown4 = Read32(f);
|
||||
PS3_plaintext_capability_header.unknown5 = Read32(f);
|
||||
PS3_plaintext_capability_header.unknown6 = Read32(f);
|
||||
PS3_plaintext_capability_header.unknown7 = Read32(f);
|
||||
}
|
||||
else if (type == 2)
|
||||
{
|
||||
if (size == 0x30)
|
||||
{
|
||||
f.read(file_digest_30.digest, 20);
|
||||
file_digest_30.unknown = Read64(f);
|
||||
f.read(PS3_elf_digest_header_30.constant_or_elf_digest, sizeof(PS3_elf_digest_header_30.constant_or_elf_digest));
|
||||
f.read(PS3_elf_digest_header_30.padding, sizeof(PS3_elf_digest_header_30.padding));
|
||||
}
|
||||
else if (size == 0x40)
|
||||
{
|
||||
f.read(file_digest_40.digest1, 20);
|
||||
f.read(file_digest_40.digest2, 20);
|
||||
file_digest_40.unknown = Read64(f);
|
||||
f.read(PS3_elf_digest_header_40.constant, sizeof(PS3_elf_digest_header_40.constant));
|
||||
f.read(PS3_elf_digest_header_40.elf_digest, sizeof(PS3_elf_digest_header_40.elf_digest));
|
||||
PS3_elf_digest_header_40.required_system_version = Read64(f);
|
||||
}
|
||||
}
|
||||
else if (type == 3)
|
||||
{
|
||||
npdrm.magic = Read32(f);
|
||||
npdrm.version = Read32(f);
|
||||
npdrm.license = Read32(f);
|
||||
npdrm.type = Read32(f);
|
||||
f.read(npdrm.content_id, 48);
|
||||
f.read(npdrm.digest, 16);
|
||||
f.read(npdrm.title_hash, 16);
|
||||
f.read(npdrm.dev_hash, 16);
|
||||
npdrm.activate_time = Read64(f);
|
||||
npdrm.expire_time = Read64(f);
|
||||
PS3_npdrm_header.npd.magic = Read32(f);
|
||||
PS3_npdrm_header.npd.version = Read32(f);
|
||||
PS3_npdrm_header.npd.license = Read32(f);
|
||||
PS3_npdrm_header.npd.type = Read32(f);
|
||||
f.read(PS3_npdrm_header.npd.content_id, 48);
|
||||
f.read(PS3_npdrm_header.npd.digest, 16);
|
||||
f.read(PS3_npdrm_header.npd.title_hash, 16);
|
||||
f.read(PS3_npdrm_header.npd.dev_hash, 16);
|
||||
PS3_npdrm_header.npd.activate_time = Read64(f);
|
||||
PS3_npdrm_header.npd.expire_time = Read64(f);
|
||||
}
|
||||
}
|
||||
|
||||
void ControlInfo::Show() const
|
||||
void supplemental_header::Show() const
|
||||
{
|
||||
self_log.notice("Type: 0x%08x", type);
|
||||
self_log.notice("Size: 0x%08x", size);
|
||||
@@ -299,41 +297,41 @@ void ControlInfo::Show() const
|
||||
|
||||
if (type == 1)
|
||||
{
|
||||
self_log.notice("Control flag 1: 0x%08x", control_flags.ctrl_flag1);
|
||||
self_log.notice("Unknown1: 0x%08x", control_flags.unknown1);
|
||||
self_log.notice("Unknown2: 0x%08x", control_flags.unknown2);
|
||||
self_log.notice("Unknown3: 0x%08x", control_flags.unknown3);
|
||||
self_log.notice("Unknown4: 0x%08x", control_flags.unknown4);
|
||||
self_log.notice("Unknown5: 0x%08x", control_flags.unknown5);
|
||||
self_log.notice("Unknown6: 0x%08x", control_flags.unknown6);
|
||||
self_log.notice("Unknown7: 0x%08x", control_flags.unknown7);
|
||||
self_log.notice("Control flag 1: 0x%08x", PS3_plaintext_capability_header.ctrl_flag1);
|
||||
self_log.notice("Unknown1: 0x%08x", PS3_plaintext_capability_header.unknown1);
|
||||
self_log.notice("Unknown2: 0x%08x", PS3_plaintext_capability_header.unknown2);
|
||||
self_log.notice("Unknown3: 0x%08x", PS3_plaintext_capability_header.unknown3);
|
||||
self_log.notice("Unknown4: 0x%08x", PS3_plaintext_capability_header.unknown4);
|
||||
self_log.notice("Unknown5: 0x%08x", PS3_plaintext_capability_header.unknown5);
|
||||
self_log.notice("Unknown6: 0x%08x", PS3_plaintext_capability_header.unknown6);
|
||||
self_log.notice("Unknown7: 0x%08x", PS3_plaintext_capability_header.unknown7);
|
||||
}
|
||||
else if (type == 2)
|
||||
{
|
||||
if (size == 0x30)
|
||||
{
|
||||
self_log.notice("Digest: %s", file_digest_30.digest);
|
||||
self_log.notice("Unknown: 0x%llx", file_digest_30.unknown);
|
||||
self_log.notice("Digest: %s", PS3_elf_digest_header_30.constant_or_elf_digest);
|
||||
self_log.notice("Unknown: 0x%llx", PS3_elf_digest_header_30.padding);
|
||||
}
|
||||
else if (size == 0x40)
|
||||
{
|
||||
self_log.notice("Digest1: %s", file_digest_40.digest1);
|
||||
self_log.notice("Digest2: %s", file_digest_40.digest2);
|
||||
self_log.notice("Unknown: 0x%llx", file_digest_40.unknown);
|
||||
self_log.notice("Digest1: %s", PS3_elf_digest_header_40.constant);
|
||||
self_log.notice("Digest2: %s", PS3_elf_digest_header_40.elf_digest);
|
||||
self_log.notice("Unknown: 0x%llx", PS3_elf_digest_header_40.required_system_version);
|
||||
}
|
||||
}
|
||||
else if (type == 3)
|
||||
{
|
||||
self_log.notice("Magic: 0x%08x", npdrm.magic);
|
||||
self_log.notice("Version: 0x%08x", npdrm.version);
|
||||
self_log.notice("License: 0x%08x", npdrm.license);
|
||||
self_log.notice("Type: 0x%08x", npdrm.type);
|
||||
self_log.notice("ContentID: %s", npdrm.content_id);
|
||||
self_log.notice("Digest: %s", npdrm.digest);
|
||||
self_log.notice("Inverse digest: %s", npdrm.title_hash);
|
||||
self_log.notice("XOR digest: %s", npdrm.dev_hash);
|
||||
self_log.notice("Activation time: 0x%llx", npdrm.activate_time);
|
||||
self_log.notice("Expiration time: 0x%llx", npdrm.expire_time);
|
||||
self_log.notice("Magic: 0x%08x", PS3_npdrm_header.npd.magic);
|
||||
self_log.notice("Version: 0x%08x", PS3_npdrm_header.npd.version);
|
||||
self_log.notice("License: 0x%08x", PS3_npdrm_header.npd.license);
|
||||
self_log.notice("Type: 0x%08x", PS3_npdrm_header.npd.type);
|
||||
self_log.notice("ContentID: %s", PS3_npdrm_header.npd.content_id);
|
||||
self_log.notice("Digest: %s", PS3_npdrm_header.npd.digest);
|
||||
self_log.notice("Inverse digest: %s", PS3_npdrm_header.npd.title_hash);
|
||||
self_log.notice("XOR digest: %s", PS3_npdrm_header.npd.dev_hash);
|
||||
self_log.notice("Activation time: 0x%llx", PS3_npdrm_header.npd.activate_time);
|
||||
self_log.notice("Expiration time: 0x%llx", PS3_npdrm_header.npd.expire_time);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -610,18 +608,18 @@ void SceHeader::Load(const fs::file& f)
|
||||
se_esize = Read64(f);
|
||||
}
|
||||
|
||||
void SelfHeader::Load(const fs::file& f)
|
||||
void ext_hdr::Load(const fs::file& f)
|
||||
{
|
||||
se_htype = Read64(f);
|
||||
se_appinfooff = Read64(f);
|
||||
se_elfoff = Read64(f);
|
||||
se_phdroff = Read64(f);
|
||||
se_shdroff = Read64(f);
|
||||
se_secinfoff = Read64(f);
|
||||
se_sceveroff = Read64(f);
|
||||
se_controloff = Read64(f);
|
||||
se_controlsize = Read64(f);
|
||||
pad = Read64(f);
|
||||
ext_hdr_version = Read64(f);
|
||||
program_identification_hdr_offset = Read64(f);
|
||||
ehdr_offset = Read64(f);
|
||||
phdr_offset = Read64(f);
|
||||
shdr_offset = Read64(f);
|
||||
segment_ext_hdr_offset = Read64(f);
|
||||
version_hdr_offset = Read64(f);
|
||||
supplemental_hdr_offset = Read64(f);
|
||||
supplemental_hdr_size = Read64(f);
|
||||
padding = Read64(f);
|
||||
}
|
||||
|
||||
SCEDecrypter::SCEDecrypter(const fs::file& s)
|
||||
@@ -683,7 +681,7 @@ bool SCEDecrypter::LoadMetadata(const u8 erk[32], const u8 riv[16])
|
||||
if ((meta_info.key_pad[0] != 0x00) ||
|
||||
(meta_info.iv_pad[0] != 0x00))
|
||||
{
|
||||
self_log.error("Failed to decrypt metadata info!");
|
||||
self_log.error("Failed to decrypt SCE metadata info!");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -884,19 +882,19 @@ bool SELFDecrypter::LoadHeaders(bool isElf32, SelfAdditionalInfo* out_info)
|
||||
}
|
||||
|
||||
// Read SELF header.
|
||||
self_hdr.Load(self_f);
|
||||
m_ext_hdr.Load(self_f);
|
||||
|
||||
// Read the APP INFO.
|
||||
self_f.seek(self_hdr.se_appinfooff);
|
||||
app_info.Load(self_f);
|
||||
self_f.seek(m_ext_hdr.program_identification_hdr_offset);
|
||||
m_prog_id_hdr.Load(self_f);
|
||||
|
||||
if (out_info)
|
||||
{
|
||||
out_info->app_info = app_info;
|
||||
out_info->prog_id_hdr = m_prog_id_hdr;
|
||||
}
|
||||
|
||||
// Read ELF header.
|
||||
self_f.seek(self_hdr.se_elfoff);
|
||||
self_f.seek(m_ext_hdr.ehdr_offset);
|
||||
|
||||
if (isElf32)
|
||||
elf32_hdr.Load(self_f);
|
||||
@@ -912,7 +910,7 @@ bool SELFDecrypter::LoadHeaders(bool isElf32, SelfAdditionalInfo* out_info)
|
||||
self_log.error("ELF program header offset is null!");
|
||||
return false;
|
||||
}
|
||||
self_f.seek(self_hdr.se_phdroff);
|
||||
self_f.seek(m_ext_hdr.phdr_offset);
|
||||
for(u32 i = 0; i < elf32_hdr.e_phnum; ++i)
|
||||
{
|
||||
phdr32_arr.emplace_back();
|
||||
@@ -929,7 +927,7 @@ bool SELFDecrypter::LoadHeaders(bool isElf32, SelfAdditionalInfo* out_info)
|
||||
return false;
|
||||
}
|
||||
|
||||
self_f.seek(self_hdr.se_phdroff);
|
||||
self_f.seek(m_ext_hdr.phdr_offset);
|
||||
|
||||
for (u32 i = 0; i < elf64_hdr.e_phnum; ++i)
|
||||
{
|
||||
@@ -940,34 +938,34 @@ bool SELFDecrypter::LoadHeaders(bool isElf32, SelfAdditionalInfo* out_info)
|
||||
|
||||
|
||||
// Read section info.
|
||||
secinfo_arr.clear();
|
||||
self_f.seek(self_hdr.se_secinfoff);
|
||||
m_seg_ext_hdr.clear();
|
||||
self_f.seek(m_ext_hdr.segment_ext_hdr_offset);
|
||||
|
||||
for(u32 i = 0; i < ((isElf32) ? elf32_hdr.e_phnum : elf64_hdr.e_phnum); ++i)
|
||||
{
|
||||
secinfo_arr.emplace_back();
|
||||
secinfo_arr.back().Load(self_f);
|
||||
m_seg_ext_hdr.emplace_back();
|
||||
m_seg_ext_hdr.back().Load(self_f);
|
||||
}
|
||||
|
||||
// Read SCE version info.
|
||||
self_f.seek(self_hdr.se_sceveroff);
|
||||
scev_info.Load(self_f);
|
||||
self_f.seek(m_ext_hdr.version_hdr_offset);
|
||||
m_version_hdr.Load(self_f);
|
||||
|
||||
// Read control info.
|
||||
ctrlinfo_arr.clear();
|
||||
self_f.seek(self_hdr.se_controloff);
|
||||
m_supplemental_hdr_arr.clear();
|
||||
self_f.seek(m_ext_hdr.supplemental_hdr_offset);
|
||||
|
||||
for (u64 i = 0; i < self_hdr.se_controlsize;)
|
||||
for (u64 i = 0; i < m_ext_hdr.supplemental_hdr_size;)
|
||||
{
|
||||
ctrlinfo_arr.emplace_back();
|
||||
ControlInfo &cinfo = ctrlinfo_arr.back();
|
||||
m_supplemental_hdr_arr.emplace_back();
|
||||
supplemental_header& cinfo = m_supplemental_hdr_arr.back();
|
||||
cinfo.Load(self_f);
|
||||
i += cinfo.size;
|
||||
}
|
||||
|
||||
if (out_info)
|
||||
{
|
||||
out_info->ctrl_info = ctrlinfo_arr;
|
||||
out_info->supplemental_hdr = m_supplemental_hdr_arr;
|
||||
}
|
||||
|
||||
// Read ELF section headers.
|
||||
@@ -981,7 +979,7 @@ bool SELFDecrypter::LoadHeaders(bool isElf32, SelfAdditionalInfo* out_info)
|
||||
return true;
|
||||
}
|
||||
|
||||
self_f.seek(self_hdr.se_shdroff);
|
||||
self_f.seek(m_ext_hdr.shdr_offset);
|
||||
|
||||
for(u32 i = 0; i < elf32_hdr.e_shnum; ++i)
|
||||
{
|
||||
@@ -998,7 +996,7 @@ bool SELFDecrypter::LoadHeaders(bool isElf32, SelfAdditionalInfo* out_info)
|
||||
return true;
|
||||
}
|
||||
|
||||
self_f.seek(self_hdr.se_shdroff);
|
||||
self_f.seek(m_ext_hdr.shdr_offset);
|
||||
|
||||
for(u32 i = 0; i < elf64_hdr.e_shnum; ++i)
|
||||
{
|
||||
@@ -1023,11 +1021,11 @@ void SELFDecrypter::ShowHeaders(bool isElf32)
|
||||
self_log.notice("----------------------------------------------------");
|
||||
self_log.notice("SELF header");
|
||||
self_log.notice("----------------------------------------------------");
|
||||
self_hdr.Show();
|
||||
m_ext_hdr.Show();
|
||||
self_log.notice("----------------------------------------------------");
|
||||
self_log.notice("APP INFO");
|
||||
self_log.notice("----------------------------------------------------");
|
||||
app_info.Show();
|
||||
m_prog_id_hdr.Show();
|
||||
self_log.notice("----------------------------------------------------");
|
||||
self_log.notice("ELF header");
|
||||
self_log.notice("----------------------------------------------------");
|
||||
@@ -1040,17 +1038,17 @@ void SELFDecrypter::ShowHeaders(bool isElf32)
|
||||
self_log.notice("----------------------------------------------------");
|
||||
self_log.notice("Section info");
|
||||
self_log.notice("----------------------------------------------------");
|
||||
for(unsigned int i = 0; i < secinfo_arr.size(); i++)
|
||||
secinfo_arr[i].Show();
|
||||
for(unsigned int i = 0; i < m_seg_ext_hdr.size(); i++)
|
||||
m_seg_ext_hdr[i].Show();
|
||||
self_log.notice("----------------------------------------------------");
|
||||
self_log.notice("SCE version info");
|
||||
self_log.notice("----------------------------------------------------");
|
||||
scev_info.Show();
|
||||
m_version_hdr.Show();
|
||||
self_log.notice("----------------------------------------------------");
|
||||
self_log.notice("Control info");
|
||||
self_log.notice("----------------------------------------------------");
|
||||
for(unsigned int i = 0; i < ctrlinfo_arr.size(); i++)
|
||||
ctrlinfo_arr[i].Show();
|
||||
for(unsigned int i = 0; i < m_supplemental_hdr_arr.size(); i++)
|
||||
m_supplemental_hdr_arr[i].Show();
|
||||
self_log.notice("----------------------------------------------------");
|
||||
self_log.notice("ELF section headers");
|
||||
self_log.notice("----------------------------------------------------");
|
||||
@@ -1095,7 +1093,7 @@ bool SELFDecrypter::DecryptNPDRM(u8 *metadata, u32 metadata_size)
|
||||
else if (npd->license == 3) // Free license.
|
||||
{
|
||||
// Use klicensee if available.
|
||||
if (key_v.GetKlicenseeKey() != nullptr)
|
||||
if (key_v.GetKlicenseeKey())
|
||||
memcpy(npdrm_key, key_v.GetKlicenseeKey(), 0x10);
|
||||
else
|
||||
memcpy(npdrm_key, NP_KLIC_FREE, 0x10);
|
||||
@@ -1123,11 +1121,11 @@ bool SELFDecrypter::DecryptNPDRM(u8 *metadata, u32 metadata_size)
|
||||
const NPD_HEADER* SELFDecrypter::GetNPDHeader() const
|
||||
{
|
||||
// Parse the control info structures to find the NPDRM control info.
|
||||
for (const ControlInfo& info : ctrlinfo_arr)
|
||||
for (const supplemental_header& info : m_supplemental_hdr_arr)
|
||||
{
|
||||
if (info.type == 3)
|
||||
{
|
||||
return &info.npdrm;
|
||||
return &info.PS3_npdrm_header.npd;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1150,7 +1148,7 @@ bool SELFDecrypter::LoadMetadata(u8* klic_key)
|
||||
self_f.read(metadata_headers.get(), metadata_headers_size);
|
||||
|
||||
// Find the right keyset from the key vault.
|
||||
SELF_KEY keyset = key_v.FindSelfKey(app_info.self_type, sce_hdr.se_flags, app_info.version);
|
||||
SELF_KEY keyset = key_v.FindSelfKey(m_prog_id_hdr.program_type, sce_hdr.se_flags, m_prog_id_hdr.program_sceversion);
|
||||
|
||||
// Set klic if given
|
||||
if (klic_key)
|
||||
@@ -1182,7 +1180,7 @@ bool SELFDecrypter::LoadMetadata(u8* klic_key)
|
||||
if ((meta_info.key_pad[0] != 0x00) ||
|
||||
(meta_info.iv_pad[0] != 0x00))
|
||||
{
|
||||
self_log.error("Failed to decrypt metadata info!");
|
||||
self_log.error("Failed to decrypt SELF metadata info!");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1333,15 +1331,15 @@ static bool IsSelfElf32(const fs::file& f)
|
||||
|
||||
f.seek(0);
|
||||
|
||||
SceHeader hdr;
|
||||
SelfHeader sh;
|
||||
SceHeader hdr{};
|
||||
ext_hdr sh{};
|
||||
hdr.Load(f);
|
||||
sh.Load(f);
|
||||
|
||||
// Locate the class byte and check it.
|
||||
u8 elf_class[0x8];
|
||||
|
||||
f.seek(sh.se_elfoff);
|
||||
f.seek(sh.ehdr_offset);
|
||||
f.read(elf_class, 0x8);
|
||||
|
||||
return (elf_class[4] == 1);
|
||||
|
||||
+184
-121
@@ -11,52 +11,113 @@
|
||||
|
||||
LOG_CHANNEL(self_log, "SELF");
|
||||
|
||||
struct AppInfo
|
||||
// SCE-specific definitions for e_type:
|
||||
enum
|
||||
{
|
||||
u64 authid;
|
||||
u32 vendor_id;
|
||||
u32 self_type;
|
||||
u64 version;
|
||||
ET_SCE_EXEC = 0xFE00, // SCE Executable - PRX2
|
||||
ET_SCE_RELEXEC = 0xFE04, // SCE Relocatable Executable - PRX2
|
||||
ET_SCE_STUBLIB = 0xFE0C, // SCE SDK Stubs
|
||||
ET_SCE_DYNEXEC = 0xFE10, // SCE EXEC_ASLR (PS4 Executable with ASLR)
|
||||
ET_SCE_DYNAMIC = 0xFE18, // ?
|
||||
ET_SCE_IOPRELEXEC = 0xFF80, // SCE IOP Relocatable Executable
|
||||
ET_SCE_IOPRELEXEC2 = 0xFF81, // SCE IOP Relocatable Executable Version 2
|
||||
ET_SCE_EERELEXEC = 0xFF90, // SCE EE Relocatable Executable
|
||||
ET_SCE_EERELEXEC2 = 0xFF91, // SCE EE Relocatable Executable Version 2
|
||||
ET_SCE_PSPRELEXEC = 0xFFA0, // SCE PSP Relocatable Executable
|
||||
ET_SCE_PPURELEXEC = 0xFFA4, // SCE PPU Relocatable Executable
|
||||
ET_SCE_ARMRELEXEC = 0xFFA5, // ?SCE ARM Relocatable Executable (PS Vita System Software earlier or equal 0.931.010)
|
||||
ET_SCE_PSPOVERLAY = 0xFFA8, // ?
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
ELFOSABI_CELL_LV2 = 102 // CELL LV2
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
PT_SCE_RELA = 0x60000000,
|
||||
PT_SCE_LICINFO_1 = 0x60000001,
|
||||
PT_SCE_LICINFO_2 = 0x60000002,
|
||||
PT_SCE_DYNLIBDATA = 0x61000000,
|
||||
PT_SCE_PROCPARAM = 0x61000001,
|
||||
PT_SCE_UNK_61000010 = 0x61000010,
|
||||
PT_SCE_COMMENT = 0x6FFFFF00,
|
||||
PT_SCE_LIBVERSION = 0x6FFFFF01,
|
||||
PT_SCE_UNK_70000001 = 0x70000001,
|
||||
PT_SCE_IOPMOD = 0x70000080,
|
||||
PT_SCE_EEMOD = 0x70000090,
|
||||
PT_SCE_PSPRELA = 0x700000A0,
|
||||
PT_SCE_PSPRELA2 = 0x700000A1,
|
||||
PT_SCE_PPURELA = 0x700000A4,
|
||||
PT_SCE_SEGSYM = 0x700000A8,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
PF_SPU_X = 0x00100000,
|
||||
PF_SPU_W = 0x00200000,
|
||||
PF_SPU_R = 0x00400000,
|
||||
PF_RSX_X = 0x01000000,
|
||||
PF_RSX_W = 0x02000000,
|
||||
PF_RSX_R = 0x04000000,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
SHT_SCE_RELA = 0x60000000,
|
||||
SHT_SCE_NID = 0x61000001,
|
||||
SHT_SCE_IOPMOD = 0x70000080,
|
||||
SHT_SCE_EEMOD = 0x70000090,
|
||||
SHT_SCE_PSPRELA = 0x700000A0,
|
||||
SHT_SCE_PPURELA = 0x700000A4,
|
||||
};
|
||||
|
||||
struct program_identification_header
|
||||
{
|
||||
u64 program_authority_id;
|
||||
u32 program_vendor_id;
|
||||
u32 program_type;
|
||||
u64 program_sceversion;
|
||||
u64 padding;
|
||||
|
||||
void Load(const fs::file& f);
|
||||
void Show() const;
|
||||
};
|
||||
|
||||
struct SectionInfo
|
||||
struct segment_ext_header
|
||||
{
|
||||
u64 offset;
|
||||
u64 size;
|
||||
u32 compressed;
|
||||
u32 unknown1;
|
||||
u32 unknown2;
|
||||
u32 encrypted;
|
||||
u64 offset; // Offset to data
|
||||
u64 size; // Size of data
|
||||
u32 compression; // 1 = plain, 2 = zlib
|
||||
u32 unknown; // Always 0, as far as I know.
|
||||
u64 encryption; // 0 = unrequested, 1 = completed, 2 = requested
|
||||
|
||||
void Load(const fs::file& f);
|
||||
void Show() const;
|
||||
};
|
||||
|
||||
struct SCEVersionInfo
|
||||
struct version_header
|
||||
{
|
||||
u32 subheader_type;
|
||||
u32 present;
|
||||
u32 size;
|
||||
u32 unknown;
|
||||
u32 subheader_type; // 1 - sceversion
|
||||
u32 present; // 0 = false, 1 = true
|
||||
u32 size; // usually 0x10
|
||||
u32 unknown4;
|
||||
|
||||
void Load(const fs::file& f);
|
||||
void Show() const;
|
||||
};
|
||||
|
||||
struct ControlInfo
|
||||
struct supplemental_header
|
||||
{
|
||||
u32 type;
|
||||
u32 type; // 1=PS3 plaintext_capability; 2=PS3 ELF digest; 3=PS3 NPDRM, 4=PS Vita ELF digest; 5=PS Vita NPDRM; 6=PS Vita boot param; 7=PS Vita shared secret
|
||||
u32 size;
|
||||
u64 next;
|
||||
u64 next; // 1 if another Supplemental Header element follows else 0
|
||||
|
||||
union
|
||||
{
|
||||
// type 1 0x30 bytes
|
||||
struct
|
||||
// type 1, 0x30 bytes
|
||||
struct // 0x20 bytes of data
|
||||
{
|
||||
u32 ctrl_flag1;
|
||||
u32 unknown1;
|
||||
@@ -66,28 +127,28 @@ struct ControlInfo
|
||||
u32 unknown5;
|
||||
u32 unknown6;
|
||||
u32 unknown7;
|
||||
} PS3_plaintext_capability_header;
|
||||
|
||||
} control_flags;
|
||||
|
||||
// type 2 0x30 bytes
|
||||
struct
|
||||
// type 2, 0x40 bytes
|
||||
struct // 0x30 bytes of data
|
||||
{
|
||||
u8 digest[20];
|
||||
u64 unknown;
|
||||
u8 constant[0x14]; // same for every PS3/PS Vita SELF, hardcoded in make_fself.exe: 627CB1808AB938E32C8C091708726A579E2586E4
|
||||
u8 elf_digest[0x14]; // SHA-1. Hash F2C552BF716ED24759CBE8A0A9A6DB9965F3811C is blacklisted by appldr
|
||||
u64 required_system_version; // filled on Sony authentication server, contains decimal PS3_SYSTEM_VER value from PARAM.SFO
|
||||
} PS3_elf_digest_header_40;
|
||||
|
||||
} file_digest_30;
|
||||
|
||||
// type 2 0x40 bytes
|
||||
struct
|
||||
// type 2, 0x30 bytes
|
||||
struct // 0x20 bytes of data
|
||||
{
|
||||
u8 digest1[20];
|
||||
u8 digest2[20];
|
||||
u64 unknown;
|
||||
u8 constant_or_elf_digest[0x14];
|
||||
u8 padding[0xC];
|
||||
} PS3_elf_digest_header_30;
|
||||
|
||||
} file_digest_40;
|
||||
|
||||
// type 3 0x90 bytes
|
||||
NPD_HEADER npdrm;
|
||||
// type 3, 0x90 bytes
|
||||
struct // 0x80 bytes of data
|
||||
{
|
||||
NPD_HEADER npd;
|
||||
} PS3_npdrm_header;
|
||||
};
|
||||
|
||||
void Load(const fs::file& f);
|
||||
@@ -172,7 +233,7 @@ struct Signature
|
||||
|
||||
struct SelfSection
|
||||
{
|
||||
u8 *data;
|
||||
u8* data;
|
||||
u64 size;
|
||||
u64 offset;
|
||||
|
||||
@@ -181,25 +242,26 @@ struct SelfSection
|
||||
|
||||
struct Elf32_Ehdr
|
||||
{
|
||||
//u8 e_ident[16]; // ELF identification
|
||||
u32 e_magic;
|
||||
u8 e_class;
|
||||
u8 e_data;
|
||||
u8 e_curver;
|
||||
u8 e_os_abi;
|
||||
u64 e_abi_ver;
|
||||
u16 e_type;
|
||||
u16 e_machine;
|
||||
u32 e_version;
|
||||
u32 e_entry;
|
||||
u32 e_phoff;
|
||||
u32 e_shoff;
|
||||
u32 e_flags;
|
||||
u16 e_ehsize;
|
||||
u16 e_phentsize;
|
||||
u16 e_phnum;
|
||||
u16 e_shentsize;
|
||||
u16 e_shnum;
|
||||
u16 e_shstrndx;
|
||||
u16 e_type; // object file type
|
||||
u16 e_machine; // machine type
|
||||
u32 e_version; // object file version
|
||||
u32 e_entry; // entry point address
|
||||
u32 e_phoff; // program header offset
|
||||
u32 e_shoff; // section header offset
|
||||
u32 e_flags; // processor-specific flags
|
||||
u16 e_ehsize; // ELF header size
|
||||
u16 e_phentsize; // size of program header entry
|
||||
u16 e_phnum; // number of program header entries
|
||||
u16 e_shentsize; // size of section header entry
|
||||
u16 e_shnum; // number of section header entries
|
||||
u16 e_shstrndx; // section name string table index
|
||||
|
||||
void Load(const fs::file& f);
|
||||
static void Show() {}
|
||||
@@ -210,16 +272,16 @@ struct Elf32_Ehdr
|
||||
|
||||
struct Elf32_Shdr
|
||||
{
|
||||
u32 sh_name;
|
||||
u32 sh_type;
|
||||
u32 sh_flags;
|
||||
u32 sh_addr;
|
||||
u32 sh_offset;
|
||||
u32 sh_size;
|
||||
u32 sh_link;
|
||||
u32 sh_info;
|
||||
u32 sh_addralign;
|
||||
u32 sh_entsize;
|
||||
u32 sh_name; // section name
|
||||
u32 sh_type; // section type
|
||||
u32 sh_flags; // section attributes
|
||||
u32 sh_addr; // virtual address in memory
|
||||
u32 sh_offset; // offset in file
|
||||
u32 sh_size; // size of section
|
||||
u32 sh_link; // link to other section
|
||||
u32 sh_info; // miscellaneous information
|
||||
u32 sh_addralign; // address alignment boundary
|
||||
u32 sh_entsize; // size of entries, if section has table
|
||||
|
||||
void Load(const fs::file& f);
|
||||
void LoadLE(const fs::file& f);
|
||||
@@ -228,14 +290,14 @@ struct Elf32_Shdr
|
||||
|
||||
struct Elf32_Phdr
|
||||
{
|
||||
u32 p_type;
|
||||
u32 p_offset;
|
||||
u32 p_vaddr;
|
||||
u32 p_paddr;
|
||||
u32 p_filesz;
|
||||
u32 p_memsz;
|
||||
u32 p_flags;
|
||||
u32 p_align;
|
||||
u32 p_type; // Segment type
|
||||
u32 p_offset; // Segment file offset
|
||||
u32 p_vaddr; // Segment virtual address
|
||||
u32 p_paddr; // Segment physical address
|
||||
u32 p_filesz; // Segment size in file
|
||||
u32 p_memsz; // Segment size in memory
|
||||
u32 p_flags; // Segment flags
|
||||
u32 p_align; // Segment alignment
|
||||
|
||||
void Load(const fs::file& f);
|
||||
void LoadLE(const fs::file& f);
|
||||
@@ -244,25 +306,26 @@ struct Elf32_Phdr
|
||||
|
||||
struct Elf64_Ehdr
|
||||
{
|
||||
//u8 e_ident[16]; // ELF identification
|
||||
u32 e_magic;
|
||||
u8 e_class;
|
||||
u8 e_data;
|
||||
u8 e_curver;
|
||||
u8 e_os_abi;
|
||||
u64 e_abi_ver;
|
||||
u16 e_type;
|
||||
u16 e_machine;
|
||||
u32 e_version;
|
||||
u64 e_entry;
|
||||
u64 e_phoff;
|
||||
u64 e_shoff;
|
||||
u32 e_flags;
|
||||
u16 e_ehsize;
|
||||
u16 e_phentsize;
|
||||
u16 e_phnum;
|
||||
u16 e_shentsize;
|
||||
u16 e_shnum;
|
||||
u16 e_shstrndx;
|
||||
u16 e_type; // object file type
|
||||
u16 e_machine; // machine type
|
||||
u32 e_version; // object file version
|
||||
u64 e_entry; // entry point address
|
||||
u64 e_phoff; // program header offset
|
||||
u64 e_shoff; // section header offset
|
||||
u32 e_flags; // processor-specific flags
|
||||
u16 e_ehsize; // ELF header size
|
||||
u16 e_phentsize; // size of program header entry
|
||||
u16 e_phnum; // number of program header entries
|
||||
u16 e_shentsize; // size of section header entry
|
||||
u16 e_shnum; // number of section header entries
|
||||
u16 e_shstrndx; // section name string table index
|
||||
|
||||
void Load(const fs::file& f);
|
||||
static void Show() {}
|
||||
@@ -272,16 +335,16 @@ struct Elf64_Ehdr
|
||||
|
||||
struct Elf64_Shdr
|
||||
{
|
||||
u32 sh_name;
|
||||
u32 sh_type;
|
||||
u64 sh_flags;
|
||||
u64 sh_addr;
|
||||
u64 sh_offset;
|
||||
u64 sh_size;
|
||||
u32 sh_link;
|
||||
u32 sh_info;
|
||||
u64 sh_addralign;
|
||||
u64 sh_entsize;
|
||||
u32 sh_name; // section name
|
||||
u32 sh_type; // section type
|
||||
u64 sh_flags; // section attributes
|
||||
u64 sh_addr; // virtual address in memory
|
||||
u64 sh_offset; // offset in file
|
||||
u64 sh_size; // size of section
|
||||
u32 sh_link; // link to other section
|
||||
u32 sh_info; // miscellaneous information
|
||||
u64 sh_addralign; // address alignment boundary
|
||||
u64 sh_entsize; // size of entries, if section has table
|
||||
|
||||
void Load(const fs::file& f);
|
||||
static void Show(){}
|
||||
@@ -289,14 +352,14 @@ struct Elf64_Shdr
|
||||
|
||||
struct Elf64_Phdr
|
||||
{
|
||||
u32 p_type;
|
||||
u32 p_flags;
|
||||
u64 p_offset;
|
||||
u64 p_vaddr;
|
||||
u64 p_paddr;
|
||||
u64 p_filesz;
|
||||
u64 p_memsz;
|
||||
u64 p_align;
|
||||
u32 p_type; // Segment type
|
||||
u32 p_flags; // Segment flags
|
||||
u64 p_offset; // Segment file offset
|
||||
u64 p_vaddr; // Segment virtual address
|
||||
u64 p_paddr; // Segment physical address
|
||||
u64 p_filesz; // Segment size in file
|
||||
u64 p_memsz; // Segment size in memory
|
||||
u64 p_align; // Segment alignment
|
||||
|
||||
void Load(const fs::file& f);
|
||||
static void Show(){}
|
||||
@@ -317,18 +380,18 @@ struct SceHeader
|
||||
bool CheckMagic() const { return se_magic == 0x53434500; }
|
||||
};
|
||||
|
||||
struct SelfHeader
|
||||
struct ext_hdr
|
||||
{
|
||||
u64 se_htype;
|
||||
u64 se_appinfooff;
|
||||
u64 se_elfoff;
|
||||
u64 se_phdroff;
|
||||
u64 se_shdroff;
|
||||
u64 se_secinfoff;
|
||||
u64 se_sceveroff;
|
||||
u64 se_controloff;
|
||||
u64 se_controlsize;
|
||||
u64 pad;
|
||||
u64 ext_hdr_version;
|
||||
u64 program_identification_hdr_offset;
|
||||
u64 ehdr_offset;
|
||||
u64 phdr_offset;
|
||||
u64 shdr_offset;
|
||||
u64 segment_ext_hdr_offset;
|
||||
u64 version_hdr_offset;
|
||||
u64 supplemental_hdr_offset;
|
||||
u64 supplemental_hdr_size;
|
||||
u64 padding;
|
||||
|
||||
void Load(const fs::file& f);
|
||||
static void Show(){}
|
||||
@@ -337,8 +400,8 @@ struct SelfHeader
|
||||
struct SelfAdditionalInfo
|
||||
{
|
||||
bool valid = false;
|
||||
std::vector<ControlInfo> ctrl_info;
|
||||
AppInfo app_info;
|
||||
std::vector<supplemental_header> supplemental_hdr;
|
||||
program_identification_header prog_id_hdr;
|
||||
};
|
||||
|
||||
class SCEDecrypter
|
||||
@@ -376,8 +439,8 @@ class SELFDecrypter
|
||||
|
||||
// SCE, SELF and APP headers.
|
||||
SceHeader sce_hdr{};
|
||||
SelfHeader self_hdr{};
|
||||
AppInfo app_info{};
|
||||
ext_hdr m_ext_hdr{};
|
||||
program_identification_header m_prog_id_hdr{};
|
||||
|
||||
// ELF64 header and program header/section header arrays.
|
||||
Elf64_Ehdr elf64_hdr{};
|
||||
@@ -390,9 +453,9 @@ class SELFDecrypter
|
||||
std::vector<Elf32_Phdr> phdr32_arr{};
|
||||
|
||||
// Decryption info structs.
|
||||
std::vector<SectionInfo> secinfo_arr{};
|
||||
SCEVersionInfo scev_info{};
|
||||
std::vector<ControlInfo> ctrlinfo_arr{};
|
||||
std::vector<segment_ext_header> m_seg_ext_hdr{};
|
||||
version_header m_version_hdr{};
|
||||
std::vector<supplemental_header> m_supplemental_hdr_arr{};
|
||||
|
||||
// Metadata structs.
|
||||
MetadataInfo meta_info{};
|
||||
@@ -484,7 +547,7 @@ private:
|
||||
}
|
||||
|
||||
// Write section headers.
|
||||
if (self_hdr.se_shdroff != 0)
|
||||
if (m_ext_hdr.shdr_offset != 0)
|
||||
{
|
||||
e.seek(ehdr.e_shoff);
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
add_library(rpcs3_emu
|
||||
cache_utils.cpp
|
||||
games_config.cpp
|
||||
IdManager.cpp
|
||||
localized_string.cpp
|
||||
savestate_utils.cpp
|
||||
@@ -159,6 +160,10 @@ target_link_libraries(rpcs3_emu
|
||||
PUBLIC
|
||||
3rdparty::soundtouch)
|
||||
|
||||
target_link_libraries(rpcs3_emu
|
||||
PUBLIC
|
||||
3rdparty::miniupnpc)
|
||||
|
||||
# Cell
|
||||
target_sources(rpcs3_emu PRIVATE
|
||||
Cell/MFC.cpp
|
||||
@@ -388,14 +393,24 @@ target_sources(rpcs3_emu PRIVATE
|
||||
Io/pad_config.cpp
|
||||
Io/pad_config_types.cpp
|
||||
Io/PadHandler.cpp
|
||||
Io/pad_types.cpp
|
||||
Io/usb_device.cpp
|
||||
Io/usb_vfs.cpp
|
||||
Io/Infinity.cpp
|
||||
Io/Skylander.cpp
|
||||
Io/GHLtar.cpp
|
||||
Io/midi_config_types.cpp
|
||||
Io/RB3MidiKeyboard.cpp
|
||||
Io/RB3MidiGuitar.cpp
|
||||
Io/Buzz.cpp
|
||||
Io/Turntable.cpp
|
||||
Io/usio.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(rpcs3_emu PRIVATE
|
||||
3rdparty::rtmidi
|
||||
)
|
||||
|
||||
# Np
|
||||
target_sources(rpcs3_emu PRIVATE
|
||||
NP/fb_helpers.cpp
|
||||
@@ -410,6 +425,8 @@ target_sources(rpcs3_emu PRIVATE
|
||||
NP/np_structs_extra.cpp
|
||||
NP/rpcn_client.cpp
|
||||
NP/rpcn_config.cpp
|
||||
NP/upnp_config.cpp
|
||||
NP/upnp_handler.cpp
|
||||
)
|
||||
|
||||
# Memory
|
||||
@@ -436,12 +453,20 @@ target_sources(rpcs3_emu PRIVATE
|
||||
RSX/Common/TextureUtils.cpp
|
||||
RSX/Common/texture_cache.cpp
|
||||
RSX/Null/NullGSRender.cpp
|
||||
RSX/Overlays/HomeMenu/overlay_home_menu.cpp
|
||||
RSX/Overlays/HomeMenu/overlay_home_menu_components.cpp
|
||||
RSX/Overlays/HomeMenu/overlay_home_menu_main_menu.cpp
|
||||
RSX/Overlays/HomeMenu/overlay_home_menu_message_box.cpp
|
||||
RSX/Overlays/HomeMenu/overlay_home_menu_page.cpp
|
||||
RSX/Overlays/HomeMenu/overlay_home_menu_settings.cpp
|
||||
RSX/Overlays/overlay_animated_icon.cpp
|
||||
RSX/Overlays/overlay_animation.cpp
|
||||
RSX/Overlays/overlay_controls.cpp
|
||||
RSX/Overlays/overlay_cursor.cpp
|
||||
RSX/Overlays/overlay_edit_text.cpp
|
||||
RSX/Overlays/overlay_fonts.cpp
|
||||
RSX/Overlays/overlay_list_view.cpp
|
||||
RSX/Overlays/overlay_manager.cpp
|
||||
RSX/Overlays/overlay_media_list_dialog.cpp
|
||||
RSX/Overlays/overlay_message.cpp
|
||||
RSX/Overlays/overlay_message_dialog.cpp
|
||||
@@ -450,10 +475,10 @@ target_sources(rpcs3_emu PRIVATE
|
||||
RSX/Overlays/overlay_perf_metrics.cpp
|
||||
RSX/Overlays/overlay_progress_bar.cpp
|
||||
RSX/Overlays/overlay_save_dialog.cpp
|
||||
RSX/Overlays/overlay_compile_notification.cpp
|
||||
RSX/Overlays/overlay_user_list_dialog.cpp
|
||||
RSX/Overlays/overlay_utils.cpp
|
||||
RSX/Overlays/overlays.cpp
|
||||
RSX/Overlays/overlay_shader_compile_notification.cpp
|
||||
RSX/Overlays/overlay_trophy_notification.cpp
|
||||
RSX/Overlays/Shaders/shader_loading_dialog.cpp
|
||||
RSX/Overlays/Shaders/shader_loading_dialog_native.cpp
|
||||
|
||||
@@ -35,6 +35,7 @@ static thread_local u32 s_tls_thread_slot = -1;
|
||||
static thread_local u64 s_tls_sctr = -1;
|
||||
|
||||
extern thread_local void(*g_tls_log_control)(const char* fmt, u64 progress);
|
||||
extern thread_local std::string(*g_tls_log_prefix)();
|
||||
|
||||
template <>
|
||||
void fmt_class_string<cpu_flag>::format(std::string& out, u64 arg)
|
||||
@@ -478,6 +479,8 @@ namespace cpu_counter
|
||||
|
||||
void cpu_thread::operator()()
|
||||
{
|
||||
const auto old_prefix = g_tls_log_prefix;
|
||||
|
||||
g_tls_this_thread = this;
|
||||
|
||||
if (g_cfg.core.thread_scheduler != thread_scheduler_mode::os)
|
||||
@@ -545,6 +548,7 @@ void cpu_thread::operator()()
|
||||
{
|
||||
cpu_thread* _this = nullptr;
|
||||
std::string name;
|
||||
std::string(*log_prefix)() = nullptr;
|
||||
|
||||
void cleanup()
|
||||
{
|
||||
@@ -571,6 +575,8 @@ void cpu_thread::operator()()
|
||||
|
||||
s_cpu_counter--;
|
||||
|
||||
g_tls_log_prefix = log_prefix;
|
||||
|
||||
g_tls_this_thread = nullptr;
|
||||
|
||||
g_threads_deleted++;
|
||||
@@ -590,6 +596,7 @@ void cpu_thread::operator()()
|
||||
|
||||
cleanup._this = this;
|
||||
cleanup.name = thread_ctrl::get_name();
|
||||
cleanup.log_prefix = old_prefix;
|
||||
|
||||
// Check thread status
|
||||
while (!(state & cpu_flag::exit) && thread_ctrl::state() != thread_state::aborting)
|
||||
|
||||
@@ -75,6 +75,14 @@ cpu_translator::cpu_translator(llvm::Module* _module, bool is_be)
|
||||
return result;
|
||||
}
|
||||
});
|
||||
|
||||
register_intrinsic("any_select_by_bit4", [&](llvm::CallInst* ci) -> llvm::Value*
|
||||
{
|
||||
const auto s = bitcast<s8[16]>(m_ir->CreateShl(bitcast<u64[2]>(ci->getOperand(0)), 3));;
|
||||
const auto a = bitcast<u8[16]>(ci->getOperand(1));
|
||||
const auto b = bitcast<u8[16]>(ci->getOperand(2));
|
||||
return m_ir->CreateSelect(m_ir->CreateICmpSLT(s, llvm::ConstantAggregateZero::get(get_type<s8[16]>())), b, a);
|
||||
});
|
||||
}
|
||||
|
||||
void cpu_translator::initialize(llvm::LLVMContext& context, llvm::ExecutionEngine& engine)
|
||||
@@ -112,10 +120,14 @@ void cpu_translator::initialize(llvm::LLVMContext& context, llvm::ExecutionEngin
|
||||
cpu == "broadwell" ||
|
||||
cpu == "skylake" ||
|
||||
cpu == "alderlake" ||
|
||||
cpu == "raptorlake" ||
|
||||
cpu == "meteorlake" ||
|
||||
cpu == "bdver2" ||
|
||||
cpu == "bdver3" ||
|
||||
cpu == "bdver4" ||
|
||||
cpu.startswith("znver"))
|
||||
cpu == "znver1" ||
|
||||
cpu == "znver2" ||
|
||||
cpu == "znver3")
|
||||
{
|
||||
m_use_fma = true;
|
||||
m_use_avx = true;
|
||||
@@ -135,7 +147,9 @@ void cpu_translator::initialize(llvm::LLVMContext& context, llvm::ExecutionEngin
|
||||
// Test VNNI feature (TODO)
|
||||
if (cpu == "cascadelake" ||
|
||||
cpu == "cooperlake" ||
|
||||
cpu == "alderlake")
|
||||
cpu == "alderlake" ||
|
||||
cpu == "raptorlake" ||
|
||||
cpu == "meteorlake")
|
||||
{
|
||||
m_use_vnni = true;
|
||||
}
|
||||
@@ -146,7 +160,8 @@ void cpu_translator::initialize(llvm::LLVMContext& context, llvm::ExecutionEngin
|
||||
cpu == "icelake-server" ||
|
||||
cpu == "tigerlake" ||
|
||||
cpu == "rocketlake" ||
|
||||
cpu == "sapphirerapids")
|
||||
cpu == "sapphirerapids" ||
|
||||
(cpu.startswith("znver") && cpu != "znver1" && cpu != "znver2" && cpu != "znver3"))
|
||||
{
|
||||
m_use_avx = true;
|
||||
m_use_fma = true;
|
||||
@@ -299,7 +314,7 @@ llvm::Constant* cpu_translator::make_const_vector<v128>(v128 v, llvm::Type* t, u
|
||||
{
|
||||
if (const auto ct = llvm::dyn_cast<llvm::IntegerType>(t); ct && ct->getBitWidth() == 128)
|
||||
{
|
||||
return llvm::ConstantInt::get(t, llvm::APInt(128, llvm::makeArrayRef(reinterpret_cast<const u64*>(v._bytes), 2)));
|
||||
return llvm::ConstantInt::get(t, llvm::APInt(128, llvm::ArrayRef(reinterpret_cast<const u64*>(v._bytes), 2)));
|
||||
}
|
||||
|
||||
ensure(t->isVectorTy());
|
||||
@@ -309,27 +324,27 @@ llvm::Constant* cpu_translator::make_const_vector<v128>(v128 v, llvm::Type* t, u
|
||||
|
||||
if (sct->isIntegerTy(8))
|
||||
{
|
||||
return llvm::ConstantDataVector::get(m_context, llvm::makeArrayRef(reinterpret_cast<const u8*>(v._bytes), 16));
|
||||
return llvm::ConstantDataVector::get(m_context, llvm::ArrayRef(reinterpret_cast<const u8*>(v._bytes), 16));
|
||||
}
|
||||
if (sct->isIntegerTy(16))
|
||||
{
|
||||
return llvm::ConstantDataVector::get(m_context, llvm::makeArrayRef(reinterpret_cast<const u16*>(v._bytes), 8));
|
||||
return llvm::ConstantDataVector::get(m_context, llvm::ArrayRef(reinterpret_cast<const u16*>(v._bytes), 8));
|
||||
}
|
||||
if (sct->isIntegerTy(32))
|
||||
{
|
||||
return llvm::ConstantDataVector::get(m_context, llvm::makeArrayRef(reinterpret_cast<const u32*>(v._bytes), 4));
|
||||
return llvm::ConstantDataVector::get(m_context, llvm::ArrayRef(reinterpret_cast<const u32*>(v._bytes), 4));
|
||||
}
|
||||
if (sct->isIntegerTy(64))
|
||||
{
|
||||
return llvm::ConstantDataVector::get(m_context, llvm::makeArrayRef(reinterpret_cast<const u64*>(v._bytes), 2));
|
||||
return llvm::ConstantDataVector::get(m_context, llvm::ArrayRef(reinterpret_cast<const u64*>(v._bytes), 2));
|
||||
}
|
||||
if (sct->isFloatTy())
|
||||
{
|
||||
return llvm::ConstantDataVector::get(m_context, llvm::makeArrayRef(reinterpret_cast<const f32*>(v._bytes), 4));
|
||||
return llvm::ConstantDataVector::get(m_context, llvm::ArrayRef(reinterpret_cast<const f32*>(v._bytes), 4));
|
||||
}
|
||||
if (sct->isDoubleTy())
|
||||
{
|
||||
return llvm::ConstantDataVector::get(m_context, llvm::makeArrayRef(reinterpret_cast<const f64*>(v._bytes), 2));
|
||||
return llvm::ConstantDataVector::get(m_context, llvm::ArrayRef(reinterpret_cast<const f64*>(v._bytes), 2));
|
||||
}
|
||||
|
||||
fmt::throw_exception("[line %u] No supported constant type", _line);
|
||||
|
||||
@@ -13,13 +13,17 @@
|
||||
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
|
||||
#pragma GCC diagnostic ignored "-Weffc++"
|
||||
#pragma GCC diagnostic ignored "-Wmissing-noreturn"
|
||||
#pragma GCC diagnostic ignored "-Wredundant-decls"
|
||||
#endif
|
||||
#include "llvm/IR/LLVMContext.h"
|
||||
#include "llvm/ExecutionEngine/ExecutionEngine.h"
|
||||
#include "llvm/IR/IRBuilder.h"
|
||||
#include "llvm/IR/Module.h"
|
||||
#include "llvm/Target/TargetMachine.h"
|
||||
#include "llvm/Support/KnownBits.h"
|
||||
#include "llvm/Support/ModRef.h"
|
||||
#include "llvm/Analysis/ConstantFolding.h"
|
||||
#include "llvm/Analysis/ValueTracking.h"
|
||||
#include "llvm/IR/IntrinsicsX86.h"
|
||||
#include "llvm/IR/IntrinsicsAArch64.h"
|
||||
|
||||
@@ -59,6 +63,62 @@ concept DSLValue = requires (T& v)
|
||||
{ v.eval(std::declval<llvm::IRBuilder<>*>()) } -> LLVMValue;
|
||||
};
|
||||
|
||||
template <usz N>
|
||||
struct get_int_bits
|
||||
{
|
||||
};
|
||||
|
||||
template <>
|
||||
struct get_int_bits<1>
|
||||
{
|
||||
using utype = bool;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct get_int_bits<2>
|
||||
{
|
||||
using utype = i2;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct get_int_bits<4>
|
||||
{
|
||||
using utype = i4;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct get_int_bits<8>
|
||||
{
|
||||
using utype = u8;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct get_int_bits<16>
|
||||
{
|
||||
using utype = u16;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct get_int_bits<32>
|
||||
{
|
||||
using utype = u32;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct get_int_bits<64>
|
||||
{
|
||||
using utype = u64;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct get_int_bits<128>
|
||||
{
|
||||
using utype = u128;
|
||||
};
|
||||
|
||||
template <usz Bits>
|
||||
using get_int_vt = typename get_int_bits<Bits>::utype;
|
||||
|
||||
template <typename T = void>
|
||||
struct llvm_value_t
|
||||
{
|
||||
@@ -2992,7 +3052,7 @@ public:
|
||||
}
|
||||
|
||||
template <typename RT, DSLValue... Args>
|
||||
auto call(llvm::Function* func, Args&&... args)
|
||||
auto callf(llvm::Function* func, Args&&... args)
|
||||
{
|
||||
llvm_value_t<RT> r;
|
||||
r.value = m_ir->CreateCall(func, {std::forward<Args>(args).eval(m_ir)...});
|
||||
@@ -3292,7 +3352,7 @@ public:
|
||||
|
||||
// Infinite-precision shift left
|
||||
template <typename T, typename U, typename CT = llvm_common_t<T, U>>
|
||||
static auto inf_shl(T&& a, U&& b)
|
||||
auto inf_shl(T&& a, U&& b)
|
||||
{
|
||||
static constexpr u32 esz = llvm_value_t<CT>::esize;
|
||||
|
||||
@@ -3318,7 +3378,7 @@ public:
|
||||
|
||||
// Infinite-precision logical shift right (unsigned)
|
||||
template <typename T, typename U, typename CT = llvm_common_t<T, U>>
|
||||
static auto inf_lshr(T&& a, U&& b)
|
||||
auto inf_lshr(T&& a, U&& b)
|
||||
{
|
||||
static constexpr u32 esz = llvm_value_t<CT>::esize;
|
||||
|
||||
@@ -3344,7 +3404,7 @@ public:
|
||||
|
||||
// Infinite-precision arithmetic shift right (signed)
|
||||
template <typename T, typename U, typename CT = llvm_common_t<T, U>>
|
||||
static auto inf_ashr(T&& a, U&& b)
|
||||
auto inf_ashr(T&& a, U&& b)
|
||||
{
|
||||
static constexpr u32 esz = llvm_value_t<CT>::esize;
|
||||
|
||||
@@ -3429,7 +3489,7 @@ public:
|
||||
|
||||
if (cv || llvm::isa<llvm::ConstantAggregateZero>(c))
|
||||
{
|
||||
result.value = llvm::ConstantDataVector::get(m_context, llvm::makeArrayRef(reinterpret_cast<const u8*>(&mask), 16));
|
||||
result.value = llvm::ConstantDataVector::get(m_context, llvm::ArrayRef(reinterpret_cast<const u8*>(&mask), 16));
|
||||
result.value = m_ir->CreateZExt(result.value, get_type<u32[16]>());
|
||||
result.value = m_ir->CreateShuffleVector(data0, zeros, result.value);
|
||||
return result;
|
||||
@@ -3472,7 +3532,7 @@ public:
|
||||
|
||||
if (cv || llvm::isa<llvm::ConstantAggregateZero>(c))
|
||||
{
|
||||
result.value = llvm::ConstantDataVector::get(m_context, llvm::makeArrayRef(reinterpret_cast<const u8*>(&mask), 16));
|
||||
result.value = llvm::ConstantDataVector::get(m_context, llvm::ArrayRef(reinterpret_cast<const u8*>(&mask), 16));
|
||||
result.value = m_ir->CreateZExt(result.value, get_type<u32[16]>());
|
||||
result.value = m_ir->CreateShuffleVector(data0, data1, result.value);
|
||||
return result;
|
||||
@@ -3512,7 +3572,7 @@ public:
|
||||
|
||||
if (cv || llvm::isa<llvm::ConstantAggregateZero>(c))
|
||||
{
|
||||
result.value = llvm::ConstantDataVector::get(m_context, llvm::makeArrayRef(reinterpret_cast<const u8*>(&mask), 16));
|
||||
result.value = llvm::ConstantDataVector::get(m_context, llvm::ArrayRef(reinterpret_cast<const u8*>(&mask), 16));
|
||||
result.value = m_ir->CreateZExt(result.value, get_type<u32[16]>());
|
||||
result.value = m_ir->CreateShuffleVector(data0, data1, result.value);
|
||||
return result;
|
||||
@@ -3530,7 +3590,7 @@ public:
|
||||
u8 mask16[16] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
|
||||
|
||||
// insert the second source operand into the same vector as the first source operand and expand to 256 bit width
|
||||
shuffle.value = llvm::ConstantDataVector::get(m_context, llvm::makeArrayRef(reinterpret_cast<const u8*>(&mask32), 32));
|
||||
shuffle.value = llvm::ConstantDataVector::get(m_context, llvm::ArrayRef(reinterpret_cast<const u8*>(&mask32), 32));
|
||||
shuffle.value = m_ir->CreateZExt(shuffle.value, get_type<u32[32]>());
|
||||
intermediate.value = m_ir->CreateShuffleVector(data0, data1, shuffle.value);
|
||||
|
||||
@@ -3541,22 +3601,23 @@ public:
|
||||
intermediate.value = m_ir->CreateCall(get_intrinsic(llvm::Intrinsic::x86_avx512_permvar_qi_256), {intermediate.value, shuffleindex.value});
|
||||
|
||||
// convert the 256 bit vector back to 128 bits
|
||||
result.value = llvm::ConstantDataVector::get(m_context, llvm::makeArrayRef(reinterpret_cast<const u8*>(&mask16), 16));
|
||||
result.value = llvm::ConstantDataVector::get(m_context, llvm::ArrayRef(reinterpret_cast<const u8*>(&mask16), 16));
|
||||
result.value = m_ir->CreateZExt(result.value, get_type<u32[16]>());
|
||||
result.value = m_ir->CreateShuffleVector(intermediate.value, zeroes32, result.value);
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
llvm::Value* load_const(llvm::GlobalVariable* g, llvm::Value* i)
|
||||
{
|
||||
return m_ir->CreateLoad(m_ir->CreateGEP(g, {m_ir->getInt64(0), m_ir->CreateZExtOrTrunc(i, get_type<u64>())}));
|
||||
return m_ir->CreateLoad(get_type<T>(), m_ir->CreateGEP(g->getValueType(), g, {m_ir->getInt64(0), m_ir->CreateZExtOrTrunc(i, get_type<u64>())}));
|
||||
}
|
||||
|
||||
template <typename T, typename I>
|
||||
value_t<T> load_const(llvm::GlobalVariable* g, I i)
|
||||
{
|
||||
value_t<T> result;
|
||||
result.value = load_const(g, i.eval(m_ir));
|
||||
result.value = load_const<T>(g, i.eval(m_ir));
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -3566,6 +3627,18 @@ public:
|
||||
template <typename T = v128>
|
||||
llvm::Constant* make_const_vector(T, llvm::Type*, u32 = __builtin_LINE());
|
||||
|
||||
template <typename T>
|
||||
llvm::KnownBits get_known_bits(T a)
|
||||
{
|
||||
return llvm::computeKnownBits(a.eval(m_ir), m_module->getDataLayout());
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
llvm::KnownBits kbc(T value)
|
||||
{
|
||||
return llvm::KnownBits::makeConstant(llvm::APInt(sizeof(T) * 8, u64(value)));
|
||||
}
|
||||
|
||||
private:
|
||||
// Custom intrinsic table
|
||||
std::unordered_map<std::string_view, std::function<llvm::Value*(llvm::CallInst*)>> m_intrinsics;
|
||||
@@ -3635,7 +3708,7 @@ public:
|
||||
if (cv || llvm::isa<llvm::ConstantAggregateZero>(c))
|
||||
{
|
||||
llvm::Value* r = nullptr;
|
||||
r = llvm::ConstantDataVector::get(ir->getContext(), llvm::makeArrayRef(reinterpret_cast<const u8*>(&mask), 16));
|
||||
r = llvm::ConstantDataVector::get(ir->getContext(), llvm::ArrayRef(reinterpret_cast<const u8*>(&mask), 16));
|
||||
r = ir->CreateZExt(r, llvm_value_t<u32[16]>::get_type(ir->getContext()));
|
||||
r = ir->CreateShuffleVector(args[0], zeros, r);
|
||||
return r;
|
||||
@@ -3646,6 +3719,13 @@ public:
|
||||
});
|
||||
}
|
||||
|
||||
// (m << 3) >= 0 ? a : b
|
||||
template <typename T, typename U, typename V>
|
||||
static auto select_by_bit4(T&& m, U&& a, V&& b)
|
||||
{
|
||||
return llvm_calli<u8[16], T, U, V>{"any_select_by_bit4", {std::forward<T>(m), std::forward<U>(a), std::forward<V>(b)}};
|
||||
}
|
||||
|
||||
template <typename T, typename = std::enable_if_t<std::is_same_v<llvm_common_t<T>, f32[4]>>>
|
||||
static auto fre(T&& a)
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ class error_code
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
public:
|
||||
// Implementation must be provided independently
|
||||
static s32 error_report(s32 result, const logs::message* channel, const char* fmt, const fmt_type_info* sup, const u64* args);
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include <thread>
|
||||
|
||||
// SONIC THE HEDGEDOG: a fix for a race condition between SPUs and PPUs causing missing graphics (SNR is overriden when non-empty)
|
||||
// SONIC THE HEDGEDOG: a fix for a race condition between SPUs and PPUs causing missing graphics (SNR is overriden when non-empty)
|
||||
void WaitForSPUsToEmptySNRs(ppu_thread& ppu, u32 spu_id, u32 snr_mask)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/system_config.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
#include "Emu/Cell/lv2/sys_process.h"
|
||||
#include "Emu/Cell/lv2/sys_event.h"
|
||||
#include "cellAudio.h"
|
||||
@@ -274,8 +274,8 @@ void audio_ringbuffer::process_resampled_data()
|
||||
{
|
||||
if (!cfg.time_stretching_enabled) return;
|
||||
|
||||
const auto samples = resampler.get_samples(static_cast<u32>(cb_ringbuf.get_free_size() / (cfg.audio_sample_size * static_cast<u32>(cfg.backend_ch_cnt))));
|
||||
commit_data(samples.first, samples.second);
|
||||
const auto [buffer, samples] = resampler.get_samples(static_cast<u32>(cb_ringbuf.get_free_size() / (cfg.audio_sample_size * static_cast<u32>(cfg.backend_ch_cnt))));
|
||||
commit_data(buffer, samples);
|
||||
}
|
||||
|
||||
void audio_ringbuffer::commit_data(f32* buf, u32 sample_cnt)
|
||||
@@ -455,7 +455,7 @@ std::tuple<u32, u32, u32, u32> cell_audio_thread::count_port_buffer_tags()
|
||||
u32 untouched = 0;
|
||||
u32 incomplete = 0;
|
||||
|
||||
for (auto& port : ports)
|
||||
for (audio_port& port : ports)
|
||||
{
|
||||
if (port.state != audio_port_state::started) continue;
|
||||
active++;
|
||||
@@ -526,7 +526,7 @@ std::tuple<u32, u32, u32, u32> cell_audio_thread::count_port_buffer_tags()
|
||||
void cell_audio_thread::reset_ports(s32 offset)
|
||||
{
|
||||
// Memset buffer to 0 and tag
|
||||
for (auto& port : ports)
|
||||
for (audio_port& port : ports)
|
||||
{
|
||||
if (port.state != audio_port_state::started) continue;
|
||||
|
||||
@@ -548,7 +548,7 @@ void cell_audio_thread::advance(u64 timestamp)
|
||||
// update ports
|
||||
reset_ports(0);
|
||||
|
||||
for (auto& port : ports)
|
||||
for (audio_port& port : ports)
|
||||
{
|
||||
if (port.state != audio_port_state::started) continue;
|
||||
|
||||
@@ -572,12 +572,11 @@ void cell_audio_thread::advance(u64 timestamp)
|
||||
|
||||
// send aftermix event (normal audio event)
|
||||
std::array<std::shared_ptr<lv2_event_queue>, MAX_AUDIO_EVENT_QUEUES> queues;
|
||||
std::array<u64, MAX_AUDIO_EVENT_QUEUES> event_sources;
|
||||
u32 queue_count = 0;
|
||||
|
||||
event_period++;
|
||||
|
||||
for (const auto& key_inf : keys)
|
||||
for (const key_info& key_inf : keys)
|
||||
{
|
||||
if (key_inf.flags & CELL_AUDIO_EVENTFLAG_NOMIX)
|
||||
{
|
||||
@@ -607,6 +606,7 @@ void cell_audio_thread::advance(u64 timestamp)
|
||||
}
|
||||
|
||||
event_sources[queue_count] = key_inf.source;
|
||||
event_data3[queue_count] = (key_inf.flags & CELL_AUDIO_EVENTFLAG_BEFOREMIX) ? key_inf.source : 0;
|
||||
queue_count++;
|
||||
}
|
||||
}
|
||||
@@ -616,7 +616,7 @@ void cell_audio_thread::advance(u64 timestamp)
|
||||
for (u32 i = 0; i < queue_count; i++)
|
||||
{
|
||||
lv2_obj::notify_all_t notify;
|
||||
queues[i]->send(event_sources[i], 0, 0, 0);
|
||||
queues[i]->send(event_sources[i], CELL_AUDIO_EVENT_MIX, 0, event_data3[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -648,9 +648,9 @@ namespace audio
|
||||
if (auto& g_audio = g_fxo->get<cell_audio>(); g_fxo->is_init<cell_audio>())
|
||||
{
|
||||
// Only reboot the audio renderer if a relevant setting changed
|
||||
const auto new_raw = get_raw_config();
|
||||
const cell_audio_config::raw_config new_raw = get_raw_config();
|
||||
|
||||
if (const auto raw = g_audio.cfg.raw;
|
||||
if (const cell_audio_config::raw_config raw = g_audio.cfg.raw;
|
||||
force_reset ||
|
||||
raw.audio_device != new_raw.audio_device ||
|
||||
raw.desired_buffer_duration != new_raw.desired_buffer_duration ||
|
||||
@@ -735,7 +735,7 @@ void cell_audio_thread::operator()()
|
||||
{
|
||||
loop_count++;
|
||||
|
||||
const auto update_req = m_update_configuration.observe();
|
||||
const audio_backend_update update_req = m_update_configuration.observe();
|
||||
if (update_req != audio_backend_update::NONE)
|
||||
{
|
||||
cellAudio.warning("Updating cell_audio_thread configuration");
|
||||
@@ -758,7 +758,15 @@ void cell_audio_thread::operator()()
|
||||
continue;
|
||||
}
|
||||
|
||||
// TODO: send beforemix event (in ~2,6 ms before mixing)
|
||||
// TODO: (no idea how much of this is already implemented)
|
||||
// The hardware heartbeat interval of libaudio is ~5.3ms.
|
||||
// As soon as one interval starts, libaudio waits for ~2.6ms (half of the interval) before it mixes the audio.
|
||||
// There are 2 different types of games:
|
||||
// - Normal games:
|
||||
// Once the audio was mixed, we send the CELL_AUDIO_EVENT_MIX event and the game can process audio.
|
||||
// - Latency sensitive games:
|
||||
// If CELL_AUDIO_EVENTFLAG_BEFOREMIX is specified, we immediately send the CELL_AUDIO_EVENT_MIX event and the game can process audio.
|
||||
// We then have to wait for a maximum of ~2.6ms for cellAudioSendAck and then mix immediately.
|
||||
|
||||
const u64 time_since_last_period = timestamp - m_last_period_end;
|
||||
|
||||
@@ -1057,7 +1065,7 @@ void cell_audio_thread::mix(float* out_buffer, s32 offset)
|
||||
std::memset(out_buffer, 0, out_buffer_sz * sizeof(float));
|
||||
|
||||
// mixing
|
||||
for (auto& port : ports)
|
||||
for (audio_port& port : ports)
|
||||
{
|
||||
if (port.state != audio_port_state::started) continue;
|
||||
|
||||
@@ -1070,7 +1078,7 @@ void cell_audio_thread::mix(float* out_buffer, s32 offset)
|
||||
// spread port volume changes over 13ms
|
||||
auto step_volume = [master_volume, &m](audio_port& port)
|
||||
{
|
||||
const auto param = port.level_set.load();
|
||||
const audio_port::level_set_t param = port.level_set.load();
|
||||
|
||||
if (param.inc != 0.0f)
|
||||
{
|
||||
@@ -1180,11 +1188,11 @@ void cell_audio_thread::mix(float* out_buffer, s32 offset)
|
||||
void cell_audio_thread::finish_port_volume_stepping()
|
||||
{
|
||||
// part of cellAudioSetPortLevel functionality
|
||||
for (auto& port : ports)
|
||||
for (audio_port& port : ports)
|
||||
{
|
||||
if (port.state != audio_port_state::started) continue;
|
||||
|
||||
const auto param = port.level_set.load();
|
||||
const audio_port::level_set_t param = port.level_set.load();
|
||||
port.level = param.value;
|
||||
port.level_set.compare_and_swap(param, { param.value, 0.0f });
|
||||
}
|
||||
@@ -1312,7 +1320,7 @@ error_code cellAudioPortOpen(vm::ptr<CellAudioPortParam> audioParam, vm::ptr<u32
|
||||
}
|
||||
|
||||
// Open audio port
|
||||
const auto port = g_audio.open_port();
|
||||
audio_port* port = g_audio.open_port();
|
||||
|
||||
if (!port)
|
||||
{
|
||||
@@ -1373,7 +1381,7 @@ error_code cellAudioGetPortConfig(u32 portNum, vm::ptr<CellAudioPortConfig> port
|
||||
|
||||
portConfig->readIndexAddr = port.index;
|
||||
|
||||
switch (auto state = port.state.load())
|
||||
switch (audio_port_state state = port.state.load())
|
||||
{
|
||||
case audio_port_state::closed:
|
||||
portConfig->status = CELL_AUDIO_STATUS_CLOSE;
|
||||
@@ -1414,7 +1422,7 @@ error_code cellAudioPortStart(u32 portNum)
|
||||
return CELL_AUDIO_ERROR_PARAM;
|
||||
}
|
||||
|
||||
switch (auto state = g_audio.ports[portNum].state.compare_and_swap(audio_port_state::opened, audio_port_state::started))
|
||||
switch (audio_port_state state = g_audio.ports[portNum].state.compare_and_swap(audio_port_state::opened, audio_port_state::started))
|
||||
{
|
||||
case audio_port_state::closed: return CELL_AUDIO_ERROR_PORT_NOT_OPEN;
|
||||
case audio_port_state::started: return CELL_AUDIO_ERROR_PORT_ALREADY_RUN;
|
||||
@@ -1441,7 +1449,7 @@ error_code cellAudioPortClose(u32 portNum)
|
||||
return CELL_AUDIO_ERROR_PARAM;
|
||||
}
|
||||
|
||||
switch (auto state = g_audio.ports[portNum].state.exchange(audio_port_state::closed))
|
||||
switch (audio_port_state state = g_audio.ports[portNum].state.exchange(audio_port_state::closed))
|
||||
{
|
||||
case audio_port_state::closed: return CELL_AUDIO_ERROR_PORT_NOT_OPEN;
|
||||
case audio_port_state::started: return CELL_OK;
|
||||
@@ -1468,7 +1476,7 @@ error_code cellAudioPortStop(u32 portNum)
|
||||
return CELL_AUDIO_ERROR_PARAM;
|
||||
}
|
||||
|
||||
switch (auto state = g_audio.ports[portNum].state.compare_and_swap(audio_port_state::started, audio_port_state::opened))
|
||||
switch (audio_port_state state = g_audio.ports[portNum].state.compare_and_swap(audio_port_state::started, audio_port_state::opened))
|
||||
{
|
||||
case audio_port_state::closed: return CELL_AUDIO_ERROR_PORT_NOT_RUN;
|
||||
case audio_port_state::started: return CELL_OK;
|
||||
@@ -1679,7 +1687,13 @@ error_code AudioSetNotifyEventQueue(u64 key, u32 iFlags)
|
||||
}
|
||||
|
||||
// Set unique source associated with the key
|
||||
g_audio.keys.push_back({g_audio.event_period, iFlags, ((process_getpid() + u64{}) << 32) + lv2_event_port::id_base + (g_audio.key_count++ * lv2_event_port::id_step), std::move(q)});
|
||||
g_audio.keys.push_back({
|
||||
.start_period = g_audio.event_period,
|
||||
.flags = iFlags,
|
||||
.source = ((process_getpid() + u64{}) << 32) + lv2_event_port::id_base + (g_audio.key_count++ * lv2_event_port::id_step),
|
||||
.ack_timestamp = 0,
|
||||
.port = std::move(q)
|
||||
});
|
||||
g_audio.key_count %= lv2_event_port::id_count;
|
||||
|
||||
return CELL_OK;
|
||||
@@ -1911,7 +1925,28 @@ error_code cellAudioMiscSetAccessoryVolume(u32 devNum, float volume)
|
||||
|
||||
error_code cellAudioSendAck(u64 data3)
|
||||
{
|
||||
cellAudio.todo("cellAudioSendAck(data3=0x%llx)", data3);
|
||||
cellAudio.trace("cellAudioSendAck(data3=0x%llx)", data3);
|
||||
|
||||
auto& g_audio = g_fxo->get<cell_audio>();
|
||||
|
||||
std::unique_lock lock(g_audio.mutex);
|
||||
|
||||
if (!g_audio.init)
|
||||
{
|
||||
return CELL_AUDIO_ERROR_NOT_INIT;
|
||||
}
|
||||
|
||||
// TODO: error checks
|
||||
|
||||
for (cell_audio_thread::key_info& k : g_audio.keys)
|
||||
{
|
||||
if (k.source == data3)
|
||||
{
|
||||
k.ack_timestamp = get_system_time();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -389,12 +389,15 @@ public:
|
||||
|
||||
u32 key_count = 0;
|
||||
u8 event_period = 0;
|
||||
std::array<u64, MAX_AUDIO_EVENT_QUEUES> event_sources{};
|
||||
std::array<u64, MAX_AUDIO_EVENT_QUEUES> event_data3{};
|
||||
|
||||
struct key_info
|
||||
{
|
||||
u8 start_period = 0; // Starting event_period
|
||||
u32 flags = 0; // iFlags
|
||||
u64 source = 0; // Event source
|
||||
u64 ack_timestamp = 0; // timestamp of last call of cellAudioSendAck
|
||||
std::shared_ptr<lv2_event_queue> port{}; // Underlying event port
|
||||
};
|
||||
|
||||
@@ -427,5 +430,5 @@ using cell_audio = named_thread<cell_audio_thread>;
|
||||
namespace audio
|
||||
{
|
||||
cell_audio_config::raw_config get_raw_config();
|
||||
void configure_audio(bool force_reset = false);
|
||||
extern void configure_audio(bool force_reset = false);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "Emu/Cell/lv2/sys_rsxaudio.h"
|
||||
#include "Emu/IdManager.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/system_config.h"
|
||||
#include "Loader/PSF.h"
|
||||
|
||||
#include "cellAudioOut.h"
|
||||
|
||||
@@ -5,10 +5,13 @@
|
||||
#include "Emu/RSX/rsx_utils.h"
|
||||
#include "Utilities/StrUtil.h"
|
||||
|
||||
#include "cellMic.h"
|
||||
#include "cellAudioIn.h"
|
||||
#include "cellAudioOut.h"
|
||||
#include "cellVideoOut.h"
|
||||
|
||||
#include <optional>
|
||||
|
||||
LOG_CHANNEL(cellAvconfExt);
|
||||
|
||||
template<>
|
||||
@@ -34,9 +37,12 @@ void fmt_class_string<CellAudioInError>::format(std::string& out, u64 arg)
|
||||
|
||||
struct avconf_manager
|
||||
{
|
||||
shared_mutex mutex;
|
||||
std::vector<CellAudioInDeviceInfo> devices;
|
||||
CellAudioInDeviceMode inDeviceMode = CELL_AUDIO_IN_SINGLE_DEVICE_MODE; // TODO: use somewhere
|
||||
|
||||
void copy_device_info(u32 num, vm::ptr<CellAudioInDeviceInfo> info);
|
||||
void copy_device_info(u32 num, vm::ptr<CellAudioInDeviceInfo> info) const;
|
||||
std::optional<CellAudioInDeviceInfo> get_device_info(vm::cptr<char> name) const;
|
||||
|
||||
avconf_manager();
|
||||
|
||||
@@ -49,7 +55,8 @@ avconf_manager::avconf_manager()
|
||||
{
|
||||
u32 curindex = 0;
|
||||
|
||||
auto mic_list = fmt::split(g_cfg.audio.microphone_devices.to_string(), {"@@@"});
|
||||
const std::vector<std::string> mic_list = fmt::split(g_cfg.audio.microphone_devices.to_string(), {"@@@"});
|
||||
|
||||
if (!mic_list.empty())
|
||||
{
|
||||
switch (g_cfg.audio.microphone_type)
|
||||
@@ -131,20 +138,24 @@ avconf_manager::avconf_manager()
|
||||
}
|
||||
}
|
||||
|
||||
void avconf_manager::copy_device_info(u32 num, vm::ptr<CellAudioInDeviceInfo> info)
|
||||
void avconf_manager::copy_device_info(u32 num, vm::ptr<CellAudioInDeviceInfo> info) const
|
||||
{
|
||||
memset(info.get_ptr(), 0, sizeof(CellAudioInDeviceInfo));
|
||||
ensure(num < devices.size());
|
||||
*info = devices[num];
|
||||
}
|
||||
|
||||
info->portType = devices[num].portType;
|
||||
info->availableModeCount = devices[num].availableModeCount;
|
||||
info->state = devices[num].state;
|
||||
info->deviceId = devices[num].deviceId;
|
||||
info->type = devices[num].type;
|
||||
info->availableModes[0].type = devices[num].availableModes[0].type;
|
||||
info->availableModes[0].channel = devices[num].availableModes[0].channel;
|
||||
info->availableModes[0].fs = devices[num].availableModes[0].fs;
|
||||
info->deviceNumber = devices[num].deviceNumber;
|
||||
strcpy_trunc(info->name, devices[num].name);
|
||||
std::optional<CellAudioInDeviceInfo> avconf_manager::get_device_info(vm::cptr<char> name) const
|
||||
{
|
||||
for (const CellAudioInDeviceInfo& device : devices)
|
||||
{
|
||||
if (strncmp(device.name, name.get_ptr(), sizeof(device.name)) == 0)
|
||||
{
|
||||
return device;
|
||||
}
|
||||
}
|
||||
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
error_code cellAudioOutUnregisterDevice(u32 deviceNumber)
|
||||
@@ -199,6 +210,7 @@ error_code cellAudioInGetDeviceInfo(u32 deviceNumber, u32 deviceIndex, vm::ptr<C
|
||||
}
|
||||
|
||||
auto& av_manager = g_fxo->get<avconf_manager>();
|
||||
std::lock_guard lock(av_manager.mutex);
|
||||
|
||||
if (deviceNumber >= av_manager.devices.size())
|
||||
return CELL_AUDIO_OUT_ERROR_DEVICE_NOT_FOUND;
|
||||
@@ -273,6 +285,7 @@ error_code cellAudioInGetAvailableDeviceInfo(u32 count, vm::ptr<CellAudioInDevic
|
||||
}
|
||||
|
||||
auto& av_manager = g_fxo->get<avconf_manager>();
|
||||
std::lock_guard lock(av_manager.mutex);
|
||||
|
||||
u32 num_devices_returned = std::min<u32>(count, ::size32(av_manager.devices));
|
||||
|
||||
@@ -281,6 +294,15 @@ error_code cellAudioInGetAvailableDeviceInfo(u32 count, vm::ptr<CellAudioInDevic
|
||||
av_manager.copy_device_info(index, device_info + index);
|
||||
}
|
||||
|
||||
CellAudioInDeviceInfo disconnected_device{};
|
||||
disconnected_device.state = CELL_AUDIO_OUT_DEVICE_STATE_UNAVAILABLE;
|
||||
disconnected_device.deviceNumber = 0xff;
|
||||
|
||||
for (u32 index = num_devices_returned; index < count; index++)
|
||||
{
|
||||
device_info[index] = disconnected_device;
|
||||
}
|
||||
|
||||
return not_an_error(num_devices_returned);
|
||||
}
|
||||
|
||||
@@ -355,6 +377,11 @@ error_code cellAudioInSetDeviceMode(u32 deviceMode)
|
||||
return CELL_AUDIO_IN_ERROR_ILLEGAL_PARAMETER;
|
||||
}
|
||||
|
||||
auto& av_manager = g_fxo->get<avconf_manager>();
|
||||
std::lock_guard lock(av_manager.mutex);
|
||||
|
||||
av_manager.inDeviceMode = static_cast<CellAudioInDeviceMode>(deviceMode);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@@ -368,12 +395,31 @@ error_code cellAudioInRegisterDevice(u64 deviceType, vm::cptr<char> name, vm::pt
|
||||
return CELL_AUDIO_IN_ERROR_ILLEGAL_PARAMETER;
|
||||
}
|
||||
|
||||
return not_an_error(0); // device number
|
||||
auto& av_manager = g_fxo->get<avconf_manager>();
|
||||
const std::lock_guard lock(av_manager.mutex);
|
||||
|
||||
std::optional<CellAudioInDeviceInfo> info = av_manager.get_device_info(name);
|
||||
if (!info || !memchr(info->name, '\0', sizeof(info->name)))
|
||||
{
|
||||
// TODO
|
||||
return CELL_AUDIO_IN_ERROR_DEVICE_NOT_FOUND;
|
||||
}
|
||||
|
||||
auto& mic_thr = g_fxo->get<mic_thread>();
|
||||
const std::lock_guard mic_lock(mic_thr.mutex);
|
||||
const u32 device_number = mic_thr.register_device(info->name);
|
||||
|
||||
return not_an_error(device_number);
|
||||
}
|
||||
|
||||
error_code cellAudioInUnregisterDevice(u32 deviceNumber)
|
||||
{
|
||||
cellAvconfExt.todo("cellAudioInUnregisterDevice(deviceNumber=0x%x)", deviceNumber);
|
||||
|
||||
auto& mic_thr = g_fxo->get<mic_thread>();
|
||||
const std::lock_guard lock(mic_thr.mutex);
|
||||
mic_thr.unregister_device(deviceNumber);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@@ -391,7 +437,7 @@ error_code cellVideoOutGetScreenSize(u32 videoOut, vm::ptr<f32> screenSize)
|
||||
return CELL_VIDEO_OUT_ERROR_UNSUPPORTED_VIDEO_OUT;
|
||||
}
|
||||
|
||||
if (g_cfg.video.enable_3d)
|
||||
if (g_cfg.video.stereo_render_mode != stereo_render_mode_options::disabled)
|
||||
{
|
||||
// Return Playstation 3D display value
|
||||
// Some games call this function when 3D is enabled
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "cellCamera.h"
|
||||
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/system_config.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
#include "Emu/Cell/lv2/sys_event.h"
|
||||
#include "Emu/IdManager.h"
|
||||
@@ -147,7 +148,7 @@ void camera_context::save(utils::serial& ar)
|
||||
|
||||
GET_OR_USE_SERIALIZATION_VERSION(ar.is_writing(), cellCamera);
|
||||
|
||||
ar(notify_data_map, start_timestamp, read_mode, is_streaming, is_attached, is_open, info, attr, frame_num);
|
||||
ar(notify_data_map, start_timestamp_us, read_mode, is_streaming, is_attached, is_open, info, attr, frame_num);
|
||||
}
|
||||
|
||||
static bool check_dev_num(s32 dev_num)
|
||||
@@ -1268,7 +1269,7 @@ error_code cellCameraStart(s32 dev_num)
|
||||
|
||||
// TODO: Yet another CELL_CAMERA_ERROR_TIMEOUT
|
||||
|
||||
g_camera.start_timestamp = get_guest_system_time();
|
||||
g_camera.start_timestamp_us = get_guest_system_time();
|
||||
g_camera.is_streaming = true;
|
||||
|
||||
return CELL_OK;
|
||||
@@ -1372,7 +1373,7 @@ error_code cellCameraReadEx(s32 dev_num, vm::ptr<CellCameraReadEx> read)
|
||||
return CELL_CAMERA_ERROR_DEVICE_NOT_FOUND;
|
||||
}
|
||||
|
||||
g_camera.bytes_read = bytes_read;
|
||||
g_camera.bytes_read = ::narrow<u32>(bytes_read);
|
||||
|
||||
cellCamera.trace("cellCameraRead: frame_number=%d, width=%d, height=%d. bytes_read=%d (passed to game: frame=%d, bytesread=%d)",
|
||||
frame_number, width, height, bytes_read, read ? read->frame.get() : 0, read ? read->bytesread.get() : 0);
|
||||
@@ -1385,18 +1386,18 @@ error_code cellCameraReadEx(s32 dev_num, vm::ptr<CellCameraReadEx> read)
|
||||
|
||||
if (has_new_frame)
|
||||
{
|
||||
g_camera.frame_timestamp = (get_guest_system_time() - g_camera.start_timestamp);
|
||||
g_camera.frame_timestamp_us = get_guest_system_time() - g_camera.start_timestamp_us;
|
||||
}
|
||||
|
||||
if (read) // NULL returns CELL_OK
|
||||
{
|
||||
read->timestamp = g_camera.frame_timestamp;
|
||||
read->timestamp = g_camera.frame_timestamp_us;
|
||||
read->frame = g_camera.frame_num;
|
||||
read->bytesread = g_camera.bytes_read;
|
||||
|
||||
auto& shared_data = g_fxo->get<gem_camera_shared>();
|
||||
|
||||
shared_data.frame_timestamp.store(read->timestamp);
|
||||
shared_data.frame_timestamp_us.store(read->timestamp);
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
@@ -1646,11 +1647,7 @@ void camera_context::operator()()
|
||||
else
|
||||
{
|
||||
std::lock_guard lock(mutex);
|
||||
|
||||
Emu.BlockingCallFromMainThread([&]()
|
||||
{
|
||||
send_frame_update_event = handler ? on_handler_state(handler->get_state()) : true;
|
||||
});
|
||||
send_frame_update_event = !handler || on_handler_state(handler->get_state());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1672,7 +1669,7 @@ void camera_context::operator()()
|
||||
const u64 camera_id = 0;
|
||||
|
||||
data2 = image_data_size << 32 | buffer_number << 16 | camera_id;
|
||||
data3 = get_guest_system_time() - start_timestamp; // timestamp
|
||||
data3 = get_guest_system_time() - start_timestamp_us; // timestamp
|
||||
}
|
||||
else // CELL_CAMERA_READ_FUNCCALL, also default
|
||||
{
|
||||
@@ -1714,26 +1711,21 @@ void camera_context::operator()()
|
||||
|
||||
bool camera_context::open_camera()
|
||||
{
|
||||
bool result = true;
|
||||
|
||||
Emu.BlockingCallFromMainThread([&result, this]()
|
||||
Emu.BlockingCallFromMainThread([this]()
|
||||
{
|
||||
handler.reset();
|
||||
handler = Emu.GetCallbacks().get_camera_handler();
|
||||
if (handler)
|
||||
{
|
||||
handler->open_camera();
|
||||
result = on_handler_state(handler->get_state());
|
||||
}
|
||||
});
|
||||
|
||||
return result;
|
||||
return !handler || on_handler_state(handler->get_state());
|
||||
}
|
||||
|
||||
bool camera_context::start_camera()
|
||||
{
|
||||
bool result = true;
|
||||
|
||||
if (handler)
|
||||
{
|
||||
handler->set_mirrored(!!attr[CELL_CAMERA_MIRRORFLAG].v1);
|
||||
@@ -1741,29 +1733,25 @@ bool camera_context::start_camera()
|
||||
handler->set_resolution(info.width, info.height);
|
||||
handler->set_format(info.format, info.bytesize);
|
||||
|
||||
Emu.BlockingCallFromMainThread([&result, this]()
|
||||
Emu.BlockingCallFromMainThread([this]()
|
||||
{
|
||||
handler->start_camera();
|
||||
result = on_handler_state(handler->get_state());
|
||||
});
|
||||
|
||||
return on_handler_state(handler->get_state());
|
||||
}
|
||||
|
||||
return result;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool camera_context::get_camera_frame(u8* dst, u32& width, u32& height, u64& frame_number, u64& bytes_read)
|
||||
{
|
||||
bool result = true;
|
||||
|
||||
if (handler)
|
||||
{
|
||||
Emu.BlockingCallFromMainThread([&]()
|
||||
{
|
||||
result = on_handler_state(handler->get_image(dst, info.bytesize, width, height, frame_number, bytes_read));
|
||||
});
|
||||
return on_handler_state(handler->get_image(dst, info.bytesize, width, height, frame_number, bytes_read));
|
||||
}
|
||||
|
||||
return result;
|
||||
return true;
|
||||
}
|
||||
|
||||
void camera_context::stop_camera()
|
||||
@@ -1801,7 +1789,7 @@ void camera_context::reset_state()
|
||||
pbuf_locked[0] = false;
|
||||
pbuf_locked[1] = false;
|
||||
has_new_frame = false;
|
||||
frame_timestamp = 0;
|
||||
frame_timestamp_us = 0;
|
||||
bytes_read = 0;
|
||||
|
||||
if (info.buffer)
|
||||
@@ -1915,13 +1903,19 @@ bool camera_context::on_handler_state(camera_handler_base::camera_handler_state
|
||||
if (is_streaming)
|
||||
{
|
||||
cellCamera.warning("Camera closed or disconnected (state=%d). Trying to start camera...", static_cast<int>(state));
|
||||
handler->open_camera();
|
||||
handler->start_camera();
|
||||
Emu.BlockingCallFromMainThread([&]()
|
||||
{
|
||||
handler->open_camera();
|
||||
handler->start_camera();
|
||||
});
|
||||
}
|
||||
else if (is_open)
|
||||
{
|
||||
cellCamera.warning("Camera closed or disconnected (state=%d). Trying to open camera...", static_cast<int>(state));
|
||||
handler->open_camera();
|
||||
Emu.BlockingCallFromMainThread([&]()
|
||||
{
|
||||
handler->open_camera();
|
||||
});
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@@ -1931,7 +1925,10 @@ bool camera_context::on_handler_state(camera_handler_base::camera_handler_state
|
||||
if (handler && is_streaming)
|
||||
{
|
||||
cellCamera.warning("Camera handler not running (state=%d). Trying to start camera...", static_cast<int>(state));
|
||||
handler->start_camera();
|
||||
Emu.BlockingCallFromMainThread([&]()
|
||||
{
|
||||
handler->start_camera();
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -384,7 +384,7 @@ struct CellCameraReadEx
|
||||
be_t<s32> version;
|
||||
be_t<u32> frame;
|
||||
be_t<u32> bytesread;
|
||||
be_t<s64> timestamp;
|
||||
be_t<u64> timestamp; // system_time_t (microseconds)
|
||||
vm::bptr<u8> pbuf;
|
||||
};
|
||||
|
||||
@@ -422,7 +422,7 @@ public:
|
||||
|
||||
shared_mutex mutex;
|
||||
shared_mutex mutex_notify_data_map;
|
||||
u64 start_timestamp = 0;
|
||||
u64 start_timestamp_us = 0;
|
||||
|
||||
atomic_t<u8> read_mode{CELL_CAMERA_READ_FUNCCALL};
|
||||
atomic_t<bool> is_streaming{false};
|
||||
@@ -444,7 +444,7 @@ public:
|
||||
attr_t attr[500]{};
|
||||
atomic_t<bool> has_new_frame = false;
|
||||
atomic_t<u32> frame_num = 0;
|
||||
atomic_t<u32> frame_timestamp = 0;
|
||||
atomic_t<u64> frame_timestamp_us = 0;
|
||||
atomic_t<u32> bytes_read = 0;
|
||||
|
||||
atomic_t<u8> init = 0;
|
||||
@@ -471,7 +471,7 @@ using camera_thread = named_thread<camera_context>;
|
||||
/// Shared data between cellGem and cellCamera
|
||||
struct gem_camera_shared
|
||||
{
|
||||
atomic_t<s64> frame_timestamp{}; // latest read timestamp from cellCamera (cellCameraRead(Ex))
|
||||
atomic_t<u64> frame_timestamp_us{}; // latest read timestamp from cellCamera (cellCameraRead(Ex))
|
||||
atomic_t<s32> width{640};
|
||||
atomic_t<s32> height{480};
|
||||
atomic_t<s32> size{0};
|
||||
|
||||
@@ -466,7 +466,7 @@ error_code cellHddGameCheck(ppu_thread& ppu, u32 version, vm::cptr<char> dirName
|
||||
// psf::assign(sfo, "CATEGORY", psf::string(3, "HG"));
|
||||
// }
|
||||
|
||||
// psf::assign(sfo, "TITLE_ID", psf::string(CELL_GAME_SYSP_TITLEID_SIZE, setParam->titleId));
|
||||
// psf::assign(sfo, "TITLE_ID", psf::string(TITLEID_SFO_ENTRY_SIZE, setParam->titleId));
|
||||
// psf::assign(sfo, "TITLE", psf::string(CELL_GAME_SYSP_TITLE_SIZE, setParam->title));
|
||||
// psf::assign(sfo, "VERSION", psf::string(CELL_GAME_SYSP_VERSION_SIZE, setParam->dataVersion));
|
||||
// psf::assign(sfo, "PARENTAL_LEVEL", +setParam->parentalLevel);
|
||||
@@ -990,7 +990,7 @@ error_code cellGameDataCheckCreate2(ppu_thread& ppu, u32 version, vm::cptr<char>
|
||||
psf::assign(sfo, "CATEGORY", psf::string(3, "GD"));
|
||||
}
|
||||
|
||||
psf::assign(sfo, "TITLE_ID", psf::string(CELL_GAME_SYSP_TITLEID_SIZE, setParam->titleId));
|
||||
psf::assign(sfo, "TITLE_ID", psf::string(TITLEID_SFO_ENTRY_SIZE, setParam->titleId, true));
|
||||
psf::assign(sfo, "TITLE", psf::string(CELL_GAME_SYSP_TITLE_SIZE, setParam->title));
|
||||
psf::assign(sfo, "VERSION", psf::string(CELL_GAME_SYSP_VERSION_SIZE, setParam->dataVersion));
|
||||
psf::assign(sfo, "PARENTAL_LEVEL", +setParam->parentalLevel);
|
||||
@@ -1005,6 +1005,14 @@ error_code cellGameDataCheckCreate2(ppu_thread& ppu, u32 version, vm::cptr<char>
|
||||
psf::assign(sfo, fmt::format("TITLE_%02d", i), psf::string(CELL_GAME_SYSP_TITLE_SIZE, setParam->titleLang[i]));
|
||||
}
|
||||
|
||||
if (!psf::check_registry(sfo))
|
||||
{
|
||||
// This results in CELL_OK, broken SFO and CELL_GAMEDATA_ERROR_BROKEN on the next load
|
||||
// Avoid creation for now
|
||||
cellGame.error("Broken SFO paramters: %s", sfo);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
fs::pending_file temp(vfs::get(dir + "/PARAM.SFO"));
|
||||
temp.file.write(psf::save_object(sfo));
|
||||
ensure(temp.commit());
|
||||
@@ -1125,7 +1133,7 @@ error_code cellGameCreateGameData(vm::ptr<CellGameSetInitParams> init, vm::ptr<c
|
||||
perm.sfo =
|
||||
{
|
||||
{ "CATEGORY", psf::string(3, "GD") },
|
||||
{ "TITLE_ID", psf::string(CELL_GAME_SYSP_TITLEID_SIZE, init->titleId) },
|
||||
{ "TITLE_ID", psf::string(TITLEID_SFO_ENTRY_SIZE, init->titleId) },
|
||||
{ "TITLE", psf::string(CELL_GAME_SYSP_TITLE_SIZE, init->title) },
|
||||
{ "VERSION", psf::string(CELL_GAME_SYSP_VERSION_SIZE, init->version) },
|
||||
};
|
||||
|
||||
@@ -216,6 +216,11 @@ enum // old consts
|
||||
CELL_DISCGAME_SYSP_TITLEID_SIZE=10,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
TITLEID_SFO_ENTRY_SIZE = 16, // This is the true length on PS3 (TODO: Fix in more places)
|
||||
};
|
||||
|
||||
struct CellGameDataSystemFileParam
|
||||
{
|
||||
char title[CELL_GAMEDATA_SYSP_TITLE_SIZE];
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user