Compare commits
634 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9b3a878c18 | |||
| 365b264656 | |||
| 1184d6aecb | |||
| b12edf70bb | |||
| 53c1da8f94 | |||
| 213b810279 | |||
| 8a4617d3c2 | |||
| c108b31954 | |||
| fd6829f757 | |||
| dabb2cc9a0 | |||
| 4ecb06c901 | |||
| 375bc4cc69 | |||
| 9265ff53d0 | |||
| 75ad56338b | |||
| db24ce7708 | |||
| 2d45ecff22 | |||
| 5d98f3866c | |||
| 106f31db6a | |||
| 9a5bdc9b4f | |||
| 0b829be798 | |||
| 94bb75fb7c | |||
| 7d84d0f83e | |||
| bc40b61ef1 | |||
| 73c3d5fc81 | |||
| 13575029c0 | |||
| ea016382f2 | |||
| 782344eed8 | |||
| 95fb7859d2 | |||
| 9d3e626b55 | |||
| a6e8b9037a | |||
| c9f91ecee9 | |||
| 7cb2d3f143 | |||
| a975b4937a | |||
| fce8e0fef0 | |||
| 12fe55a258 | |||
| 3bbc2c1f4c | |||
| 99671b754f | |||
| 9fc5f6271b | |||
| 4647f3046e | |||
| c44cddabfa | |||
| 9ff91c29f2 | |||
| e303cc536c | |||
| afdfefc9ad | |||
| 3033914e2d | |||
| 70b124cfa0 | |||
| 38a5313ed2 | |||
| 9291e2777d | |||
| 465da5136d | |||
| 568e7481d8 | |||
| a0297933ce | |||
| 50dad6801b | |||
| ee7475a9d4 | |||
| ba988f1d3f | |||
| db029ed29f | |||
| 41d38975f7 | |||
| eecadab387 | |||
| e27e6c0b2d | |||
| 30a5d646ec | |||
| 882fb3e049 | |||
| 0423781363 | |||
| 43cfb3cd10 | |||
| de15c9746f | |||
| 1371bf89e0 | |||
| 3b8f8d7fc8 | |||
| a828c214b5 | |||
| 3381144d2e | |||
| a19883f875 | |||
| 482722af0a | |||
| 02bac61c9c | |||
| e8ee5831d3 | |||
| 083b4f0d3b | |||
| c0280b43f2 | |||
| d153e977a7 | |||
| eee7bf0c97 | |||
| 0c94606fcf | |||
| ed75bab7b2 | |||
| bff6e0d277 | |||
| c325017675 | |||
| 4b12c9a9fc | |||
| 0d57744efa | |||
| e882d64d8a | |||
| 16f910e350 | |||
| e2c2ef9788 | |||
| a98b4adead | |||
| 186fe53279 | |||
| c9917c826a | |||
| aedebecae2 | |||
| 482dd0e8f8 | |||
| cae2e7de80 | |||
| e76ce05e29 | |||
| a98174be85 | |||
| b68cfbf794 | |||
| 17d8f2884e | |||
| 050b8fa7df | |||
| c30c9b2168 | |||
| 358735a199 | |||
| d909bbc297 | |||
| 2adb2f82d7 | |||
| 5a013127ec | |||
| 1219e5c244 | |||
| 4aec48c2ca | |||
| 8d54ddf426 | |||
| c21cdb8055 | |||
| 05824e6acd | |||
| b3b680f073 | |||
| 598fe85243 | |||
| e7ac84fca3 | |||
| b9ea6be842 | |||
| d46dbc0fa8 | |||
| 0e10f12ec0 | |||
| 8f178b2c29 | |||
| d41fe80b8e | |||
| 96e992bd26 | |||
| 465c421707 | |||
| f7e9622084 | |||
| 79e000f63d | |||
| 10af0e8c93 | |||
| d13cf0e29a | |||
| 1671922f7e | |||
| c9da795bf3 | |||
| 69eb1401a9 | |||
| aa06ac119f | |||
| 1afee59c95 | |||
| 4decad6f6b | |||
| a37f786a37 | |||
| 8f98e572e1 | |||
| c818f8af82 | |||
| fac8bcc20c | |||
| 1d004f2788 | |||
| cef4ea786a | |||
| 8ebf24d8e7 | |||
| 69b02f7e46 | |||
| b788e05396 | |||
| 5dc4e74c98 | |||
| 436ef1cff6 | |||
| d77a78cdf1 | |||
| 66cb855db0 | |||
| fb3aa9628d | |||
| 89c81d9f22 | |||
| cffcfad42a | |||
| 21f5976d35 | |||
| 21ada251fe | |||
| 44801c50f3 | |||
| 6a1fb8cb73 | |||
| 8e8cefb3f6 | |||
| e0e4fa3b3e | |||
| b9dbda5ddc | |||
| 931a2c516f | |||
| 2f9e1cf4df | |||
| 68d1c38f3b | |||
| c4acea6c82 | |||
| 7ebabddfe0 | |||
| a047ddffc0 | |||
| 92992a5406 | |||
| 593f850693 | |||
| f87db1ac14 | |||
| 363e498462 | |||
| a03dd44924 | |||
| 554b27a82a | |||
| 7062ead4fd | |||
| 5f2f084091 | |||
| a560121775 | |||
| b0a346709e | |||
| 7b64cd2a8e | |||
| 9ecfecb83e | |||
| ec4565263d | |||
| ed1da364e5 | |||
| 942dbbc8fa | |||
| 3e8f9cbbf2 | |||
| 322b5dac79 | |||
| 5a85fee3f1 | |||
| ca472b6750 | |||
| 8e3d0af08e | |||
| 12f2b900ca | |||
| 6228dff809 | |||
| d34b3190f7 | |||
| 4f5348c7d4 | |||
| aff871f127 | |||
| 9f00359e17 | |||
| 0871436488 | |||
| 6aa598b029 | |||
| 83e22fa9f0 | |||
| a230340578 | |||
| 2da78c6591 | |||
| 46350200d7 | |||
| 00502e94b5 | |||
| 70ce7ee106 | |||
| cf4ae38699 | |||
| 09f83e48ff | |||
| bcbce5dd48 | |||
| 0a0ef50caf | |||
| e20f1587cd | |||
| 715e3856f2 | |||
| 850166eca1 | |||
| 00cca7be69 | |||
| 0a43f69e87 | |||
| c84d2d895e | |||
| 87d5f45277 | |||
| 137f37cd41 | |||
| 18722d7874 | |||
| 307e1351df | |||
| 441fbd63bb | |||
| 073b723c09 | |||
| 37bc73865d | |||
| e2bced978e | |||
| a6d8c4343f | |||
| d5654d64d5 | |||
| 06459eb37b | |||
| d08fea551e | |||
| 924692bf1c | |||
| ec9e8916b1 | |||
| d3be8ee2b7 | |||
| 16f869fe5a | |||
| a90858193e | |||
| 6dcf63009e | |||
| 5f8f86b5a7 | |||
| a78117e094 | |||
| 44421920b3 | |||
| 0e79fbda05 | |||
| 9ab89c634b | |||
| 0a6f12f448 | |||
| 8612bdd03d | |||
| f08d3e12ca | |||
| deda47f461 | |||
| 2751f5e254 | |||
| 2ac1ff1d0a | |||
| 30e8c70055 | |||
| 62600b3be0 | |||
| 57b9130cf7 | |||
| b557a7fa16 | |||
| 73e336adfa | |||
| 86b27a3088 | |||
| cce699a465 | |||
| d662a39a12 | |||
| 49c6c2c529 | |||
| 29f3eec957 | |||
| c1d875d841 | |||
| d28e3c4f08 | |||
| cedfb95f9b | |||
| 59430ee83e | |||
| b436d2a7f4 | |||
| 84d2ad70e6 | |||
| 1bd9549e45 | |||
| 2409a0d04e | |||
| 635fed0427 | |||
| 5d7e75c5d8 | |||
| c0e97b4e96 | |||
| b2842dcd52 | |||
| 112f1016ed | |||
| c78c504043 | |||
| 27349c5c69 | |||
| 872aa2b358 | |||
| 72abc0f219 | |||
| 4d565eade6 | |||
| 2df7e46cb1 | |||
| 105205312b | |||
| 97f7461aa9 | |||
| 7e2eaf43ca | |||
| d752ab0151 | |||
| c87a7cb2c0 | |||
| 6aff2803e5 | |||
| fcfca6efda | |||
| 0ebe832f8e | |||
| 86ed82dcec | |||
| 769b69999f | |||
| 91ee066751 | |||
| 404d08ef6d | |||
| 11487cd591 | |||
| 51a30977d2 | |||
| c0366ba40c | |||
| 3f5bc3464d | |||
| fcd6be71b0 | |||
| ad22cf5051 | |||
| 8f66c50721 | |||
| 6f834e99d2 | |||
| 86c7b31b6d | |||
| 6d918b565f | |||
| 52575a44b2 | |||
| d5eebd6ab4 | |||
| 3f44ecb77a | |||
| 9bd4426225 | |||
| 4af0a33f1f | |||
| 636bde6343 | |||
| 16579e0b1f | |||
| 292d3faa9e | |||
| 6d2f7f6e54 | |||
| a131a41874 | |||
| 48ffc19193 | |||
| e75c0dbaa1 | |||
| 0c0f63a2a8 | |||
| c9942aa828 | |||
| ca56f0747e | |||
| e77c01d00a | |||
| c85775922e | |||
| da0c9c2ce9 | |||
| 42b388317e | |||
| 6a570ae57e | |||
| 5e6aa45658 | |||
| 5fa8af1c9a | |||
| 2e4bf9ef1b | |||
| ba9f55679d | |||
| 2c999a550b | |||
| 805de248d3 | |||
| 1240874e41 | |||
| feff50e7e0 | |||
| 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 |
@@ -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=$?;
|
||||
|
||||
+37
-15
@@ -1,11 +1,17 @@
|
||||
#!/bin/sh -ex
|
||||
|
||||
brew install -f --overwrite llvm@14 nasm ninja git p7zip create-dmg ccache
|
||||
export HOMEBREW_NO_AUTO_UPDATE=1
|
||||
brew install -f --overwrite nasm ninja git p7zip create-dmg ccache pipenv
|
||||
|
||||
#/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 install -f --overwrite llvm@14 sdl2 glew cmake
|
||||
arch -x86_64 /usr/local/bin/brew update
|
||||
arch -x86_64 /usr/local/bin/brew install -f --overwrite llvm@16 sdl2 glew cmake faudio vulkan-headers
|
||||
arch -x86_64 /usr/local/bin/brew link -f llvm@16
|
||||
|
||||
# moltenvk based on commit for 1.2.4 release
|
||||
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/b233d4f9f40f26d81da11140defbfd578cfe4a69/Formula/molten-vk.rb
|
||||
arch -x86_64 /usr/local/bin/brew install -f --overwrite ./molten-vk.rb
|
||||
#export MACOSX_DEPLOYMENT_TARGET=12.0
|
||||
export CXX=clang++
|
||||
export CC=clang
|
||||
@@ -13,7 +19,7 @@ export CC=clang
|
||||
export BREW_PATH;
|
||||
BREW_PATH="$(brew --prefix)"
|
||||
export BREW_X64_PATH;
|
||||
BREW_X64_PATH="$("/usr/local/homebrew/bin/brew" --prefix)"
|
||||
BREW_X64_PATH="$("/usr/local/bin/brew" --prefix)"
|
||||
export BREW_BIN="/usr/local/bin"
|
||||
export BREW_SBIN="/usr/local/sbin"
|
||||
export CMAKE_EXTRA_OPTS='-DLLVM_TARGETS_TO_BUILD=X86'
|
||||
@@ -21,25 +27,39 @@ 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
|
||||
pip3 install pipenv
|
||||
pipenv run pip3 install py7zr requests semantic_version lxml
|
||||
pipenv run ./qt-downloader macos desktop 5.15.2 clang_64 --opensource
|
||||
cd ..
|
||||
# Get Qt
|
||||
if [ ! -d "/tmp/Qt/5.15.2" ]; then
|
||||
mkdir -p "/tmp/Qt"
|
||||
git clone https://github.com/engnr/qt-downloader.git
|
||||
cd qt-downloader
|
||||
git checkout f52efee0f18668c6d6de2dec0234b8c4bc54c597
|
||||
cd "/tmp/Qt"
|
||||
"/opt/homebrew/bin/pipenv" run pip3 install py7zr requests semantic_version lxml
|
||||
"/opt/homebrew/bin/pipenv" run "$WORKDIR/qt-downloader/qt-downloader" macos desktop 5.15.2 clang_64 --opensource
|
||||
fi
|
||||
|
||||
cd "$WORKDIR"
|
||||
ditto "/tmp/Qt/5.15.2" "qt-downloader/5.15.2"
|
||||
|
||||
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_PATH/opt/llvm@14/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 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
|
||||
export VULKAN_SDK
|
||||
VULKAN_SDK="$BREW_X64_PATH/opt/molten-vk"
|
||||
ln -s "$VULKAN_SDK/lib/libMoltenVK.dylib" "$VULKAN_SDK/lib/libvulkan.dylib"
|
||||
export VK_ICD_FILENAMES="$VULKAN_SDK/share/vulkan/icd.d/MoltenVK_icd.json"
|
||||
|
||||
export LLVM_DIR
|
||||
LLVM_DIR="BREW_X64_PATH/opt/llvm@16"
|
||||
# exclude FAudio, SPIRV and LLVM, and sdl from submodule update
|
||||
# shellcheck disable=SC2046
|
||||
git submodule -q update --init --depth=1 --jobs=8 $(awk '/path/ && !/FAudio/ && !/llvm/ && !/SPIRV/ && !/SDL/ { print $3 }' .gitmodules)
|
||||
|
||||
# 3rdparty fixes
|
||||
sed -i '' "s/extern const double NSAppKitVersionNumber;/const double NSAppKitVersionNumber = 1343;/g" 3rdparty/hidapi/hidapi/mac/hid.c
|
||||
@@ -47,12 +67,14 @@ sed -i '' "s/extern const double NSAppKitVersionNumber;/const double NSAppKitVer
|
||||
mkdir build && cd build || exit 1
|
||||
|
||||
"$BREW_X64_PATH/bin/cmake" .. \
|
||||
-DUSE_SDL=ON -DUSE_DISCORD_RPC=OFF -DUSE_VULKAN=ON -DUSE_ALSA=OFF -DUSE_PULSE=OFF -DUSE_AUDIOUNIT=ON \
|
||||
-DUSE_SDL=ON -DUSE_DISCORD_RPC=ON -DUSE_VULKAN=ON -DUSE_ALSA=OFF -DUSE_PULSE=OFF -DUSE_AUDIOUNIT=ON \
|
||||
-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 \
|
||||
-DUSE_SYSTEM_MVK=ON \
|
||||
-DUSE_SYSTEM_FAUDIO=ON \
|
||||
-DUSE_SYSTEM_SDL=ON \
|
||||
$CMAKE_EXTRA_OPTS \
|
||||
-DLLVM_TARGET_ARCH=X86_64 -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_IGNORE_PATH="$BREW_PATH/lib" \
|
||||
-G Ninja
|
||||
|
||||
+14
-40
@@ -3,48 +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
|
||||
|
||||
# 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++/
|
||||
EXTRA_QT_PLUGINS="svg;" APPIMAGE_EXTRACT_AND_RUN=1 linuxdeploy --appdir AppDir --plugin qt
|
||||
|
||||
# Remove libwayland-client because it has platform-dependent exports and breaks other OSes
|
||||
rm -f ./appdir/usr/lib/libwayland-client.so*
|
||||
rm -f ./AppDir/usr/lib/libwayland-client.so*
|
||||
|
||||
# Remove libgmodule and libglib due to g_source_set_static_name symbol conflict with host libraries
|
||||
rm -f ./appdir/usr/lib/libgmodule-2.0.so*
|
||||
rm -f ./appdir/usr/lib/libglib-2.0.so*
|
||||
# Remove git directory containing local commit history file
|
||||
rm -rf ./AppDir/usr/share/rpcs3/git
|
||||
|
||||
# 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
|
||||
./linuxdeploy-plugin-checkrt.sh --appdir AppDir
|
||||
|
||||
# Compile checker binary for AppImageKit-checkrt
|
||||
|
||||
# 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 -
|
||||
|
||||
# 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)"
|
||||
@@ -61,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
|
||||
|
||||
+3
-2
@@ -15,7 +15,7 @@ echo "AVVER=$AVVER" >> ../.ci/ci-vars.env
|
||||
cd bin
|
||||
mkdir "rpcs3.app/Contents/lib/"
|
||||
|
||||
cp "/usr/local/Homebrew/opt/llvm@14/lib/c++/libc++abi.1.0.dylib" "rpcs3.app/Contents/lib/libc++abi.1.dylib"
|
||||
cp "/usr/local/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" \
|
||||
@@ -23,7 +23,8 @@ rm -rf "rpcs3.app/Contents/Frameworks/QtPdf.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
|
||||
|
||||
@@ -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/ && !/FAudio/ && !/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
-3
@@ -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:
|
||||
@@ -108,7 +108,7 @@ freebsd_task:
|
||||
matrix:
|
||||
- name: Cirrus FreeBSD
|
||||
freebsd_instance:
|
||||
image_family: freebsd-13-1
|
||||
image_family: freebsd-13-2
|
||||
cpu: 8
|
||||
memory: 8G
|
||||
env:
|
||||
@@ -121,12 +121,16 @@ freebsd_task:
|
||||
|
||||
macos_task:
|
||||
timeout_in: 12000m
|
||||
homebrew_cache:
|
||||
folder: /Users/admin/Library/Caches/Homebrew
|
||||
qt_cache:
|
||||
folder: /tmp/Qt
|
||||
ccache_cache:
|
||||
folder: /tmp/ccache_dir
|
||||
matrix:
|
||||
- name: Cirrus macOS
|
||||
macos_instance:
|
||||
image: ghcr.io/cirruslabs/macos-monterey-xcode:14
|
||||
image: ghcr.io/cirruslabs/macos-monterey-xcode:latest
|
||||
mac_script:
|
||||
- mkdir artifacts
|
||||
- chmod +x ".ci/build-mac.sh"
|
||||
|
||||
+12
-1
@@ -31,12 +31,12 @@
|
||||
*.wav
|
||||
|
||||
/build
|
||||
/build-*
|
||||
/lib
|
||||
/tmp
|
||||
/ipch
|
||||
/rpcs3/Debug
|
||||
/rpcs3/Release
|
||||
/llvm_build
|
||||
|
||||
!/bin
|
||||
/bin/*
|
||||
@@ -104,6 +104,7 @@ rpcs3/rpcs3_autogen/*
|
||||
|
||||
# QtCreator
|
||||
CMakeLists.txt.user
|
||||
*.autosave
|
||||
|
||||
# CLion
|
||||
/.idea/*
|
||||
@@ -125,7 +126,17 @@ yaml-cpp.pc
|
||||
# miniupnp
|
||||
/3rdparty/miniupnp/x64/*
|
||||
|
||||
# llvm
|
||||
/3rdparty/llvm/llvm_build
|
||||
|
||||
# legacy llvm
|
||||
/llvm_build
|
||||
|
||||
# ssl certificate
|
||||
cacert.pem
|
||||
|
||||
_ReSharper.*/
|
||||
CMakeUserPresets.json
|
||||
|
||||
.cache/
|
||||
.lldbinit
|
||||
|
||||
+9
-5
@@ -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,8 +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 = https://github.com/miniupnp/miniupnp.git
|
||||
url = ../../miniupnp/miniupnp.git
|
||||
ignore = dirty
|
||||
[submodule "3rdparty/rtmidi/rtmidi"]
|
||||
path = 3rdparty/rtmidi/rtmidi
|
||||
url = ../../thestk/rtmidi
|
||||
|
||||
Vendored
+44
-40
@@ -4,6 +4,11 @@ include(CMakeDependentOption)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
|
||||
# Warnings are silenced for 3rdparty code
|
||||
if(NOT MSVC)
|
||||
add_compile_options("$<$<COMPILE_LANGUAGE:CXX,C>:-w>")
|
||||
endif()
|
||||
|
||||
# Dummy target to use when lib isn't available
|
||||
add_library(3rdparty_dummy_lib INTERFACE)
|
||||
|
||||
@@ -42,16 +47,16 @@ endif()
|
||||
|
||||
|
||||
# libusb
|
||||
if(CMAKE_SYSTEM MATCHES "DragonFly|FreeBSD")
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD")
|
||||
pkg_check_modules(LIBUSB REQUIRED IMPORTED_TARGET libusb-1.0>=1.0 )
|
||||
CMAKE_DEPENDENT_OPTION( USE_SYSTEM_LIBUSB "Use system libusb-1.0 as shared library" ON
|
||||
cmake_dependent_option(USE_SYSTEM_LIBUSB "Use system libusb-1.0 as shared library" ON
|
||||
"LIBUSB_FOUND" OFF)
|
||||
else()
|
||||
pkg_check_modules(LIBUSB IMPORTED_TARGET libusb-1.0>=1.0 )
|
||||
CMAKE_DEPENDENT_OPTION( USE_SYSTEM_LIBUSB "Use system libusb-1.0 as shared library" OFF
|
||||
cmake_dependent_option(USE_SYSTEM_LIBUSB "Use system libusb-1.0 as shared library" OFF
|
||||
"LIBUSB_FOUND" OFF)
|
||||
endif()
|
||||
if(CMAKE_SYSTEM MATCHES "DragonFly|FreeBSD")
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD")
|
||||
# Always use system libusb as reference implementation isn't supported
|
||||
add_library(usb-1.0-shared INTERFACE)
|
||||
target_link_libraries(usb-1.0-shared INTERFACE PkgConfig::LIBUSB)
|
||||
@@ -78,7 +83,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
|
||||
@@ -100,10 +105,6 @@ endif()
|
||||
|
||||
# OpenGL
|
||||
|
||||
# Prefer GLVND for OpenGL rather than legacy, unless it's been defined elsewhere, in the case of AppImage builds
|
||||
if(NOT DEFINED OpenGL_GL_PREFERENCE)
|
||||
set(OpenGL_GL_PREFERENCE GLVND)
|
||||
endif()
|
||||
find_package(OpenGL REQUIRED)
|
||||
|
||||
add_library(3rdparty_opengl INTERFACE)
|
||||
@@ -111,17 +112,14 @@ target_include_directories(3rdparty_opengl INTERFACE GL)
|
||||
|
||||
if (WIN32)
|
||||
if(NOT MSVC)
|
||||
target_link_libraries(3rdparty_opengl INTERFACE ${OPENGL_LIBRARIES} opengl32.lib glu32.lib)
|
||||
target_link_libraries(3rdparty_opengl INTERFACE OpenGL::GL OpenGL::GLU)
|
||||
else()
|
||||
target_link_libraries(3rdparty_opengl INTERFACE dxgi.lib d2d1.lib dwrite.lib)
|
||||
endif()
|
||||
elseif(APPLE)
|
||||
target_link_libraries(3rdparty_opengl INTERFACE OpenGL::GL OpenGL::GLU)
|
||||
else()
|
||||
target_link_libraries(3rdparty_opengl INTERFACE ${OPENGL_LIBRARIES})
|
||||
|
||||
target_compile_definitions(3rdparty_opengl
|
||||
INTERFACE
|
||||
-DGL_GLEXT_PROTOTYPES
|
||||
-DGLX_GLXEXT_PROTOTYPES)
|
||||
target_link_libraries(3rdparty_opengl INTERFACE OpenGL::GL OpenGL::GLU OpenGL::GLX)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -160,9 +158,9 @@ set(VULKAN_TARGET 3rdparty_dummy_lib)
|
||||
if(USE_VULKAN)
|
||||
if(APPLE)
|
||||
if(USE_SYSTEM_MVK)
|
||||
message("-- RPCS3: Using system MoltenVK")
|
||||
message(STATUS "RPCS3: Using system MoltenVK")
|
||||
else()
|
||||
message("-- RPCS3: MoltenVK submodule")
|
||||
message(STATUS "RPCS3: MoltenVK submodule")
|
||||
|
||||
execute_process(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" .
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/MoltenVK"
|
||||
@@ -189,7 +187,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)
|
||||
@@ -204,9 +202,9 @@ if(USE_VULKAN)
|
||||
|
||||
set(VULKAN_TARGET 3rdparty_vulkan)
|
||||
else()
|
||||
message("WARNING! USE_VULKAN was enabled, but libvulkan was not found. RPCS3 will be compiled without Vulkan support.")
|
||||
message(WARNING "USE_VULKAN was enabled, but libvulkan was not found. RPCS3 will be compiled without Vulkan support.")
|
||||
if(APPLE)
|
||||
message( FATAL_ERROR "ERROR! To build without Vulkan support on macOS, please disable USE_VULKAN.")
|
||||
message(FATAL_ERROR "To build without Vulkan support on macOS, please disable USE_VULKAN.")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
@@ -225,7 +223,7 @@ if(USE_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"
|
||||
"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.")
|
||||
@@ -262,36 +260,36 @@ add_library(3rdparty_ffmpeg INTERFACE)
|
||||
|
||||
# Select the version of ffmpeg to use, default is builtin
|
||||
if(USE_SYSTEM_FFMPEG)
|
||||
message("-- RPCS3: using shared ffmpeg")
|
||||
message(STATUS "RPCS3: using shared ffmpeg")
|
||||
find_package(FFMPEG REQUIRED)
|
||||
|
||||
target_include_directories(3rdparty_ffmpeg INTERFACE ${FFMPEG_INCLUDE_DIR})
|
||||
target_link_libraries(3rdparty_ffmpeg INTERFACE ${FFMPEG_LIBRARIES})
|
||||
else()
|
||||
if (NOT MSVC AND WIN32)
|
||||
message("-- RPCS3: building ffmpeg submodule")
|
||||
message(STATUS "RPCS3: building ffmpeg submodule")
|
||||
|
||||
include(ProcessorCount)
|
||||
ProcessorCount(N)
|
||||
|
||||
ExternalProject_Add(ffmpeg-mingw
|
||||
DOWNLOAD_COMMAND ""
|
||||
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ffmpeg
|
||||
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/ffmpeg
|
||||
CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/ffmpeg/configure --prefix=./windows/x86_64 --arch=x86_64 --disable-avdevice --disable-programs --disable-avfilter --disable-postproc --disable-doc --disable-pthreads --enable-w32threads --disable-network --disable-everything --disable-encoders --disable-muxers --disable-hwaccels --disable-parsers --disable-protocols --enable-dxva2 --enable-static --disable-shared --enable-decoder=aac --enable-decoder=aac_latm --enable-decoder=atrac3 --enable-decoder=atrac3p --enable-decoder=mp3 --enable-decoder=pcm_s16le --enable-decoder=pcm_s8 --enable-decoder=h264 --enable-decoder=mpeg4 --enable-decoder=mpeg2video --enable-decoder=mjpeg --enable-decoder=mjpegb --enable-encoder=pcm_s16le --enable-encoder=ffv1 --enable-encoder=mpeg4 --enable-parser=h264 --enable-parser=mpeg4video --enable-parser=mpegaudio --enable-parser=mpegvideo --enable-parser=mjpeg --enable-parser=aac --enable-parser=aac_latm --enable-muxer=avi --enable-demuxer=h264 --enable-demuxer=m4v --enable-demuxer=mp3 --enable-demuxer=mpegvideo --enable-demuxer=mpegps --enable-demuxer=mjpeg --enable-demuxer=avi --enable-demuxer=aac --enable-demuxer=pmp --enable-demuxer=oma --enable-demuxer=pcm_s16le --enable-demuxer=pcm_s8 --enable-demuxer=wav --enable-hwaccel=h264_dxva2 --enable-indev=dshow --enable-protocol=file
|
||||
BUILD_COMMAND make -j 4
|
||||
CONFIGURE_COMMAND bash ${CMAKE_CURRENT_SOURCE_DIR}/ffmpeg/configure --prefix=./windows/x86_64 --arch=x86_64 --disable-avdevice --disable-programs --disable-avfilter --disable-postproc --disable-doc --disable-pthreads --enable-w32threads --disable-network --disable-everything --disable-encoders --disable-muxers --disable-hwaccels --disable-parsers --disable-protocols --enable-dxva2 --enable-static --disable-shared --enable-decoder=aac --enable-decoder=aac_latm --enable-decoder=atrac3 --enable-decoder=atrac3p --enable-decoder=mp3 --enable-decoder=pcm_s16le --enable-decoder=pcm_s8 --enable-decoder=h264 --enable-decoder=mpeg4 --enable-decoder=mpeg2video --enable-decoder=mjpeg --enable-decoder=mjpegb --enable-encoder=pcm_s16le --enable-encoder=ffv1 --enable-encoder=mpeg4 --enable-parser=h264 --enable-parser=mpeg4video --enable-parser=mpegaudio --enable-parser=mpegvideo --enable-parser=mjpeg --enable-parser=aac --enable-parser=aac_latm --enable-muxer=avi --enable-demuxer=h264 --enable-demuxer=m4v --enable-demuxer=mp3 --enable-demuxer=mpegvideo --enable-demuxer=mpegps --enable-demuxer=mjpeg --enable-demuxer=avi --enable-demuxer=aac --enable-demuxer=pmp --enable-demuxer=oma --enable-demuxer=pcm_s16le --enable-demuxer=pcm_s8 --enable-demuxer=wav --enable-hwaccel=h264_dxva2 --enable-indev=dshow --enable-protocol=file
|
||||
BUILD_COMMAND make -j ${N}
|
||||
INSTALL_COMMAND make install
|
||||
)
|
||||
|
||||
set(FFMPEG_LIB_AVFORMAT "${CMAKE_CURRENT_BINARY_DIR}/ffmpeg/windows/x86_64/lib/libavformat.a")
|
||||
set(FFMPEG_LIB_AVCODEC "${CMAKE_CURRENT_BINARY_DIR}/ffmpeg/windows/x86_64/lib/libavcodec.a")
|
||||
set(FFMPEG_LIB_AVUTIL "${CMAKE_CURRENT_BINARY_DIR}/ffmpeg/windows/x86_64/lib/libavutil.a")
|
||||
set(FFMPEG_LIB_SWSCALE "${CMAKE_CURRENT_BINARY_DIR}/ffmpeg/windows/x86_64/lib/libswscale.a")
|
||||
set(FFMPEG_LIB_SWRESAMPLE "${CMAKE_CURRENT_BINARY_DIR}/ffmpeg/windows/x86_64/lib/libswresample.a")
|
||||
target_link_directories(3rdparty_ffmpeg INTERFACE "${CMAKE_CURRENT_BINARY_DIR}/ffmpeg/windows/x86_64/lib")
|
||||
target_link_libraries(3rdparty_ffmpeg INTERFACE avformat avcodec avutil swscale swresample iconv)
|
||||
else()
|
||||
message("-- RPCS3: using builtin ffmpeg")
|
||||
message(STATUS "RPCS3: using builtin ffmpeg")
|
||||
|
||||
if (WIN32)
|
||||
set(FFMPEG_LIB_DIR "ffmpeg/windows/x86_64")
|
||||
target_link_libraries(3rdparty_ffmpeg INTERFACE "Bcrypt.lib")
|
||||
elseif(CMAKE_SYSTEM MATCHES "Linux")
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set(FFMPEG_LIB_DIR "ffmpeg/linux/x86_64")
|
||||
elseif(APPLE)
|
||||
set(FFMPEG_LIB_DIR "ffmpeg/macos/x86_64")
|
||||
@@ -304,31 +302,31 @@ else()
|
||||
find_library(FFMPEG_LIB_AVUTIL avutil PATHS ${FFMPEG_LIB_DIR} NO_DEFAULT_PATH)
|
||||
find_library(FFMPEG_LIB_SWSCALE swscale PATHS ${FFMPEG_LIB_DIR} NO_DEFAULT_PATH)
|
||||
find_library(FFMPEG_LIB_SWRESAMPLE swresample PATHS ${FFMPEG_LIB_DIR} NO_DEFAULT_PATH)
|
||||
endif()
|
||||
|
||||
target_include_directories(3rdparty_ffmpeg INTERFACE "ffmpeg/include")
|
||||
|
||||
target_link_libraries(3rdparty_ffmpeg
|
||||
target_link_libraries(3rdparty_ffmpeg
|
||||
INTERFACE
|
||||
${FFMPEG_LIB_AVFORMAT}
|
||||
${FFMPEG_LIB_AVCODEC}
|
||||
${FFMPEG_LIB_AVUTIL}
|
||||
${FFMPEG_LIB_SWSCALE}
|
||||
${FFMPEG_LIB_SWRESAMPLE}
|
||||
)
|
||||
)
|
||||
endif()
|
||||
|
||||
target_include_directories(3rdparty_ffmpeg INTERFACE "ffmpeg/include")
|
||||
endif()
|
||||
|
||||
|
||||
# GLEW
|
||||
add_library(3rdparty_glew INTERFACE)
|
||||
if(NOT MSVC)
|
||||
find_package(GLEW 1.13.0 REQUIRED)
|
||||
find_package(GLEW REQUIRED)
|
||||
target_link_libraries(3rdparty_glew INTERFACE GLEW::GLEW)
|
||||
endif()
|
||||
|
||||
|
||||
# LLVM
|
||||
include(llvm.cmake)
|
||||
add_subdirectory(llvm EXCLUDE_FROM_ALL)
|
||||
|
||||
# WOLFSSL
|
||||
add_subdirectory(wolfssl EXCLUDE_FROM_ALL)
|
||||
@@ -345,6 +343,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")
|
||||
@@ -361,6 +361,9 @@ 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)
|
||||
@@ -389,3 +392,4 @@ 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: c42b6814c2...58cf606b5f
Vendored
+1
-1
@@ -4,7 +4,7 @@ include(ExternalProject)
|
||||
|
||||
ExternalProject_Add(moltenvk
|
||||
GIT_REPOSITORY https://github.com/KhronosGroup/MoltenVK.git
|
||||
GIT_TAG fb581e4
|
||||
GIT_TAG 4c6bfbe
|
||||
BUILD_IN_SOURCE 1
|
||||
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/MoltenVK
|
||||
CONFIGURE_COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/MoltenVK/fetchDependencies" --macos
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
# OpenAL
|
||||
if (MSVC)
|
||||
if (WIN32)
|
||||
find_path(OPENAL_INCLUDE_DIR al.h PATHS include/)
|
||||
find_library(OPENAL_LIBRARY OpenAL32 PATHS libs/Win64/)
|
||||
else()
|
||||
|
||||
+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
@@ -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
+22
-10
@@ -1,24 +1,36 @@
|
||||
# CURL
|
||||
|
||||
if(USE_SYSTEM_CURL)
|
||||
message("-- RPCS3: using shared libcurl")
|
||||
message(STATUS "RPCS3: using shared libcurl")
|
||||
find_package(CURL REQUIRED)
|
||||
add_library(libcurl INTERFACE)
|
||||
target_link_libraries(libcurl INTERFACE CURL::libcurl)
|
||||
else()
|
||||
message("-- RPCS3: building libcurl + wolfssl submodules")
|
||||
add_compile_definitions(HAVE_SNI OPENSSL_EXTRA)
|
||||
option(BUILD_CURL_EXE "Set to ON to build curl executable." OFF)
|
||||
option(CURL_USE_WOLFSSL "enable wolfSSL for SSL/TLS" ON)
|
||||
option(HTTP_ONLY "disables all protocols except HTTP (This overrides all CURL_DISABLE_* options)" ON)
|
||||
option(CURL_ZLIB "Set to ON to enable building curl with zlib support." OFF)
|
||||
option(USE_LIBIDN2 "Use libidn2 for IDN support" OFF) # Disabled because MacOs CI doesn't work otherwise
|
||||
message(STATUS "RPCS3: building libcurl + wolfssl submodules")
|
||||
set(BUILD_CURL_EXE OFF CACHE BOOL "Set to ON to build curl executable.")
|
||||
# If set to ON then CURL can not find our wolfssl
|
||||
set(CURL_USE_WOLFSSL OFF CACHE BOOL "enable wolfSSL for SSL/TLS")
|
||||
set(CURL_USE_OPENSSL OFF CACHE BOOL "Use OpenSSL code. Experimental")
|
||||
set(HTTP_ONLY ON CACHE BOOL "disables all protocols except HTTP (This overrides all CURL_DISABLE_* options)")
|
||||
set(USE_LIBIDN2 OFF CACHE BOOL "Use libidn2 for IDN support") # Disabled because MacOS CI doesn't work otherwise
|
||||
set(CURL_CA_PATH "none" CACHE STRING "Location of default CA path. Set 'none' to disable or 'auto' for auto-detection. Defaults to 'auto'.")
|
||||
if(USE_MSVC_STATIC_CRT)
|
||||
set(CURL_STATIC_CRT ON CACHE BOOL "Use static crt to build curl" FORCE)
|
||||
set(CURL_STATIC_CRT ON CACHE BOOL "Use static crt to build curl")
|
||||
endif()
|
||||
if(WIN32)
|
||||
set(ENABLE_UNICODE ON CACHE BOOL "enable Unicode")
|
||||
endif()
|
||||
set(CURL_USE_LIBSSH2 OFF CACHE BOOL "Use libSSH2")
|
||||
set(CURL_USE_LIBPSL OFF CACHE BOOL "Use libPSL")
|
||||
|
||||
set(SSL_ENABLED ON)
|
||||
set(USE_WOLFSSL ON)
|
||||
|
||||
add_subdirectory(curl EXCLUDE_FROM_ALL)
|
||||
|
||||
set_property(TARGET libcurl PROPERTY FOLDER "3rdparty/")
|
||||
target_link_libraries(libcurl PRIVATE wolfssl)
|
||||
if(MSVC)
|
||||
target_compile_definitions(libcurl PRIVATE HAVE_SSIZE_T)
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
Vendored
+1
-1
Submodule 3rdparty/curl/curl updated: c12fb3ddaf...7ab9d43720
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
@@ -14,7 +14,7 @@ if(APPLE)
|
||||
elseif(CMAKE_SYSTEM MATCHES "Linux")
|
||||
target_link_libraries(3rdparty_hidapi INTERFACE hidapi-hidraw udev)
|
||||
elseif(WIN32)
|
||||
target_link_libraries(3rdparty_hidapi INTERFACE hidapi-hid Shlwapi.lib)
|
||||
target_link_libraries(3rdparty_hidapi INTERFACE hidapi::hidapi hidapi::include Shlwapi.lib)
|
||||
else()
|
||||
target_link_libraries(3rdparty_hidapi INTERFACE hidapi-libusb usb)
|
||||
endif()
|
||||
|
||||
Vendored
+1
-1
Submodule 3rdparty/hidapi/hidapi updated: ecf1b62882...8b43a97a93
Vendored
+5
-4
@@ -2,14 +2,15 @@
|
||||
# Select the version of libpng to use, default is builtin
|
||||
if (NOT USE_SYSTEM_LIBPNG)
|
||||
# We use libpng's static library and don't need to build the shared library and run the tests
|
||||
set(PNG_SHARED OFF CACHE BOOL "Build shared lib" FORCE)
|
||||
set(PNG_TESTS OFF CACHE BOOL "Build libpng tests" FORCE)
|
||||
set(PNG_BUILD_ZLIB ON CACHE BOOL "ZLIB is already build or package is found" FORCE)
|
||||
set(PNG_SHARED OFF CACHE BOOL "Build shared lib")
|
||||
set(PNG_TESTS OFF CACHE BOOL "Build libpng tests")
|
||||
set(PNG_BUILD_ZLIB ON CACHE BOOL "ZLIB is already build or package is found")
|
||||
set(SKIP_INSTALL_ALL ON)
|
||||
add_subdirectory(libpng EXCLUDE_FROM_ALL)
|
||||
target_include_directories(png_static INTERFACE "${libpng_BINARY_DIR}" "${libpng_SOURCE_DIR}")
|
||||
target_link_libraries(png_static 3rdparty::zlib)
|
||||
|
||||
set(LIBPNG_TARGET png_static PARENT_SCOPE)
|
||||
set(LIBPNG_TARGET png_static PARENT_SCOPE)
|
||||
else()
|
||||
find_package(PNG REQUIRED)
|
||||
|
||||
|
||||
Vendored
+1
-1
Submodule 3rdparty/libpng/libpng updated: 07b8803110...f135775ad4
Vendored
+1
-1
Submodule 3rdparty/libsdl-org/SDL updated: adf31f6ec0...ffa78e6bea
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
+1
-1
@@ -1,4 +1,4 @@
|
||||
cmake_minimum_required(VERSION 2.8.4)
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
|
||||
project(libusb)
|
||||
|
||||
|
||||
Vendored
+5
-1
@@ -89,7 +89,11 @@ set(PACKAGE_URL "http://www.libusb.org" CACHE INTERNAL "package url" FORCE)
|
||||
set(PACKAGE_TARNAME "libusb" CACHE INTERNAL "tarball name" FORCE)
|
||||
set(VERSION "${PACKAGE_VERSION}" CACHE INTERNAL "version" FORCE)
|
||||
|
||||
configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h @ONLY)
|
||||
if(MSVC)
|
||||
file(COPY libusb/msvc/config.h DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
||||
else()
|
||||
configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h @ONLY)
|
||||
endif()
|
||||
message(STATUS "Generated configuration file in ${CMAKE_CURRENT_BINARY_DIR}/config.h")
|
||||
|
||||
# for generated config.h
|
||||
|
||||
Vendored
+8
-17
@@ -3,22 +3,6 @@ include(os.cmake)
|
||||
include(config.cmake)
|
||||
include(FindThreads)
|
||||
|
||||
set (LIBUSB_COMMON
|
||||
core.c
|
||||
descriptor.c
|
||||
io.c
|
||||
sync.c
|
||||
hotplug.c
|
||||
strerror.c
|
||||
libusb-1.0.rc
|
||||
libusb-1.0.def
|
||||
)
|
||||
|
||||
foreach(SRC IN LISTS LIBUSB_COMMON)
|
||||
list(APPEND LIBUSB_COMMON_FINAL ${LIBUSB_SOURCE_DIR}/libusb/${SRC})
|
||||
endforeach()
|
||||
|
||||
|
||||
include_directories(${LIBUSB_SOURCE_DIR}/libusb)
|
||||
include_directories(${LIBUSB_SOURCE_DIR}/libusb/os)
|
||||
|
||||
@@ -28,7 +12,14 @@ endif()
|
||||
|
||||
add_library(usb-1.0-static
|
||||
STATIC
|
||||
${LIBUSB_COMMON_FINAL}
|
||||
libusb/libusb/core.c
|
||||
libusb/libusb/descriptor.c
|
||||
libusb/libusb/io.c
|
||||
libusb/libusb/sync.c
|
||||
libusb/libusb/hotplug.c
|
||||
libusb/libusb/strerror.c
|
||||
libusb/libusb/libusb-1.0.rc
|
||||
libusb/libusb/libusb-1.0.def
|
||||
${LIBUSB_PLATFORM}
|
||||
)
|
||||
|
||||
|
||||
Vendored
+22
-21
@@ -5,42 +5,43 @@ if (CMAKE_USE_PTHREADS_INIT)
|
||||
set(PTHREADS_ENABLED TRUE)
|
||||
endif()
|
||||
|
||||
if (WIN32 OR "${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
|
||||
if (CYGWIN)
|
||||
add_compile_definitions(PLATFORM_WINDOWS=1)
|
||||
set(OS_WINDOWS 1 CACHE INTERNAL "controls config.h macro definition" FORCE)
|
||||
set(OS_WINDOWS 1)
|
||||
|
||||
# Enable MingW support for RC language (for CMake pre-2.8)
|
||||
if (MINGW)
|
||||
set(CMAKE_RC_COMPILER_INIT windres)
|
||||
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <FLAGS> -O coff <DEFINES> -i <SOURCE> -o <OBJECT>")
|
||||
endif()
|
||||
enable_language(RC)
|
||||
|
||||
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
|
||||
message(STATUS "Detected cygwin")
|
||||
set(PTHREADS_ENABLED TRUE)
|
||||
set(WITHOUT_POLL_H TRUE CACHE INTERNAL "Disable using poll.h even if it's available - use windows poll instead fo cygwin's" FORCE)
|
||||
endif()
|
||||
message(STATUS "Detected Cygwin")
|
||||
set(PTHREADS_ENABLED TRUE)
|
||||
set(WITHOUT_POLL_H TRUE)
|
||||
|
||||
list(APPEND PLATFORM_SRC
|
||||
events_windows.c
|
||||
windows_usbdk.c
|
||||
windows_common.c
|
||||
windows_winusb.c
|
||||
threads_windows.c
|
||||
)
|
||||
|
||||
if (PTHREADS_ENABLED AND NOT WITHOUT_PTHREADS)
|
||||
list(APPEND PLATFORM_SRC threads_posix)
|
||||
else()
|
||||
list(APPEND PLATFORM_SRC threads_windows.c)
|
||||
endif()
|
||||
elseif(WIN32)
|
||||
add_compile_definitions(PLATFORM_WINDOWS=1)
|
||||
set(OS_WINDOWS 1)
|
||||
set(PTHREADS_ENABLED FALSE)
|
||||
|
||||
list(APPEND PLATFORM_SRC
|
||||
events_windows.c
|
||||
windows_usbdk.c
|
||||
windows_common.c
|
||||
windows_winusb.c
|
||||
)
|
||||
|
||||
list(APPEND PLATFORM_SRC threads_windows.c)
|
||||
elseif (APPLE)
|
||||
# Apple != OSX alone
|
||||
add_compile_definitions(PLATFORM_POSIX=1 HAVE_CLOCK_GETTIME)
|
||||
set(OS_DARWIN 1 CACHE INTERNAL "controls config.h macro definition" FORCE)
|
||||
set(OS_DARWIN 1)
|
||||
|
||||
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
set(PLATFORM_SRC
|
||||
darwin_usb.c
|
||||
threads_posix.c
|
||||
@@ -77,7 +78,7 @@ elseif (UNIX)
|
||||
# Unix is for all *NIX systems including OSX
|
||||
add_compile_definitions(PLATFORM_POSIX=1 HAVE_CLOCK_GETTIME)
|
||||
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
|
||||
set(OS_LINUX 1 CACHE INTERNAL "controls config.h macro definition" FORCE)
|
||||
set(OS_LINUX 1)
|
||||
|
||||
set(PLATFORM_SRC
|
||||
linux_usbfs.c
|
||||
@@ -108,4 +109,4 @@ set(LIBUSB_LIBRARIES ${LIBUSB_LIBRARIES} PARENT_SCOPE)
|
||||
if (WITHOUT_PTHREADS)
|
||||
set(PTHREADS_ENABLED FALSE)
|
||||
endif()
|
||||
set(THREADS_POSIX ${PTHREADS_ENABLED} CACHE INTERNAL "use pthreads" FORCE)
|
||||
set(THREADS_POSIX ${PTHREADS_ENABLED})
|
||||
|
||||
Vendored
-93
@@ -1,93 +0,0 @@
|
||||
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)
|
||||
message(STATUS "LLVM will be built from the submodule.")
|
||||
|
||||
set(LLVM_TARGETS_TO_BUILD "AArch64;X86")
|
||||
option(LLVM_BUILD_RUNTIME OFF)
|
||||
option(LLVM_BUILD_TOOLS OFF)
|
||||
option(LLVM_INCLUDE_BENCHMARKS OFF)
|
||||
option(LLVM_INCLUDE_DOCS OFF)
|
||||
option(LLVM_INCLUDE_EXAMPLES OFF)
|
||||
option(LLVM_INCLUDE_TESTS OFF)
|
||||
option(LLVM_INCLUDE_TOOLS OFF)
|
||||
option(LLVM_INCLUDE_UTILS OFF)
|
||||
option(LLVM_CCACHE_BUILD ON)
|
||||
|
||||
if(WIN32)
|
||||
set(LLVM_USE_INTEL_JITEVENTS ON)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM MATCHES "Linux")
|
||||
set(LLVM_USE_INTEL_JITEVENTS ON)
|
||||
set(LLVM_USE_PERF ON)
|
||||
endif()
|
||||
|
||||
set(CXX_FLAGS_OLD ${CMAKE_CXX_FLAGS})
|
||||
|
||||
if (MSVC)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS")
|
||||
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/")
|
||||
|
||||
set(CMAKE_CXX_FLAGS ${CXX_FLAGS_OLD})
|
||||
|
||||
# now tries to find LLVM again
|
||||
find_package(LLVM 13.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")
|
||||
|
||||
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)
|
||||
|
||||
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.")
|
||||
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.")
|
||||
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)
|
||||
endif()
|
||||
|
||||
add_library(3rdparty_llvm INTERFACE)
|
||||
target_link_libraries(3rdparty_llvm INTERFACE ${LLVM_LIBS})
|
||||
target_include_directories(3rdparty_llvm INTERFACE ${LLVM_INCLUDE_DIRS})
|
||||
target_compile_definitions(3rdparty_llvm INTERFACE ${LLVM_DEFINITIONS} -DLLVM_AVAILABLE)
|
||||
|
||||
add_library(3rdparty::llvm ALIAS 3rdparty_llvm)
|
||||
else()
|
||||
add_library(3rdparty::llvm ALIAS 3rdparty_dummy_lib)
|
||||
endif()
|
||||
Vendored
+99
@@ -0,0 +1,99 @@
|
||||
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)
|
||||
message(STATUS "LLVM will be built from the submodule.")
|
||||
|
||||
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)
|
||||
option(LLVM_INCLUDE_DOCS OFF)
|
||||
option(LLVM_INCLUDE_EXAMPLES OFF)
|
||||
option(LLVM_INCLUDE_TESTS OFF)
|
||||
option(LLVM_INCLUDE_TOOLS OFF)
|
||||
option(LLVM_INCLUDE_UTILS OFF)
|
||||
# we globally enable ccache
|
||||
set(LLVM_CCACHE_BUILD OFF CACHE BOOL "Set to ON for a ccache enabled build")
|
||||
|
||||
if(WIN32)
|
||||
set(LLVM_USE_INTEL_JITEVENTS ON)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set(LLVM_USE_INTEL_JITEVENTS ON)
|
||||
set(LLVM_USE_PERF ON)
|
||||
endif()
|
||||
|
||||
if (MSVC)
|
||||
add_compile_definitions("$<$<COMPILE_LANGUAGE:CXX>:_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS>")
|
||||
endif()
|
||||
|
||||
# LLVM needs to be built out-of-tree
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/llvm/llvm ${CMAKE_CURRENT_BINARY_DIR}/llvm_build EXCLUDE_FROM_ALL)
|
||||
set(LLVM_DIR "${CMAKE_CURRENT_BINARY_DIR}/llvm_build/lib/cmake/llvm/")
|
||||
|
||||
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 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 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 16.0 CONFIG)
|
||||
|
||||
if (NOT LLVM_FOUND)
|
||||
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 option to build LLVM from included as a git submodule.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
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 AND BUILD_LLVM) OR CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
list (APPEND LLVM_ADDITIONAL_LIBS IntelJITEvents)
|
||||
endif()
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
list (APPEND 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)
|
||||
target_link_libraries(3rdparty_llvm INTERFACE ${LLVM_LIBS})
|
||||
target_include_directories(3rdparty_llvm INTERFACE ${LLVM_INCLUDE_DIRS})
|
||||
separate_arguments(LLVM_DEFINITIONS_LIST NATIVE_COMMAND ${LLVM_DEFINITIONS})
|
||||
target_compile_definitions(3rdparty_llvm INTERFACE ${LLVM_DEFINITIONS_LIST} LLVM_AVAILABLE)
|
||||
|
||||
add_library(3rdparty::llvm ALIAS 3rdparty_llvm)
|
||||
else()
|
||||
add_library(3rdparty::llvm ALIAS 3rdparty_dummy_lib)
|
||||
endif()
|
||||
+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
+1
-1
Submodule 3rdparty/miniupnp/miniupnp updated: f4a739d730...e439318cf7
Vendored
+16
-5
@@ -12,24 +12,32 @@
|
||||
#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
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
constexpr SOCKET invalid_socket = INVALID_SOCKET;
|
||||
#else
|
||||
constexpr int invalid_socket = -1;
|
||||
#endif
|
||||
|
||||
namespace pine
|
||||
{
|
||||
/**
|
||||
@@ -379,7 +387,7 @@ namespace pine
|
||||
|
||||
m_msgsock = accept(m_sock, 0, 0);
|
||||
|
||||
if (m_msgsock == -1)
|
||||
if (m_msgsock == invalid_socket)
|
||||
{
|
||||
// everything else is non recoverable in our scope
|
||||
// we also mark as recoverable socket errors where it would block a
|
||||
@@ -533,10 +541,13 @@ 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)
|
||||
if (bind(m_sock, reinterpret_cast<struct sockaddr*>(&server), sizeof(server)) == SOCKET_ERROR)
|
||||
{
|
||||
Impl::error("IPC: Error while binding to socket! Shutting down...");
|
||||
return;
|
||||
|
||||
Vendored
+2
-2
@@ -20,7 +20,7 @@ endif()
|
||||
if(NOT Qt5Widgets_FOUND)
|
||||
if(Qt5Widgets_VERSION VERSION_LESS ${QT_MIN_VER})
|
||||
message("Minimum supported Qt5 version is ${QT_MIN_VER}! You have version ${Qt5Widgets_VERSION} installed, please upgrade!")
|
||||
if(CMAKE_SYSTEM MATCHES "Linux")
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
message(FATAL_ERROR "Most distros do not provide an up-to-date version of Qt.
|
||||
If you're on Ubuntu or Linux Mint, there are PPAs you can use to install one of the latest qt5 versions.
|
||||
Find the correct ppa at https://launchpad.net/~beineri and follow the instructions.")
|
||||
@@ -35,7 +35,7 @@ Find the correct ppa at https://launchpad.net/~beineri and follow the instructio
|
||||
if(WIN32)
|
||||
message(FATAL_ERROR "Make sure the QTDIR env variable has been set properly. (for example C:\\Qt\\${QT_MIN_VER}\\msvc2019_64\\)
|
||||
You can also try setting the Qt5_DIR preprocessor definiton.")
|
||||
elseif(CMAKE_SYSTEM MATCHES "Linux")
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
message(FATAL_ERROR "Make sure to install your distro's qt5 package!")
|
||||
else()
|
||||
message(FATAL_ERROR "You need to have Qt5 installed, look online for instructions on installing Qt5 on ${CMAKE_SYSTEM}.")
|
||||
|
||||
+2551
File diff suppressed because it is too large
Load Diff
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
+17
-31
@@ -1,40 +1,26 @@
|
||||
if(USE_SYSTEM_WOLFSSL)
|
||||
message("-- RPCS3: using shared wolfssl")
|
||||
message(STATUS "RPCS3: using shared wolfssl")
|
||||
pkg_check_modules(WolfSSL REQUIRED IMPORTED_TARGET wolfssl>=4.7.0)
|
||||
add_library(wolfssl INTERFACE)
|
||||
target_link_libraries(wolfssl INTERFACE PkgConfig::WolfSSL)
|
||||
else()
|
||||
# TODO(cjj19970505@live.cn)
|
||||
# OPENSSL_EXTRA, and HAVE_SNI are unconfigurable from CMake cache.
|
||||
# but they do have it in a TODO list (wolfssl/CMakeList, 1021)
|
||||
add_compile_definitions(OPENSSL_EXTRA WOLFSSL_DES_ECB HAVE_SNI HAVE_WRITE_DUP)
|
||||
add_compile_definitions(FP_MAX_BITS=8192)
|
||||
|
||||
set(WOLFSSL_TLS13 "no" CACHE INTERNAL "")
|
||||
set(WOLFSSL_SHA224 "yes" CACHE INTERNAL "")
|
||||
set(WOLFSSL_SHA3 "yes" CACHE INTERNAL "")
|
||||
set(WOLFSSL_SHAKE256 "yes" CACHE INTERNAL "")
|
||||
set(WOLFSSL_BASE64_ENCODE "no" CACHE INTERNAL "")
|
||||
set(WOLFSSL_DES3 "yes" CACHE INTERNAL "")
|
||||
set(WOLFSSL_POLY1305 "yes" CACHE INTERNAL "")
|
||||
set(WOLFSSL_CHACHA "yes" CACHE INTERNAL "")
|
||||
set(WOLFSSL_FILESYSTEM "yes" CACHE INTERNAL "")
|
||||
set(WOLFSSL_PWDBASED "yes" CACHE INTERNAL "")
|
||||
set(WOLFSSL_FAST_MATH "yes" CACHE INTERNAL "")
|
||||
set(WOLFSSL_EXAMPLES "no" CACHE INTERNAL "")
|
||||
set(WOLFSSL_CRYPT_TESTS "no" CACHE INTERNAL "")
|
||||
set(WOLFSSL_ASYNC_THREADS "no" CACHE INTERNAL "")
|
||||
set(WOLFSSL_CONFIG_H "no" CACHE INTERNAL "")
|
||||
set(WOLFSSL_TLS13 OFF CACHE STRING "Enable wolfSSL TLS v1.3 (default: enabled)")
|
||||
set(WOLFSSL_SHA3 ON CACHE STRING "Enable wolfSSL SHA-3 support (default: enabled on x86_64/aarch64)")
|
||||
set(WOLFSSL_SHAKE256 ON CACHE STRING "Enable wolfSSL SHAKE256 support (default: enabled on x86_64/aarch64)")
|
||||
set(WOLFSSL_BASE64_ENCODE OFF CACHE STRING "Enable Base64 encoding (default: enabled on x86_64)")
|
||||
set(WOLFSSL_DES3 ON CACHE STRING "Enable DES3 (default: disabled)")
|
||||
set(WOLFSSL_PWDBASED ON CACHE STRING "Enable PWDBASED (default: disabled)")
|
||||
set(WOLFSSL_FAST_MATH ON CACHE STRING "Enable fast math ops (default: disabled)")
|
||||
set(WOLFSSL_EXAMPLES OFF CACHE STRING "Enable examples (default: enabled)")
|
||||
set(WOLFSSL_CRYPT_TESTS OFF CACHE STRING "Enable Crypt Bench/Test (default: enabled)")
|
||||
set(WOLFSSL_ASYNC_THREADS OFF CACHE STRING "Enable Asynchronous Threading (default: enabled)")
|
||||
set(WOLFSSL_BUILD_OUT_OF_TREE ON CACHE STRING "Don't generate files in the source tree (default: no)")
|
||||
set(WOLFSSL_SNI ON CACHE STRING "Enable SNI (default: disabled)")
|
||||
set(WOLFSSL_OPENSSLEXTRA ON CACHE STRING "Enable extra OpenSSL API, size+ (default: disabled)")
|
||||
set(WOLFSSL_HARDEN OFF CACHE STRING "Enable Hardened build, Enables Timing Resistance and Blinding (default: enabled)")
|
||||
|
||||
add_subdirectory(wolfssl EXCLUDE_FROM_ALL)
|
||||
|
||||
set(WolfSSL_LIBRARY "$<TARGET_FILE:wolfssl>" CACHE INTERNAL "")
|
||||
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/wolfssl/wolfssl/" provides openssl headers
|
||||
# So that curl can be built on an environment where openssl headers are not provided
|
||||
set(WolfSSL_INCLUDE_DIR
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/wolfssl/"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/wolfssl/wolfssl/"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/wolfssl/"
|
||||
CACHE INTERNAL "")
|
||||
target_compile_definitions(wolfssl PUBLIC WOLFSSL_DES_ECB HAVE_WRITE_DUP)
|
||||
target_compile_definitions(wolfssl PUBLIC FP_MAX_BITS=8192)
|
||||
endif()
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#define NO_PSK
|
||||
#define HAVE_EXTENDED_MASTER
|
||||
#define WOLFSSL_SNIFFER
|
||||
#define WOLFSSL_IGNORE_FILE_WARN
|
||||
#define HAVE_AESGCM
|
||||
#define HAVE_SUPPORTED_CURVES
|
||||
#define HAVE_TLS_EXTENSIONS
|
||||
@@ -63,11 +64,16 @@ extern FILE* wolfSSL_fopen_utf8(const char* name, const char* mode);
|
||||
#define XFWRITE fwrite
|
||||
#define XFCLOSE fclose
|
||||
#define XSEEK_END SEEK_END
|
||||
#define XSEEK_SET SEEK_SET
|
||||
#define XBADFILE NULL
|
||||
#define XFGETS fgets
|
||||
#define XFPRINTF fprintf
|
||||
#define XFFLUSH fflush
|
||||
|
||||
/* For some reason we need to define ssize_t */
|
||||
#define HAVE_SSIZE_T
|
||||
#define ssize_t __int64
|
||||
|
||||
#include <sys/stat.h>
|
||||
extern int wolfSSL_stat_utf8(const char* path, struct _stat* buffer);
|
||||
#define XSTAT wolfSSL_stat_utf8
|
||||
|
||||
Vendored
+1
-1
Submodule 3rdparty/wolfssl/wolfssl updated: 4fbd4fd36a...3b3c175af0
Vendored
+1
@@ -73,6 +73,7 @@
|
||||
<ItemGroup>
|
||||
<ClCompile Include="wolfssl\src\crl.c" />
|
||||
<ClCompile Include="wolfssl\src\internal.c" />
|
||||
<ClCompile Include="wolfssl\src\ssl_asn1.c" />
|
||||
<ClCompile Include="wolfssl\src\wolfio.c" />
|
||||
<ClCompile Include="wolfssl\src\keys.c" />
|
||||
<ClCompile Include="wolfssl\src\ocsp.c" />
|
||||
|
||||
Vendored
+11
-9
@@ -1,14 +1,16 @@
|
||||
if (USE_SYSTEM_ZLIB)
|
||||
message(STATUS "-- RPCS3: Using syztem ZLIB")
|
||||
find_package(ZLIB QUIET)
|
||||
message(STATUS "RPCS3: Using system ZLIB")
|
||||
find_package(ZLIB QUIET)
|
||||
|
||||
add_library(3rdparty_zlib INTERFACE)
|
||||
target_link_libraries(3rdparty_zlib INTERFACE ${ZLIB_LIBRARIES})
|
||||
target_include_directories(3rdparty_zlib INTERFACE ${ZLIB_INCLUDE_DIRS})
|
||||
else()
|
||||
message(STATUS "-- RPCS3: Using builtin ZLIB")
|
||||
message(STATUS "RPCS3: Using builtin ZLIB")
|
||||
set(SKIP_INSTALL_ALL ON)
|
||||
add_subdirectory(zlib EXCLUDE_FROM_ALL)
|
||||
set(ZLIB_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/zlib" "${CMAKE_CURRENT_BINARY_DIR}/zlib")
|
||||
set(ZLIB_LIBRARY zlibstatic)
|
||||
endif()
|
||||
|
||||
add_library(3rdparty_zlib INTERFACE)
|
||||
target_link_libraries(3rdparty_zlib INTERFACE ${ZLIB_LIBRARY})
|
||||
target_include_directories(3rdparty_zlib INTERFACE ${ZLIB_INCLUDE_DIR})
|
||||
add_library(3rdparty_zlib INTERFACE)
|
||||
target_link_libraries(3rdparty_zlib INTERFACE zlibstatic)
|
||||
target_include_directories(3rdparty_zlib INTERFACE zlib ${CMAKE_CURRENT_BINARY_DIR}/zlib)
|
||||
endif()
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
+18
-21
@@ -1,12 +1,14 @@
|
||||
cmake_minimum_required(VERSION 3.16.9)
|
||||
|
||||
project(rpcs3)
|
||||
project(rpcs3 LANGUAGES C CXX)
|
||||
|
||||
if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11)
|
||||
message(FATAL_ERROR "RPCS3 requires at least gcc-11.")
|
||||
endif()
|
||||
elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.0)
|
||||
message(FATAL_ERROR "RPCS3 requires at least clang-12.0.")
|
||||
endif()
|
||||
@@ -14,7 +16,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)
|
||||
@@ -24,7 +27,7 @@ option(USE_PRECOMPILED_HEADERS "Use precompiled headers" OFF)
|
||||
option(USE_SDL "Enables SDL input handler" OFF)
|
||||
option(USE_SYSTEM_SDL "Prefer system SDL instead of the builtin one" OFF)
|
||||
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/buildfiles/cmake")
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/buildfiles/cmake")
|
||||
|
||||
include(CheckCXXCompilerFlag)
|
||||
|
||||
@@ -42,7 +45,7 @@ else()
|
||||
endif()
|
||||
|
||||
if(CMAKE_BUILD_TYPE MATCHES "Debug" AND NOT MSVC)
|
||||
add_definitions(-D_DEBUG)
|
||||
add_compile_definitions(_DEBUG)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
@@ -74,7 +77,7 @@ if(MSVC)
|
||||
# TODO(cjj19970505@live.cn)
|
||||
# offical QT uses dynamic CRT.
|
||||
# When building our lib with static CRT and debug build type
|
||||
# and linking with Qt with dynmaic CRT and debug build,
|
||||
# and linking with Qt with dynamic CRT and debug build,
|
||||
# error is encountered in runtime (which is expected).
|
||||
# But building our lib with static CRT and release build type,
|
||||
# and linking with Qt with dynamic CRT and release build seems to be working,
|
||||
@@ -89,6 +92,7 @@ if(MSVC)
|
||||
message(AUTHOR_WARNING "Debug build currently can not work with static CRT.")
|
||||
endif()
|
||||
endif()
|
||||
add_compile_options(/MP)
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
@@ -97,13 +101,12 @@ endif()
|
||||
|
||||
find_program(CCACHE_FOUND ccache)
|
||||
if(CCACHE_FOUND)
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
|
||||
set(CMAKE_CXX_COMPILER_LAUNCHER ccache)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
add_definitions(-DUNICODE)
|
||||
add_definitions(-D_WIN32_WINNT=0x0602)
|
||||
add_compile_definitions(UNICODE)
|
||||
add_compile_definitions(_WIN32_WINNT=0x0602)
|
||||
endif()
|
||||
|
||||
if(APPLE AND CMAKE_OSX_ARCHITECTURES STREQUAL "arm64")
|
||||
@@ -111,10 +114,7 @@ if(APPLE AND CMAKE_OSX_ARCHITECTURES STREQUAL "arm64")
|
||||
link_directories(/opt/homebrew/lib)
|
||||
endif()
|
||||
|
||||
# Warnings are silenced for 3rdparty code
|
||||
set(CMAKE_CXX_FLAGS -w)
|
||||
set(CMAKE_C_FLAGS -w)
|
||||
set(LLVM_ENABLE_WARNINGS OFF CACHE BOOL "")
|
||||
set(LLVM_ENABLE_WARNINGS OFF CACHE BOOL "Enable compiler warnings.")
|
||||
|
||||
if(MSVC)
|
||||
add_compile_options(/wd4530 /utf-8) # C++ exception handler used, but unwind semantics are not enabled
|
||||
@@ -122,9 +122,6 @@ endif()
|
||||
|
||||
add_subdirectory(3rdparty)
|
||||
|
||||
unset(CMAKE_CXX_FLAGS)
|
||||
unset(CMAKE_C_FLAGS)
|
||||
|
||||
if (DISABLE_LTO)
|
||||
if (CMAKE_C_FLAGS)
|
||||
string(REGEX REPLACE "-flto[^ ]*" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
|
||||
@@ -136,7 +133,7 @@ endif()
|
||||
|
||||
string(FIND "${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS}" "-flto" FOUND_LTO)
|
||||
if (NOT FOUND_LTO EQUAL -1)
|
||||
message(FATAL_ERROR "Rpcs3 doesn't support building with LTO, use -DDISABLE_LTO=TRUE to force-disable it")
|
||||
message(FATAL_ERROR "RPCS3 doesn't support building with LTO, use -DDISABLE_LTO=TRUE to force-disable it")
|
||||
endif()
|
||||
|
||||
if(NOT WIN32)
|
||||
@@ -148,6 +145,6 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${PROJECT_BINARY_DIR}/bin")
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${PROJECT_BINARY_DIR}/bin")
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${PROJECT_BINARY_DIR}/bin")
|
||||
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
add_subdirectory(rpcs3)
|
||||
|
||||
set_directory_properties(PROPERTIES VS_STARTUP_PROJECT rpcs3)
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"version": 3,
|
||||
"configurePresets": [
|
||||
{
|
||||
"name": "gcc",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "build-gcc",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug",
|
||||
"USE_FAUDIO": "OFF",
|
||||
"USE_SYSTEM_CURL": "OFF",
|
||||
"USE_SYSTEM_ZLIB": "OFF",
|
||||
"USE_SYSTEM_LIBPNG": "OFF",
|
||||
"USE_NATIVE_INSTRUCTIONS": "ON",
|
||||
"USE_PRECOMPILED_HEADERS": "ON",
|
||||
"BUILD_LLVM": "OFF",
|
||||
"STATIC_LINK_LLVM": "ON"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "clang",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "build-clang64",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug",
|
||||
"USE_FAUDIO": "OFF",
|
||||
"USE_SYSTEM_CURL": "OFF",
|
||||
"USE_SYSTEM_ZLIB": "OFF",
|
||||
"USE_SYSTEM_LIBPNG": "OFF",
|
||||
"LLVM_ENABLE_LIBCXX": "ON",
|
||||
"USE_NATIVE_INSTRUCTIONS": "ON",
|
||||
"USE_PRECOMPILED_HEADERS": "ON",
|
||||
"BUILD_LLVM": "OFF",
|
||||
"STATIC_LINK_LLVM": "ON"
|
||||
},
|
||||
"environment": {
|
||||
"CXX": "clang++",
|
||||
"CC": "clang"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "msvc",
|
||||
"displayName": "Windows x64",
|
||||
"generator": "Visual Studio 17 2022",
|
||||
"binaryDir": "build-msvc",
|
||||
"architecture": {
|
||||
"value": "x64",
|
||||
"strategy": "external"
|
||||
},
|
||||
"cacheVariables": {
|
||||
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}",
|
||||
"USE_FAUDIO": "OFF",
|
||||
"USE_PRECOMPILED_HEADERS": "ON",
|
||||
"USE_SYSTEM_ZLIB": "OFF",
|
||||
"USE_NATIVE_INSTRUCTIONS": "ON",
|
||||
"BUILD_LLVM": "ON",
|
||||
"STATIC_LINK_LLVM": "ON"
|
||||
},
|
||||
"vendor": {
|
||||
"microsoft.com/VisualStudioSettings/CMake/1.0": {
|
||||
"hostOS": [
|
||||
"Windows"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+2
-2
@@ -725,7 +725,7 @@ namespace CRCPP
|
||||
{
|
||||
while (size--)
|
||||
{
|
||||
#if defined(WIN32) || defined(_WIN32) || defined(WINCE)
|
||||
#ifdef _MSC_VER
|
||||
// Disable warning about data loss when doing (remainder >> CHAR_BIT) when
|
||||
// remainder is one byte long. The algorithm is still correct in this case,
|
||||
// though it's possible that one additional machine instruction will be executed.
|
||||
@@ -733,7 +733,7 @@ namespace CRCPP
|
||||
# pragma warning (disable : 4333)
|
||||
#endif
|
||||
remainder = (remainder >> CHAR_BIT) ^ lookupTable[static_cast<unsigned char>(remainder ^ *current++)];
|
||||
#if defined(WIN32) || defined(_WIN32) || defined(WINCE)
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning (pop)
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -7,6 +7,12 @@
|
||||
|
||||
LOG_CHANNEL(cfg_log, "CFG");
|
||||
|
||||
template <>
|
||||
void fmt_class_string<cfg::node>::format(std::string& out, u64 arg)
|
||||
{
|
||||
out += get_object(arg).to_string();
|
||||
}
|
||||
|
||||
namespace cfg
|
||||
{
|
||||
_base::_base(type _type)
|
||||
@@ -23,9 +29,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +67,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;
|
||||
}
|
||||
|
||||
|
||||
@@ -226,6 +226,11 @@ namespace cfg
|
||||
return m_value;
|
||||
}
|
||||
|
||||
T get_default() const
|
||||
{
|
||||
return def;
|
||||
}
|
||||
|
||||
void set(T value)
|
||||
{
|
||||
m_value = value;
|
||||
|
||||
+152
-19
@@ -130,6 +130,7 @@ static fs::error to_error(DWORD e)
|
||||
case ERROR_NOT_READY: return fs::error::noent;
|
||||
case ERROR_FILENAME_EXCED_RANGE: return fs::error::toolong;
|
||||
case ERROR_DISK_FULL: return fs::error::nospace;
|
||||
case ERROR_NOT_SAME_DEVICE: return fs::error::xdev;
|
||||
default: return fs::error::unknown;
|
||||
}
|
||||
}
|
||||
@@ -172,6 +173,7 @@ static fs::error to_error(int e)
|
||||
case EROFS: return fs::error::readonly;
|
||||
case EISDIR: return fs::error::isdir;
|
||||
case ENOSPC: return fs::error::nospace;
|
||||
case EXDEV: return fs::error::xdev;
|
||||
default: return fs::error::unknown;
|
||||
}
|
||||
}
|
||||
@@ -225,9 +227,9 @@ namespace fs
|
||||
{
|
||||
}
|
||||
|
||||
[[noreturn]] stat_t file_base::stat()
|
||||
[[noreturn]] stat_t file_base::get_stat()
|
||||
{
|
||||
fmt::throw_exception("fs::file::stat() not supported.");
|
||||
fmt::throw_exception("fs::file::get_stat() not supported.");
|
||||
}
|
||||
|
||||
void file_base::sync()
|
||||
@@ -244,6 +246,11 @@ namespace fs
|
||||
#endif
|
||||
}
|
||||
|
||||
file_id file_base::get_id()
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
u64 file_base::write_gather(const iovec_clone* buffers, u64 buf_count)
|
||||
{
|
||||
u64 total = 0;
|
||||
@@ -272,6 +279,66 @@ namespace fs
|
||||
return this->write(buf.get(), total);
|
||||
}
|
||||
|
||||
file_id::operator bool() const
|
||||
{
|
||||
return !type.empty() && !data.empty();
|
||||
}
|
||||
|
||||
// Test if identical
|
||||
// For example: when LHS writes one byte to a file at X offset, RHS file be able to read that exact byte at X offset)
|
||||
bool file_id::is_mirror_of(const file_id& rhs) const
|
||||
{
|
||||
// If either is an invalid ID we cannot compare safely, return false
|
||||
return rhs && type == rhs.type && data == rhs.data;
|
||||
}
|
||||
|
||||
// Test if both files point to the same file
|
||||
// For example: if a file descriptor pointing to the complete file exists and is being truncated to 0 bytes from non-
|
||||
// -zero size state: this has to affect both RHS and LHS files.
|
||||
bool file_id::is_coherent_with(const file_id& rhs) const
|
||||
{
|
||||
struct id_view
|
||||
{
|
||||
std::string_view type_view;
|
||||
std::basic_string_view<u8> data_view;
|
||||
};
|
||||
|
||||
id_view _rhs{rhs.type, {rhs.data.data(), rhs.data.size()}};
|
||||
id_view _lhs{type, {data.data(), data.size()}};
|
||||
|
||||
// Peek through fs::file wrappers
|
||||
auto peek_wrapppers = [](id_view& id)
|
||||
{
|
||||
u64 offset_count = 0;
|
||||
constexpr auto lv2_view = "lv2_file::file_view: "sv;
|
||||
|
||||
for (usz pos = 0; (pos = id.type_view.find(lv2_view, pos)) != umax; pos += lv2_view.size())
|
||||
{
|
||||
offset_count++;
|
||||
}
|
||||
|
||||
// Remove offsets data
|
||||
id.data_view.remove_suffix(sizeof(u64) * offset_count);
|
||||
|
||||
// Get last category identifier
|
||||
if (usz sep = id.type_view.rfind(": "); sep != umax)
|
||||
{
|
||||
id.type_view.remove_prefix(sep + 2);
|
||||
}
|
||||
};
|
||||
|
||||
peek_wrapppers(_rhs);
|
||||
peek_wrapppers(_lhs);
|
||||
|
||||
// If either is an invalid ID we cannot compare safely, return false
|
||||
if (_rhs.type_view.empty() || _rhs.data_view.empty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return _rhs.type_view == _lhs.type_view && _rhs.data_view == _lhs.data_view;
|
||||
}
|
||||
|
||||
dir_base::~dir_base()
|
||||
{
|
||||
}
|
||||
@@ -384,12 +451,12 @@ shared_ptr<fs::device_base> fs::set_virtual_device(const std::string& name, shar
|
||||
return get_device_manager().set_device(name, std::move(device));
|
||||
}
|
||||
|
||||
std::string fs::get_parent_dir(std::string_view path, u32 levels)
|
||||
std::string_view fs::get_parent_dir_view(std::string_view path, u32 parent_level)
|
||||
{
|
||||
std::string_view result = path;
|
||||
|
||||
// Number of path components to remove
|
||||
usz to_remove = levels;
|
||||
usz to_remove = parent_level;
|
||||
|
||||
while (to_remove--)
|
||||
{
|
||||
@@ -432,10 +499,10 @@ std::string fs::get_parent_dir(std::string_view path, u32 levels)
|
||||
return "/";
|
||||
}
|
||||
|
||||
return std::string{result};
|
||||
return result;
|
||||
}
|
||||
|
||||
bool fs::stat(const std::string& path, stat_t& info)
|
||||
bool fs::get_stat(const std::string& path, stat_t& info)
|
||||
{
|
||||
// Ensure consistent information on failure
|
||||
info = {};
|
||||
@@ -551,13 +618,13 @@ bool fs::stat(const std::string& path, stat_t& info)
|
||||
bool fs::exists(const std::string& path)
|
||||
{
|
||||
fs::stat_t info{};
|
||||
return fs::stat(path, info);
|
||||
return fs::get_stat(path, info);
|
||||
}
|
||||
|
||||
bool fs::is_file(const std::string& path)
|
||||
{
|
||||
fs::stat_t info{};
|
||||
if (!fs::stat(path, info))
|
||||
if (!fs::get_stat(path, info))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -574,7 +641,7 @@ bool fs::is_file(const std::string& path)
|
||||
bool fs::is_dir(const std::string& path)
|
||||
{
|
||||
fs::stat_t info{};
|
||||
if (!fs::stat(path, info))
|
||||
if (!fs::get_stat(path, info))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -863,9 +930,20 @@ bool fs::copy_file(const std::string& from, const std::string& to, bool overwrit
|
||||
if (::fcopyfile(input, output, 0, COPYFILE_ALL))
|
||||
#elif defined(__linux__) || defined(__sun)
|
||||
// sendfile will work with non-socket output (i.e. regular file) on Linux 2.6.33+
|
||||
off_t bytes_copied = 0;
|
||||
struct ::stat fileinfo = { 0 };
|
||||
if (::fstat(input, &fileinfo) == -1 || ::sendfile(output, input, &bytes_copied, fileinfo.st_size) == -1)
|
||||
bool result = ::fstat(input, &fileinfo) != -1;
|
||||
if (result)
|
||||
{
|
||||
for (off_t bytes_copied = 0; bytes_copied < fileinfo.st_size; /* Do nothing, bytes_copied is increased by sendfile. */)
|
||||
{
|
||||
if (::sendfile(output, input, &bytes_copied, fileinfo.st_size - bytes_copied) == -1)
|
||||
{
|
||||
result = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!result)
|
||||
#else
|
||||
#error "Native file copy implementation is missing"
|
||||
#endif
|
||||
@@ -1120,7 +1198,7 @@ fs::file::file(const std::string& path, bs_t<open_mode> mode)
|
||||
CloseHandle(m_handle);
|
||||
}
|
||||
|
||||
stat_t stat() override
|
||||
stat_t get_stat() override
|
||||
{
|
||||
FILE_BASIC_INFO basic_info;
|
||||
ensure(GetFileInformationByHandleEx(m_handle, FileBasicInfo, &basic_info, sizeof(FILE_BASIC_INFO))); // "file::stat"
|
||||
@@ -1278,6 +1356,28 @@ fs::file::file(const std::string& path, bs_t<open_mode> mode)
|
||||
{
|
||||
return m_handle;
|
||||
}
|
||||
|
||||
file_id get_id() override
|
||||
{
|
||||
file_id id{"windows_file"};
|
||||
id.data.resize(sizeof(FILE_ID_INFO));
|
||||
|
||||
FILE_ID_INFO info;
|
||||
|
||||
if (!GetFileInformationByHandleEx(m_handle, FileIdInfo, &info, sizeof(info)))
|
||||
{
|
||||
// Try GetFileInformationByHandle as a fallback
|
||||
BY_HANDLE_FILE_INFORMATION info2;
|
||||
ensure(GetFileInformationByHandle(m_handle, &info2));
|
||||
|
||||
info = {};
|
||||
info.VolumeSerialNumber = info2.dwVolumeSerialNumber;
|
||||
std::memcpy(&info.FileId, &info2.nFileIndexHigh, 8);
|
||||
}
|
||||
|
||||
std::memcpy(id.data.data(), &info, sizeof(info));
|
||||
return id;
|
||||
}
|
||||
};
|
||||
|
||||
m_file = std::make_unique<windows_file>(handle);
|
||||
@@ -1345,7 +1445,7 @@ fs::file::file(const std::string& path, bs_t<open_mode> mode)
|
||||
::close(m_fd);
|
||||
}
|
||||
|
||||
stat_t stat() override
|
||||
stat_t get_stat() override
|
||||
{
|
||||
struct ::stat file_info;
|
||||
ensure(::fstat(m_fd, &file_info) == 0); // "file::stat"
|
||||
@@ -1470,6 +1570,19 @@ fs::file::file(const std::string& path, bs_t<open_mode> mode)
|
||||
return m_fd;
|
||||
}
|
||||
|
||||
file_id get_id() override
|
||||
{
|
||||
struct ::stat file_info;
|
||||
ensure(::fstat(m_fd, &file_info) == 0); // "file::get_id"
|
||||
|
||||
file_id id{"unix_file"};
|
||||
id.data.resize(sizeof(file_info.st_dev) + sizeof(file_info.st_ino));
|
||||
|
||||
std::memcpy(id.data.data(), &file_info.st_dev, sizeof(file_info.st_dev));
|
||||
std::memcpy(id.data.data() + sizeof(file_info.st_dev), &file_info.st_ino, sizeof(file_info.st_ino));
|
||||
return id;
|
||||
}
|
||||
|
||||
u64 write_gather(const iovec_clone* buffers, u64 buf_count) override
|
||||
{
|
||||
static_assert(sizeof(iovec) == sizeof(iovec_clone), "Weird iovec size");
|
||||
@@ -1495,7 +1608,7 @@ fs::file::file(const std::string& path, bs_t<open_mode> mode)
|
||||
|
||||
m_file = std::make_unique<unix_file>(fd);
|
||||
|
||||
if (mode & fs::isfile && !(mode & fs::write) && stat().is_directory)
|
||||
if (mode & fs::isfile && !(mode & fs::write) && get_stat().is_directory)
|
||||
{
|
||||
m_file.reset();
|
||||
g_tls_error = error::isdir;
|
||||
@@ -1604,6 +1717,16 @@ fs::native_handle fs::file::get_handle() const
|
||||
#endif
|
||||
}
|
||||
|
||||
fs::file_id fs::file::get_id() const
|
||||
{
|
||||
if (m_file)
|
||||
{
|
||||
return m_file->get_id();
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
bool fs::dir::open(const std::string& path)
|
||||
{
|
||||
if (path.empty())
|
||||
@@ -1646,7 +1769,7 @@ bool fs::dir::open(const std::string& path)
|
||||
to_utf8(info.name, found.cFileName);
|
||||
info.is_directory = (found.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0;
|
||||
info.is_writable = (found.dwFileAttributes & FILE_ATTRIBUTE_READONLY) == 0;
|
||||
info.size = ((u64)found.nFileSizeHigh << 32) | (u64)found.nFileSizeLow;
|
||||
info.size = (static_cast<u64>(found.nFileSizeHigh) << 32) | static_cast<u64>(found.nFileSizeLow);
|
||||
info.atime = to_time(found.ftLastAccessTime);
|
||||
info.mtime = to_time(found.ftLastWriteTime);
|
||||
info.ctime = info.mtime;
|
||||
@@ -1783,7 +1906,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 +1991,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
|
||||
}
|
||||
|
||||
@@ -1991,13 +2114,13 @@ fs::file fs::make_gather(std::vector<fs::file> files)
|
||||
{
|
||||
}
|
||||
|
||||
fs::stat_t stat() override
|
||||
fs::stat_t get_stat() override
|
||||
{
|
||||
fs::stat_t result{};
|
||||
|
||||
if (!files.empty())
|
||||
{
|
||||
result = files[0].stat();
|
||||
result = files[0].get_stat();
|
||||
}
|
||||
|
||||
result.is_directory = false;
|
||||
@@ -2239,9 +2362,19 @@ void fmt_class_string<fs::error>::format(std::string& out, u64 arg)
|
||||
case fs::error::isdir: return "Is a directory";
|
||||
case fs::error::toolong: return "Path too long";
|
||||
case fs::error::nospace: return "Not enough space on the device";
|
||||
case fs::error::xdev: return "Device mismatch";
|
||||
case fs::error::unknown: return "Unknown system error";
|
||||
}
|
||||
|
||||
return unknown;
|
||||
});
|
||||
}
|
||||
|
||||
template<>
|
||||
void fmt_class_string<fs::file_id>::format(std::string& out, u64 arg)
|
||||
{
|
||||
const fs::file_id& id = get_object(arg);
|
||||
|
||||
// TODO: Format data
|
||||
fmt::append(out, "{type='%s'}", id.type);
|
||||
}
|
||||
|
||||
+28
-7
@@ -84,12 +84,22 @@ namespace fs
|
||||
usz iov_len;
|
||||
};
|
||||
|
||||
struct file_id
|
||||
{
|
||||
std::string type;
|
||||
std::vector<u8> data;
|
||||
|
||||
explicit operator bool() const;
|
||||
bool is_mirror_of(const file_id&) const;
|
||||
bool is_coherent_with(const file_id&) const;
|
||||
};
|
||||
|
||||
// File handle base
|
||||
struct file_base
|
||||
{
|
||||
virtual ~file_base();
|
||||
|
||||
[[noreturn]] virtual stat_t stat();
|
||||
[[noreturn]] virtual stat_t get_stat();
|
||||
virtual void sync();
|
||||
virtual bool trunc(u64 length) = 0;
|
||||
virtual u64 read(void* buffer, u64 size) = 0;
|
||||
@@ -98,6 +108,7 @@ namespace fs
|
||||
virtual u64 seek(s64 offset, seek_mode whence) = 0;
|
||||
virtual u64 size() = 0;
|
||||
virtual native_handle get_handle();
|
||||
virtual file_id get_id();
|
||||
virtual u64 write_gather(const iovec_clone* buffers, u64 buf_count);
|
||||
};
|
||||
|
||||
@@ -165,11 +176,17 @@ namespace fs
|
||||
// Set virtual device with specified name (nullptr for deletion)
|
||||
shared_ptr<device_base> set_virtual_device(const std::string& name, shared_ptr<device_base> device);
|
||||
|
||||
// Try to get parent directory (returns empty string on failure)
|
||||
std::string get_parent_dir(std::string_view path, u32 levels = 1);
|
||||
// Try to get parent directory
|
||||
std::string_view get_parent_dir_view(std::string_view path, u32 parent_level = 1);
|
||||
|
||||
// String (typical use) version
|
||||
inline std::string get_parent_dir(std::string_view path, u32 parent_level = 1)
|
||||
{
|
||||
return std::string{get_parent_dir_view(path, parent_level)};
|
||||
}
|
||||
|
||||
// Get file information
|
||||
bool stat(const std::string& path, stat_t& info);
|
||||
bool get_stat(const std::string& path, stat_t& info);
|
||||
|
||||
// Check whether a file or a directory exists (not recommended, use is_file() or is_dir() instead)
|
||||
bool exists(const std::string& path);
|
||||
@@ -267,14 +284,14 @@ namespace fs
|
||||
}
|
||||
|
||||
// Get file information
|
||||
stat_t stat(
|
||||
stat_t get_stat(
|
||||
u32 line = __builtin_LINE(),
|
||||
u32 col = __builtin_COLUMN(),
|
||||
const char* file = __builtin_FILE(),
|
||||
const char* func = __builtin_FUNCTION()) const
|
||||
{
|
||||
if (!m_file) xnull({line, col, file, func});
|
||||
return m_file->stat();
|
||||
return m_file->get_stat();
|
||||
}
|
||||
|
||||
// Sync file buffers
|
||||
@@ -499,6 +516,9 @@ namespace fs
|
||||
// Get native handle if available
|
||||
native_handle get_handle() const;
|
||||
|
||||
// Get file ID information (custom ID)
|
||||
file_id get_id() const;
|
||||
|
||||
// Gathered write
|
||||
u64 write_gather(const iovec_clone* buffers, u64 buf_count,
|
||||
u32 line = __builtin_LINE(),
|
||||
@@ -684,6 +704,7 @@ namespace fs
|
||||
isdir,
|
||||
toolong,
|
||||
nospace,
|
||||
xdev,
|
||||
unknown
|
||||
};
|
||||
|
||||
@@ -808,7 +829,7 @@ namespace fs
|
||||
return obj.size();
|
||||
}
|
||||
|
||||
stat_t stat() override
|
||||
stat_t get_stat() override
|
||||
{
|
||||
return m_stat;
|
||||
}
|
||||
|
||||
+67
-23
@@ -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);
|
||||
@@ -1461,7 +1505,7 @@ void jit_compiler::add(const std::string& path)
|
||||
|
||||
if (auto object_file = llvm::object::ObjectFile::createObjectFile(*cache))
|
||||
{
|
||||
m_engine->addObjectFile( std::move(*object_file) );
|
||||
m_engine->addObjectFile(llvm::object::OwningBinary<llvm::object::ObjectFile>(std::move(*object_file), std::move(cache)));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
+41
-4
@@ -63,7 +63,7 @@ std::string fmt::win_error_to_string(unsigned long error, void* module_handle)
|
||||
std::string message;
|
||||
LPWSTR message_buffer = nullptr;
|
||||
if (FormatMessageW((module_handle ? FORMAT_MESSAGE_FROM_HMODULE : FORMAT_MESSAGE_FROM_SYSTEM) | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_IGNORE_INSERTS,
|
||||
module_handle, error, 0, (LPWSTR)&message_buffer, 0, nullptr))
|
||||
module_handle, error, 0, reinterpret_cast<LPWSTR>(&message_buffer), 0, nullptr))
|
||||
{
|
||||
message = fmt::format("%s (0x%x)", fmt::trim(wchar_to_utf8(message_buffer), " \t\n\r\f\v"), error);
|
||||
}
|
||||
@@ -79,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 <>
|
||||
@@ -203,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)
|
||||
@@ -558,7 +589,7 @@ std::vector<std::string> fmt::split(std::string_view source, std::initializer_li
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string fmt::trim(const std::string& source, const std::string& values)
|
||||
std::string fmt::trim(const std::string& source, std::string_view values)
|
||||
{
|
||||
usz begin = source.find_first_not_of(values);
|
||||
|
||||
@@ -568,7 +599,13 @@ 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)
|
||||
void fmt::trim_back(std::string& source, std::string_view values)
|
||||
{
|
||||
const usz index = source.find_last_not_of(values);
|
||||
source.resize(index + 1);
|
||||
}
|
||||
|
||||
std::string fmt::to_upper(std::string_view string)
|
||||
{
|
||||
std::string result;
|
||||
result.resize(string.size());
|
||||
@@ -576,7 +613,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
|
||||
}
|
||||
|
||||
|
||||
+33
-4
@@ -15,7 +15,7 @@ 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);
|
||||
@@ -124,7 +124,8 @@ namespace fmt
|
||||
}
|
||||
|
||||
std::vector<std::string> split(std::string_view source, std::initializer_list<std::string_view> separators, bool is_skip_empty = true);
|
||||
std::string trim(const std::string& source, const std::string& values = " \t");
|
||||
std::string trim(const std::string& source, std::string_view values = " \t");
|
||||
void trim_back(std::string& source, std::string_view values = " \t");
|
||||
|
||||
template <typename T>
|
||||
std::string merge(const T& source, const std::string& separator)
|
||||
@@ -173,8 +174,36 @@ 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;
|
||||
};
|
||||
|
||||
struct string_hash
|
||||
{
|
||||
using hash_type = std::hash<std::string_view>;
|
||||
using is_transparent = void;
|
||||
|
||||
std::size_t operator()(const char* str) const
|
||||
{
|
||||
return hash_type{}(str);
|
||||
}
|
||||
std::size_t operator()(std::string_view str) const
|
||||
{
|
||||
return hash_type{}(str);
|
||||
}
|
||||
std::size_t operator()(std::string const& str) const
|
||||
{
|
||||
return hash_type{}(str);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
+116
-47
@@ -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
|
||||
@@ -104,11 +110,7 @@ std::string dump_useful_thread_info()
|
||||
|
||||
if (auto cpu = get_current_cpu_thread())
|
||||
{
|
||||
// Wrap it to disable some internal exceptions when printing (not thrown on main thread)
|
||||
Emu.BlockingCallFromMainThread([&]()
|
||||
{
|
||||
cpu->dump_all(result);
|
||||
});
|
||||
cpu->dump_all(result);
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -277,8 +279,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 +744,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 +779,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 +1390,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 +1511,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 +1549,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 +1588,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())
|
||||
{
|
||||
@@ -1569,7 +1635,7 @@ bool handle_access_violation(u32 addr, bool is_writing, ucontext_t* context) noe
|
||||
if (!g_tls_access_violation_recovered)
|
||||
{
|
||||
vm_log.notice("\n%s", dump_useful_thread_info());
|
||||
vm_log.error("Access violation %s location 0x%x (%s)", is_writing ? "writing" : "reading", addr, (is_writing && vm::check_addr(addr)) ? "read-only memory" : "unmapped memory");
|
||||
vm_log.error("[%s] Access violation %s location 0x%x (%s)", cpu->get_name(), is_writing ? "writing" : "reading", addr, (is_writing && vm::check_addr(addr)) ? "read-only memory" : "unmapped memory");
|
||||
}
|
||||
|
||||
// TODO:
|
||||
@@ -1761,12 +1827,16 @@ static LONG exception_filter(PEXCEPTION_POINTERS pExp) noexcept
|
||||
|
||||
const bool s_exception_handler_set = []() -> bool
|
||||
{
|
||||
if (!AddVectoredExceptionHandler(1, (PVECTORED_EXCEPTION_HANDLER)exception_handler))
|
||||
#ifdef USE_ASAN
|
||||
if (!AddVectoredExceptionHandler(FALSE, static_cast<PVECTORED_EXCEPTION_HANDLER>(exception_handler)))
|
||||
#else
|
||||
if (!AddVectoredExceptionHandler(1, static_cast<PVECTORED_EXCEPTION_HANDLER>(exception_handler)))
|
||||
#endif
|
||||
{
|
||||
report_fatal_error("AddVectoredExceptionHandler() failed.");
|
||||
}
|
||||
|
||||
if (!SetUnhandledExceptionFilter((LPTOP_LEVEL_EXCEPTION_FILTER)exception_filter))
|
||||
if (!SetUnhandledExceptionFilter(static_cast<LPTOP_LEVEL_EXCEPTION_FILTER>(exception_filter)))
|
||||
{
|
||||
report_fatal_error("SetUnhandledExceptionFilter() failed.");
|
||||
}
|
||||
@@ -1972,7 +2042,7 @@ void thread_base::start()
|
||||
#ifdef _WIN32
|
||||
m_thread = ::_beginthreadex(nullptr, 0, entry_point, this, CREATE_SUSPENDED, nullptr);
|
||||
ensure(m_thread);
|
||||
ensure(::ResumeThread(reinterpret_cast<HANDLE>(+m_thread)) != -1);
|
||||
ensure(::ResumeThread(reinterpret_cast<HANDLE>(+m_thread)) != static_cast<DWORD>(-1));
|
||||
#elif defined(__APPLE__)
|
||||
pthread_attr_t stack_size_attr;
|
||||
pthread_attr_init(&stack_size_attr);
|
||||
@@ -2018,6 +2088,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
|
||||
{
|
||||
@@ -2073,7 +2150,7 @@ u64 thread_base::finalize(thread_state result_state) noexcept
|
||||
tls_cycles += cycles;
|
||||
FILETIME ctime, etime, ktime, utime;
|
||||
GetThreadTimes(GetCurrentThread(), &ctime, &etime, &ktime, &utime);
|
||||
const u64 time = ((ktime.dwLowDateTime | (u64)ktime.dwHighDateTime << 32) + (utime.dwLowDateTime | (u64)utime.dwHighDateTime << 32)) * 100ull - tls_time;
|
||||
const u64 time = ((ktime.dwLowDateTime | static_cast<u64>(ktime.dwHighDateTime) << 32) + (utime.dwLowDateTime | static_cast<u64>(utime.dwHighDateTime) << 32)) * 100ull - tls_time;
|
||||
tls_time += time;
|
||||
const u64 fsoft = 0;
|
||||
const u64 fhard = 0;
|
||||
@@ -2351,10 +2428,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 +2656,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 +2697,6 @@ void thread_base::exec()
|
||||
// Partial cleanup
|
||||
ptr->next.reset();
|
||||
}
|
||||
|
||||
if (!ptr->prev)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!m_taskq) [[likely]]
|
||||
@@ -2710,7 +2779,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 +3026,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 +3078,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{};
|
||||
|
||||
+206
-34
@@ -4,6 +4,7 @@
|
||||
#include "version.h"
|
||||
#include "Emu/Memory/vm.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/VFS.h"
|
||||
|
||||
#include "util/types.hpp"
|
||||
#include "util/endian.hpp"
|
||||
@@ -76,6 +77,9 @@ void fmt_class_string<patch_type>::format(std::string& out, u64 arg)
|
||||
case patch_type::lef32: return "lef32";
|
||||
case patch_type::lef64: return "lef64";
|
||||
case patch_type::utf8: return "utf8";
|
||||
case patch_type::c_utf8: return "cutf8";
|
||||
case patch_type::move_file: return "move_file";
|
||||
case patch_type::hide_file: return "hide_file";
|
||||
}
|
||||
|
||||
return unknown;
|
||||
@@ -215,18 +219,18 @@ bool patch_engine::load(patch_map& patches_map, const std::string& path, std::st
|
||||
// Go through each main key in the file
|
||||
for (auto pair : root)
|
||||
{
|
||||
const auto& main_key = pair.first.Scalar();
|
||||
const std::string& main_key = pair.first.Scalar();
|
||||
|
||||
if (const auto yml_type = pair.second.Type(); yml_type != YAML::NodeType::Map)
|
||||
if (main_key.empty())
|
||||
{
|
||||
append_log_message(log_messages, fmt::format("Error: Skipping key %s: expected Map, found %s (location: %s, file: %s)", main_key, yml_type, get_yaml_node_location(pair.second), path), &patch_log.error);
|
||||
append_log_message(log_messages, fmt::format("Error: Skipping empty key (location: %s, file: %s)", get_yaml_node_location(pair.first), path), &patch_log.error);
|
||||
is_valid = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (main_key.empty())
|
||||
if (const auto yml_type = pair.second.Type(); yml_type != YAML::NodeType::Map)
|
||||
{
|
||||
append_log_message(log_messages, fmt::format("Error: Skipping empty key (location: %s, file: %s)", get_yaml_node_location(pair.second), path), &patch_log.error);
|
||||
append_log_message(log_messages, fmt::format("Error: Skipping key %s: expected Map, found %s (location: %s, file: %s)", main_key, yml_type, get_yaml_node_location(pair.second), path), &patch_log.error);
|
||||
is_valid = false;
|
||||
continue;
|
||||
}
|
||||
@@ -238,7 +242,7 @@ bool patch_engine::load(patch_map& patches_map, const std::string& path, std::st
|
||||
}
|
||||
|
||||
// Find or create an entry matching the key/hash in our map
|
||||
auto& container = patches_map[main_key];
|
||||
patch_container& container = patches_map[main_key];
|
||||
container.hash = main_key;
|
||||
container.version = version;
|
||||
|
||||
@@ -248,6 +252,13 @@ bool patch_engine::load(patch_map& patches_map, const std::string& path, std::st
|
||||
// Each key in "Patches" is also the patch description
|
||||
const std::string& description = patches_entry.first.Scalar();
|
||||
|
||||
if (description.empty())
|
||||
{
|
||||
append_log_message(log_messages, fmt::format("Error: Empty patch name (key: %s, location: %s, file: %s)", main_key, get_yaml_node_location(patches_entry.first), path), &patch_log.error);
|
||||
is_valid = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Compile patch information
|
||||
|
||||
if (const auto yml_type = patches_entry.second.Type(); yml_type != YAML::NodeType::Map)
|
||||
@@ -326,7 +337,7 @@ bool patch_engine::load(patch_map& patches_map, const std::string& path, std::st
|
||||
continue;
|
||||
}
|
||||
|
||||
patch_engine::patch_app_versions app_versions;
|
||||
patch_app_versions app_versions;
|
||||
|
||||
for (const auto version : serial_node.second)
|
||||
{
|
||||
@@ -575,6 +586,14 @@ bool patch_engine::load(patch_map& patches_map, const std::string& path, std::st
|
||||
{
|
||||
if (!read_patch_node(info, patch_node, root, log_messages))
|
||||
{
|
||||
for (const auto& it : patches_entry.second)
|
||||
{
|
||||
if (it.first.Scalar() == patch_key::patch)
|
||||
{
|
||||
append_log_message(log_messages, fmt::format("Skipping invalid patch node %s: (key: %s, location: %s)", info.description, main_key, get_yaml_node_location(it.first)), &patch_log.error);
|
||||
break;
|
||||
}
|
||||
}
|
||||
is_valid = false;
|
||||
}
|
||||
}
|
||||
@@ -682,26 +701,56 @@ bool patch_engine::add_patch_data(YAML::Node node, patch_info& info, u32 modifie
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!addr_node.Scalar().starts_with("0x"))
|
||||
if (patch_type_uses_hex_offset(type) && !addr_node.Scalar().starts_with("0x"))
|
||||
{
|
||||
append_log_message(log_messages, fmt::format("Skipping patch node %s. Address element has wrong format %s. (key: %s, location: %s)", info.description, addr_node.Scalar(), info.hash, get_yaml_node_location(node)), &patch_log.error);
|
||||
return false;
|
||||
}
|
||||
|
||||
struct patch_data p_data{};
|
||||
p_data.type = type;
|
||||
p_data.offset = addr_node.as<u32>(0) + modifier;
|
||||
p_data.original_value = value_node.Scalar();
|
||||
p_data.type = type;
|
||||
p_data.offset = addr_node.as<u32>(0) + modifier;
|
||||
p_data.original_offset = addr_node.Scalar();
|
||||
p_data.original_value = value_node.Scalar();
|
||||
|
||||
const bool is_config_value = info.default_config_values.contains(p_data.original_value);
|
||||
const patch_config_value config_value = is_config_value ? ::at32(info.default_config_values, p_data.original_value) : patch_config_value{};
|
||||
|
||||
std::string error_message;
|
||||
|
||||
// Validate offset
|
||||
switch (p_data.type)
|
||||
{
|
||||
case patch_type::move_file:
|
||||
case patch_type::hide_file:
|
||||
break;
|
||||
default:
|
||||
{
|
||||
get_yaml_node_value<u32>(addr_node, error_message);
|
||||
if (!error_message.empty())
|
||||
{
|
||||
error_message = fmt::format("Skipping patch data entry: [ %s, 0x%.8x, %s ] (key: %s, location: %s) Invalid patch offset '%s' (not a valid u32 or overflow)",
|
||||
p_data.type, p_data.offset, p_data.original_value.empty() ? "?" : p_data.original_value, info.hash, get_yaml_node_location(node), p_data.original_offset);
|
||||
append_log_message(log_messages, error_message, &patch_log.error);
|
||||
return false;
|
||||
}
|
||||
if ((0xFFFFFFFF - modifier) < p_data.offset)
|
||||
{
|
||||
error_message = fmt::format("Skipping patch data entry: [ %s, 0x%.8x, %s ] (key: %s, location: %s) Invalid combination of patch offset 0x%.8x and modifier 0x%.8x (overflow)",
|
||||
p_data.type, p_data.offset, p_data.original_value.empty() ? "?" : p_data.original_value, info.hash, get_yaml_node_location(node), p_data.offset, modifier);
|
||||
append_log_message(log_messages, error_message, &patch_log.error);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
switch (p_data.type)
|
||||
{
|
||||
case patch_type::utf8:
|
||||
case patch_type::jump_func:
|
||||
case patch_type::move_file:
|
||||
case patch_type::hide_file:
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -799,7 +848,7 @@ void unmap_vm_area(std::shared_ptr<vm::block_t>& ptr)
|
||||
}
|
||||
|
||||
// Returns old 'applied' size
|
||||
static usz apply_modification(std::basic_string<u32>& applied, patch_engine::patch_info& patch, u8* dst, u32 filesz, u32 min_addr)
|
||||
static usz apply_modification(std::basic_string<u32>& applied, patch_engine::patch_info& patch, std::function<u8*(u32, u32)> mem_translate, u32 filesz, u32 min_addr)
|
||||
{
|
||||
const usz old_applied_size = applied.size();
|
||||
|
||||
@@ -840,8 +889,8 @@ static usz apply_modification(std::basic_string<u32>& applied, patch_engine::pat
|
||||
{
|
||||
if (p.type != patch_type::alloc) continue;
|
||||
|
||||
// Do not allow null address or if dst is not a VM ptr
|
||||
if (const u32 alloc_at = vm::try_get_addr(dst + (p.offset & -4096)).first; alloc_at >> 16)
|
||||
// Do not allow null address or if resultant ptr is not a VM ptr
|
||||
if (const u32 alloc_at = (p.offset & -4096); alloc_at >> 16)
|
||||
{
|
||||
const u32 alloc_size = utils::align(static_cast<u32>(p.value.long_value) + alloc_at % 4096, 4096);
|
||||
|
||||
@@ -920,7 +969,74 @@ static usz apply_modification(std::basic_string<u32>& applied, patch_engine::pat
|
||||
relocate_instructions_at = 0;
|
||||
}
|
||||
|
||||
if (!relocate_instructions_at && (offset < min_addr || offset - min_addr >= filesz))
|
||||
u32 memory_size = 0;
|
||||
|
||||
switch (p.type)
|
||||
{
|
||||
case patch_type::invalid:
|
||||
case patch_type::load:
|
||||
{
|
||||
// Invalid in this context
|
||||
break;
|
||||
}
|
||||
case patch_type::alloc:
|
||||
{
|
||||
// Applied before
|
||||
memory_size = 0;
|
||||
continue;
|
||||
}
|
||||
case patch_type::byte:
|
||||
{
|
||||
memory_size = sizeof(u8);
|
||||
break;
|
||||
}
|
||||
case patch_type::le16:
|
||||
case patch_type::be16:
|
||||
{
|
||||
memory_size = sizeof(u16);
|
||||
break;
|
||||
}
|
||||
case patch_type::code_alloc:
|
||||
case patch_type::jump:
|
||||
case patch_type::jump_link:
|
||||
case patch_type::jump_func:
|
||||
case patch_type::le32:
|
||||
case patch_type::lef32:
|
||||
case patch_type::bd32:
|
||||
case patch_type::be32:
|
||||
case patch_type::bef32:
|
||||
{
|
||||
memory_size = sizeof(u32);
|
||||
break;
|
||||
}
|
||||
case patch_type::lef64:
|
||||
case patch_type::le64:
|
||||
case patch_type::bd64:
|
||||
case patch_type::be64:
|
||||
case patch_type::bef64:
|
||||
{
|
||||
memory_size = sizeof(u64);
|
||||
break;
|
||||
}
|
||||
case patch_type::utf8:
|
||||
{
|
||||
memory_size = p.original_value.size();
|
||||
break;
|
||||
}
|
||||
case patch_type::c_utf8:
|
||||
{
|
||||
memory_size = utils::add_saturate<u32>(p.original_value.size(), 1);
|
||||
break;
|
||||
}
|
||||
case patch_type::move_file:
|
||||
case patch_type::hide_file:
|
||||
{
|
||||
memory_size = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (memory_size != 0 && !relocate_instructions_at && (filesz < memory_size || offset < min_addr || offset - min_addr > filesz - memory_size))
|
||||
{
|
||||
// This patch is out of range for this segment
|
||||
continue;
|
||||
@@ -928,7 +1044,13 @@ static usz apply_modification(std::basic_string<u32>& applied, patch_engine::pat
|
||||
|
||||
offset -= min_addr;
|
||||
|
||||
auto ptr = dst + offset;
|
||||
auto ptr = mem_translate(offset, memory_size);
|
||||
|
||||
if (!ptr && memory_size != 0 && !relocate_instructions_at)
|
||||
{
|
||||
// Memory translation failed
|
||||
continue;
|
||||
}
|
||||
|
||||
if (relocate_instructions_at)
|
||||
{
|
||||
@@ -954,7 +1076,7 @@ static usz apply_modification(std::basic_string<u32>& applied, patch_engine::pat
|
||||
}
|
||||
case patch_type::code_alloc:
|
||||
{
|
||||
const u32 out_branch = vm::try_get_addr(dst + (offset & -4)).first;
|
||||
const u32 out_branch = vm::try_get_addr(relocate_instructions_at ? vm::get_super_ptr<u8>(offset & -4) : mem_translate(offset & -4, 4)).first;
|
||||
|
||||
// Allow only if points to a PPU executable instruction
|
||||
if (out_branch < 0x10000 || out_branch >= 0x4000'0000 || !vm::check_addr<4>(out_branch, vm::page_executable))
|
||||
@@ -1038,7 +1160,7 @@ static usz apply_modification(std::basic_string<u32>& applied, patch_engine::pat
|
||||
case patch_type::jump:
|
||||
case patch_type::jump_link:
|
||||
{
|
||||
const u32 out_branch = vm::try_get_addr(dst + (offset & -4)).first;
|
||||
const u32 out_branch = vm::try_get_addr(relocate_instructions_at ? vm::get_super_ptr<u8>(offset & -4) : mem_translate(offset & -4, 4)).first;
|
||||
const u32 dest = static_cast<u32>(p.value.long_value);
|
||||
|
||||
// Allow only if points to a PPU executable instruction
|
||||
@@ -1054,7 +1176,7 @@ static usz apply_modification(std::basic_string<u32>& applied, patch_engine::pat
|
||||
{
|
||||
const std::string& str = p.original_value;
|
||||
|
||||
const u32 out_branch = vm::try_get_addr(dst + (offset & -4)).first;
|
||||
const u32 out_branch = vm::try_get_addr(relocate_instructions_at ? vm::get_super_ptr<u8>(offset & -4) : mem_translate(offset & -4, 4)).first;
|
||||
const usz sep_pos = str.find_first_of(':');
|
||||
|
||||
// Must contain only a single ':' or none
|
||||
@@ -1070,7 +1192,7 @@ static usz apply_modification(std::basic_string<u32>& applied, patch_engine::pat
|
||||
|
||||
if (func_name.starts_with("0x"sv))
|
||||
{
|
||||
// Raw hexadeciaml-formatted FNID (real function name cannot contain a digit at the start, derived from C/CPP which were used in PS3 development)
|
||||
// Raw hexadecimal-formatted FNID (real function name cannot contain a digit at the start, derived from C/CPP which were used in PS3 development)
|
||||
const auto result = std::from_chars(func_name.data() + 2, func_name.data() + func_name.size() - 2, id, 16);
|
||||
|
||||
if (result.ec != std::errc() || str.data() + sep_pos != result.ptr)
|
||||
@@ -1191,6 +1313,56 @@ static usz apply_modification(std::basic_string<u32>& applied, patch_engine::pat
|
||||
std::memcpy(ptr, p.original_value.data(), p.original_value.size());
|
||||
break;
|
||||
}
|
||||
case patch_type::c_utf8:
|
||||
{
|
||||
std::memcpy(ptr, p.original_value.data(), p.original_value.size() + 1);
|
||||
break;
|
||||
}
|
||||
case patch_type::move_file:
|
||||
case patch_type::hide_file:
|
||||
{
|
||||
const bool is_hide = p.type == patch_type::hide_file;
|
||||
std::string original_vfs_path = p.original_offset;
|
||||
std::string dest_vfs_path = p.original_value;
|
||||
|
||||
if (original_vfs_path.empty())
|
||||
{
|
||||
patch_log.error("Failed to patch file: original path is empty", original_vfs_path);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!is_hide && dest_vfs_path.empty())
|
||||
{
|
||||
patch_log.error("Failed to patch file: destination path is empty", dest_vfs_path);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!original_vfs_path.starts_with("/dev_"))
|
||||
{
|
||||
original_vfs_path.insert(0, "/dev_");
|
||||
}
|
||||
|
||||
if (!is_hide && !dest_vfs_path.starts_with("/dev_"))
|
||||
{
|
||||
dest_vfs_path.insert(0, "/dev_");
|
||||
}
|
||||
|
||||
const std::string dest_path = is_hide ? fs::get_config_dir() + "delete_this_dir.../delete_this..." : vfs::get(dest_vfs_path);
|
||||
|
||||
if (dest_path.empty())
|
||||
{
|
||||
patch_log.error("Failed to patch file path at '%s': destination is not mounted", original_vfs_path, dest_vfs_path);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!vfs::mount(original_vfs_path, dest_path))
|
||||
{
|
||||
patch_log.error("Failed to patch file path at '%s': vfs::mount(dest='%s') failed", original_vfs_path, dest_vfs_path);
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Possibly an executable instruction
|
||||
@@ -1200,7 +1372,7 @@ static usz apply_modification(std::basic_string<u32>& applied, patch_engine::pat
|
||||
return old_applied_size;
|
||||
}
|
||||
|
||||
std::basic_string<u32> patch_engine::apply(const std::string& name, u8* dst, u32 filesz, u32 min_addr)
|
||||
std::basic_string<u32> patch_engine::apply(const std::string& name, std::function<u8*(u32, u32)> mem_translate, u32 filesz, u32 min_addr)
|
||||
{
|
||||
if (!m_map.contains(name))
|
||||
{
|
||||
@@ -1208,11 +1380,11 @@ std::basic_string<u32> patch_engine::apply(const std::string& name, u8* dst, u32
|
||||
}
|
||||
|
||||
std::basic_string<u32> applied_total;
|
||||
const auto& container = ::at32(m_map, name);
|
||||
const auto& serial = Emu.GetTitleID();
|
||||
const auto& app_version = Emu.GetAppVersion();
|
||||
const patch_container& container = ::at32(m_map, name);
|
||||
const std::string& serial = Emu.GetTitleID();
|
||||
const std::string& app_version = Emu.GetAppVersion();
|
||||
|
||||
// Different containers in order to seperate the patches
|
||||
// Different containers in order to separate the patches
|
||||
std::vector<std::shared_ptr<patch_info>> patches_for_this_serial_and_this_version;
|
||||
std::vector<std::shared_ptr<patch_info>> patches_for_this_serial_and_all_versions;
|
||||
std::vector<std::shared_ptr<patch_info>> patches_for_all_serials_and_this_version;
|
||||
@@ -1244,7 +1416,7 @@ std::basic_string<u32> patch_engine::apply(const std::string& name, u8* dst, u32
|
||||
continue;
|
||||
}
|
||||
|
||||
const auto& app_versions = ::at32(serials, found_serial);
|
||||
const patch_app_versions& app_versions = ::at32(serials, found_serial);
|
||||
std::string found_app_version;
|
||||
|
||||
if (app_versions.contains(app_version))
|
||||
@@ -1341,7 +1513,7 @@ std::basic_string<u32> patch_engine::apply(const std::string& name, u8* dst, u32
|
||||
{
|
||||
if (patch)
|
||||
{
|
||||
const usz old_size = apply_modification(applied_total, *patch, dst, filesz, min_addr);
|
||||
const usz old_size = apply_modification(applied_total, *patch, mem_translate, filesz, min_addr);
|
||||
|
||||
if (applied_total.size() != old_size)
|
||||
{
|
||||
@@ -1362,11 +1534,11 @@ void patch_engine::unload(const std::string& name)
|
||||
return;
|
||||
}
|
||||
|
||||
const auto& container = ::at32(m_map, name);
|
||||
const patch_container& container = ::at32(m_map, name);
|
||||
|
||||
for (const auto& [description, patch] : container.patch_info_map)
|
||||
{
|
||||
for (auto& entry : patch.data_list)
|
||||
for (const patch_data& entry : patch.data_list)
|
||||
{
|
||||
// Deallocate used memory
|
||||
if (u32 addr = std::exchange(entry.alloc_addr, 0))
|
||||
@@ -1494,7 +1666,7 @@ static void append_patches(patch_engine::patch_map& existing_patches, const patc
|
||||
continue;
|
||||
}
|
||||
|
||||
auto& container = existing_patches[hash];
|
||||
patch_engine::patch_container& container = existing_patches[hash];
|
||||
|
||||
for (const auto& [description, new_info] : new_container.patch_info_map)
|
||||
{
|
||||
@@ -1505,7 +1677,7 @@ static void append_patches(patch_engine::patch_map& existing_patches, const patc
|
||||
continue;
|
||||
}
|
||||
|
||||
auto& info = container.patch_info_map[description];
|
||||
patch_engine::patch_info& info = container.patch_info_map[description];
|
||||
|
||||
bool ok;
|
||||
const bool version_is_bigger = utils::compare_versions(new_info.patch_version, info.patch_version, ok) > 0;
|
||||
@@ -1668,7 +1840,7 @@ bool patch_engine::save_patches(const patch_map& patches, const std::string& pat
|
||||
|
||||
bool patch_engine::import_patches(const patch_engine::patch_map& patches, const std::string& path, usz& count, usz& total, std::stringstream* log_messages)
|
||||
{
|
||||
patch_engine::patch_map existing_patches;
|
||||
patch_map existing_patches;
|
||||
|
||||
if (load(existing_patches, path, "", true, log_messages))
|
||||
{
|
||||
@@ -1681,13 +1853,13 @@ bool patch_engine::import_patches(const patch_engine::patch_map& patches, const
|
||||
|
||||
bool patch_engine::remove_patch(const patch_info& info)
|
||||
{
|
||||
patch_engine::patch_map patches;
|
||||
patch_map patches;
|
||||
|
||||
if (load(patches, info.source_path))
|
||||
{
|
||||
if (patches.contains(info.hash))
|
||||
{
|
||||
auto& container = patches[info.hash];
|
||||
patch_container& container = patches[info.hash];
|
||||
|
||||
if (container.patch_info_map.contains(info.description))
|
||||
{
|
||||
|
||||
+11
-1
@@ -3,6 +3,7 @@
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <functional>
|
||||
|
||||
#include "util/types.hpp"
|
||||
#include "util/yaml.hpp"
|
||||
@@ -52,8 +53,16 @@ enum class patch_type
|
||||
bef32,
|
||||
bef64,
|
||||
utf8, // Text of string (not null-terminated automatically)
|
||||
c_utf8, // Text of string (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::c_utf8;
|
||||
}
|
||||
|
||||
enum class patch_configurable_type
|
||||
{
|
||||
double_range,
|
||||
@@ -69,6 +78,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
|
||||
{
|
||||
@@ -204,7 +214,7 @@ public:
|
||||
void append_title_patches(const std::string& title_id);
|
||||
|
||||
// Apply patch (returns the number of entries applied)
|
||||
std::basic_string<u32> apply(const std::string& name, u8* dst, u32 filesz = -1, u32 min_addr = 0);
|
||||
std::basic_string<u32> apply(const std::string& name, std::function<u8*(u32, u32)> mem_translate, u32 filesz = -1, u32 min_addr = 0);
|
||||
|
||||
// Deallocate memory used by patches
|
||||
void unload(const std::string& name);
|
||||
|
||||
+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;
|
||||
}
|
||||
|
||||
+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{};
|
||||
|
||||
@@ -73,12 +73,12 @@ namespace utils
|
||||
std::vector<std::string> get_backtrace_symbols(const std::vector<void*>& stack)
|
||||
{
|
||||
std::vector<std::string> result = {};
|
||||
std::vector<u8> symbol_buf(sizeof(SYMBOL_INFO) + sizeof(TCHAR) * 256);
|
||||
std::vector<u8> symbol_buf(sizeof(SYMBOL_INFOW) + sizeof(TCHAR) * 256);
|
||||
|
||||
const auto hProcess = ::GetCurrentProcess();
|
||||
|
||||
auto sym = reinterpret_cast<SYMBOL_INFO*>(symbol_buf.data());
|
||||
sym->SizeOfStruct = sizeof(SYMBOL_INFO);
|
||||
auto sym = reinterpret_cast<SYMBOL_INFOW*>(symbol_buf.data());
|
||||
sym->SizeOfStruct = sizeof(SYMBOL_INFOW);
|
||||
sym->MaxNameLen = 256;
|
||||
|
||||
IMAGEHLP_LINEW64 line_info{};
|
||||
@@ -90,7 +90,7 @@ namespace utils
|
||||
for (const auto& pointer : stack)
|
||||
{
|
||||
DWORD64 unused;
|
||||
SymFromAddr(hProcess, reinterpret_cast<DWORD64>(pointer), &unused, sym);
|
||||
SymFromAddrW(hProcess, reinterpret_cast<DWORD64>(pointer), &unused, sym);
|
||||
|
||||
if (sym->NameLen)
|
||||
{
|
||||
@@ -98,7 +98,7 @@ namespace utils
|
||||
|
||||
// Attempt to get file and line information if available
|
||||
DWORD unused2;
|
||||
if (SymGetLineFromAddrW(hProcess, reinterpret_cast<DWORD64>(pointer), &unused2, &line_info))
|
||||
if (SymGetLineFromAddrW64(hProcess, reinterpret_cast<DWORD64>(pointer), &unused2, &line_info))
|
||||
{
|
||||
const auto full_path = fmt::format("%s:%u %s", wstr_to_utf8(line_info.FileName, -1), line_info.LineNumber, function_name);
|
||||
result.push_back(full_path);
|
||||
|
||||
@@ -43,28 +43,14 @@ 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 {
|
||||
QPlainTextEdit#tty_frame {
|
||||
background-color:#ffffff;
|
||||
}
|
||||
QLabel#tty_text {
|
||||
color:#000000;
|
||||
}
|
||||
QTextEdit#log_frame {
|
||||
QPlainTextEdit#log_frame {
|
||||
background-color:#ffffff;
|
||||
}
|
||||
QLabel#log_level_always {
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -197,17 +197,6 @@ 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;
|
||||
@@ -264,7 +253,7 @@ QLabel#thumbnail_icon_color {
|
||||
}
|
||||
|
||||
/* Set Log colors */
|
||||
QTextEdit#log_frame {
|
||||
QPlainTextEdit#log_frame {
|
||||
background-color: #000; /* Black */
|
||||
}
|
||||
QLabel#log_level_always {
|
||||
@@ -296,7 +285,7 @@ QLabel#log_stack {
|
||||
}
|
||||
|
||||
/* Set TTY colors */
|
||||
QTextEdit#tty_frame {
|
||||
QPlainTextEdit#tty_frame {
|
||||
background-color: #000; /* Black */
|
||||
}
|
||||
QLabel#tty_text {
|
||||
@@ -344,24 +333,57 @@ 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;
|
||||
}
|
||||
|
||||
/* Richtext link color */
|
||||
QLabel#richtext_link_color { color: #87cefa; }
|
||||
|
||||
+35
-14
@@ -454,7 +454,7 @@ QListWidget::item:selected {
|
||||
}
|
||||
|
||||
QListWidget::item:hover {
|
||||
background-color: #30333a;
|
||||
background-color: #30333a;
|
||||
color: #8cf944;
|
||||
border-radius: 0.25em;
|
||||
}
|
||||
@@ -565,7 +565,7 @@ QTableView {
|
||||
}
|
||||
|
||||
QTableView::item:hover {
|
||||
color: #8cf944;
|
||||
color: #8cf944;
|
||||
}
|
||||
|
||||
/* Game Icon Background */
|
||||
@@ -579,7 +579,7 @@ QLabel#thumbnail_icon_color {
|
||||
}
|
||||
|
||||
/* Log colors */
|
||||
QTextEdit#log_frame {
|
||||
QPlainTextEdit#log_frame {
|
||||
background-color: #23262d;
|
||||
}
|
||||
|
||||
@@ -620,7 +620,7 @@ QLabel#log_stack {
|
||||
}
|
||||
|
||||
/* TTY colors */
|
||||
QTextEdit#tty_frame {
|
||||
QPlainTextEdit#tty_frame {
|
||||
background-color: #23262d;
|
||||
}
|
||||
|
||||
@@ -641,24 +641,45 @@ 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;
|
||||
}
|
||||
|
||||
/* Richtext link color */
|
||||
QLabel#richtext_link_color { 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;
|
||||
@@ -306,7 +292,7 @@ QLabel#debugger_frame_pc {
|
||||
}
|
||||
|
||||
/* Set Log colors */
|
||||
QTextEdit#log_frame {
|
||||
QPlainTextEdit#log_frame {
|
||||
background-color: #000000; /* Black */
|
||||
}
|
||||
QLabel#log_level_always {
|
||||
@@ -337,7 +323,7 @@ QLabel#log_stack {
|
||||
color: #ffffff; /* White */
|
||||
}
|
||||
/* Set TTY colors */
|
||||
QTextEdit#tty_frame {
|
||||
QPlainTextEdit#tty_frame {
|
||||
background-color: #000000; /* Black */
|
||||
}
|
||||
QLabel#tty_text {
|
||||
@@ -347,24 +333,57 @@ 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;
|
||||
}
|
||||
|
||||
/* Richtext link color */
|
||||
QLabel#richtext_link_color { color: #87cefa; }
|
||||
|
||||
@@ -194,17 +194,6 @@ 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;
|
||||
@@ -261,7 +250,7 @@ QLabel#thumbnail_icon_color {
|
||||
}
|
||||
|
||||
/* Set Log colors */
|
||||
QTextEdit#log_frame {
|
||||
QPlainTextEdit#log_frame {
|
||||
background-color: #181d24; /* Black */
|
||||
}
|
||||
QLabel#log_level_always {
|
||||
@@ -293,7 +282,7 @@ QLabel#log_stack {
|
||||
}
|
||||
|
||||
/* Set TTY colors */
|
||||
QTextEdit#tty_frame {
|
||||
QPlainTextEdit#tty_frame {
|
||||
background-color: #181d24; /* Black */
|
||||
}
|
||||
QLabel#tty_text {
|
||||
@@ -341,24 +330,57 @@ 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;
|
||||
}
|
||||
|
||||
/* Richtext link color */
|
||||
QLabel#richtext_link_color { color: #87cefa; }
|
||||
|
||||
@@ -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,36 @@ 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;
|
||||
}
|
||||
|
||||
/* Richtext link color */
|
||||
QLabel#richtext_link_color { color: #87cefa; }
|
||||
|
||||
@@ -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;
|
||||
@@ -600,7 +611,7 @@ QLineEdit:focus {
|
||||
}
|
||||
|
||||
/* Log colors */
|
||||
QTextEdit#log_frame {
|
||||
QPlainTextEdit#log_frame {
|
||||
background-color: #111525;
|
||||
}
|
||||
|
||||
@@ -663,24 +674,52 @@ 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;
|
||||
}
|
||||
|
||||
/* Richtext link color */
|
||||
QLabel#richtext_link_color { color: #0074e7; }
|
||||
|
||||
@@ -619,7 +619,7 @@ QLineEdit:focus {
|
||||
}
|
||||
|
||||
/* Log colors */
|
||||
QTextEdit#log_frame {
|
||||
QPlainTextEdit#log_frame {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
@@ -463,3 +455,26 @@ QSlider#sizeSlider::groove:horizontal {
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
# Check and configure compiler options for RPCS3
|
||||
|
||||
if(MSVC)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:throwingNew- /constexpr:steps16777216 /D _CRT_SECURE_NO_DEPRECATE=1 /D _CRT_NON_CONFORMING_SWPRINTFS=1 /D _SCL_SECURE_NO_WARNINGS=1")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D NOMINMAX /D _ENABLE_EXTENDED_ALIGNED_STORAGE=1 /D _HAS_EXCEPTIONS=0")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS /DYNAMICBASE:NO /BASE:0x10000 /FIXED")
|
||||
add_compile_options(/Zc:throwingNew- /constexpr:steps16777216)
|
||||
add_compile_definitions(
|
||||
_CRT_SECURE_NO_DEPRECATE=1 _CRT_NON_CONFORMING_SWPRINTFS=1 _SCL_SECURE_NO_WARNINGS=1
|
||||
NOMINMAX _ENABLE_EXTENDED_ALIGNED_STORAGE=1 _HAS_EXCEPTIONS=0)
|
||||
add_link_options(/DYNAMICBASE:NO /BASE:0x10000 /FIXED)
|
||||
|
||||
#TODO: Some of these could be cleaned up
|
||||
add_compile_options(/wd4805) # Comparing boolean and int
|
||||
@@ -12,19 +14,19 @@ if(MSVC)
|
||||
add_link_options(/ignore:4281) # Undesirable base address 0x10000
|
||||
|
||||
# MSVC 2017 uses iterator as base class internally, causing a lot of warning spam
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING=1")
|
||||
add_compile_definitions(_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING=1)
|
||||
|
||||
# Increase stack limit to 8 MB
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:8388608,1048576")
|
||||
add_link_options(/STACK:8388608,1048576)
|
||||
else()
|
||||
# Some distros have the compilers set to use PIE by default, but RPCS3 doesn't work with PIE, so we need to disable it.
|
||||
CHECK_CXX_COMPILER_FLAG("-no-pie" HAS_NO_PIE)
|
||||
CHECK_CXX_COMPILER_FLAG("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE)
|
||||
CHECK_CXX_COMPILER_FLAG("-msse -msse2 -mcx16" COMPILER_X86)
|
||||
check_cxx_compiler_flag("-no-pie" HAS_NO_PIE)
|
||||
check_cxx_compiler_flag("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE)
|
||||
check_cxx_compiler_flag("-msse -msse2 -mcx16" COMPILER_X86)
|
||||
if (APPLE)
|
||||
CHECK_CXX_COMPILER_FLAG("-march=armv8.4-a" COMPILER_ARM)
|
||||
check_cxx_compiler_flag("-march=armv8.4-a" COMPILER_ARM)
|
||||
else()
|
||||
CHECK_CXX_COMPILER_FLAG("-march=armv8.1-a" COMPILER_ARM)
|
||||
check_cxx_compiler_flag("-march=armv8.1-a" COMPILER_ARM)
|
||||
endif()
|
||||
|
||||
add_compile_options(-Wall)
|
||||
@@ -65,24 +67,24 @@ else()
|
||||
add_compile_options(-Wstrict-aliasing=1)
|
||||
#add_compile_options(-Wnull-dereference)
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
add_compile_options(-Werror=inconsistent-missing-override)
|
||||
elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
add_compile_options(-Werror=suggest-override)
|
||||
add_compile_options(-Wclobbered)
|
||||
add_compile_options(-Wcast-function-type)
|
||||
# add_compile_options(-Wcast-function-type)
|
||||
add_compile_options(-Wduplicated-branches)
|
||||
add_compile_options(-Wduplicated-cond)
|
||||
endif()
|
||||
|
||||
#TODO Clean the code so these are removed
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
add_compile_options(-fconstexpr-steps=16777216)
|
||||
add_compile_options(-Wno-unused-lambda-capture)
|
||||
add_compile_options(-Wno-unused-private-field)
|
||||
add_compile_options(-Wno-delete-non-virtual-dtor)
|
||||
add_compile_options(-Wno-unused-command-line-argument)
|
||||
elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
add_compile_options(-Wno-class-memaccess)
|
||||
endif()
|
||||
|
||||
@@ -92,10 +94,10 @@ else()
|
||||
|
||||
if(NOT APPLE AND NOT WIN32)
|
||||
# This hides our LLVM from mesa's LLVM, otherwise we get some unresolvable conflicts.
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--exclude-libs,ALL")
|
||||
add_link_options(-Wl,--exclude-libs,ALL)
|
||||
|
||||
if(HAS_NO_PIE)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -no-pie")
|
||||
add_link_options(-no-pie)
|
||||
endif()
|
||||
elseif(APPLE)
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
@@ -103,20 +105,18 @@ else()
|
||||
endif()
|
||||
|
||||
if (CMAKE_OSX_ARCHITECTURES MATCHES "x86_64")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-image_base,0x10000 -Wl,-pagezero_size,0x10000")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-no_pie")
|
||||
add_link_options(-Wl,-image_base,0x10000 -Wl,-pagezero_size,0x10000)
|
||||
add_link_options(-Wl,-no_pie)
|
||||
endif()
|
||||
elseif(WIN32)
|
||||
set(CMAKE_RC_COMPILER_INIT windres)
|
||||
enable_language(RC)
|
||||
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <FLAGS> -O coff <DEFINES> -i <SOURCE> -o <OBJECT>")
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_FORMAT_MACROS=1")
|
||||
add_compile_definitions(__STDC_FORMAT_MACROS=1)
|
||||
|
||||
# Workaround for mingw64 (MSYS2)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--allow-multiple-definition")
|
||||
add_link_options(-Wl,--allow-multiple-definition)
|
||||
|
||||
# Increase stack limit to 8 MB
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--stack -Wl,8388608")
|
||||
add_link_options(-Wl,--stack -Wl,8388608)
|
||||
|
||||
add_link_options(-Wl,--image-base,0x10000)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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,11 +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
|
||||
@@ -41,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}
|
||||
@@ -79,7 +81,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "spirv", "3rdparty\SPIRV\spi
|
||||
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
|
||||
@@ -96,6 +98,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "pine", "pine", "{A55DA1B5-C
|
||||
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
|
||||
@@ -194,6 +198,10 @@ Global
|
||||
{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
|
||||
@@ -224,6 +232,7 @@ Global
|
||||
{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}
|
||||
|
||||
+38
-56
@@ -1,9 +1,4 @@
|
||||
|
||||
if(USE_PRECOMPILED_HEADERS AND NOT COMMAND target_precompile_headers)
|
||||
include(cotire)
|
||||
endif()
|
||||
|
||||
# Define GNU standard installation directories
|
||||
# Define GNU standard installation directories
|
||||
include(GNUInstallDirs)
|
||||
|
||||
# Generate git-version.h at build time.
|
||||
@@ -16,10 +11,10 @@ include(CheckFunctionExists)
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
|
||||
set(ADDITIONAL_LIBS "")
|
||||
if(CMAKE_SYSTEM MATCHES "Linux")
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
#on some Linux distros shm_unlink and similar functions are in librt only
|
||||
set(ADDITIONAL_LIBS ${ADDITIONAL_LIBS} "rt")
|
||||
elseif(NOT MSVC AND NOT CMAKE_CXX_FLAGS MATCHES "LIBICONV_PLUG")
|
||||
elseif(NOT WIN32 AND NOT CMAKE_CXX_FLAGS MATCHES "LIBICONV_PLUG")
|
||||
#it seems like glibc includes the iconv functions we use but other libc
|
||||
#implementations like the one on OSX don't seem implement them
|
||||
set(ADDITIONAL_LIBS ${ADDITIONAL_LIBS} "iconv")
|
||||
@@ -34,13 +29,6 @@ if(UNIX AND NOT APPLE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT RPCS3_SRC_DIR)
|
||||
set(RPCS3_SRC_DIR ${CMAKE_CURRENT_LIST_DIR})
|
||||
message("-- Initializing RPCS3_SRC_DIR=${RPCS3_SRC_DIR}")
|
||||
else()
|
||||
message("-- Using Custom RPCS3_SRC_DIR=${RPCS3_SRC_DIR}")
|
||||
endif()
|
||||
|
||||
# Qt5
|
||||
# finds Qt libraries and setups custom commands for MOC and UIC
|
||||
# Must be done here because generated MOC and UIC targets cant
|
||||
@@ -51,7 +39,21 @@ include(${CMAKE_SOURCE_DIR}/3rdparty/qt5.cmake)
|
||||
add_subdirectory(Emu)
|
||||
add_subdirectory(rpcs3qt)
|
||||
|
||||
set(RPCS3_SRC
|
||||
if(WIN32)
|
||||
add_executable(rpcs3 WIN32)
|
||||
target_sources(rpcs3 PRIVATE rpcs3.rc)
|
||||
elseif(APPLE)
|
||||
add_executable(rpcs3 MACOSX_BUNDLE)
|
||||
target_sources(rpcs3 PRIVATE rpcs3.icns)
|
||||
set_target_properties(rpcs3
|
||||
PROPERTIES
|
||||
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/rpcs3.plist.in")
|
||||
else()
|
||||
add_executable(rpcs3)
|
||||
endif()
|
||||
|
||||
target_sources(rpcs3
|
||||
PRIVATE
|
||||
display_sleep_control.cpp
|
||||
headless_application.cpp
|
||||
main.cpp
|
||||
@@ -75,36 +77,20 @@ set(RPCS3_SRC
|
||||
Input/xinput_pad_handler.cpp
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
add_executable(rpcs3 WIN32 ${RPCS3_SRC})
|
||||
elseif(APPLE)
|
||||
add_executable(rpcs3 MACOSX_BUNDLE ${RPCS3_SRC} "${RPCS3_SRC_DIR}/rpcs3.icns")
|
||||
set_target_properties(rpcs3
|
||||
PROPERTIES
|
||||
MACOSX_BUNDLE_INFO_PLIST "${RPCS3_SRC_DIR}/rpcs3.plist.in")
|
||||
else()
|
||||
add_executable(rpcs3 ${RPCS3_SRC})
|
||||
endif()
|
||||
|
||||
gen_git_version(${RPCS3_SRC_DIR})
|
||||
gen_git_version(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
set_target_properties(rpcs3
|
||||
PROPERTIES
|
||||
AUTOMOC ON
|
||||
AUTOUIC ON)
|
||||
|
||||
target_link_libraries(rpcs3 rpcs3_emu rpcs3_ui)
|
||||
target_link_libraries(rpcs3 3rdparty::discordRPC 3rdparty::qt5 3rdparty::hidapi 3rdparty::libusb 3rdparty::wolfssl 3rdparty::libcurl)
|
||||
target_link_libraries(rpcs3 ${ADDITIONAL_LIBS})
|
||||
|
||||
# Win resource file
|
||||
if(WIN32)
|
||||
target_sources(rpcs3 PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/rpcs3.rc")
|
||||
endif()
|
||||
target_link_libraries(rpcs3 PRIVATE rpcs3_emu rpcs3_ui)
|
||||
target_link_libraries(rpcs3 PRIVATE 3rdparty::discordRPC 3rdparty::qt5 3rdparty::hidapi 3rdparty::libusb 3rdparty::wolfssl 3rdparty::libcurl 3rdparty::zlib)
|
||||
target_link_libraries(rpcs3 PRIVATE ${ADDITIONAL_LIBS})
|
||||
|
||||
# Unix display manager
|
||||
if(X11_FOUND)
|
||||
target_include_directories(rpcs3 PUBLIC ${X11_INCLUDE_DIR})
|
||||
target_link_libraries(rpcs3 ${X11_LIBRARIES})
|
||||
target_link_libraries(rpcs3 PRIVATE ${X11_LIBRARIES})
|
||||
elseif(USE_VULKAN AND UNIX AND NOT WAYLAND_FOUND AND NOT APPLE)
|
||||
# Wayland has been checked in 3rdparty/CMakeLists.txt already.
|
||||
message(FATAL_ERROR "RPCS3 requires either X11 or Wayland (or both) for Vulkan.")
|
||||
@@ -113,30 +99,26 @@ endif()
|
||||
if(UNIX)
|
||||
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
|
||||
find_package(Threads REQUIRED)
|
||||
target_link_libraries(rpcs3 Threads::Threads)
|
||||
target_link_libraries(rpcs3 PRIVATE Threads::Threads)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(rpcs3 ws2_32.lib Iphlpapi.lib Winmm.lib Psapi.lib gdi32.lib setupapi.lib)
|
||||
target_link_libraries(rpcs3 PRIVATE ws2_32 Iphlpapi Winmm Psapi gdi32 setupapi pdh)
|
||||
else()
|
||||
target_link_libraries(rpcs3 ${CMAKE_DL_LIBS})
|
||||
target_link_libraries(rpcs3 PRIVATE ${CMAKE_DL_LIBS})
|
||||
endif()
|
||||
|
||||
if(USE_PRECOMPILED_HEADERS)
|
||||
if(COMMAND target_precompile_headers)
|
||||
target_precompile_headers(rpcs3 PRIVATE "${RPCS3_SRC_DIR}/stdafx.h")
|
||||
else()
|
||||
set_target_properties(rpcs3 PROPERTIES
|
||||
COTIRE_CXX_PREFIX_HEADER_INIT "${RPCS3_SRC_DIR}/stdafx.h"
|
||||
COTIRE_ADD_UNITY_BUILD OFF)
|
||||
|
||||
cotire(rpcs3)
|
||||
endif()
|
||||
target_precompile_headers(rpcs3 PRIVATE stdafx.h)
|
||||
endif()
|
||||
|
||||
get_target_property(_qmake_executable Qt5::qmake IMPORTED_LOCATION)
|
||||
get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY)
|
||||
find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${_qt_bin_dir}")
|
||||
if(APPLE)
|
||||
find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${_qt_bin_dir}")
|
||||
elseif(WIN32)
|
||||
find_program(WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${_qt_bin_dir}")
|
||||
endif()
|
||||
|
||||
# Copy icons to executable directory
|
||||
if(APPLE)
|
||||
@@ -147,7 +129,7 @@ if(APPLE)
|
||||
endif()
|
||||
add_custom_command(TARGET rpcs3 POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${RPCS3_SRC_DIR}/rpcs3.icns $<TARGET_FILE_DIR:rpcs3>/../Resources/rpcs3.icns
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rpcs3.icns $<TARGET_FILE_DIR:rpcs3>/../Resources/rpcs3.icns
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
${CMAKE_SOURCE_DIR}/bin/Icons $<TARGET_FILE_DIR:rpcs3>/../Resources/Icons
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
@@ -183,18 +165,18 @@ elseif(WIN32)
|
||||
# share/cmake/Qt5/ for Qt5_Dir
|
||||
|
||||
# If Qt5 is installed from official Qt installer
|
||||
list(APPEND _QT5_TOOLS_PATHS "${Qt5_DIR}/../../../bin/")
|
||||
# list(APPEND _QT5_TOOLS_PATHS "${Qt5_DIR}/../../../bin/")
|
||||
|
||||
# If Qt5 is installed from vcpkg
|
||||
list(APPEND _QT5_TOOLS_PATHS "${Qt5_DIR}/../../../tools/qt5$<$<CONFIG:Debug>:/debug>/bin/")
|
||||
# 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 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 "${_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>")
|
||||
# COMMAND set PATH=${Qt5_DIR}/../../../$<$<CONFIG:Debug>:debug/>bin/$<SEMICOLON>%PATH%
|
||||
COMMAND "${WINDEPLOYQT_EXECUTABLE}" --no-angle --no-compiler-runtime --no-opengl-sw --no-patchqt --no-translations --no-quick --plugindir "$<TARGET_FILE_DIR:rpcs3>/qt/plugins" --verbose 0 "$<TARGET_FILE:rpcs3>")
|
||||
endif()
|
||||
|
||||
# Unix installation
|
||||
|
||||
@@ -11,46 +11,77 @@
|
||||
|
||||
LOG_CHANNEL(dec_log, "DECRYPT");
|
||||
|
||||
void decrypt_sprx_libraries(std::vector<std::string> modules, std::function<std::string(std::string old_path, std::string path, bool tried)> input_cb)
|
||||
usz decrypt_binaries_t::decrypt(std::string klic_input)
|
||||
{
|
||||
if (modules.empty())
|
||||
if (m_index >= m_modules.size())
|
||||
{
|
||||
std::cout << "No paths specified" << std::endl; // For CLI
|
||||
return;
|
||||
m_index = umax;
|
||||
return umax;
|
||||
}
|
||||
|
||||
dec_log.notice("Decrypting binaries...");
|
||||
std::cout << "Decrypting binaries..." << std::endl; // For CLI
|
||||
|
||||
// Always start with no KLIC
|
||||
std::vector<u128> klics{u128{}};
|
||||
|
||||
if (const auto keys = g_fxo->try_get<loaded_npdrm_keys>())
|
||||
if (m_klics.empty())
|
||||
{
|
||||
// Second klic: get it from a running game
|
||||
if (const u128 klic = keys->last_key())
|
||||
dec_log.notice("Decrypting binaries...");
|
||||
std::cout << "Decrypting binaries..." << std::endl; // For CLI
|
||||
|
||||
// Always start with no KLIC
|
||||
m_klics.emplace_back(u128{});
|
||||
|
||||
if (const auto keys = g_fxo->try_get<loaded_npdrm_keys>())
|
||||
{
|
||||
klics.emplace_back(klic);
|
||||
// Second klic: get it from a running game
|
||||
if (const u128 klic = keys->last_key())
|
||||
{
|
||||
m_klics.emplace_back(klic);
|
||||
}
|
||||
}
|
||||
|
||||
// Try to use the key that has been for the current running ELF
|
||||
m_klics.insert(m_klics.end(), Emu.klic.begin(), Emu.klic.end());
|
||||
}
|
||||
|
||||
if (std::string_view text = std::string_view{klic_input}.substr(klic_input.find_first_of('x') + 1); text.size() == 32)
|
||||
{
|
||||
// Allowed to fail (would simply repeat the operation if fails again)
|
||||
u64 lo = 0;
|
||||
u64 hi = 0;
|
||||
bool success = false;
|
||||
|
||||
if (auto res = std::from_chars(text.data() + 0, text.data() + 16, lo, 16); res.ec == std::errc() && res.ptr == text.data() + 16)
|
||||
{
|
||||
if (res = std::from_chars(text.data() + 16, text.data() + 32, hi, 16); res.ec == std::errc() && res.ptr == text.data() + 32)
|
||||
{
|
||||
success = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (success)
|
||||
{
|
||||
lo = std::bit_cast<be_t<u64>>(lo);
|
||||
hi = std::bit_cast<be_t<u64>>(hi);
|
||||
|
||||
if (u128 input_key = ((u128{hi} << 64) | lo))
|
||||
{
|
||||
m_klics.emplace_back(input_key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Try to use the key that has been for the current running ELF
|
||||
klics.insert(klics.end(), Emu.klic.begin(), Emu.klic.end());
|
||||
|
||||
for (const std::string& _module : modules)
|
||||
while (m_index < m_modules.size())
|
||||
{
|
||||
const std::string& _module = m_modules[m_index];
|
||||
const std::string old_path = _module;
|
||||
|
||||
fs::file elf_file;
|
||||
|
||||
bool tried = false;
|
||||
bool invalid = false;
|
||||
usz key_it = 0;
|
||||
u32 file_magic{};
|
||||
|
||||
while (true)
|
||||
{
|
||||
for (; key_it < klics.size(); key_it++)
|
||||
for (; key_it < m_klics.size(); key_it++)
|
||||
{
|
||||
if (!elf_file.open(old_path) || !elf_file.read(file_magic))
|
||||
{
|
||||
@@ -62,7 +93,7 @@ void decrypt_sprx_libraries(std::vector<std::string> modules, std::function<std:
|
||||
case "SCE\0"_u32:
|
||||
{
|
||||
// First KLIC is no KLIC
|
||||
elf_file = decrypt_self(std::move(elf_file), key_it != 0 ? reinterpret_cast<u8*>(&klics[key_it]) : nullptr);
|
||||
elf_file = decrypt_self(std::move(elf_file), key_it != 0 ? reinterpret_cast<u8*>(&m_klics[key_it]) : nullptr);
|
||||
|
||||
if (!elf_file)
|
||||
{
|
||||
@@ -75,7 +106,7 @@ void decrypt_sprx_libraries(std::vector<std::string> modules, std::function<std:
|
||||
case "NPD\0"_u32:
|
||||
{
|
||||
// EDAT / SDAT
|
||||
elf_file = DecryptEDAT(elf_file, old_path, key_it != 0 ? 8 : 1, reinterpret_cast<u8*>(&klics[key_it]), true);
|
||||
elf_file = DecryptEDAT(elf_file, old_path, key_it != 0 ? 8 : 1, reinterpret_cast<u8*>(&m_klics[key_it]), true);
|
||||
|
||||
if (!elf_file)
|
||||
{
|
||||
@@ -111,11 +142,13 @@ void decrypt_sprx_libraries(std::vector<std::string> modules, std::function<std:
|
||||
new_file.write(elf_file.to_string());
|
||||
dec_log.success("Decrypted %s -> %s", old_path, new_path);
|
||||
std::cout << "Decrypted " << old_path << " -> " << new_path << std::endl; // For CLI
|
||||
m_index++;
|
||||
}
|
||||
else
|
||||
{
|
||||
dec_log.error("Failed to create %s", new_path);
|
||||
std::cout << "Failed to create " << new_path << std::endl; // For CLI
|
||||
m_index = umax;
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -124,42 +157,16 @@ void decrypt_sprx_libraries(std::vector<std::string> modules, std::function<std:
|
||||
if (!invalid)
|
||||
{
|
||||
// Allow the user to manually type KLIC if decryption failed
|
||||
|
||||
const std::string filename = old_path.substr(old_path.find_last_of(fs::delim) + 1);
|
||||
const std::string text = input_cb ? input_cb(old_path, filename, tried) : "";
|
||||
|
||||
if (!text.empty())
|
||||
{
|
||||
auto& klic = (tried ? klics.back() : klics.emplace_back());
|
||||
|
||||
ensure(text.size() == 32);
|
||||
|
||||
// It must succeed (only hex characters are present)
|
||||
u64 lo_ = 0;
|
||||
u64 hi_ = 0;
|
||||
std::from_chars(&text[0], &text[16], lo_, 16);
|
||||
std::from_chars(&text[16], &text[32], hi_, 16);
|
||||
|
||||
be_t<u64> lo = std::bit_cast<be_t<u64>>(lo_);
|
||||
be_t<u64> hi = std::bit_cast<be_t<u64>>(hi_);
|
||||
|
||||
klic = (u128{+hi} << 64) | +lo;
|
||||
|
||||
// Retry with specified KLIC
|
||||
key_it -= +std::exchange(tried, true); // Rewind on second and above attempt
|
||||
dec_log.notice("KLIC entered for %s: %s", filename, klic);
|
||||
continue;
|
||||
}
|
||||
|
||||
dec_log.notice("User has cancelled entering KLIC.");
|
||||
return m_index;
|
||||
}
|
||||
|
||||
dec_log.error("Failed to decrypt \"%s\".", old_path);
|
||||
std::cout << "Failed to decrypt \"" << old_path << "\"." << std::endl; // For CLI
|
||||
break;
|
||||
return m_index;
|
||||
}
|
||||
}
|
||||
|
||||
dec_log.notice("Finished decrypting all binaries.");
|
||||
std::cout << "Finished decrypting all binaries." << std::endl; // For CLI
|
||||
return m_index;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
void decrypt_sprx_libraries(std::vector<std::string> modules, std::function<std::string(std::string old_path, std::string path, bool tried)> input_cb);
|
||||
class decrypt_binaries_t
|
||||
{
|
||||
std::vector<u128> m_klics;
|
||||
std::vector<std::string> m_modules;
|
||||
usz m_index = 0;
|
||||
|
||||
public:
|
||||
decrypt_binaries_t(std::vector<std::string> modules) noexcept
|
||||
: m_modules(std::move(modules))
|
||||
{
|
||||
}
|
||||
|
||||
usz decrypt(std::string klic_input = {});
|
||||
|
||||
bool done() const
|
||||
{
|
||||
return m_index >= m_klics.size();
|
||||
}
|
||||
|
||||
const std::string& operator[](usz index) const
|
||||
{
|
||||
return ::at32(m_modules, index);
|
||||
}
|
||||
};
|
||||
|
||||
+65
-101
@@ -5,21 +5,9 @@
|
||||
#include "utils.h"
|
||||
#include <cstring>
|
||||
|
||||
static void bn_zero(u8* d, u32 n)
|
||||
static inline int bn_compare(u8* a, u8* b, u32 n)
|
||||
{
|
||||
memset(d, 0, n);
|
||||
}
|
||||
|
||||
static void bn_copy(u8* d, u8* a, u32 n)
|
||||
{
|
||||
memcpy(d, a, n);
|
||||
}
|
||||
|
||||
static int bn_compare(u8* a, u8* b, u32 n)
|
||||
{
|
||||
u32 i;
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
for (u32 i = 0; i < n; i++)
|
||||
{
|
||||
if (a[i] < b[i])
|
||||
return -1;
|
||||
@@ -32,14 +20,10 @@ static int bn_compare(u8* a, u8* b, u32 n)
|
||||
|
||||
static u8 bn_add_1(u8* d, u8* a, u8* b, u32 n)
|
||||
{
|
||||
u32 i;
|
||||
u32 dig;
|
||||
u8 c;
|
||||
|
||||
c = 0;
|
||||
for (i = n - 1; i < n; i--)
|
||||
u8 c = 0;
|
||||
for (u32 i = n - 1; i != umax; i--)
|
||||
{
|
||||
dig = a[i] + b[i] + c;
|
||||
const u32 dig = a[i] + b[i] + c;
|
||||
c = dig >> 8;
|
||||
d[i] = dig;
|
||||
}
|
||||
@@ -49,14 +33,10 @@ static u8 bn_add_1(u8* d, u8* a, u8* b, u32 n)
|
||||
|
||||
static u8 bn_sub_1(u8* d, u8* a, u8* b, u32 n)
|
||||
{
|
||||
u32 i;
|
||||
u32 dig;
|
||||
u8 c;
|
||||
|
||||
c = 1;
|
||||
for (i = n - 1; i < n; i--)
|
||||
u8 c = 1;
|
||||
for (u32 i = n - 1; i != umax; i--)
|
||||
{
|
||||
dig = a[i] + 255 - b[i] + c;
|
||||
const u32 dig = a[i] + 255 - b[i] + c;
|
||||
c = dig >> 8;
|
||||
d[i] = dig;
|
||||
}
|
||||
@@ -105,15 +85,12 @@ static constexpr u8 inv256[0x80] = {
|
||||
|
||||
static void bn_mon_muladd_dig(u8* d, u8* a, u8 b, u8* N, u32 n)
|
||||
{
|
||||
u32 dig;
|
||||
u32 i;
|
||||
|
||||
const u8 z = -(d[n - 1] + a[n - 1] * b) * inv256[N[n - 1] / 2];
|
||||
|
||||
dig = d[n - 1] + a[n - 1] * b + N[n - 1] * z;
|
||||
u32 dig = d[n - 1] + a[n - 1] * b + N[n - 1] * z;
|
||||
dig >>= 8;
|
||||
|
||||
for (i = n - 2; i < n; i--)
|
||||
for (u32 i = n - 2; i < n; i--)
|
||||
{
|
||||
dig += d[i] + a[i] * b + N[i] * z;
|
||||
d[i + 1] = dig;
|
||||
@@ -132,21 +109,17 @@ static void bn_mon_muladd_dig(u8* d, u8* a, u8 b, u8* N, u32 n)
|
||||
static void bn_mon_mul(u8* d, u8* a, u8* b, u8* N, u32 n)
|
||||
{
|
||||
u8 t[512];
|
||||
u32 i;
|
||||
memset(t, 0, n);
|
||||
|
||||
bn_zero(t, n);
|
||||
|
||||
for (i = n - 1; i < n; i--)
|
||||
for (u32 i = n - 1; i != umax; i--)
|
||||
bn_mon_muladd_dig(t, a, b[i], N, n);
|
||||
|
||||
bn_copy(d, t, n);
|
||||
memcpy(d, t, n);
|
||||
}
|
||||
|
||||
static void bn_to_mon(u8* d, u8* N, u32 n)
|
||||
{
|
||||
u32 i;
|
||||
|
||||
for (i = 0; i < 8 * n; i++)
|
||||
for (u32 i = 0; i < 8 * n; i++)
|
||||
bn_add(d, d, d, N, n);
|
||||
}
|
||||
|
||||
@@ -154,7 +127,7 @@ static void bn_from_mon(u8* d, u8* N, u32 n)
|
||||
{
|
||||
u8 t[512];
|
||||
|
||||
bn_zero(t, n);
|
||||
memset(t, 0, n);
|
||||
t[n - 1] = 1;
|
||||
bn_mon_mul(d, d, t, N, n);
|
||||
}
|
||||
@@ -162,29 +135,29 @@ static void bn_from_mon(u8* d, u8* N, u32 n)
|
||||
static void bn_mon_exp(u8* d, u8* a, u8* N, u32 n, u8* e, u32 en)
|
||||
{
|
||||
u8 t[512];
|
||||
u32 i;
|
||||
u8 mask;
|
||||
|
||||
bn_zero(d, n);
|
||||
memset(d, 0, n);
|
||||
d[n - 1] = 1;
|
||||
bn_to_mon(d, N, n);
|
||||
|
||||
for (i = 0; i < en; i++)
|
||||
for (mask = 0x80; mask != 0; mask >>= 1)
|
||||
for (u32 i = 0; i < en; i++)
|
||||
{
|
||||
for (u8 mask = 0x80; mask != 0; mask >>= 1)
|
||||
{
|
||||
bn_mon_mul(t, d, d, N, n);
|
||||
if ((e[i] & mask) != 0)
|
||||
bn_mon_mul(d, t, a, N, n);
|
||||
else
|
||||
bn_copy(d, t, n);
|
||||
memcpy(d, t, n);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void bn_mon_inv(u8* d, u8* a, u8* N, u32 n)
|
||||
{
|
||||
u8 t[512], s[512];
|
||||
|
||||
bn_zero(s, n);
|
||||
memset(s, 0, n);
|
||||
s[n - 1] = 2;
|
||||
bn_sub_1(t, N, s, n);
|
||||
bn_mon_exp(d, a, N, n, t, n);
|
||||
@@ -203,26 +176,16 @@ static thread_local u8 ec_N[21]{};
|
||||
static thread_local point ec_G{}; // mon
|
||||
static thread_local point ec_Q{}; // mon
|
||||
static thread_local u8 ec_k[21]{};
|
||||
static thread_local bool ec_curve_initialized{};
|
||||
static thread_local bool ec_pub_initialized{};
|
||||
|
||||
static void elt_copy(u8* d, u8* a)
|
||||
static inline bool elt_is_zero(u8* d)
|
||||
{
|
||||
memcpy(d, a, 20);
|
||||
}
|
||||
|
||||
static void elt_zero(u8* d)
|
||||
{
|
||||
memset(d, 0, 20);
|
||||
}
|
||||
|
||||
static int elt_is_zero(u8* d)
|
||||
{
|
||||
u32 i;
|
||||
|
||||
for (i = 0; i < 20; i++)
|
||||
for (u32 i = 0; i < 20; i++)
|
||||
if (d[i] != 0)
|
||||
return 0;
|
||||
return false;
|
||||
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void elt_add(u8* d, u8* a, u8* b)
|
||||
@@ -248,7 +211,7 @@ static void elt_square(u8* d, u8* a)
|
||||
static void elt_inv(u8* d, u8* a)
|
||||
{
|
||||
u8 s[20];
|
||||
elt_copy(s, a);
|
||||
memcpy(s, a, 20);
|
||||
bn_mon_inv(d, s, ec_p, 20);
|
||||
}
|
||||
|
||||
@@ -264,13 +227,13 @@ static void point_from_mon(point* p)
|
||||
bn_from_mon(p->y, ec_p, 20);
|
||||
}
|
||||
|
||||
static void point_zero(point* p)
|
||||
static inline void point_zero(point* p)
|
||||
{
|
||||
elt_zero(p->x);
|
||||
elt_zero(p->y);
|
||||
memset(p->x, 0, 20);
|
||||
memset(p->y, 0, 20);
|
||||
}
|
||||
|
||||
static int point_is_zero(point* p)
|
||||
static inline bool point_is_zero(point* p)
|
||||
{
|
||||
return elt_is_zero(p->x) && elt_is_zero(p->y);
|
||||
}
|
||||
@@ -278,15 +241,13 @@ static int point_is_zero(point* p)
|
||||
static void point_double(point* r, point* p)
|
||||
{
|
||||
u8 s[20], t[20];
|
||||
point pp;
|
||||
u8 *px, *py, *rx, *ry;
|
||||
|
||||
pp = *p;
|
||||
point pp = *p;
|
||||
|
||||
px = pp.x;
|
||||
py = pp.y;
|
||||
rx = r->x;
|
||||
ry = r->y;
|
||||
u8* px = pp.x;
|
||||
u8* py = pp.y;
|
||||
u8* rx = r->x;
|
||||
u8* ry = r->y;
|
||||
|
||||
if (elt_is_zero(py))
|
||||
{
|
||||
@@ -314,30 +275,28 @@ static void point_double(point* r, point* p)
|
||||
static void point_add(point* r, point* p, point* q)
|
||||
{
|
||||
u8 s[20], t[20], u[20];
|
||||
u8 *px, *py, *qx, *qy, *rx, *ry;
|
||||
point pp, qq;
|
||||
|
||||
pp = *p;
|
||||
qq = *q;
|
||||
point pp = *p;
|
||||
point qq = *q;
|
||||
|
||||
px = pp.x;
|
||||
py = pp.y;
|
||||
qx = qq.x;
|
||||
qy = qq.y;
|
||||
rx = r->x;
|
||||
ry = r->y;
|
||||
u8* px = pp.x;
|
||||
u8* py = pp.y;
|
||||
u8* qx = qq.x;
|
||||
u8* qy = qq.y;
|
||||
u8* rx = r->x;
|
||||
u8* ry = r->y;
|
||||
|
||||
if (point_is_zero(&pp))
|
||||
{
|
||||
elt_copy(rx, qx);
|
||||
elt_copy(ry, qy);
|
||||
memcpy(rx, qx, 20);
|
||||
memcpy(ry, qy, 20);
|
||||
return;
|
||||
}
|
||||
|
||||
if (point_is_zero(&qq))
|
||||
{
|
||||
elt_copy(rx, px);
|
||||
elt_copy(ry, py);
|
||||
memcpy(rx, px, 20);
|
||||
memcpy(ry, py, 20);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -369,21 +328,20 @@ static void point_add(point* r, point* p, point* q)
|
||||
|
||||
static void point_mul(point* d, u8* a, point* b) // a is bignum
|
||||
{
|
||||
u32 i;
|
||||
u8 mask;
|
||||
|
||||
point_zero(d);
|
||||
|
||||
for (i = 0; i < 21; i++)
|
||||
for (mask = 0x80; mask != 0; mask >>= 1)
|
||||
for (u32 i = 0; i < 21; i++)
|
||||
{
|
||||
for (u8 mask = 0x80; mask != 0; mask >>= 1)
|
||||
{
|
||||
point_double(d, d);
|
||||
if ((a[i] & mask) != 0)
|
||||
point_add(d, d, b);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int check_ecdsa(struct point* Q, u8* R, u8* S, u8* hash)
|
||||
static bool check_ecdsa(struct point* Q, u8* R, u8* S, u8* hash)
|
||||
{
|
||||
u8 Sinv[21];
|
||||
u8 e[21];
|
||||
@@ -424,8 +382,10 @@ static int check_ecdsa(struct point* Q, u8* R, u8* S, u8* hash)
|
||||
return (bn_compare(rr, R, 21) == 0);
|
||||
}
|
||||
|
||||
int ecdsa_set_curve(const u8* p, const u8* a, const u8* b, const u8* N, const u8* Gx, const u8* Gy)
|
||||
void ecdsa_set_curve(const u8* p, const u8* a, const u8* b, const u8* N, const u8* Gx, const u8* Gy)
|
||||
{
|
||||
if (ec_curve_initialized) return;
|
||||
|
||||
memcpy(ec_p, p, 20);
|
||||
memcpy(ec_a, a, 20);
|
||||
memcpy(ec_b, b, 20);
|
||||
@@ -438,14 +398,18 @@ int ecdsa_set_curve(const u8* p, const u8* a, const u8* b, const u8* N, const u8
|
||||
|
||||
point_to_mon(&ec_G);
|
||||
|
||||
return 0;
|
||||
ec_curve_initialized = true;
|
||||
}
|
||||
|
||||
void ecdsa_set_pub(const u8* Q)
|
||||
{
|
||||
if (ec_pub_initialized) return;
|
||||
|
||||
memcpy(ec_Q.x, Q, 20);
|
||||
memcpy(ec_Q.y, Q+20, 20);
|
||||
memcpy(ec_Q.y, Q + 20, 20);
|
||||
point_to_mon(&ec_Q);
|
||||
|
||||
ec_pub_initialized = true;
|
||||
}
|
||||
|
||||
void ecdsa_set_priv(const u8* k)
|
||||
@@ -453,7 +417,7 @@ void ecdsa_set_priv(const u8* k)
|
||||
memcpy(ec_k, k, sizeof ec_k);
|
||||
}
|
||||
|
||||
int ecdsa_verify(u8* hash, u8* R, u8* S)
|
||||
bool ecdsa_verify(u8* hash, u8* R, u8* S)
|
||||
{
|
||||
return check_ecdsa(&ec_Q, R, S, hash);
|
||||
}
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "util/types.hpp"
|
||||
|
||||
int ecdsa_set_curve(const u8* p, const u8* a, const u8* b, const u8* N, const u8* Gx, const u8* Gy);
|
||||
void ecdsa_set_curve(const u8* p, const u8* a, const u8* b, const u8* N, const u8* Gx, const u8* Gy);
|
||||
void ecdsa_set_pub(const u8* Q);
|
||||
void ecdsa_set_priv(const u8* k);
|
||||
int ecdsa_verify(u8* hash, u8* R, u8* S);
|
||||
bool ecdsa_verify(u8* hash, u8* R, u8* S);
|
||||
|
||||
@@ -493,7 +493,9 @@ int check_data(unsigned char *key, EDAT_HEADER *edat, NPD_HEADER *npd, const fs:
|
||||
memcpy(signature_r + 01, metadata_signature, 0x14);
|
||||
memcpy(signature_s + 01, metadata_signature + 0x14, 0x14);
|
||||
if ((!memcmp(signature_r, zero_buf, 0x15)) || (!memcmp(signature_s, zero_buf, 0x15)))
|
||||
{
|
||||
edat_log.warning("Metadata signature is invalid!");
|
||||
}
|
||||
else
|
||||
{
|
||||
// Setup signature hash.
|
||||
@@ -524,7 +526,9 @@ int check_data(unsigned char *key, EDAT_HEADER *edat, NPD_HEADER *npd, const fs:
|
||||
memcpy(signature_s + 01, header_signature + 0x14, 0x14);
|
||||
|
||||
if ((!memcmp(signature_r, zero_buf, 0x15)) || (!memcmp(signature_s, zero_buf, 0x15)))
|
||||
{
|
||||
edat_log.warning("Header signature is invalid!");
|
||||
}
|
||||
else
|
||||
{
|
||||
// Setup header signature hash.
|
||||
|
||||
@@ -95,9 +95,9 @@ public:
|
||||
bool ReadHeader();
|
||||
u64 ReadData(u64 pos, u8* data, u64 size);
|
||||
|
||||
fs::stat_t stat() override
|
||||
fs::stat_t get_stat() override
|
||||
{
|
||||
fs::stat_t stats = edata_file.stat();
|
||||
fs::stat_t stats = edata_file.get_stat();
|
||||
stats.is_writable = false; // TODO
|
||||
stats.size = file_size;
|
||||
return stats;
|
||||
@@ -143,4 +143,11 @@ public:
|
||||
}
|
||||
|
||||
u64 size() override { return file_size; }
|
||||
|
||||
fs::file_id get_id() override
|
||||
{
|
||||
fs::file_id id = edata_file.get_id();
|
||||
id.type.insert(0, "EDATADecrypter: "sv);
|
||||
return id;
|
||||
}
|
||||
};
|
||||
|
||||
+43
-31
@@ -67,7 +67,7 @@ bool package_reader::read_header()
|
||||
}
|
||||
|
||||
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_magic = 0x%x = \"%s\"", +m_header.pkg_magic, std::string_view(reinterpret_cast<const char*>(&m_header.pkg_magic + 1), 3)); // Skip 0x7F
|
||||
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);
|
||||
pkg_log.notice("Header: meta_offset = 0x%x = %d", m_header.meta_offset, m_header.meta_offset);
|
||||
@@ -94,7 +94,7 @@ bool package_reader::read_header()
|
||||
return false;
|
||||
}
|
||||
|
||||
pkg_log.notice("Extended header: magic = 0x%x = \"%s\"", +ext_header.magic, std::string(reinterpret_cast<const char*>(&ext_header.magic), 4));
|
||||
pkg_log.notice("Extended header: magic = 0x%x = \"%s\"", +ext_header.magic, std::string_view(reinterpret_cast<const char*>(&ext_header.magic + 1), 3));
|
||||
pkg_log.notice("Extended header: unknown_1 = 0x%x = %d", ext_header.unknown_1, ext_header.unknown_1);
|
||||
pkg_log.notice("Extended header: ext_hdr_size = 0x%x = %d", ext_header.ext_hdr_size, ext_header.ext_hdr_size);
|
||||
pkg_log.notice("Extended header: ext_data_size = 0x%x = %d", ext_header.ext_data_size, ext_header.ext_data_size);
|
||||
@@ -782,7 +782,7 @@ bool package_reader::fill_data(std::map<std::string, install_entry*>& all_instal
|
||||
const bool is_psp = (entry.type & PKG_FILE_ENTRY_PSP) != 0u;
|
||||
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};
|
||||
const std::string_view name{reinterpret_cast<char*>(m_bufs.back().get()), entry.name_size};
|
||||
std::string path = m_install_path + vfs::escape(name);
|
||||
|
||||
if (entry.pad || (entry.type & ~PKG_FILE_ENTRY_KNOWN_BITS))
|
||||
@@ -833,7 +833,7 @@ bool package_reader::fill_data(std::map<std::string, install_entry*>& all_instal
|
||||
|
||||
m_install_entries.push_back({
|
||||
.weak_reference = map_ptr,
|
||||
.name = name,
|
||||
.name = std::string(name),
|
||||
.file_offset = entry.file_offset,
|
||||
.file_size = entry.file_size,
|
||||
.type = entry.type,
|
||||
@@ -1032,8 +1032,8 @@ package_error package_reader::extract_data(std::deque<package_reader>& readers,
|
||||
if (!reader.set_install_path())
|
||||
{
|
||||
error = package_error::other;
|
||||
reader.m_result = result::error;
|
||||
break;
|
||||
reader.m_result = result::error; // We don't know if it's dirty yet.
|
||||
return error;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1042,41 +1042,52 @@ package_error package_reader::extract_data(std::deque<package_reader>& readers,
|
||||
// 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;
|
||||
|
||||
if (error == package_error::no_error)
|
||||
if (error != package_error::no_error || num_failures > 0)
|
||||
{
|
||||
// Check if this package is allowed to be installed on top of the existing data
|
||||
error = reader.check_target_app_version();
|
||||
ensure(reader.m_result == result::error || reader.m_result == result::error_dirty);
|
||||
return error;
|
||||
}
|
||||
|
||||
if (error == package_error::no_error)
|
||||
{
|
||||
reader.m_result = result::started;
|
||||
// Check if this package is allowed to be installed on top of the existing data
|
||||
error = reader.check_target_app_version();
|
||||
|
||||
// Parse the files to be installed and create all paths.
|
||||
if (!reader.fill_data(all_install_entries))
|
||||
{
|
||||
error = package_error::other;
|
||||
}
|
||||
if (error != package_error::no_error)
|
||||
{
|
||||
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_bufs.resize(std::min<usz>(utils::get_thread_count(), reader.m_install_entries.size()));
|
||||
reader.m_num_failures = error == package_error::no_error ? 0 : 1;
|
||||
|
||||
atomic_t<usz> thread_indexer = 0;
|
||||
|
||||
named_thread_group workers("PKG Installer "sv, std::max<u32>(::narrow<u32>(reader.m_bufs.size()), 1) - 1, [&]()
|
||||
if (reader.m_num_failures == 0)
|
||||
{
|
||||
reader.extract_worker(thread_key{thread_indexer++});
|
||||
});
|
||||
reader.m_bufs.resize(std::min<usz>(utils::get_thread_count(), reader.m_install_entries.size()));
|
||||
|
||||
reader.extract_worker(thread_key{thread_indexer++});
|
||||
workers.join();
|
||||
atomic_t<usz> thread_indexer = 0;
|
||||
|
||||
named_thread_group workers("PKG Installer "sv, std::max<u32>(::narrow<u32>(reader.m_bufs.size()), 1) - 1, [&]()
|
||||
{
|
||||
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;
|
||||
|
||||
reader.m_bufs.clear();
|
||||
reader.m_bufs.shrink_to_fit();
|
||||
|
||||
// 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()))
|
||||
{
|
||||
@@ -1099,13 +1110,14 @@ package_error package_reader::extract_data(std::deque<package_reader>& readers,
|
||||
if (reader.m_num_failures)
|
||||
{
|
||||
pkg_log.error("Package failed to install ('%s')", reader.m_install_path);
|
||||
reader.m_result = cleaned ? result::error_cleaned : result::error;
|
||||
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_cleaned : result::aborted;
|
||||
reader.m_result = cleaned ? result::aborted : result::aborted_dirty;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1121,7 +1133,7 @@ package_error package_reader::extract_data(std::deque<package_reader>& readers,
|
||||
bootable_paths.emplace_back(std::move(reader.m_bootable_file_path));
|
||||
}
|
||||
|
||||
if (num_failures > 0)
|
||||
if (error == package_error::no_error && num_failures > 0)
|
||||
{
|
||||
error = package_error::other;
|
||||
}
|
||||
|
||||
@@ -338,9 +338,9 @@ public:
|
||||
started,
|
||||
success,
|
||||
aborted,
|
||||
aborted_cleaned,
|
||||
aborted_dirty,
|
||||
error,
|
||||
error_cleaned
|
||||
error_dirty
|
||||
};
|
||||
|
||||
bool is_valid() const { return m_is_valid; }
|
||||
|
||||
+123
-125
@@ -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;
|
||||
}
|
||||
|
||||
@@ -873,7 +871,7 @@ bool SELFDecrypter::LoadHeaders(bool isElf32, SelfAdditionalInfo* out_info)
|
||||
|
||||
if (out_info)
|
||||
{
|
||||
out_info->valid = false;
|
||||
*out_info = {};
|
||||
}
|
||||
|
||||
// Check SCE magic.
|
||||
@@ -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);
|
||||
@@ -1413,7 +1411,7 @@ fs::file decrypt_self(fs::file elf_or_self, u8* klic_key, SelfAdditionalInfo* ou
|
||||
{
|
||||
if (out_info)
|
||||
{
|
||||
out_info->valid = false;
|
||||
*out_info = {};
|
||||
}
|
||||
|
||||
if (!elf_or_self)
|
||||
|
||||
+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);
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user