mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-09 03:29:43 -10:00
Compare commits
827
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7b6e564ba3 | ||
|
|
b574780d99 | ||
|
|
1a2ee91117 | ||
|
|
bc6fec6e0c | ||
|
|
ec06ab0941 | ||
|
|
32e2aacd3c | ||
|
|
7f08729a5e | ||
|
|
ea6139b234 | ||
|
|
96d87802cd | ||
|
|
618cfacd59 | ||
|
|
6d9ee4c161 | ||
|
|
46b9432fb8 | ||
|
|
c66bcc05cf | ||
|
|
00b15c4e79 | ||
|
|
597dbfdf9a | ||
|
|
af6b09d950 | ||
|
|
0194ce91bf | ||
|
|
a6901dc85e | ||
|
|
8850a4984b | ||
|
|
daef26f951 | ||
|
|
5ca99fdb51 | ||
|
|
23a06ef1a1 | ||
|
|
cd3e818210 | ||
|
|
619df7e11b | ||
|
|
df98bca9ae | ||
|
|
10e1f5d72a | ||
|
|
aac207b455 | ||
|
|
ca311246b1 | ||
|
|
22de07a662 | ||
|
|
2329a36f54 | ||
|
|
ab3385c73d | ||
|
|
f21f113678 | ||
|
|
d5b1c3092f | ||
|
|
d401816f41 | ||
|
|
dbb74ba5ab | ||
|
|
4e188c0f26 | ||
|
|
376f06c993 | ||
|
|
1bd188c5a7 | ||
|
|
d3813dddb1 | ||
|
|
957b71cfdc | ||
|
|
d35200aa56 | ||
|
|
919954c5be | ||
|
|
cc7247aecf | ||
|
|
024dbb5008 | ||
|
|
41afbc30ef | ||
|
|
8d513f8199 | ||
|
|
eb49458284 | ||
|
|
b2c87baa87 | ||
|
|
71ca56e0fb | ||
|
|
f505d625a3 | ||
|
|
6855b7f2b1 | ||
|
|
1ad0251da9 | ||
|
|
e5d6d411be | ||
|
|
b0c5362da6 | ||
|
|
67bc91c1d0 | ||
|
|
f0a510c8a6 | ||
|
|
f2d574fd87 | ||
|
|
8590e0e3fe | ||
|
|
d44f3e1239 | ||
|
|
1855ce5fc7 | ||
|
|
fa5ec2d4b1 | ||
|
|
bea512b70b | ||
|
|
54ae219302 | ||
|
|
5ac7d89e36 | ||
|
|
755789f825 | ||
|
|
5f3cb1fae2 | ||
|
|
9bd6051581 | ||
|
|
df5a2c5160 | ||
|
|
2482a6f42a | ||
|
|
26d6c8243a | ||
|
|
4fae4ead73 | ||
|
|
0f3ae9b03d | ||
|
|
5a65773b81 | ||
|
|
559a173e8b | ||
|
|
9a97eb47ad | ||
|
|
ac539f6316 | ||
|
|
ca26e50050 | ||
|
|
b620325714 | ||
|
|
1e4557c09a | ||
|
|
11d5d3170d | ||
|
|
21d3c13ed3 | ||
|
|
393343c03c | ||
|
|
4f57b6f6fa | ||
|
|
7a6434ecb2 | ||
|
|
b02ef55a92 | ||
|
|
462137305b | ||
|
|
eb50d7dbb4 | ||
|
|
77a17b213d | ||
|
|
ddd75d3bb9 | ||
|
|
ffb59e5261 | ||
|
|
5f834a8cb3 | ||
|
|
9a6faa3ddd | ||
|
|
0c0de9f0ad | ||
|
|
bbc121cd74 | ||
|
|
48bb705b03 | ||
|
|
78431d0700 | ||
|
|
97144833cb | ||
|
|
ae327a769b | ||
|
|
a66b1b3e48 | ||
|
|
5e879fa201 | ||
|
|
80136dd3ec | ||
|
|
2e82db6447 | ||
|
|
2802817239 | ||
|
|
9750ebcf71 | ||
|
|
0e98b4ddea | ||
|
|
97b9a79fc0 | ||
|
|
3963039102 | ||
|
|
4f26860bb4 | ||
|
|
47b6d4a99d | ||
|
|
52db47d0fd | ||
|
|
92b330f2aa | ||
|
|
bf8f527143 | ||
|
|
5a8920c862 | ||
|
|
dfea030f5b | ||
|
|
e68e3e9bb3 | ||
|
|
f3458fb943 | ||
|
|
d369e06a67 | ||
|
|
fa7dd0f6d9 | ||
|
|
0f142d531a | ||
|
|
6e7e8a7680 | ||
|
|
c2b3ba907c | ||
|
|
ece8ff8ad8 | ||
|
|
89f984400b | ||
|
|
a442c5b14f | ||
|
|
6223ba47fd | ||
|
|
1906a741c2 | ||
|
|
bba924e8d2 | ||
|
|
a6f44ab642 | ||
|
|
e999c65037 | ||
|
|
2d934f4d53 | ||
|
|
f5564120a4 | ||
|
|
b0ac722366 | ||
|
|
757ce5e572 | ||
|
|
def35ebe8e | ||
|
|
a0f3bf7432 | ||
|
|
b837e053e9 | ||
|
|
c8e183fb3c | ||
|
|
29510df156 | ||
|
|
d9157c5dc7 | ||
|
|
692f4443f4 | ||
|
|
d0a08ce959 | ||
|
|
6780f58444 | ||
|
|
a489f1275a | ||
|
|
84f5ab96ea | ||
|
|
fe10d285ec | ||
|
|
9ad6ebc879 | ||
|
|
4116cb6fa5 | ||
|
|
14e974ea07 | ||
|
|
a6b0efa4f0 | ||
|
|
c4880ca840 | ||
|
|
1c4895b8bf | ||
|
|
1ca1d362bf | ||
|
|
beabcebe9d | ||
|
|
1e4af83e2a | ||
|
|
9e84c5c2c8 | ||
|
|
1c82fd29ef | ||
|
|
f0bd4e9172 | ||
|
|
05bf208f7d | ||
|
|
e9e6607fc9 | ||
|
|
5b3942eae7 | ||
|
|
148a489af5 | ||
|
|
d28402b87d | ||
|
|
a736dd27d2 | ||
|
|
ccb8ecec4d | ||
|
|
f1c276b751 | ||
|
|
ef31302bd5 | ||
|
|
28417a02b7 | ||
|
|
cd69803427 | ||
|
|
11b0667e72 | ||
|
|
d4c62a177a | ||
|
|
7c9817b582 | ||
|
|
3ce8d14c2e | ||
|
|
57054a075d | ||
|
|
027bbe0755 | ||
|
|
ac4adabeb9 | ||
|
|
c76cb77202 | ||
|
|
d07e0da412 | ||
|
|
43b72ea23c | ||
|
|
fbeb157bba | ||
|
|
df89a6b604 | ||
|
|
8d7e8bb574 | ||
|
|
20ef0667b0 | ||
|
|
c34982d695 | ||
|
|
0c806447b5 | ||
|
|
b375e08c67 | ||
|
|
b2a4620f3b | ||
|
|
013dd30bde | ||
|
|
7e08c019bc | ||
|
|
8dfaee370a | ||
|
|
c737947d74 | ||
|
|
9a4597d7ba | ||
|
|
82e53d3db8 | ||
|
|
59e36c51a3 | ||
|
|
a4017e69e4 | ||
|
|
8b1fa3bb59 | ||
|
|
2aeb0b079e | ||
|
|
2d9a1d2270 | ||
|
|
075783d4f7 | ||
|
|
a2c378c594 | ||
|
|
9cd5e66b21 | ||
|
|
f58c7f69d9 | ||
|
|
406c8bee7b | ||
|
|
13a2d2419f | ||
|
|
c6e86caeed | ||
|
|
e42a1895af | ||
|
|
efffa2a76e | ||
|
|
5b801bab46 | ||
|
|
187a73d93a | ||
|
|
ef3dbc8378 | ||
|
|
7e1fdafa47 | ||
|
|
92efe48db2 | ||
|
|
1f7532bf52 | ||
|
|
0e3fddf448 | ||
|
|
0515377d63 | ||
|
|
93e5fc60af | ||
|
|
bb30dc3dee | ||
|
|
70ca111a53 | ||
|
|
80225daee0 | ||
|
|
feb4f266fa | ||
|
|
34758d15ef | ||
|
|
6fe45a451d | ||
|
|
f7ad73b494 | ||
|
|
8e46e46a40 | ||
|
|
722e36001f | ||
|
|
8a037a3091 | ||
|
|
f129a55a8a | ||
|
|
390f914357 | ||
|
|
980647c9b8 | ||
|
|
87c1800cb8 | ||
|
|
4c227afb0d | ||
|
|
35c2ec993b | ||
|
|
86b297e0fd | ||
|
|
b513a3d166 | ||
|
|
c19c6a3ca8 | ||
|
|
a40d1ce8b6 | ||
|
|
d9312d09a8 | ||
|
|
97db0291d2 | ||
|
|
ce4fce12c0 | ||
|
|
1661d4e969 | ||
|
|
f459472f6d | ||
|
|
6170fc45ae | ||
|
|
c1ed271a12 | ||
|
|
84a83ef43c | ||
|
|
079070daf7 | ||
|
|
110882903c | ||
|
|
a5f8053533 | ||
|
|
b0e7a4db6a | ||
|
|
9700a009c5 | ||
|
|
64244cd73f | ||
|
|
2178f9d36f | ||
|
|
26c2259b11 | ||
|
|
60e25c5e3b | ||
|
|
fe1f311a35 | ||
|
|
885f9bbcc3 | ||
|
|
7a0dc3c4ca | ||
|
|
a803f652ab | ||
|
|
a2fb0847ae | ||
|
|
bd3533f05d | ||
|
|
5dcec3819e | ||
|
|
a58676709a | ||
|
|
c6af4089b4 | ||
|
|
4e90b731d3 | ||
|
|
5dd06ccfcd | ||
|
|
7b75dc4f9b | ||
|
|
2c47d94bf5 | ||
|
|
e5dc368e20 | ||
|
|
49632bbde9 | ||
|
|
e58b2c9b6b | ||
|
|
9956ff041e | ||
|
|
2d1a657ba8 | ||
|
|
39275e8ce3 | ||
|
|
bdba803909 | ||
|
|
327f220857 | ||
|
|
c844705665 | ||
|
|
109f4fafec | ||
|
|
0527d77de1 | ||
|
|
f9c0cb198c | ||
|
|
e596bf7925 | ||
|
|
2af9441d35 | ||
|
|
f4b79ad13d | ||
|
|
0c7650c525 | ||
|
|
d0612f906d | ||
|
|
05b36ec374 | ||
|
|
1df4fa70e8 | ||
|
|
9dd06996c5 | ||
|
|
c427e9d9ba | ||
|
|
18cc6b4bd9 | ||
|
|
2aee034a24 | ||
|
|
10d7e4c643 | ||
|
|
2962707d5f | ||
|
|
15d28fe2eb | ||
|
|
fe694b8f96 | ||
|
|
8b1e816f77 | ||
|
|
9224329450 | ||
|
|
984d8e2584 | ||
|
|
87f7a7f94d | ||
|
|
85c73d523c | ||
|
|
be1a768bca | ||
|
|
93649d9147 | ||
|
|
902c115d48 | ||
|
|
bb6911077a | ||
|
|
33ac1856f2 | ||
|
|
78341e5824 | ||
|
|
ab9a4a95b1 | ||
|
|
b3aafd2f86 | ||
|
|
b4ccf23701 | ||
|
|
742e195172 | ||
|
|
f831fe9ad0 | ||
|
|
e90f352c2f | ||
|
|
0c2299396c | ||
|
|
9000e81498 | ||
|
|
4714af546b | ||
|
|
a40edc40e9 | ||
|
|
1d988d374a | ||
|
|
d53ff1cc9b | ||
|
|
149beaf061 | ||
|
|
910d729d50 | ||
|
|
0f5f8798ea | ||
|
|
09d496b534 | ||
|
|
5ac432026a | ||
|
|
8e9587f451 | ||
|
|
9de0cc1ffe | ||
|
|
0faddc91f7 | ||
|
|
d2f8af553d | ||
|
|
5c2f79aa29 | ||
|
|
9e1ad64e89 | ||
|
|
0d36cf2a4a | ||
|
|
61aeb982fd | ||
|
|
48e4b02fad | ||
|
|
8373ac6746 | ||
|
|
73342af8b6 | ||
|
|
d972f66faa | ||
|
|
dadf49764b | ||
|
|
c9ca0489ed | ||
|
|
bb2cf59a12 | ||
|
|
e3d2a9b614 | ||
|
|
1071c93c82 | ||
|
|
773c7ed5ee | ||
|
|
a65a5c675a | ||
|
|
0ffd876115 | ||
|
|
fdee0f4e7e | ||
|
|
7f411db808 | ||
|
|
218286aa99 | ||
|
|
d4d9129ad4 | ||
|
|
be89054d07 | ||
|
|
28043d88b0 | ||
|
|
60c32fe494 | ||
|
|
20e70f9caa | ||
|
|
4621ed7dcc | ||
|
|
646cadba8c | ||
|
|
edd9ed3619 | ||
|
|
53a35e87c3 | ||
|
|
e9a5625445 | ||
|
|
8038d899d6 | ||
|
|
e306dd8eeb | ||
|
|
8db304328c | ||
|
|
af88aaee77 | ||
|
|
ea18d4ffcb | ||
|
|
27b02d66aa | ||
|
|
8bde566019 | ||
|
|
7cb5857ed3 | ||
|
|
48830e72df | ||
|
|
fcefefaeab | ||
|
|
21cf6b89a8 | ||
|
|
c007a81103 | ||
|
|
80fc5062c1 | ||
|
|
da8f257323 | ||
|
|
e43f07b85b | ||
|
|
a3be19214e | ||
|
|
90040117af | ||
|
|
5887016db3 | ||
|
|
e5553bde4e | ||
|
|
a35323ace9 | ||
|
|
6521bfcdc1 | ||
|
|
e5bbd9488f | ||
|
|
6b65daf07d | ||
|
|
03f2d2376e | ||
|
|
214a80b338 | ||
|
|
64672b4b63 | ||
|
|
d1c03b22e3 | ||
|
|
260352aa9e | ||
|
|
2ea76c6188 | ||
|
|
9e100b752e | ||
|
|
23b8652656 | ||
|
|
c88226188f | ||
|
|
c3fee95273 | ||
|
|
7900ba604f | ||
|
|
21228cfbd4 | ||
|
|
0437659490 | ||
|
|
d8f780848a | ||
|
|
14580e5f6f | ||
|
|
0ad936f600 | ||
|
|
607711d3f9 | ||
|
|
7439f4d6d0 | ||
|
|
137f18bed1 | ||
|
|
7af4f6e84d | ||
|
|
b644a37622 | ||
|
|
e1daabde65 | ||
|
|
ec685d051e | ||
|
|
f6aeb717ba | ||
|
|
54706bec8a | ||
|
|
eb259174b8 | ||
|
|
3bc06b0d57 | ||
|
|
7f4f1d82bb | ||
|
|
b5c5508e62 | ||
|
|
7a3d78b1c0 | ||
|
|
89b46bc246 | ||
|
|
32ed7ed1d7 | ||
|
|
e4fd172892 | ||
|
|
57c52e4fc7 | ||
|
|
bd04a6412d | ||
|
|
902949ea94 | ||
|
|
0570ed4ca3 | ||
|
|
b3c929499e | ||
|
|
0d46eb9066 | ||
|
|
acf5c2e992 | ||
|
|
7b55b03c96 | ||
|
|
0216aab022 | ||
|
|
c10bac6558 | ||
|
|
d4fb27a7a9 | ||
|
|
4803100dc4 | ||
|
|
ed3412c004 | ||
|
|
63acb6173a | ||
|
|
375eb4b852 | ||
|
|
7dba607d76 | ||
|
|
7d9d57dc50 | ||
|
|
27fbb3f971 | ||
|
|
9188c4a7f0 | ||
|
|
ea7e9aaa61 | ||
|
|
9e85eec4a7 | ||
|
|
41e25902a1 | ||
|
|
bc4a9a3696 | ||
|
|
46ffe5f4b2 | ||
|
|
7aca71e625 | ||
|
|
f556eba0a3 | ||
|
|
197203d09b | ||
|
|
d14c4d2883 | ||
|
|
4954af9dc7 | ||
|
|
b17dd28ff2 | ||
|
|
6e61eb084a | ||
|
|
d0212ec5aa | ||
|
|
523d7d6ee8 | ||
|
|
647e39afaa | ||
|
|
7b46cca917 | ||
|
|
f93499181c | ||
|
|
c31e0ba9b9 | ||
|
|
4a6dc36b1c | ||
|
|
c6967f56bd | ||
|
|
0e654c8e9e | ||
|
|
e1270742b9 | ||
|
|
1c87853496 | ||
|
|
119788593c | ||
|
|
fb2b3695d9 | ||
|
|
aacf2bed34 | ||
|
|
badd588652 | ||
|
|
a40c3767bb | ||
|
|
b0831bf1a0 | ||
|
|
d1f7d8af0d | ||
|
|
f7f007519c | ||
|
|
92a098ee02 | ||
|
|
d00c2a6407 | ||
|
|
991b43d4ee | ||
|
|
ac8a977492 | ||
|
|
1bc588acbd | ||
|
|
eafeb83d0b | ||
|
|
2e215bda5b | ||
|
|
0a5fd837a2 | ||
|
|
edf10b576f | ||
|
|
46dcf1204e | ||
|
|
5feeb362b1 | ||
|
|
d6a1c21fe1 | ||
|
|
67358fb145 | ||
|
|
41fbbda8e8 | ||
|
|
b1b5148090 | ||
|
|
bd1d39d7fb | ||
|
|
b2c7fae912 | ||
|
|
13e88ebe74 | ||
|
|
d5d6b1d91e | ||
|
|
8915d82fd6 | ||
|
|
0785d4aa72 | ||
|
|
0744683c2b | ||
|
|
b483f233d2 | ||
|
|
55afe18872 | ||
|
|
f83e614b4e | ||
|
|
5dc070f041 | ||
|
|
585af66b5c | ||
|
|
c8241f3f21 | ||
|
|
3a82cf980d | ||
|
|
7b47f5f49a | ||
|
|
94e4b1883a | ||
|
|
c73592d379 | ||
|
|
4ba0ba4c70 | ||
|
|
11dba60ea7 | ||
|
|
97ad8cbfd2 | ||
|
|
b5be2006f2 | ||
|
|
8ec39ca7ec | ||
|
|
bd937eb49f | ||
|
|
23b810b820 | ||
|
|
322aeb4e46 | ||
|
|
ed2d6b1730 | ||
|
|
9afa30af5e | ||
|
|
5d3719df44 | ||
|
|
3f00d2f041 | ||
|
|
a30a86a09c | ||
|
|
bd10e5bdc3 | ||
|
|
0e1d5ba30e | ||
|
|
10f42d7034 | ||
|
|
6986caed5b | ||
|
|
c802a549f6 | ||
|
|
0a75b51b29 | ||
|
|
0c64ac0bde | ||
|
|
15b0f5478f | ||
|
|
a6b0199204 | ||
|
|
973f5cda6d | ||
|
|
46a318db45 | ||
|
|
1657d67182 | ||
|
|
7949a9c8ad | ||
|
|
2ae11b7222 | ||
|
|
f05c124c98 | ||
|
|
5f182fa564 | ||
|
|
c2d5003f80 | ||
|
|
6e2709d62a | ||
|
|
eef86d5f72 | ||
|
|
863aaa5b9d | ||
|
|
54eed63418 | ||
|
|
7695298dfc | ||
|
|
917fb1f796 | ||
|
|
81075aa5fa | ||
|
|
ff7982fbcd | ||
|
|
7915b040a9 | ||
|
|
a129764f0d | ||
|
|
aeddcb54e0 | ||
|
|
10f0073778 | ||
|
|
8b6e58eebd | ||
|
|
49bd8d2d27 | ||
|
|
946d87cf89 | ||
|
|
138d5b3a4e | ||
|
|
cdba9accdf | ||
|
|
963350a0f2 | ||
|
|
dd48b65687 | ||
|
|
642d6c9fb8 | ||
|
|
6738fa57aa | ||
|
|
d40d7c389b | ||
|
|
3c2e3f1ce9 | ||
|
|
766c59d469 | ||
|
|
7492f5d60c | ||
|
|
bd9c35d379 | ||
|
|
5d4069cf8f | ||
|
|
0caeed6e1d | ||
|
|
98194ce135 | ||
|
|
4dcda032d0 | ||
|
|
f74fddf3fd | ||
|
|
08481e2a68 | ||
|
|
dc50ff584e | ||
|
|
98be8f0c22 | ||
|
|
3647bdef0f | ||
|
|
75fcd63b4a | ||
|
|
27cacffe54 | ||
|
|
74d85e3269 | ||
|
|
9d92888846 | ||
|
|
adfabcb742 | ||
|
|
620302ddaa | ||
|
|
da9f87c63f | ||
|
|
fe2fd18aad | ||
|
|
1c61068291 | ||
|
|
681983d1b2 | ||
|
|
ec627a9c00 | ||
|
|
462cedb654 | ||
|
|
f1347829c2 | ||
|
|
b08169255d | ||
|
|
610b0b7095 | ||
|
|
caf3f3dadd | ||
|
|
04962e1741 | ||
|
|
44e2530fbb | ||
|
|
52b827155f | ||
|
|
3eecf92f8f | ||
|
|
9184a9d04c | ||
|
|
5534fd7275 | ||
|
|
8e06aa2417 | ||
|
|
f57fcd4048 | ||
|
|
4b4576ed62 | ||
|
|
9f8092dc27 | ||
|
|
e40f0d308b | ||
|
|
2259e9b38e | ||
|
|
e44f0749a1 | ||
|
|
3fe52bb7fb | ||
|
|
2edc6d6e6a | ||
|
|
fce9da5e76 | ||
|
|
4b2f27eff8 | ||
|
|
7919a87b97 | ||
|
|
8584b122e1 | ||
|
|
ec7e528094 | ||
|
|
f0c9c542a2 | ||
|
|
4ed88ec68a | ||
|
|
140b8f5e0a | ||
|
|
b5df2b883a | ||
|
|
4fab84ca9e | ||
|
|
d8a5505204 | ||
|
|
1218aebfbf | ||
|
|
b81ec7d631 | ||
|
|
f8479c2b5a | ||
|
|
69f3dda90a | ||
|
|
a06b303879 | ||
|
|
ef9beea9f8 | ||
|
|
cd8f6ede4e | ||
|
|
e76265e1aa | ||
|
|
6443d6f019 | ||
|
|
293e797146 | ||
|
|
55c855267e | ||
|
|
73a5ec9f42 | ||
|
|
86f8670d0b | ||
|
|
6772b89872 | ||
|
|
d95e46c2bd | ||
|
|
74d9f976a8 | ||
|
|
b1a3ea72c9 | ||
|
|
ab888629a5 | ||
|
|
935c7d0e2c | ||
|
|
a8028d5e8e | ||
|
|
cc1e080dfe | ||
|
|
35f7ef3cc2 | ||
|
|
c226bd87f4 | ||
|
|
c0b7c34264 | ||
|
|
5cf7b57064 | ||
|
|
adf6a7ff20 | ||
|
|
5a7cebf7da | ||
|
|
4a8fdaed84 | ||
|
|
4441219df9 | ||
|
|
750ad9aa7b | ||
|
|
0d7a028ce3 | ||
|
|
84975d71ea | ||
|
|
45c0dc4486 | ||
|
|
2c21e3df8b | ||
|
|
138f41160f | ||
|
|
194de13afb | ||
|
|
2c7c8def4c | ||
|
|
ff3928224e | ||
|
|
a39c38f267 | ||
|
|
8e54b4cec9 | ||
|
|
0dfb2b57fb | ||
|
|
a84c9022af | ||
|
|
0a5d4288f5 | ||
|
|
3c6ac487d0 | ||
|
|
466bd3be7f | ||
|
|
5dc7b7f7c7 | ||
|
|
3e814bc4b6 | ||
|
|
f70b6fbf58 | ||
|
|
30a90adc47 | ||
|
|
621a0b61f6 | ||
|
|
244a2ad052 | ||
|
|
bb04b0b9d3 | ||
|
|
e616b41b62 | ||
|
|
fb8c73508b | ||
|
|
f2a73d1b14 | ||
|
|
2b4f2525d0 | ||
|
|
75175ddbce | ||
|
|
c424315510 | ||
|
|
4dcbd3e383 | ||
|
|
d75e53a11a | ||
|
|
b48ab663b0 | ||
|
|
364d518726 | ||
|
|
d1c7d97b10 | ||
|
|
f8b6443b91 | ||
|
|
8344ed9db5 | ||
|
|
76f3d0c1b7 | ||
|
|
52af69e6cd | ||
|
|
d6b1836919 | ||
|
|
7c483340fc | ||
|
|
33de17548b | ||
|
|
9cd19d4944 | ||
|
|
89e4cac3f1 | ||
|
|
29e9027ec0 | ||
|
|
68c377cd55 | ||
|
|
706ab17b2c | ||
|
|
fede9eee4b | ||
|
|
d84a2ef700 | ||
|
|
4ba92b1643 | ||
|
|
57a728fd41 | ||
|
|
bc8f98358b | ||
|
|
3887db349e | ||
|
|
98448960f5 | ||
|
|
22a2b5ac1c | ||
|
|
6e4620cebc | ||
|
|
458d636861 | ||
|
|
64c01e620d | ||
|
|
57c4802ab4 | ||
|
|
74f1bf59b9 | ||
|
|
cacbd451dc | ||
|
|
7174563f7d | ||
|
|
d5f862ee07 | ||
|
|
f66d4ea33c | ||
|
|
0797fd957a | ||
|
|
b45acf2223 | ||
|
|
30143f15f2 | ||
|
|
24389bbcd5 | ||
|
|
2e50b57643 | ||
|
|
5b995dec26 | ||
|
|
5ae4524176 | ||
|
|
87a7795331 | ||
|
|
44fc3666ed | ||
|
|
cea6b17391 | ||
|
|
334a43a7c5 | ||
|
|
d1300dbdb3 | ||
|
|
b355217e6d | ||
|
|
a6f8355c6f | ||
|
|
ce474040af | ||
|
|
32f68e81d6 | ||
|
|
0bd49c59c6 | ||
|
|
a1ff509276 | ||
|
|
8346c4eeff | ||
|
|
29475a904f | ||
|
|
159602d697 | ||
|
|
de88edf56c | ||
|
|
4fb6bc9f33 | ||
|
|
b82a20ea0c | ||
|
|
8291b18771 | ||
|
|
181824eb00 | ||
|
|
7a2115670a | ||
|
|
951999e5ce | ||
|
|
23acacf436 | ||
|
|
925c459aed | ||
|
|
0482892a9c | ||
|
|
dd922bfc2c | ||
|
|
35543ecd91 | ||
|
|
e08290acb0 | ||
|
|
e34c84d791 | ||
|
|
2e4b734159 | ||
|
|
3b64752f4f | ||
|
|
9829051841 | ||
|
|
fc2a011a5c | ||
|
|
0e7ff6ea4e | ||
|
|
e784cc1aaf | ||
|
|
e4a8f42ad1 | ||
|
|
a04fe66032 | ||
|
|
9669cff16b | ||
|
|
09439332f3 | ||
|
|
216deda910 | ||
|
|
7bbdd6d18a | ||
|
|
b037da7264 | ||
|
|
ef35adc9d6 | ||
|
|
f6a8480f21 | ||
|
|
d3b3b40ea7 | ||
|
|
6972cc2bc6 | ||
|
|
74cef32c1d | ||
|
|
d50be7a0ab | ||
|
|
d228e5f759 | ||
|
|
10546594de | ||
|
|
e9b5f009cc | ||
|
|
d6ec36c707 | ||
|
|
be84700d0a | ||
|
|
ad5b2d614a | ||
|
|
9e87040c02 | ||
|
|
90abd49892 | ||
|
|
654aae58d6 | ||
|
|
e6adca7679 | ||
|
|
095f6d4377 | ||
|
|
b946b146f3 | ||
|
|
4e0f8bf621 | ||
|
|
de4343caeb | ||
|
|
a9426925cf | ||
|
|
aebdc8b747 | ||
|
|
c9d4775ffc | ||
|
|
3b8bd1a6e8 | ||
|
|
734401440d | ||
|
|
9fbf3b9732 | ||
|
|
67b180d63d | ||
|
|
c378665af5 | ||
|
|
3187c87451 | ||
|
|
122be0cc64 | ||
|
|
6b13e3f050 | ||
|
|
87e248f4eb | ||
|
|
2be7106055 | ||
|
|
0a24f5f38a | ||
|
|
6189fd3f42 | ||
|
|
29d5a692d0 | ||
|
|
358cafa978 | ||
|
|
b3eebbd5ec | ||
|
|
cc5b491e21 | ||
|
|
bf0b9f536a | ||
|
|
6f471e0660 | ||
|
|
484c4ad51e | ||
|
|
66c77af4a6 | ||
|
|
667568b0b8 | ||
|
|
f3ff36ac34 | ||
|
|
feaefbef04 | ||
|
|
a16aba2138 | ||
|
|
50d27fada9 | ||
|
|
a6d92de0b2 | ||
|
|
89391ccf9a | ||
|
|
e430f832cc | ||
|
|
9280340fe0 | ||
|
|
85466225de | ||
|
|
c9aaf598bb | ||
|
|
92e795aa28 | ||
|
|
fa2c789c3f | ||
|
|
475213aa0a | ||
|
|
32d6eeaf07 | ||
|
|
6f95e7819a | ||
|
|
f24f827c4c | ||
|
|
53a266728b | ||
|
|
215ed2ccf6 | ||
|
|
a671b6394c | ||
|
|
dec1fd097c | ||
|
|
a0f0d7bed2 | ||
|
|
6a21eca5df | ||
|
|
c37f540b72 | ||
|
|
5aba614b60 | ||
|
|
0680505ebf | ||
|
|
528af55abd | ||
|
|
1167dde73a | ||
|
|
b3abdefb9a | ||
|
|
1b0ae7a0b2 | ||
|
|
f3daf070e1 | ||
|
|
6241909a08 | ||
|
|
7fbb7a8007 | ||
|
|
e96cbcac04 | ||
|
|
0706cdea4c | ||
|
|
07099797bd | ||
|
|
77967f0148 | ||
|
|
56e40e8204 | ||
|
|
218c6f30b9 | ||
|
|
b2c20e8ce0 | ||
|
|
76eeee2c9a | ||
|
|
3b7e0a8db1 | ||
|
|
c5e5cf28af | ||
|
|
8ff0430370 | ||
|
|
0a83817f25 | ||
|
|
f8b4289811 |
No files matched your search
+1
-1
@@ -1,4 +1,4 @@
|
||||
# EditorConfig: http://EditorConfig.org
|
||||
# EditorConfig: https://EditorConfig.org
|
||||
|
||||
# Top-most EditorConfig file
|
||||
root = true
|
||||
|
||||
+4
-2
@@ -9,6 +9,8 @@
|
||||
*.map
|
||||
*.swp
|
||||
*.cache
|
||||
*.gcda
|
||||
*.gcno
|
||||
.tmp
|
||||
.tmp.c
|
||||
.tmp.cxx
|
||||
@@ -92,7 +94,6 @@ database
|
||||
overlays
|
||||
playlists
|
||||
states
|
||||
system
|
||||
shaders/shaders_cg
|
||||
shaders/shaders_glsl
|
||||
shaders/shaders_slang
|
||||
@@ -218,8 +219,9 @@ libretro-common/samples/streams/rzip/rzip
|
||||
|
||||
#VITA
|
||||
param.sfo
|
||||
*.S
|
||||
*.wo
|
||||
*.elf
|
||||
*.self
|
||||
*.vpk
|
||||
/.vs
|
||||
/deps/SPIRV-Cross/out/build/x64-Debug
|
||||
+45
-1
@@ -426,6 +426,50 @@ build-retroarch-dingux-odbeta-mips32:
|
||||
- "cp -f libretro-common/audio/dsp_filters/*.dsp ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/audio"
|
||||
- "cp -f gfx/video_filters/*.filt ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
|
||||
|
||||
build-retroarch-rs90-odbeta-mips32:
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-dingux:odbeta
|
||||
stage: build
|
||||
variables:
|
||||
MEDIA_PATH: .media
|
||||
STRIP_BIN: 1
|
||||
before_script:
|
||||
- export NUMPROC=$(($(nproc)/3))
|
||||
artifacts:
|
||||
paths:
|
||||
- retroarch
|
||||
- retroarch_rs90_odbeta.opk
|
||||
- ${MEDIA_PATH}
|
||||
expire_in: 10 min
|
||||
dependencies: []
|
||||
script:
|
||||
- "make -j$NUMPROC -f Makefile.rs90"
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/audio"
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
|
||||
- "cp -f libretro-common/audio/dsp_filters/*.dsp ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/audio"
|
||||
- "cp -f gfx/video_filters/*.filt ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
|
||||
|
||||
build-retroarch-retrofw-mips32:
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-dingux:odbeta
|
||||
stage: build
|
||||
variables:
|
||||
MEDIA_PATH: .media
|
||||
STRIP_BIN: 1
|
||||
before_script:
|
||||
- export NUMPROC=$(($(nproc)/3))
|
||||
artifacts:
|
||||
paths:
|
||||
- retroarch
|
||||
- retroarch_retrofw.opk
|
||||
- ${MEDIA_PATH}
|
||||
expire_in: 10 min
|
||||
dependencies: []
|
||||
script:
|
||||
- "make -j$NUMPROC -f Makefile.retrofw"
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/audio"
|
||||
- "mkdir -p ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
|
||||
- "cp -f libretro-common/audio/dsp_filters/*.dsp ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/audio"
|
||||
- "cp -f gfx/video_filters/*.filt ${MEDIA_PATH}/${CI_PROJECT_NAME}/filters/video"
|
||||
|
||||
build-retroarch-android-normal:
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-android:latest
|
||||
stage: build
|
||||
@@ -739,7 +783,7 @@ build-static-retroarch-wiiu:
|
||||
- "mv .retroarch-precompiled/ retroarch-precompiled/"
|
||||
|
||||
build-static-retroarch-dummy-wiiu:
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-devkitpro:latest
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-wiiu:latest
|
||||
stage: build
|
||||
variables:
|
||||
MEDIA_PATH: .media
|
||||
|
||||
+216
@@ -1,5 +1,221 @@
|
||||
# Future
|
||||
|
||||
# 1.9.8
|
||||
- AUDIO/WINDOWS/WASAPI: Stop deactivating audio on fast forward
|
||||
- CHEEVOS: Hide challenge indicators when resetting
|
||||
- CHEEVOS: Support for more than 64 memory regions
|
||||
- CHEEVOS: Automatically retry 'http error code -1'
|
||||
- CONTENT INFORMATION: Show content info label+path rows always
|
||||
- CORE OPTIONS: Core option categories implemented
|
||||
- CORE OPTIONS: Add option to disable core option categories
|
||||
- D3D10/11/12: Fix gfx_display_draw_texture - fixes OSK (On-Screen Keyboard) issues
|
||||
- DATABASE: Fix heap-buffer-overflow when fetching CRC values
|
||||
- DATABASE/EXPLORE: Fix CRC32 reading in explore menu
|
||||
- DATABASE/LIBRETRODB: Fix writing of numerical values
|
||||
- DATABASE/LIBRETRODB: Fix libretro-db loading on big endian platforms
|
||||
- DUMMY CORE: Skip state_manager_event_{deinit/init} when core type is dummy, should skip warning spam 'Implementation uses threaded audio. Cannot use rewind..' when using rewind
|
||||
- INPUT/UDEV: Limit udev device scan to subsystem 'input'
|
||||
- INPUT/SDL2/WINDOWS: Fix keyboard event keycodes
|
||||
- INPUT/WAYLAND: Fixes a bug where the first player's mouse, pointer, and lightgun are echoed to the other ports. Now, those other ports correctly report zero. In the future support for multiple mouselike devices will need to be added, which is a bigger project
|
||||
- INPUT/WAYLAND: The driver now respects keyboard_mapping_blocked
|
||||
- INPUT/WAYLAND: When possible, deprecated lightgun defines are replaced with the new ones. The coordinates are still using the old relative callbacks
|
||||
- INPUT/WINRAW: Trigger joypad driver reinit on DEVICECHANGE - avoids fullscreen toggle
|
||||
- INPUT/WINRAW: Alt sticky fix
|
||||
- INPUT/WINRAW: Prevent Alt getting stuck when Alt-Tabbing
|
||||
- INPUT/WINRAW: Add pointer status
|
||||
- INPUT/WINRAW: Add missing analog keybinds
|
||||
- LIBNX/SWITCH: Fix poll missing for controller 2-8
|
||||
- LIBNX/SWITCH: Fix layout not applied correctly and hangs when splitting joycons
|
||||
- LIBRETRO: Core options category API implemented
|
||||
- LIBRETRO: Fix RETRO_ENVIRONMENT_SET_FASTFORWARDING_OVERRIDE callback when runahead is enabled
|
||||
- LIBRETRO: Add environment callback for enabling core option menu visibility updates without toggling Quick Menu
|
||||
- LOGGING: Starting logging and verbose mode before first config load
|
||||
- LINUX: In some Linux Desktop Environments, like Budgie, task bar feature is unable to pin applications. With StartupWMClass= present in .desktop file, it is possible to pin the application
|
||||
- LOCALIZATION: Fetch translations from Crowdin
|
||||
- MENU: Relocate 'Manage Playlists' to top
|
||||
- MENU: Fullscreen resolution width/height settings no longer require 'advanced settings'
|
||||
- MENU/REFRESH RATE: Fix double notifications with refresh rate settings
|
||||
- MENU/OZONE: Ensure the existence of values used in selection calculation
|
||||
- MENU/OZONE/VULKAN: Casting to unsigned caused an integer overflow and after float promotion would lead to 'x' being a garbage value, leading to problems when this value was passed to vkCmdSetViewport. This stops Vulkan validation layers from complaining about it
|
||||
- METAL: Fixed font driver memory leaks
|
||||
- MOUSE: Change default mouse index to port index
|
||||
- MOUSE: Friendly names for mice where available
|
||||
- OSX: Fix some memory leaks
|
||||
- OSX: Fix controller duplication bug
|
||||
- PS2: Implement alpha for the video driver
|
||||
- PS2: Aspect ratio handling
|
||||
- RETROFW: Initial port
|
||||
- UWP/XBOX: Enable Explore tab by default - seems to work fine
|
||||
- UWP/XBOX: Fix startup issues with latest Xbox Dashboard updates - ANGLE cores still show up wrong
|
||||
- UWP/XBOX: fix issue where files where opened as OPENALWAYS instead of OPENEXISTING this fixes beetle cores
|
||||
- UWP/XBOX: fix issue where filesizes where not returned properly, this fixes loading arcade dat files
|
||||
- UWP/TRANSLATION: Enabled translation services for both UWP MSVC2017 and 2019. No TTS speech yet.
|
||||
- VIDEO: Fix refresh rate 59Hz rounding
|
||||
- WINDOWS: Remember original refresh rate
|
||||
- WINDOWS/VULKAN: Refresh rate fixes + cleanups
|
||||
- WIIU: Fix L3/R3 buttons
|
||||
- WIIU: Compress RPX libretro cores
|
||||
- WIIU: Add ICInvalidateRange (necessary for JITs)
|
||||
- WIIU: Slight filesystem optimisation
|
||||
- WIIU: Add option for running without core info (emscripten-style)
|
||||
|
||||
# 1.9.7
|
||||
- 3DS: Add unique ID's
|
||||
- CRT/SWITCHRES: Fixed some Monitor index bugs ad updated to the latest SR2
|
||||
- CRT/SWITCHRES: Fixed monitor index corruption on Windows and added correct fractal scaling. Only used when required
|
||||
- CRT/SWITCHRES: Updated log defines to match SR upstream.
|
||||
- CRT/SWITCHRES: Added new SR_CONFIG_PATHS for non Windows and Linux systems.
|
||||
Not that SR works on them but to fix RA compile issues
|
||||
- CRT/SWITCHRES: Updated SR2 code base to latest. Added supprt for windows monitor indexing. Fixed monitor index bug where index 1 was not being used correctly and "auto" was not being sent.
|
||||
- CRT/SWITCHRES: Updated swithres for x86 windows fix
|
||||
- CRT/SWITCHRES: fixed SR2 auto issue
|
||||
- CRT/SWITCHRES: Fixed auto monitor bug
|
||||
- CRT/SWITCHRES: Fixed monitor index corruption on Windows
|
||||
- CRT/SWITCHRES: Fixed buffer size bug
|
||||
- CRT/SWITCHRES: Added correct fractal scalling. only used when required.
|
||||
- CORE INFO: Automatically disable core info cache when core info directory is read-only
|
||||
- EMSCRIPTEN: add MAME2003 / MAME2003-plus to web.libretro
|
||||
- INPUT/UDEV: udev fixes add pointer pressed to pointer device to allow udev users to access this device
|
||||
- LIBNX/SWITCH: Enable 7zip support
|
||||
- LINUX/XDG: Prevent xdg-screensaver's "Protocol error" messages
|
||||
- LOCALIZATION: Fetch translations from Crowdin
|
||||
- LOCALIZATION: Add missing languages for the first startup
|
||||
- MENU/XMB/WIDGETS: Add workaround for FPU bug that breaks scale factor comparisons on certain platforms (fixes XMB thumbnails on 32bit Linux/Windows)
|
||||
- MENU/RGUI: Enable fullscreen thumbnail toggle using RetroPad 'start' button
|
||||
- MENU/RGUI: Fix sublabel length when menu clock is disabled
|
||||
- NETWORK/HTTP: Fix HTTP progress indication for large files on 32-bit systems
|
||||
- NETWORK/NATT: implement natt fix from void()
|
||||
- OPENDINGUX: Fix display when cores 'drop' frames
|
||||
- OPENDINGUX BETA: Use ALSA audio driver by default
|
||||
- OPENDINGUX BETA: Fix IPU scaling when running 256x224 (SNES/Genesis) content
|
||||
- PATHS: Fix garbled path string
|
||||
- PS2: Implement proper ps2_font driver instead of using the font driver from gskit
|
||||
- PS2: Use BDM for increasing up USB stability
|
||||
- PS3: First basic RSX driver for PSL1GHT
|
||||
- RS90: Initial port
|
||||
- RS90: Fix offset of OSD text
|
||||
- RS90: Disable menu clock by default
|
||||
- RS90: Hide 'Bilinear Filtering' video option
|
||||
- RS90: Move appdata (retroarch) base directory to external microsd card
|
||||
- RS90: Add optional approximate 'semi-linear' scaling filter
|
||||
- SHADERS: Max Shader Parameters increased to 1024
|
||||
- VIDEO: Add 'Integer Scale Overlay' - Force integer scaling to round up to the next larger integer instead of rounding down
|
||||
- VIDEO: New 'Full' aspect ratio added. This aspect ratio is useful when used with a shader which has a border in it. The aspect ratio is set to the full window area, so that the viewport spans the whole viewport. When using a border type shader like the Mega Bezel this allows the graphics to span the whole window regardless of the user's monitor aspect ratio
|
||||
- VITA: Wrong flags for not piglet version
|
||||
- UNIX: Correct backlight max_brightness path
|
||||
- UWP/XBOX: Default to Direct3D11 driver on UWP builds
|
||||
- UWP/XBOX: Do not use windowed mode on UWP/Xbox by default, set default resolution to 1920x1080 by default. Should fix display issues with Dolphin/PCSX2 on Xbox
|
||||
- WIIU: Fix inputs breaking when connecting/disconnecting remotes
|
||||
- WIIU: Input - ignore some bogus KPAD results
|
||||
- WIIU: Font rendering fixes - render font lines with correct spacing, and only sample alpha channel when rendering fonts
|
||||
- WIIU/NETWORK: Network speed optimisations - WINSCALE, TCP sACK, large buffers
|
||||
- WIIU/LIBFAT: Increase cache size on WiiU
|
||||
- WIIU/FILE IO: Filesystem optimisations - add fast path for already aligned buffers
|
||||
- WIIU/FILE IO: Use 128K vbufs for WiiU - we have loads of RAM and large vbufs are very beneficial
|
||||
- WIIU/MENU/OZONE: Fix Ozone rendering error (scissor fix)
|
||||
- WIIU/MENU/OZONE: Use Ozone icons instead of XMB Monochrome
|
||||
|
||||
# 1.9.6
|
||||
- ARCHIVE: Fix archive delimiter detection when file path contains no slashes
|
||||
- ANDROID: Do not duplicate port 0 mouse and gun inputs to other ports
|
||||
- AUDIO/XAUDIO2: Fail instead of crashing when disconnecting an audio device
|
||||
- CHEEVOS: Reset cached progress each time menu is opened
|
||||
- CRT/SWITCHRES: Add support for switchres.ini core and directory overrides
|
||||
- D3D11: Don't use allow tearing flag with blit swap chains. Also disables the flip model if the allow tearing flag is not supported.
|
||||
- D3D11: Disable DXGI's ALT+ENTER handling
|
||||
- D3D11: Don't pass ALLOW_TEARING when unsupported
|
||||
- D3D11: Fix non-vsynced output without flip, black screens in fullscreen
|
||||
- D3D12: Relocated 'd3d12_gfx_sync'
|
||||
- D3D12: Fixed swap interval option
|
||||
- GFX: Fix uninitialized variables in gfx_display_draw_cursor
|
||||
- HISTORY: Hide 'Add to Favorites' when viewing an entry of the favorites playlist
|
||||
- INPUT: 'Analog to Digital Type' usability improvements
|
||||
- INPUT: Add support for mapping multiple controllers to a single input device
|
||||
- INPUT/REMAPPING: Add support for mapping multiple controllers to a single input device
|
||||
- INPUT/LIGHTGUN: Bind lightgun trigger to first mouse button by default
|
||||
- INPUT/WINDOWS/RAWINPUT: Mouse access violation fix
|
||||
- INPUT/UDEV: Only add mouse if it has buttons and add vebose device friendly names
|
||||
- INPUT/UDEV: Skip mouse with no button errors and keep the rest
|
||||
- INPUT/UDEV: Fix Game Focus mode
|
||||
- INPUT/UDEV/X11: Change udev driver for dual lightgun support in X11
|
||||
- LIBNX/SWITCH: Update to libnx 4.0.0
|
||||
- LOCALIZATION: Fetch translations from Crowdin
|
||||
- LOCALIZATION: Fix Switchres menu texts
|
||||
- MENU/OZONE: Ensure sidebar display status is updated correctly when performing rapid menu navigation
|
||||
- MENU/XMB: Dynamic wallpaper fix
|
||||
- MENU/XMB: Icon opacity fix
|
||||
- MENU/QT/WIMP: Fix default core detection when playlist file name does not match 'db_name'
|
||||
- PLAYLISTS: Optimise scanning of large rom sets
|
||||
- SECURITY: Plug so-called high-risk vulnerability related to Powershell - avoid injection - don't send speech input as commandline argument
|
||||
- UWP/XBOX: Add expanded resources Rescap to increase performance of UWP version in app mode on Xbox
|
||||
- WINDOWS/INSTALLER: Add smarter isEmptyDir reference implementation that looks for subdirectories from NSIS documentation
|
||||
- WINDOWS/INSTALLER: Register new function DirectorySet that is called when pressing the "Next" button on the MUI_PAGE_DIRECTORY, aka the install folder selection GUI. DirectorySet contains the criteria for an acceptable folder, which are:
|
||||
- `IfFileExists "$INSTDIR\retroarch.exe"` returns 1
|
||||
- `IfFileExists "$INSTDIR\*.*` returns 0, there is no existing folder
|
||||
- `IfFileExists "$INSTDIR\*.*"` returns 1, there is a folder, and `isEmptyDir` returns 1, therefore the folder is empty, including of subdirectories
|
||||
- X11: Fix threaded video segfault
|
||||
|
||||
# 1.9.5
|
||||
- ALSATHREAD: Make alsathread default for all ALSA devices with threads
|
||||
- ARCHIVE: Fix loading of archived content with file names containing '#' characters
|
||||
- CHEEVOS: Upgrade to rcheevos 10.1
|
||||
- CHEEVOS: Challenge indicators
|
||||
- CHEEVOS: Group achievements by category in quick menu
|
||||
- CHEEVOS: Relabel 'Start Active' with 'Encore Mode'
|
||||
- D3D10: Window title should now update
|
||||
- D3D11: Window title should now update
|
||||
- D3D11: Allow fastforward in fullscreen
|
||||
- D3D12: Window title should now update
|
||||
- D3D12: Allow fastforward in fullscreen
|
||||
- CRT/SWITCHRES: New implementation
|
||||
- FONTS: Improve message wrapping with CJK languages
|
||||
- FONTS: Fix garbled characters when converting encodings
|
||||
- INPUT: Allow the 8 analog stick directions to be used as keys for core keyboard mappings
|
||||
- LIBRETRO: Add API extension for setting 'need_fullpath' based on content file extension and to request persistent frontend content data buffers
|
||||
- MENU/SEARCH: Add enhanced search functionality to the 'Manage Cores' menu
|
||||
- OPENDINGUX: Fix black screens when triggering gfx driver initialisation via menu actions
|
||||
- UNIX: Get better battery stats on sysfs nodes
|
||||
- VIDEO: Extend Frame Delay range to 19 to accommodate PAL land too
|
||||
- WIFI/LAKKA: Add nmcli to wifi drivers
|
||||
- WIFI/LAKKA: Add wifi configuration menu
|
||||
- X11: fix fullscreen when swapping monitors/resolution
|
||||
|
||||
# 1.9.4
|
||||
- CHEEVOS: update rcheevos to v10.0.0
|
||||
- CONTENT LOADING/FILE IO: Prevent unnecessary extraction (to disk) of compressed content files when need_fullpath is false
|
||||
- CORE INFO/FILE IO: Enable core info cache by default now for all platforms
|
||||
- CORE INFO/REGRESSION FIX: Fix regression caused by core info file caching - Downloads was no longer showing up in Load Content
|
||||
- FILE IO/COMPRESSED: Ability to load content inside ZIP files directly into RAM
|
||||
- INPUT/OVERLAYS: Add option to select between 'touched' elements and physical controller inputs when showing inputs on overlays
|
||||
- INPUT REMAPPING/OVERLAYS: Prevent duplicate inputs when using remaps with input overlays
|
||||
- LAKKA: Add brightness restore hook
|
||||
- LOCALIZATION: Fetch translations from Crowdin
|
||||
- MENU/OZONE: Added simple playlist entry enumeration
|
||||
- MENU/XMB: Fix display of 'Maximum Users' menu entry dropdown list
|
||||
- PS3/PSL1GHT: Joypad driver works again
|
||||
- PSTV: Fix Vita input driver for PSTV
|
||||
- PSTV: Support for 720p on PSTV when using 'Unlock framebuffer' in Sharpscale plugin
|
||||
- PSTV: Fix scaling on PSTV when not using 720p
|
||||
- RPNG: Fix some memory corruption if processing broken input PNG file
|
||||
- SECURITY: Fix CVE-2021-28927
|
||||
|
||||
# 1.9.3
|
||||
- 3DS: Disable menu screensaver animations in XMB/GLUI
|
||||
- COMMAND: Initialize netcmd->cmd_source_len before recvfrom()
|
||||
- CONTENT LOADING/STATICALLY LINKED: Ensure 'Always Reload Core on Run Content' setting is applied when loading content via the file browser
|
||||
- CONTENT LOADING/EMSCRIPTEN: Fix content loading via file browser on platforms with 'broken' core handling (i.e. emscripten)
|
||||
- CORE INFO: Skip whitespace when writing compressed core info cache files
|
||||
- CORE INFO/FILE IO: Core Info cache; significant file I/O performance improvements on systems with slow disk file I/O
|
||||
- CORE INFO/FILE IO: Enable core info cache by default on all 'console' platforms
|
||||
- FREEBSD: FreeBSD build fix
|
||||
- LAKKA: Support for tweaking CPU governors/scaling policies
|
||||
- LAKKA: This adds managed policies and settings to store them and reload them at startup
|
||||
- LIBRETRO API: Add API extension for cores to override frontend fast-forward state
|
||||
- MENU/RGUI: Fix saving of config files/overrides when 'Lock Menu Aspect Ratio' is enabled
|
||||
- SHADERS: Fix 'Auto-Shader Delay' functionality
|
||||
- UWP/D3D11: Disable mipmap generation
|
||||
- UWP/XBOX: Add 'Force 4K resolution' option (Force the resolution to the fullscreen size on Xbox, if set to 0, a fixed value of 3840 x 2160 will be used)
|
||||
|
||||
# 1.9.2
|
||||
- 3DS: Enable graphics widgets / overlays
|
||||
- 3DS: Load texture images as BGR colors
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
We as members, contributors, and leaders pledge to make participation in our
|
||||
community a harassment-free experience for everyone, regardless of age, body
|
||||
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||
identity and expression, level of experience, education, socio-economic status,
|
||||
nationality, personal appearance, race, caste, color, religion, or sexual identity
|
||||
and orientation.
|
||||
|
||||
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||
diverse, inclusive, and healthy community.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to a positive environment for our
|
||||
community include:
|
||||
|
||||
* Demonstrating empathy and kindness toward other people
|
||||
* Being respectful of differing opinions, viewpoints, and experiences
|
||||
* Giving and gracefully accepting constructive feedback
|
||||
* Accepting responsibility and apologizing to those affected by our mistakes,
|
||||
and learning from the experience
|
||||
* Focusing on what is best not just for us as individuals, but for the
|
||||
overall community
|
||||
|
||||
Examples of unacceptable behavior include:
|
||||
|
||||
* The use of sexualized language or imagery, and sexual attention or
|
||||
advances of any kind
|
||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or email
|
||||
address, without their explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Enforcement Responsibilities
|
||||
|
||||
Community leaders are responsible for clarifying and enforcing our standards of
|
||||
acceptable behavior and will take appropriate and fair corrective action in
|
||||
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||
or harmful.
|
||||
|
||||
Community leaders have the right and responsibility to remove, edit, or reject
|
||||
comments, commits, code, wiki edits, issues, and other contributions that are
|
||||
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
||||
decisions when appropriate.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies within all community spaces, and also applies when
|
||||
an individual is officially representing the community in public spaces.
|
||||
Examples of representing our community include using an official e-mail address,
|
||||
posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported to the community leaders responsible for enforcement at:
|
||||
|
||||
* Via E-Mail to <libretro@gmail.com>, please include in the subject line
|
||||
`RETROARCH COC` so that your e-mail may reach the correct party.
|
||||
|
||||
All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
All community leaders are obligated to respect the privacy and security of the
|
||||
reporter of any incident.
|
||||
|
||||
## Enforcement Guidelines
|
||||
|
||||
Community leaders will follow these Community Impact Guidelines in determining
|
||||
the consequences for any action they deem in violation of this Code of Conduct:
|
||||
|
||||
### 1. Correction
|
||||
|
||||
**Community Impact**: Use of inappropriate language or other behavior deemed
|
||||
unprofessional or unwelcome in the community.
|
||||
|
||||
**Consequence**: A private, written warning from community leaders, providing
|
||||
clarity around the nature of the violation and an explanation of why the
|
||||
behavior was inappropriate. A public apology may be requested.
|
||||
|
||||
### 2. Warning
|
||||
|
||||
**Community Impact**: A violation through a single incident or series
|
||||
of actions.
|
||||
|
||||
**Consequence**: A warning with consequences for continued behavior. No
|
||||
interaction with the people involved, including unsolicited interaction with
|
||||
those enforcing the Code of Conduct, for a specified period of time. This
|
||||
includes avoiding interactions in community spaces as well as external channels
|
||||
like social media. Violating these terms may lead to a temporary or
|
||||
permanent ban.
|
||||
|
||||
### 3. Temporary Ban
|
||||
|
||||
**Community Impact**: A serious violation of community standards, including
|
||||
sustained inappropriate behavior.
|
||||
|
||||
**Consequence**: A temporary ban from any sort of interaction or public
|
||||
communication with the community for a specified period of time. No public or
|
||||
private interaction with the people involved, including unsolicited interaction
|
||||
with those enforcing the Code of Conduct, is allowed during this period.
|
||||
Violating these terms may lead to a permanent ban.
|
||||
|
||||
### 4. Permanent Ban
|
||||
|
||||
**Community Impact**: Demonstrating a pattern of violation of community
|
||||
standards, including sustained inappropriate behavior, harassment of an
|
||||
individual, or aggression toward or disparagement of classes of individuals.
|
||||
|
||||
**Consequence**: A permanent ban from any sort of public interaction within
|
||||
the community.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||
version 2.1, available at
|
||||
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
||||
|
||||
Community Impact Guidelines were inspired by
|
||||
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
||||
|
||||
For answers to common questions about this code of conduct, see the FAQ at
|
||||
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available
|
||||
at [https://www.contributor-covenant.org/translations][translations].
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
||||
[Mozilla CoC]: https://github.com/mozilla/diversity
|
||||
[FAQ]: https://www.contributor-covenant.org/faq
|
||||
[translations]: https://www.contributor-covenant.org/translations
|
||||
+79
-44
@@ -1,58 +1,93 @@
|
||||
# Contributing to RetroArch
|
||||
|
||||
If you are a developer and want to contribute to the development of RetroArch, please read this.
|
||||
If you have found a bug and want to submit a minor patch or a bug report, please read this as well.
|
||||
If you are a developer who wishes to contribute to the development of _RetroArch_; or if you have
|
||||
found a bug and wish to submit a minor patch and/or bug report, please read this document.
|
||||
|
||||
# Submitting a bug report
|
||||
When submitting a bug report, make sure that the bug is local to RetroArch.
|
||||
A bug in a libretro core or something deemed to be external is likely to be closed very fast.
|
||||
If you still suspect a bug in RetroArch, make sure to test with several cores to make sure.
|
||||
Active discussions happen on our [Discord](https://discordapp.com/invite/27Xxm2h), mostly within
|
||||
the _Programming_ channel category. We value discussions that happen in real time around
|
||||
these contributions.
|
||||
|
||||
If you have troubles building RetroArch on Linux/BSD/OSX, make sure to paste shell output of ./configure,
|
||||
as well as config.log and shell output of make. If building on Windows, just paste shell output of make.
|
||||
Please do note that contributors to _RetroArch_ do such contributions within their spare time.
|
||||
We do prefer to keep a professional and non-aggressive atmosphere around the project, along
|
||||
with any disagreements to be settled professionally without insults, name calling, or otherwise.
|
||||
If there are any issues, we are willing to have discussions about it.
|
||||
|
||||
If the issue occurs during runtime, make sure to paste RetroArch's verbose log.
|
||||
If using Phoenix frontend, you can find log in (File -> Show Log) after running.
|
||||
In console, make sure to run with verbose (-v) flag.
|
||||
## Submitting Bug Reports
|
||||
|
||||
# Pull Requests
|
||||
Outside contributions are generally only accepted in the form of a pull request. The process is very simple.
|
||||
Fork RetroArch, make your changes, and issue a pull request on GitHub. This can all be done within the browser.
|
||||
The changes are reviewed, and might be merged in. If the pull request isn't acceptable at the time,
|
||||
note that it's possible to continue pushing up commits to your branch.
|
||||
Bug reports in _RetroArch_ may fall into one of two categories:
|
||||
|
||||
If you want to develop a larger feature,
|
||||
we'd like to discuss this first (ideally on IRC) so that you don't risk developing something
|
||||
that won't be merged. A pull request with a proof-of-concept is fine, but please indicate so.
|
||||
* _RetroArch_ itself, the user interface and API around all of the various cores.
|
||||
* Individual _Core_, of which interact with _RetroArch_.
|
||||
|
||||
When submitting a bug report, ensure that the report is submitted to the correct repository.
|
||||
For _RetroArch_ itself, it is done by reporting a bug within the
|
||||
[RetroArch](https://github.com/libretro/RetroArch) repository. For other cores, please use
|
||||
the search function within the [libretro Organization](https://github.com/libretro) on
|
||||
GitHub. Issues that are specific to a core and not _RetroArch_ are likely to be closed very
|
||||
quickly. If an issue is suspected with _RetroArch_, please make sure to test with multiple
|
||||
cores to be sure that is is not isolated.
|
||||
|
||||
If the issue occurs during runtime, please paste the verbose log output:
|
||||
|
||||
* If using the _Pheonix_ interface, the log will be in _File_ -> _Show Log_.
|
||||
* If using the main interface, enable verbose logging with _Settings_ -> _Logging_ ->
|
||||
_Logging Verbosity_. Ensure both _Log to File_ and _Timestamp log Files_ is enabled.
|
||||
* Otherwise, run _RetroArch_ with the verbose (`-v`) flag.
|
||||
|
||||
If the error happens during compilation and/or building, paste the output of `./configure`
|
||||
and `make` accordingly. If using an IDE, please paste any of the errors and log output.
|
||||
|
||||
## Submitting Pull Requests
|
||||
|
||||
Any and all contributions should be submitted through Pull Requests on
|
||||
[GitHub](https://github.com/libretro/RetroArch/pulls). The process requires that you fork the
|
||||
repository, make the appropriate changes, and then open a pull request on _GitHub_. If your
|
||||
pull request is for a proof-of-concept then please indicate as such.
|
||||
|
||||
Your pull request will then be reviewed. There may be comments and requests for additional
|
||||
changes to be made. It may also be possible that the changes will not be accepted. Otherwise, it
|
||||
may be merged in when it is fully approved. The final approval of merge requests is at the
|
||||
discretion of the project.
|
||||
|
||||
If you want to develop a larger feature or make broad changes, please do join our
|
||||
[Discord](https://discordapp.com/invite/27Xxm2h) server to discuss. The discussion is
|
||||
necessary to prevent the possibility of major work being done which will not be accepted at all.
|
||||
|
||||
## libretro API
|
||||
If you wish to add functionality to libretro's API, it can take some time to merge in, because changes
|
||||
to libretro API will affect other projects as well, and we highly value API/ABI stability.
|
||||
Features will only be added when deemed *necessary* for a concrete libretro core to function properly.
|
||||
Features will not be added on basis of hypothetical libretro implementations.
|
||||
|
||||
# Coding style
|
||||
Having a consistent code style throughout the code base is highly valued.
|
||||
Please look through the code to get a feel for the coding style.
|
||||
A pull request may be asked to fix the coding style before submission.
|
||||
In other cases, a pull request may be followed up with a "style nit commit".
|
||||
If you wish to contribute additional functionality to _libretro_'s API, there are considerations
|
||||
that must be accepted. Please note that because this API affects multiple different projects, we
|
||||
highly value and require API and ABI stability and backwards-compatibility. Due to this
|
||||
requirement, there will be additional scrutiny in reviews for this added functionality.
|
||||
|
||||
## Non-obvious things:
|
||||
- Code should be both C89 and ISO C++ compatible. This dual requirement is for XBox360 and MSVC in general. Think of it as a C++ compatible subset of C99.
|
||||
- Warnings are not allowed (-Wall). Make sure your code is warning-free. Note that warning sensitivity differs a bit across compiler versions.
|
||||
- Using deprecated APIs is discouraged.
|
||||
Any and all features will be added only when **necessary** for an existing _libretro_ core to
|
||||
properly function. Hypothetical implementations of _libretro_ are not considered.
|
||||
|
||||
# Copyright Headers and AUTHORS
|
||||
If you have contributed to a part of a source file (a chunk of code that's written by you),
|
||||
you should add yourself to the copyright header in that file.
|
||||
If you have contributed significantly
|
||||
(a feature, a contribution you can "name", e.g. "Added audio driver foo"), you should add yourself to AUTHORS file.
|
||||
We'd like your full name and email, and which features you have been part of.
|
||||
## Coding style
|
||||
|
||||
# IRC
|
||||
Active development happens on IRC. (#retroarch @ irc.freenode.org)
|
||||
We value discussing things in "real-time".
|
||||
We highly value a consistent code style throughout the entire code base, please make sure you look
|
||||
through the existing code to get a feel for the coding style. When submitting a pull request, it may
|
||||
be asked to fix any coding style issues before submission. In other cases, there may be a follow-up
|
||||
pull request making the code style consistent.
|
||||
|
||||
# Commit Access
|
||||
Contributors who show a track record of making good pull requests over time will eventually get commit access to the repo.
|
||||
This typically happens when the "overhead" of looking through pull requests over time becomes a burden.
|
||||
For full guidelines please see the [Coding Standards](https://docs.libretro.com/development/coding-standards/).
|
||||
|
||||
Some non-obvious things to be aware of:
|
||||
|
||||
- Code should be both C89 and ISO C++ compatible. This is a requirement for XBox 360 and MSVC to
|
||||
properly build. Think of it as a C++ compatible subset of C99.
|
||||
- There must be no warnings in your code (enabled by `-Wall` for GCC compilers), do also note that
|
||||
different compilers may produce different warnings.
|
||||
- Avoid using deprecated APIs, these will be removed in the future at some point.
|
||||
|
||||
## Copyright Headers and AUTHORS
|
||||
|
||||
If you have contributed a chunk of source code that is written to you, you should add yourself to
|
||||
the copyright header in the file. If you have made a significant contribution you should add
|
||||
yourself to the `AUTHORS` file, adding your full name, e-mail, and the feature you worked on.
|
||||
|
||||
## Commit Access
|
||||
|
||||
Contributors who show a good track record of pull requests over time may eventually
|
||||
get commit access to the repository. This may happen when looking through pull requests
|
||||
over long amounts of time becomes a burden.
|
||||
+78
-24
@@ -134,7 +134,7 @@ ifneq ($(findstring Darwin,$(OS)),)
|
||||
MINVERFLAGS=
|
||||
ifeq ($(shell uname -p),arm)
|
||||
MINVERFLAGS = -mmacosx-version-min=10.15 -stdlib=libc++ # macOS (Metal, ARM 64bit)
|
||||
MINVERFLAGS += -DDONT_WANT_ARM_OPTIMIZATIONS
|
||||
MINVERFLAGS += -DDONT_WANT_ARM_ASM_OPTIMIZATIONS
|
||||
else ifeq ($(HAVE_METAL),1)
|
||||
MINVERFLAGS = -mmacosx-version-min=10.13 -stdlib=libc++ # macOS (Metal, x86 64bit)
|
||||
else ifeq ($(shell uname -p),powerpc)
|
||||
@@ -148,7 +148,7 @@ ifneq ($(findstring Darwin,$(OS)),)
|
||||
# Build for a specific architecture when ARCH is defined as a switch
|
||||
ifeq ($(ARCH),arm64)
|
||||
MINVERFLAGS = -mmacosx-version-min=10.15 -stdlib=libc++ # macOS (Metal, ARM 64bit)
|
||||
MINVERFLAGS += -DDONT_WANT_ARM_OPTIMIZATIONS
|
||||
MINVERFLAGS += -DDONT_WANT_ARM_ASM_OPTIMIZATIONS
|
||||
ARCHFLAGS = -arch arm64
|
||||
else ifeq ($(ARCH),x86_64)
|
||||
ifeq ($(HAVE_METAL),1)
|
||||
@@ -275,6 +275,11 @@ OBJ += \
|
||||
$(LIBRETRO_COMM_DIR)/memmap/memalign.o \
|
||||
$(LIBRETRO_COMM_DIR)/file/nbio/nbio_stdio.o
|
||||
|
||||
OBJ += \
|
||||
$(LIBRETRO_COMM_DIR)/lists/linked_list.o \
|
||||
$(LIBRETRO_COMM_DIR)/lists/nested_list.o \
|
||||
$(LIBRETRO_COMM_DIR)/queues/generic_queue.o
|
||||
|
||||
ifneq ($(findstring Linux,$(OS)),)
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/file/nbio/nbio_linux.o
|
||||
endif
|
||||
@@ -297,10 +302,10 @@ OBJ += \
|
||||
$(LIBRETRO_COMM_DIR)/file/file_path_io.o \
|
||||
file_path_special.o \
|
||||
$(LIBRETRO_COMM_DIR)/hash/lrc_hash.o \
|
||||
input/input_driver.o \
|
||||
input/common/input_hid_common.o \
|
||||
led/led_driver.o \
|
||||
gfx/video_coord_array.o \
|
||||
gfx/video_crt_switch.o \
|
||||
gfx/gfx_display.o \
|
||||
gfx/gfx_animation.o \
|
||||
gfx/gfx_thumbnail_path.o \
|
||||
@@ -333,6 +338,7 @@ endif
|
||||
OBJ += \
|
||||
core_info.o \
|
||||
core_backup.o \
|
||||
core_option_manager.o \
|
||||
$(LIBRETRO_COMM_DIR)/file/config_file.o \
|
||||
$(LIBRETRO_COMM_DIR)/file/config_file_userdata.o \
|
||||
runtime_file.o \
|
||||
@@ -665,7 +671,7 @@ else ifeq ($(HAVE_BUILTINMBEDTLS), 1)
|
||||
DEFINES += -DMBEDTLS_SSL_DEBUG_ALL
|
||||
endif
|
||||
|
||||
# MinGW requires this for some reason,
|
||||
# MinGW requires this for some reason,
|
||||
# even though the include paths are relative to the source
|
||||
INCLUDE_DIRS += -Ideps/mbedtls
|
||||
|
||||
@@ -764,6 +770,12 @@ endif
|
||||
|
||||
ifeq ($(HAVE_LAKKA), 1)
|
||||
OBJ += wifi/drivers/connmanctl.o
|
||||
OBJ += misc/cpufreq/cpufreq.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_WIFI), 1)
|
||||
OBJ += wifi/drivers/nmcli.o
|
||||
DEFINES += -DHAVE_WIFI
|
||||
endif
|
||||
|
||||
# Audio
|
||||
@@ -820,7 +832,9 @@ ifeq ($(HAVE_ALSA), 1)
|
||||
|
||||
ifneq ($(HAVE_HAKCHI), 1)
|
||||
ifneq ($(HAVE_SEGAM), 1)
|
||||
OBJ += midi/drivers/alsa_midi.o
|
||||
ifneq ($(DINGUX), 1)
|
||||
OBJ += midi/drivers/alsa_midi.o
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -1565,8 +1579,14 @@ else ifeq ($(HAVE_SDL), 1)
|
||||
else ifeq ($(HAVE_SDL_DINGUX), 1)
|
||||
HAVE_SDL_COMMON = 1
|
||||
DEF_FLAGS += -DHAVE_SDL -DHAVE_SDL_DINGUX
|
||||
OBJ += gfx/drivers/sdl_dingux_gfx.o \
|
||||
input/drivers/sdl_dingux_input.o \
|
||||
|
||||
ifeq ($(RS90), 1)
|
||||
OBJ += gfx/drivers/sdl_rs90_gfx.o
|
||||
else
|
||||
OBJ += gfx/drivers/sdl_dingux_gfx.o
|
||||
endif
|
||||
|
||||
OBJ += input/drivers/sdl_dingux_input.o \
|
||||
input/drivers_joypad/sdl_dingux_joypad.o
|
||||
DEF_FLAGS += $(SDL_DINGUX_CFLAGS)
|
||||
LIBS += $(SDL_DINGUX_LIBS)
|
||||
@@ -1985,7 +2005,8 @@ ifeq ($(HAVE_CDROM), 1)
|
||||
DEFINES += -DHAVE_CDROM
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/cdrom/cdrom.o \
|
||||
$(LIBRETRO_COMM_DIR)/vfs/vfs_implementation_cdrom.o \
|
||||
$(LIBRETRO_COMM_DIR)/media/media_detect_cd.o
|
||||
$(LIBRETRO_COMM_DIR)/media/media_detect_cd.o \
|
||||
tasks/task_content_disc.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_RTGA), 1)
|
||||
@@ -2101,8 +2122,8 @@ ifeq ($(HAVE_NETWORKING), 1)
|
||||
INCLUDE_DIRS += -Ideps/rcheevos/include
|
||||
|
||||
OBJ += cheevos/cheevos.o \
|
||||
cheevos/badges.o \
|
||||
cheevos/cheevos_memory.o \
|
||||
cheevos/cheevos_client.o \
|
||||
cheevos/cheevos_menu.o \
|
||||
cheevos/cheevos_parser.o \
|
||||
$(LIBRETRO_COMM_DIR)/formats/cdfs/cdfs.o \
|
||||
deps/rcheevos/src/rcheevos/alloc.o \
|
||||
@@ -2114,12 +2135,16 @@ ifeq ($(HAVE_NETWORKING), 1)
|
||||
deps/rcheevos/src/rcheevos/lboard.o \
|
||||
deps/rcheevos/src/rcheevos/memref.o \
|
||||
deps/rcheevos/src/rcheevos/operand.o \
|
||||
deps/rcheevos/src/rcheevos/rc_libretro.o \
|
||||
deps/rcheevos/src/rcheevos/richpresence.o \
|
||||
deps/rcheevos/src/rcheevos/runtime.o \
|
||||
deps/rcheevos/src/rcheevos/runtime_progress.o \
|
||||
deps/rcheevos/src/rcheevos/trigger.o \
|
||||
deps/rcheevos/src/rcheevos/value.o \
|
||||
deps/rcheevos/src/rhash/hash.o \
|
||||
deps/rcheevos/src/rapi/rc_api_common.o \
|
||||
deps/rcheevos/src/rapi/rc_api_runtime.o \
|
||||
deps/rcheevos/src/rapi/rc_api_user.o \
|
||||
deps/rcheevos/src/rurl/url.o
|
||||
|
||||
ifeq ($(HAVE_LUA), 1)
|
||||
@@ -2263,6 +2288,39 @@ ifeq ($(HAVE_FFMPEG), 1)
|
||||
INCLUDE_DIRS += -Iffmpeg
|
||||
endif
|
||||
|
||||
# CRT mode switching
|
||||
ifeq ($(HAVE_CRTSWITCHRES), 1)
|
||||
INCLUDE_DIRS += -I$(DEPS_DIR)/switchres
|
||||
OBJ += gfx/video_crt_switch.o \
|
||||
$(DEPS_DIR)/switchres/monitor.o \
|
||||
$(DEPS_DIR)/switchres/modeline.o \
|
||||
$(DEPS_DIR)/switchres/switchres.o \
|
||||
$(DEPS_DIR)/switchres/display.o \
|
||||
$(DEPS_DIR)/switchres/custom_video.o \
|
||||
$(DEPS_DIR)/switchres/log.o \
|
||||
$(DEPS_DIR)/switchres/switchres_wrapper.o \
|
||||
$(DEPS_DIR)/switchres/edid.o
|
||||
ifneq ($(findstring Win32,$(OS)),)
|
||||
OBJ += $(DEPS_DIR)/switchres/display_windows.o \
|
||||
$(DEPS_DIR)/switchres/custom_video_ati_family.o \
|
||||
$(DEPS_DIR)/switchres/custom_video_ati.o \
|
||||
$(DEPS_DIR)/switchres/custom_video_adl.o \
|
||||
$(DEPS_DIR)/switchres/custom_video_pstrip.o \
|
||||
$(DEPS_DIR)/switchres/resync_windows.o
|
||||
endif
|
||||
ifneq ($(findstring Linux,$(OS)),)
|
||||
OBJ += $(DEPS_DIR)/switchres/display_linux.o
|
||||
ifeq ($(HAVE_X11)$(HAVE_XRANDR), 11)
|
||||
OBJ += $(DEPS_DIR)/switchres/custom_video_xrandr.o
|
||||
DEFINES += -DSR_WITH_XRANDR
|
||||
endif
|
||||
endif
|
||||
ifneq ($(findstring Win32,$(OS)),)
|
||||
DEFINES += -DSR_WIN32_STATIC
|
||||
endif
|
||||
LIBS += -lstdc++
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_COMPRESSION), 1)
|
||||
DEFINES += -DHAVE_COMPRESSION
|
||||
OBJ += tasks/task_decompress.o
|
||||
@@ -2280,9 +2338,9 @@ ifeq ($(HAVE_COCOA_COMMON),1)
|
||||
OBJ += input/drivers/cocoa_input.o \
|
||||
ui/drivers/ui_cocoa.o \
|
||||
ui/drivers/cocoa/cocoa_common.o
|
||||
|
||||
|
||||
ifeq ($(HAVE_OPENGL), 1)
|
||||
DEFINES += -DGL_SILENCE_DEPRECATION
|
||||
DEFINES += -DGL_SILENCE_DEPRECATION
|
||||
OBJ += gfx/drivers_context/cocoa_gl_ctx.o
|
||||
endif
|
||||
ifeq ($(HAVE_VULKAN), 1)
|
||||
@@ -2326,10 +2384,10 @@ endif
|
||||
|
||||
ifeq ($(WANT_IOSUHAX), 1)
|
||||
DEFINES += -DHAVE_IOSUHAX
|
||||
INCLUDE_DIRS += -I$(DEPS_DIR)/libiosuhax
|
||||
OBJ += $(DEPS_DIR)/libiosuhax/iosuhax.o \
|
||||
$(DEPS_DIR)/libiosuhax/iosuhax_devoptab.o \
|
||||
$(DEPS_DIR)/libiosuhax/iosuhax_disc_interface.o
|
||||
INCLUDE_DIRS += -I$(DEPS_DIR)/libiosuhax/include
|
||||
OBJ += $(DEPS_DIR)/libiosuhax/source/iosuhax.o \
|
||||
$(DEPS_DIR)/libiosuhax/source/iosuhax_devoptab.o \
|
||||
$(DEPS_DIR)/libiosuhax/source/iosuhax_disc_interface.o
|
||||
endif
|
||||
|
||||
ifeq ($(WANT_LIBFAT), 1)
|
||||
@@ -2366,13 +2424,6 @@ ifneq ($(findstring Win32,$(OS)),)
|
||||
OBJ += led/drivers/led_win32_keyboard.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_MATH_NEON), 1)
|
||||
DEFINES += -DHAVE_MATH_NEON
|
||||
INCLUDE_DIRS += -I$(DEPS_DIR)/math-neon/source
|
||||
SOURCES := $(DEPS_DIR)/math-neon/source
|
||||
OBJ += $(patsubst %.c,%.o,$(foreach dir,$(SOURCES), $(wildcard $(dir)/*.c)))
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_VITAGLES), 1)
|
||||
DEFINES += -DHAVE_VITAGLES
|
||||
INCLUDE_DIRS += -I$(DEPS_DIR)/Pigs-In-A-Blanket/include
|
||||
@@ -2380,6 +2431,10 @@ ifeq ($(HAVE_VITAGLES), 1)
|
||||
OBJ += $(patsubst %.c,%.o,$(foreach dir,$(SOURCES), $(wildcard $(dir)/*.c)))
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_WEBOS), 1)
|
||||
DEFINES += -DWEBOS
|
||||
endif
|
||||
|
||||
#####################################
|
||||
### Android Play Feature Delivery ###
|
||||
### (Play Store build core ###
|
||||
@@ -2437,4 +2492,3 @@ ifeq ($(HAVE_ODROIDGO2), 1)
|
||||
endif
|
||||
|
||||
##################################
|
||||
|
||||
+1
-1
@@ -490,7 +490,7 @@ else ifeq ($(platform), windows_msvc2005_x86)
|
||||
CXX = cl.exe
|
||||
LD = link.exe
|
||||
|
||||
PLATCFLAGS += -D_WIN32 -D_WIN32_WINNT=0x0410 -D__STDC_CONSTANT_MACROS -D_MBCS -D__SSE__
|
||||
PLATCFLAGS += -D_WIN32 -D_WIN32_WINNT=0x0410 -D__STDC_CONSTANT_MACROS -D_MBCS
|
||||
PLATCFLAGS += -DHAVE_OPENGL -DHAVE_OPENGL1 -DHAVE_GLSL -DHAVE_OZONE -DHAVE_GFX_WIDGETS -DHAVE_CC_RESAMPLER
|
||||
PLATCFLAGS += -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORES -DHAVE_CDROM
|
||||
PLATCFLAGS += -bigobj
|
||||
|
||||
@@ -32,6 +32,7 @@ HAVE_RTGA = 1
|
||||
HAVE_RPNG = 1
|
||||
HAVE_RJPEG = 1
|
||||
HAVE_RBMP = 1
|
||||
HAVE_7ZIP = 1
|
||||
HAVE_ZLIB = 1
|
||||
HAVE_BUILTINZLIB = 1
|
||||
HAVE_LIBRETRODB = 1
|
||||
|
||||
+11
-5
@@ -1,5 +1,6 @@
|
||||
BUILD_FOR_PCSX2 = 0
|
||||
DEBUG = 0
|
||||
SCREEN_DEBUG = 0
|
||||
HAVE_THREADS = 0
|
||||
MUTE_WARNINGS = 1
|
||||
PS2_IP = 192.168.1.10
|
||||
@@ -24,18 +25,22 @@ endif
|
||||
|
||||
INCDIR = -I$(PS2DEV)/gsKit/include -I$(PS2SDK)/ports/include
|
||||
INCDIR += -Ips2/include -Ilibretro-common/include -Ideps -Ideps/stb -Ideps/7zip
|
||||
INCDIR += -Ideps/pthreads -Ideps/pthreads/platform/ps2 -Ideps/pthreads/platform/helper
|
||||
CFLAGS = $(OPTIMIZE_LV) $(DISABLE_WARNINGS) -ffast-math -fsingle-precision-constant
|
||||
ASFLAGS = $(CFLAGS)
|
||||
|
||||
RARCH_DEFINES += -DPS2 -DHAVE_GRIFFIN=1 -DRARCH_INTERNAL -DHAVE_SCREENSHOTS -DHAVE_REWIND -DRARCH_CONSOLE -DHAVE_MENU -DHAVE_CONFIGFILE -DHAVE_PATCH -DHAVE_CHEATS -DHAVE_RGUI
|
||||
RARCH_DEFINES += -DPS2 -DHAVE_GRIFFIN=1 -DRARCH_INTERNAL -DHAVE_SCREENSHOTS -DHAVE_REWIND -DRARCH_CONSOLE -DHAVE_MENU -DHAVE_CONFIGFILE -DHAVE_PATCH -DHAVE_CHEATS
|
||||
RARCH_DEFINES += -DHAVE_ZLIB -DHAVE_NO_BUILTINZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_FILTERS_BUILTIN -DHAVE_7ZIP -D_7ZIP_ST -DHAVE_CC_RESAMPLER -DHAVE_AUDIOMIXER
|
||||
RARCH_DEFINES += -DHAVE_VIDEO_FILTER -DHAVE_RGUI
|
||||
RARCH_DEFINES += -DHAVE_DSP_FILTER
|
||||
RARCH_DEFINES += -DHAVE_VIDEO_FILTER
|
||||
|
||||
LDFLAGS += -L$(PS2DEV)/gsKit/lib -L$(PS2SDK)/ports/lib -L.
|
||||
# Lib cdvd is needed to get proper time
|
||||
LIBS += -lretro_ps2 -lpatches -lgskit -ldmakit -laudsrv -lmtap -lpadx -lz -lcdvd -lelf-loader
|
||||
LIBS += -lretro_ps2 -lpatches -lgskit -ldmakit -laudsrv -lmtap -lpadx -lz -lcdvd -lelf-loader -lfileXio -lpoweroff
|
||||
|
||||
ifeq ($(SCREEN_DEBUG), 1)
|
||||
LIBS += -ldebug
|
||||
RARCH_DEFINES += -DSCREEN_DEBUG
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_FOR_PCSX2), 1)
|
||||
RARCH_DEFINES += -DBUILD_FOR_PCSX2
|
||||
@@ -50,9 +55,10 @@ CFLAGS += $(RARCH_DEFINES)
|
||||
# All the IRX objects
|
||||
EE_OBJS += $(IRX_DIR)/sio2man_irx.o $ $(IRX_DIR)/iomanX_irx.o $(IRX_DIR)/fileXio_irx.o
|
||||
EE_OBJS += $(IRX_DIR)/mcman_irx.o $(IRX_DIR)/mcserv_irx.o
|
||||
EE_OBJS += $(IRX_DIR)/usbd_irx.o $(IRX_DIR)/usbhdfsd_irx.o
|
||||
EE_OBJS += $(IRX_DIR)/usbd_irx.o $(IRX_DIR)/bdm_irx.o $(IRX_DIR)/bdmfs_vfat_irx.o $(IRX_DIR)/usbmass_bd_irx.o
|
||||
EE_OBJS += $(IRX_DIR)/libsd_irx.o $(IRX_DIR)/audsrv_irx.o
|
||||
EE_OBJS += $(IRX_DIR)/cdfs_irx.o
|
||||
EE_OBJS += $(IRX_DIR)/ps2dev9_irx.o $(IRX_DIR)/ps2atad_irx.o $(IRX_DIR)/ps2hdd_irx.o $(IRX_DIR)/ps2fs_irx.o $(IRX_DIR)/poweroff_irx.o
|
||||
EE_OBJS += $(IRX_DIR)/mtapman_irx.o $(IRX_DIR)/padman_irx.o
|
||||
|
||||
# Missing objecst on the PS2SDK
|
||||
|
||||
+10
-2
@@ -1,5 +1,6 @@
|
||||
BUILD_FOR_PCSX2 = 0
|
||||
DEBUG = 0
|
||||
SCREEN_DEBUG = 0
|
||||
MUTE_WARNINGS = 1
|
||||
PS2_IP = 192.168.1.150
|
||||
|
||||
@@ -30,7 +31,12 @@ RARCH_DEFINES += -DPS2 -DIS_SALAMANDER -DRARCH_CONSOLE
|
||||
|
||||
LIBDIR =
|
||||
LDFLAGS =
|
||||
LIBS = -lelf-loader -lpatches
|
||||
LIBS = -lelf-loader -lpatches -lfileXio -lpoweroff
|
||||
|
||||
ifeq ($(SCREEN_DEBUG), 1)
|
||||
LIBS += -ldebug
|
||||
RARCH_DEFINES += -DSCREEN_DEBUG
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_FOR_PCSX2), 1)
|
||||
RARCH_DEFINES += -DBUILD_FOR_PCSX2
|
||||
@@ -61,8 +67,10 @@ EE_OBJS = frontend/frontend_salamander.o \
|
||||
|
||||
# Needed IRX objects
|
||||
EE_OBJS += $(IRX_DIR)/sio2man_irx.o $ $(IRX_DIR)/iomanX_irx.o $(IRX_DIR)/fileXio_irx.o
|
||||
EE_OBJS += $(IRX_DIR)/mcman_irx.o $(IRX_DIR)/mcserv_irx.o $(IRX_DIR)/usbd_irx.o $(IRX_DIR)/usbhdfsd_irx.o
|
||||
EE_OBJS += $(IRX_DIR)/mcman_irx.o $(IRX_DIR)/mcserv_irx.o
|
||||
EE_OBJS += $(IRX_DIR)/usbd_irx.o $(IRX_DIR)/bdm_irx.o $(IRX_DIR)/bdmfs_vfat_irx.o $(IRX_DIR)/usbmass_bd_irx.o
|
||||
EE_OBJS += $(IRX_DIR)/cdfs_irx.o
|
||||
EE_OBJS += $(IRX_DIR)/ps2dev9_irx.o $(IRX_DIR)/ps2atad_irx.o $(IRX_DIR)/ps2hdd_irx.o $(IRX_DIR)/ps2fs_irx.o $(IRX_DIR)/poweroff_irx.o
|
||||
|
||||
EE_CFLAGS = $(CFLAGS)
|
||||
EE_CXXFLAGS = $(CFLAGS)
|
||||
|
||||
+2
-2
@@ -30,7 +30,7 @@ CORE_PATH = pkg/psl1ght/pkg/USRDIR/cores/CORE.SELF
|
||||
INCLUDE += -I. -Ips3/gcmgl/include/export -Ips3/include -Ideps -Ideps/stb -Ilibretro-common/include/compat/zlib -Ilibretro-common/include $(LIBPSL1GHT_INC) -Iinclude -Idefines
|
||||
LIBDIRS += -L.
|
||||
|
||||
MACHDEP := -D__PSL1GHT__ -mcpu=cell
|
||||
MACHDEP := -D__PSL1GHT__ -D__PS3__ -mcpu=cell
|
||||
CFLAGS += -Wall $(MACHDEP) $(INCLUDE)
|
||||
LDFLAGS := $(MACHDEP)
|
||||
LIBS := -lretro_psl1ght -laudio -lrsx -lgcm_sys -lnet -lio -lsysutil -lsysmodule -lm -ljpgdec -lpngdec -llv2 -lnet -lnetctl -lsysfs
|
||||
@@ -66,7 +66,7 @@ endif
|
||||
SHARED_FLAGS :=
|
||||
|
||||
SHARED_FLAGS += -DHAVE_VIDEO_LAYOUT
|
||||
SHARED_FLAGS += -DHAVE_MENU -DHAVE_CONFIGFILE -DHAVE_PATCH -DHAVE_CHEATS -DRARCH_CONSOLE -DHAVE_OVERLAY -DHAVE_HEADSET -DHAVE_CG -DHAVE_CG_RUNTIME_COMPILER -DHAVE_GCMGL -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_MOUSE -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_GRIFFIN=1 -DHAVE_NETWORKING=1 -DHAVE_SOCKET_LEGACY=1 -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT) -Wno-char-subscripts -DHAVE_CC_RESAMPLER -DRARCH_INTERNAL -DHAVE_SCREENSHOTS -DHAVE_REWIND -DHAVE_MULTIMAN -DHAVE_RGUI
|
||||
SHARED_FLAGS += -DHAVE_MENU -DHAVE_CONFIGFILE -DHAVE_PATCH -DHAVE_CHEATS -DRARCH_CONSOLE -DHAVE_OVERLAY -DHAVE_HEADSET -DHAVE_CG -DHAVE_CG_RUNTIME_COMPILER -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_MOUSE -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_GRIFFIN=1 -DHAVE_NETWORKING=1 -DHAVE_SOCKET_LEGACY=1 -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT) -Wno-char-subscripts -DHAVE_CC_RESAMPLER -DRARCH_INTERNAL -DHAVE_SCREENSHOTS -DHAVE_REWIND -DHAVE_MULTIMAN -DHAVE_RGUI
|
||||
CFLAGS += -std=gnu99 $(SHARED_FLAGS)
|
||||
CXXFLAGS += $(SHARED_FLAGS)
|
||||
|
||||
|
||||
@@ -27,13 +27,14 @@ ELF_TARGET := retroarch_psl1ght_salamander.elf
|
||||
ELF_TARGET_NONSTRIPPED := retroarch_psl1ght_salamander_nonstripped.elf
|
||||
EBOOT_PATH = pkg/psl1ght/pkg/USRDIR/EBOOT.BIN
|
||||
|
||||
INCLUDE += -I. -Ips3/gcmgl/include/export -Ips3/include -Ideps -Ideps/stb -Ilibretro-common/include/compat/zlib -Ilibretro-common/include $(LIBPSL1GHT_INC) -Iinclude
|
||||
INCLUDE += -I. -Ips3/gcmgl/include/export -Ips3/include -Ideps -Ideps/stb -Ilibretro-common/include/compat/zlib \
|
||||
-Ilibretro-common/include $(LIBPSL1GHT_INC) -Iinclude -Idefines
|
||||
LIBDIRS += -L.
|
||||
|
||||
MACHDEP := -D__PSL1GHT__ -mcpu=cell -mhard-float -fmodulo-sched -ffunction-sections -fdata-sections
|
||||
MACHDEP := -D__PS3__ -D__PSL1GHT__ -mcpu=cell -mhard-float -fmodulo-sched -ffunction-sections -fdata-sections
|
||||
CFLAGS += -Wall $(MACHDEP) $(INCLUDE)
|
||||
LDFLAGS := $(MACHDEP)
|
||||
LIBS := -lgcm_sys -lrsx -lsysutil -lio -lnet -lsysmodule -lrt -llv2 -lm
|
||||
LIBS := -lgcm_sys -lrsx -lsysutil -lio -lnet -lsysmodule -lrt -llv2 -lm -lsysfs
|
||||
|
||||
# system platform
|
||||
system_platform = unix
|
||||
|
||||
+2
-2
@@ -19,7 +19,7 @@ ifeq ($(WHOLE_ARCHIVE_LINK), 1)
|
||||
WHOLE_END := -Wl,--no-whole-archive
|
||||
endif
|
||||
|
||||
INCDIR = deps deps/stb deps/7zip deps/pthreads deps/pthreads/platform/psp deps/pthreads/platform/helper libretro-common/include libretro-common/include/compat/zlib
|
||||
INCDIR = deps deps/stb deps/7zip libretro-common/include libretro-common/include/compat/zlib
|
||||
CFLAGS = $(OPTIMIZE_LV) -G0 -std=gnu99 -ffast-math -fsingle-precision-constant
|
||||
ASFLAGS = $(CFLAGS)
|
||||
|
||||
@@ -27,7 +27,7 @@ RARCH_DEFINES = -DPSP -D_MIPS_ARCH_ALLEGREX -DHAVE_LANGEXTRA -DHAVE_ZLIB -DHAVE_
|
||||
|
||||
LIBDIR =
|
||||
LDFLAGS =
|
||||
LIBS = $(WHOLE_START) -lretro_psp1 $(WHOLE_END) -lstdc++ -lpspgu -lpspgum -lm -lpspaudio -lpspfpu -lpsppower -lpsprtc
|
||||
LIBS = $(WHOLE_START) -lretro_psp1 $(WHOLE_END) -lstdc++ -lpspgu -lpspgum -lm -lpspaudio -lpspfpu -lpsppower -lpsprtc -lpthread-psp
|
||||
|
||||
ifeq ($(HAVE_THREADS), 1)
|
||||
RARCH_DEFINES += -DHAVE_THREADS
|
||||
|
||||
@@ -0,0 +1,237 @@
|
||||
#########################
|
||||
## Toolchain variables ##
|
||||
#########################
|
||||
|
||||
# Default toolchain directory
|
||||
TOOLCHAIN_DIR=/opt/retrofw-toolchain
|
||||
|
||||
# All toolchain-related variables may be
|
||||
# overridden via the command line
|
||||
ifdef RETROFW_CC
|
||||
CC = $(GCW0_CC)
|
||||
else
|
||||
CC = $(TOOLCHAIN_DIR)/usr/bin/mipsel-linux-gcc
|
||||
endif
|
||||
|
||||
ifdef RETROFW_CXX
|
||||
CXX = $(GCW0_CXX)
|
||||
else
|
||||
CXX = $(TOOLCHAIN_DIR)/usr/bin/mipsel-linux-g++
|
||||
endif
|
||||
|
||||
ifdef RETROFW_STRIP
|
||||
STRIP = $(GCW0_STRIP)
|
||||
else
|
||||
STRIP = $(TOOLCHAIN_DIR)/usr/bin/mipsel-linux-strip
|
||||
endif
|
||||
|
||||
GCW0_SDL_CONFIG ?= $(TOOLCHAIN_DIR)/usr/mipsel-buildroot-linux-uclibc/sysroot/usr/bin/sdl-config
|
||||
GCW0_FREETYPE_CONFIG ?= $(TOOLCHAIN_DIR)/usr/mipsel-buildroot-linux-uclibc/sysroot/usr/bin/freetype-config
|
||||
#GCW0_MK_SQUASH_FS ?= $(TOOLCHAIN_DIR)/usr/bin/mksquashfs
|
||||
GCW0_MK_SQUASH_FS ?= mksquashfs
|
||||
|
||||
GCW0_INC_DIR ?= $(TOOLCHAIN_DIR)/usr/mipsel-buildroot-linux-uclibc/sysroot/usr/include
|
||||
GCW0_LIB_DIR ?= $(TOOLCHAIN_DIR)/usr/mipsel-buildroot-linux-uclibc/sysroot/usr/lib
|
||||
|
||||
#########################
|
||||
#########################
|
||||
|
||||
PACKAGE_NAME = retroarch
|
||||
RETROFW = 1
|
||||
|
||||
DEBUG ?= 0
|
||||
|
||||
DINGUX = 1
|
||||
HAVE_SCREENSHOTS = 0
|
||||
HAVE_REWIND = 1
|
||||
HAVE_7ZIP = 1
|
||||
HAVE_AL = 0
|
||||
# ALSA freezes when switching back from menu
|
||||
HAVE_ALSA = 0
|
||||
HAVE_DSP_FILTER = 1
|
||||
HAVE_VIDEO_FILTER = 1
|
||||
HAVE_STATIC_VIDEO_FILTERS = 1
|
||||
HAVE_STATIC_AUDIO_FILTERS = 1
|
||||
HAVE_FILTERS_BUILTIN = 1
|
||||
HAVE_BUILTINMBEDTLS = 0
|
||||
HAVE_BUILTINZLIB = 1
|
||||
HAVE_C99 = 1
|
||||
HAVE_CC = 1
|
||||
HAVE_CC_RESAMPLER = 1
|
||||
HAVE_CHD = 1
|
||||
HAVE_COMMAND = 0
|
||||
HAVE_CXX = 1
|
||||
HAVE_DR_MP3 = 1
|
||||
HAVE_DYNAMIC = 1
|
||||
HAVE_EGL = 0
|
||||
HAVE_FREETYPE = 0
|
||||
HAVE_GDI = 1
|
||||
HAVE_GETADDRINFO = 0
|
||||
HAVE_GETOPT_LONG = 1
|
||||
HAVE_GLSL = 0
|
||||
HAVE_HID = 1
|
||||
HAVE_IBXM = 1
|
||||
HAVE_IMAGEVIEWER = 1
|
||||
HAVE_LANGEXTRA = 0
|
||||
HAVE_LIBRETRODB = 1
|
||||
HAVE_MENU = 1
|
||||
HAVE_MENU_COMMON = 1
|
||||
HAVE_GFX_WIDGETS = 0
|
||||
HAVE_MMAP = 1
|
||||
HAVE_OPENDINGUX_FBDEV = 0
|
||||
HAVE_OPENGL = 0
|
||||
HAVE_OPENGL1 = 0
|
||||
HAVE_OPENGLES = 0
|
||||
HAVE_OPENGLES3 = 0
|
||||
HAVE_OPENGL_CORE = 0
|
||||
HAVE_OPENSSL = 1
|
||||
HAVE_OVERLAY = 0
|
||||
HAVE_RBMP = 1
|
||||
HAVE_RJPEG = 1
|
||||
HAVE_RPILED = 0
|
||||
HAVE_RPNG = 1
|
||||
HAVE_RUNAHEAD = 0
|
||||
HAVE_SDL_DINGUX = 1
|
||||
HAVE_SHADERPIPELINE = 0
|
||||
HAVE_STB_FONT = 0
|
||||
HAVE_STB_IMAGE = 1
|
||||
HAVE_STB_VORBIS = 1
|
||||
HAVE_STDIN_CMD = 0
|
||||
HAVE_STRCASESTR = 1
|
||||
HAVE_THREADS = 1
|
||||
HAVE_UDEV = 0
|
||||
HAVE_RGUI = 1
|
||||
HAVE_MATERIALUI = 0
|
||||
HAVE_XMB = 0
|
||||
HAVE_OZONE = 0
|
||||
HAVE_ZLIB = 1
|
||||
HAVE_CONFIGFILE = 1
|
||||
HAVE_PATCH = 1
|
||||
HAVE_CHEATS = 1
|
||||
HAVE_CHEEVOS = 0
|
||||
HAVE_LIBSHAKE = 0
|
||||
|
||||
#comment out for now not working
|
||||
#HAVE_OSS =1
|
||||
#HAVE_OSS_LIB =1
|
||||
|
||||
OS = Linux
|
||||
TARGET = retroarch
|
||||
OPK_NAME = retroarch_retrofw.opk
|
||||
|
||||
OBJ :=
|
||||
LINK := $(CXX)
|
||||
DEF_FLAGS := -march=mips32 -mtune=mips32 -mhard-float -ffast-math -fomit-frame-pointer
|
||||
DEF_FLAGS += -mplt -mno-shared
|
||||
DEF_FLAGS += -ffunction-sections -fdata-sections
|
||||
DEF_FLAGS += -I. -Ideps -Ideps/stb -DDINGUX=1 -DRETROFW=1 -MMD
|
||||
DEF_FLAGS += -Wall -Wno-unused-variable -flto
|
||||
DEF_FLAGS += -std=gnu99 -D_GNU_SOURCE
|
||||
LIBS := -ldl -lz -lrt -pthread
|
||||
CFLAGS :=
|
||||
CXXFLAGS := -fno-exceptions -fno-rtti -std=c++11 -D__STDC_CONSTANT_MACROS
|
||||
ASFLAGS :=
|
||||
LDFLAGS := -Wl,--gc-sections
|
||||
INCLUDE_DIRS = -I$(GCW0_INC_DIR)
|
||||
LIBRARY_DIRS = -L$(GCW0_LIB_DIR)
|
||||
DEFINES := -DRARCH_INTERNAL -D_FILE_OFFSET_BITS=64 -UHAVE_STATIC_DUMMY
|
||||
DEFINES += -DHAVE_C99=1 -DHAVE_CXX=1
|
||||
DEFINES += -DHAVE_GETOPT_LONG=1 -DHAVE_STRCASESTR=1 -DHAVE_DYNAMIC=1
|
||||
DEFINES += -DHAVE_FILTERS_BUILTIN
|
||||
|
||||
SDL_DINGUX_CFLAGS := $(shell $(GCW0_SDL_CONFIG) --cflags)
|
||||
SDL_DINGUX_LIBS := $(shell $(GCW0_SDL_CONFIG) --libs)
|
||||
FREETYPE_CFLAGS := $(shell $(GCW0_FREETYPE_CONFIG) --cflags)
|
||||
FREETYPE_LIBS := $(shell $(GCW0_FREETYPE_CONFIG) --libs)
|
||||
MMAP_LIBS = -lc
|
||||
|
||||
OBJDIR_BASE := obj-unix
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
OBJDIR := $(OBJDIR_BASE)/debug
|
||||
DEF_FLAGS += -O0 -g -DDEBUG -D_DEBUG
|
||||
else
|
||||
OBJDIR := $(OBJDIR_BASE)/release
|
||||
DEF_FLAGS += -O2 -DNDEBUG
|
||||
endif
|
||||
|
||||
include Makefile.common
|
||||
|
||||
DEF_FLAGS += $(INCLUDE_DIRS)
|
||||
LDFLAGS += $(CFLAGS) $(CXXFLAGS) $(DEF_FLAGS)
|
||||
CFLAGS += $(DEF_FLAGS)
|
||||
CXXFLAGS += $(DEF_FLAGS)
|
||||
|
||||
HEADERS = $(wildcard */*/*.h) $(wildcard */*.h) $(wildcard *.h)
|
||||
|
||||
Q := @
|
||||
|
||||
RARCH_OBJ := $(addprefix $(OBJDIR)/,$(OBJ))
|
||||
|
||||
define DESKTOP_ENTRY
|
||||
[Desktop Entry]
|
||||
Name=RetroArch
|
||||
Comment=Frontend for emulators, game engines
|
||||
Exec=retroarch
|
||||
Terminal=false
|
||||
Type=Application
|
||||
StartupNotify=true
|
||||
Icon=retroarch
|
||||
Categories=emulators;
|
||||
X-OD-NeedsDownscaling=true
|
||||
endef
|
||||
export DESKTOP_ENTRY
|
||||
|
||||
|
||||
all: $(TARGET) opk
|
||||
|
||||
-include $(RARCH_OBJ:.o=.d)
|
||||
|
||||
SYMBOL_MAP := -Wl,-Map=output.map
|
||||
|
||||
$(TARGET): $(RARCH_OBJ)
|
||||
@$(if $(Q), $(shell echo echo LD $@),)
|
||||
$(Q)$(LINK) -o $@ $(RARCH_OBJ) $(LIBS) $(LDFLAGS) $(LIBRARY_DIRS)
|
||||
|
||||
$(OBJDIR)/%.o: %.c
|
||||
@mkdir -p $(dir $@)
|
||||
@$(if $(Q), $(shell echo echo CC $<),)
|
||||
$(Q)$(CC) $(CPPFLAGS) $(CFLAGS) $(DEFINES) -c -o $@ $<
|
||||
|
||||
$(OBJDIR)/%.o: %.cpp
|
||||
@mkdir -p $(dir $@)
|
||||
@$(if $(Q), $(shell echo echo CXX $<),)
|
||||
$(Q)$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) -MMD -c -o $@ $<
|
||||
|
||||
$(OBJDIR)/%.o: %.m
|
||||
@mkdir -p $(dir $@)
|
||||
@$(if $(Q), $(shell echo echo OBJC $<),)
|
||||
$(Q)$(CXX) $(OBJCFLAGS) $(DEFINES) -MMD -c -o $@ $<
|
||||
|
||||
$(OBJDIR)/%.o: %.S $(HEADERS)
|
||||
@mkdir -p $(dir $@)
|
||||
@$(if $(Q), $(shell echo echo AS $<),)
|
||||
$(Q)$(CC) $(CFLAGS) $(ASFLAGS) $(DEFINES) -c -o $@ $<
|
||||
|
||||
clean:
|
||||
rm -rf $(OBJDIR_BASE)
|
||||
rm -f $(TARGET)
|
||||
rm -f *.d
|
||||
rm -rf $(OPK_NAME)
|
||||
|
||||
opk: $(TARGET)
|
||||
echo "$$DESKTOP_ENTRY" > default.retrofw.desktop
|
||||
rm -f $(OPK_NAME)
|
||||
cp media/ico_src/icon32.png retroarch.png
|
||||
chmod +x retroarch
|
||||
chmod 777 retroarch
|
||||
ifeq ($(STRIP_BIN),1)
|
||||
$(STRIP) --strip-unneeded retroarch
|
||||
endif
|
||||
$(GCW0_MK_SQUASH_FS) retroarch default.retrofw.desktop retroarch.png $(OPK_NAME) -all-root -no-xattrs -noappend -no-exports
|
||||
rm -f default.retrofw.desktop retroarch.png
|
||||
|
||||
.PHONY: all clean opk
|
||||
|
||||
print-%:
|
||||
@echo '$*=$($*)'
|
||||
+3
-1
@@ -219,7 +219,9 @@ opk: $(TARGET)
|
||||
echo "$$DESKTOP_ENTRY" > default.gcw0.desktop
|
||||
rm -f $(OPK_NAME)
|
||||
cp media/ico_src/icon32.png retroarch.png
|
||||
if [ $$STRIP_BIN -eq 1 ]; then $(STRIP) --strip-unneeded retroarch; fi
|
||||
ifeq ($(STRIP_BIN),1)
|
||||
$(STRIP) --strip-unneeded retroarch
|
||||
endif
|
||||
$(GCW0_MK_SQUASH_FS) retroarch default.gcw0.desktop retroarch.png $(OPK_NAME) -all-root -no-xattrs -noappend -no-exports
|
||||
rm -f default.gcw0.desktop retroarch.png
|
||||
|
||||
|
||||
@@ -45,8 +45,7 @@ HAVE_SCREENSHOTS = 0
|
||||
HAVE_REWIND = 1
|
||||
HAVE_7ZIP = 1
|
||||
HAVE_AL = 1
|
||||
# ALSA freezes when switching back from menu
|
||||
HAVE_ALSA = 0
|
||||
HAVE_ALSA = 1
|
||||
HAVE_DSP_FILTER = 1
|
||||
HAVE_VIDEO_FILTER = 1
|
||||
HAVE_STATIC_VIDEO_FILTERS = 1
|
||||
@@ -121,6 +120,7 @@ DEF_FLAGS += -ffunction-sections -fdata-sections
|
||||
DEF_FLAGS += -I. -Ideps -Ideps/stb -DDINGUX=1 -DDINGUX_BETA=1 -MMD
|
||||
DEF_FLAGS += -Wall -Wno-unused-variable
|
||||
DEF_FLAGS += -std=gnu99 -D_GNU_SOURCE -flto
|
||||
DEF_FLAGS += -lasound
|
||||
LIBS := -ldl -lz -lrt -ludev -pthread
|
||||
CFLAGS :=
|
||||
CXXFLAGS := -fno-exceptions -fno-rtti -std=c++11 -D__STDC_CONSTANT_MACROS
|
||||
@@ -134,6 +134,7 @@ DEFINES += -DHAVE_GETOPT_LONG=1 -DHAVE_STRCASESTR=1 -DHAVE_DYNAMIC=1
|
||||
DEFINES += -DHAVE_AL=1
|
||||
DEFINES += -DHAVE_FILTERS_BUILTIN
|
||||
DEFINES += -DHAVE_UDEV=1
|
||||
DEFINES += -DHAVE_ALSA
|
||||
|
||||
SDL_DINGUX_CFLAGS := $(shell $(GCW0_SDL_CONFIG) --cflags)
|
||||
SDL_DINGUX_LIBS := $(shell $(GCW0_SDL_CONFIG) --libs)
|
||||
@@ -219,7 +220,9 @@ opk: $(TARGET)
|
||||
echo "$$DESKTOP_ENTRY" > default.gcw0.desktop
|
||||
rm -f $(OPK_NAME)
|
||||
cp media/ico_src/icon32.png retroarch.png
|
||||
if [ $$STRIP_BIN -eq 1 ]; then $(STRIP) --strip-unneeded retroarch; fi
|
||||
ifeq ($(STRIP_BIN),1)
|
||||
$(STRIP) --strip-unneeded retroarch
|
||||
endif
|
||||
$(GCW0_MK_SQUASH_FS) retroarch default.gcw0.desktop retroarch.png $(OPK_NAME) -all-root -no-xattrs -noappend -no-exports
|
||||
rm -f default.gcw0.desktop retroarch.png
|
||||
|
||||
|
||||
+234
@@ -0,0 +1,234 @@
|
||||
#########################
|
||||
## Toolchain variables ##
|
||||
#########################
|
||||
|
||||
# Alpha toolchain
|
||||
TOOLCHAIN_DIR=/opt/rs90-toolchain
|
||||
|
||||
# All toolchain-related variables may be
|
||||
# overridden via the command line
|
||||
ifdef GCW0_CC
|
||||
CC = $(GCW0_CC)
|
||||
else
|
||||
CC = $(TOOLCHAIN_DIR)/usr/bin/mipsel-rs90-linux-musl-gcc
|
||||
endif
|
||||
|
||||
ifdef GCW0_CXX
|
||||
CXX = $(GCW0_CXX)
|
||||
else
|
||||
CXX = $(TOOLCHAIN_DIR)/usr/bin/mipsel-rs90-linux-musl-g++
|
||||
endif
|
||||
|
||||
ifdef GCW0_STRIP
|
||||
STRIP = $(GCW0_STRIP)
|
||||
else
|
||||
STRIP = $(TOOLCHAIN_DIR)/usr/bin/mipsel-rs90-linux-musl-strip
|
||||
endif
|
||||
|
||||
GCW0_SDL_CONFIG ?= $(TOOLCHAIN_DIR)/usr/mipsel-rs90-linux-musl/sysroot/usr/bin/sdl-config
|
||||
GCW0_FREETYPE_CONFIG ?= $(TOOLCHAIN_DIR)/usr/mipsel-rs90-linux-musl/sysroot/usr/bin/freetype-config
|
||||
GCW0_MK_SQUASH_FS ?= $(TOOLCHAIN_DIR)/usr/bin/mksquashfs
|
||||
|
||||
GCW0_INC_DIR ?= $(TOOLCHAIN_DIR)/usr/mipsel-rs90-linux-musl/sysroot/usr/include
|
||||
GCW0_LIB_DIR ?= $(TOOLCHAIN_DIR)/usr/mipsel-rs90-linux-musl/sysroot/usr/lib
|
||||
|
||||
#########################
|
||||
#########################
|
||||
|
||||
PACKAGE_NAME = retroarch
|
||||
|
||||
DEBUG ?= 0
|
||||
|
||||
RS90 = 1
|
||||
DINGUX = 1
|
||||
DINGUX_BETA = 1
|
||||
HAVE_SCREENSHOTS = 0
|
||||
HAVE_REWIND = 0
|
||||
HAVE_7ZIP = 1
|
||||
HAVE_AL = 0
|
||||
HAVE_ALSA = 1
|
||||
HAVE_DSP_FILTER = 1
|
||||
HAVE_VIDEO_FILTER = 1
|
||||
HAVE_STATIC_VIDEO_FILTERS = 1
|
||||
HAVE_STATIC_AUDIO_FILTERS = 1
|
||||
HAVE_FILTERS_BUILTIN = 1
|
||||
HAVE_BUILTINMBEDTLS = 0
|
||||
HAVE_BUILTINZLIB = 1
|
||||
HAVE_C99 = 1
|
||||
HAVE_CC = 1
|
||||
HAVE_CC_RESAMPLER = 1
|
||||
|
||||
HAVE_CHD = 0
|
||||
HAVE_COMMAND = 0
|
||||
HAVE_CXX = 1
|
||||
HAVE_DR_MP3 = 0
|
||||
HAVE_DYNAMIC = 1
|
||||
HAVE_EGL = 0
|
||||
HAVE_FREETYPE = 0
|
||||
HAVE_GDI = 0
|
||||
HAVE_GETADDRINFO = 0
|
||||
HAVE_GETOPT_LONG = 1
|
||||
HAVE_GLSL = 0
|
||||
HAVE_HID = 0
|
||||
HAVE_IBXM = 0
|
||||
HAVE_IMAGEVIEWER = 0
|
||||
HAVE_LANGEXTRA = 0
|
||||
HAVE_LIBRETRODB = 1
|
||||
HAVE_MENU = 1
|
||||
HAVE_MENU_COMMON = 1
|
||||
HAVE_GFX_WIDGETS = 0
|
||||
HAVE_MMAP = 1
|
||||
HAVE_OPENDINGUX_FBDEV = 0
|
||||
HAVE_OPENGL = 0
|
||||
HAVE_OPENGL1 = 0
|
||||
HAVE_OPENGLES = 0
|
||||
HAVE_OPENGLES3 = 0
|
||||
HAVE_OPENGL_CORE = 0
|
||||
HAVE_OPENSSL = 0
|
||||
HAVE_OVERLAY = 0
|
||||
HAVE_RBMP = 1
|
||||
HAVE_RJPEG = 1
|
||||
HAVE_RPILED = 0
|
||||
HAVE_RPNG = 1
|
||||
HAVE_RUNAHEAD = 0
|
||||
HAVE_SDL_DINGUX = 1
|
||||
HAVE_SHADERPIPELINE = 0
|
||||
HAVE_STB_FONT = 0
|
||||
HAVE_STB_IMAGE = 0
|
||||
HAVE_STB_VORBIS = 0
|
||||
HAVE_STDIN_CMD = 0
|
||||
HAVE_STRCASESTR = 1
|
||||
HAVE_THREADS = 1
|
||||
HAVE_UDEV = 1
|
||||
HAVE_RGUI = 1
|
||||
HAVE_MATERIALUI = 0
|
||||
HAVE_XMB = 0
|
||||
HAVE_OZONE = 0
|
||||
HAVE_ZLIB = 1
|
||||
HAVE_CONFIGFILE = 1
|
||||
HAVE_PATCH = 1
|
||||
HAVE_CHEATS = 1
|
||||
HAVE_CHEEVOS = 0
|
||||
HAVE_LIBSHAKE = 0
|
||||
HAVE_TINYALSA = 1
|
||||
HAVE_NEAREST_RESAMPLER = 1
|
||||
|
||||
OS = Linux
|
||||
TARGET = retroarch
|
||||
OPK_NAME = retroarch_rs90_odbeta.opk
|
||||
|
||||
OBJ :=
|
||||
LINK := $(CXX)
|
||||
DEF_FLAGS := -mplt -mno-shared
|
||||
DEF_FLAGS += -ffunction-sections -fdata-sections
|
||||
DEF_FLAGS += -I. -Ideps -Ideps/stb -DRS90=1 -DDINGUX=1 -DDINGUX_BETA=1 -MMD
|
||||
DEF_FLAGS += -Wall -Wno-unused-variable
|
||||
DEF_FLAGS += -std=gnu99 -D_GNU_SOURopendinguxCE -flto -lasound
|
||||
LIBS := -ldl -lz -lrt -ludev -pthread
|
||||
CFLAGS :=
|
||||
CXXFLAGS := -fno-exceptions -fno-rtti -std=c++11 -D__STDC_CONSTANT_MACROS
|
||||
ASFLAGS :=
|
||||
LDFLAGS := -Wl,--gc-sections
|
||||
INCLUDE_DIRS = -I$(GCW0_INC_DIR)
|
||||
LIBRARY_DIRS = -L$(GCW0_LIB_DIR)
|
||||
DEFINES := -DRARCH_INTERNAL -D_FILE_OFFSET_BITS=64 -UHAVE_STATIC_DUMMY
|
||||
DEFINES += -DHAVE_C99=1 -DHAVE_CXX=1
|
||||
DEFINES += -DHAVE_GETOPT_LONG=1 -DHAVE_STRCASESTR=1 -DHAVE_DYNAMIC=1
|
||||
DEFINES += -DHAVE_FILTERS_BUILTIN
|
||||
DEFINES += -DHAVE_UDEV=1
|
||||
DEFINES += -DHAVE_ALSA
|
||||
DEFINES += -DCC_RESAMPLER_PRECISION=0
|
||||
|
||||
SDL_DINGUX_CFLAGS := $(shell $(GCW0_SDL_CONFIG) --cflags)
|
||||
SDL_DINGUX_LIBS := $(shell $(GCW0_SDL_CONFIG) --libs)
|
||||
FREETYPE_CFLAGS := $(shell $(GCW0_FREETYPE_CONFIG) --cflags)
|
||||
FREETYPE_LIBS := $(shell $(GCW0_FREETYPE_CONFIG) --libs)
|
||||
MMAP_LIBS = -lc
|
||||
|
||||
OBJDIR_BASE := obj-unix
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
OBJDIR := $(OBJDIR_BASE)/debug
|
||||
DEF_FLAGS += -O0 -g -DDEBUG -D_DEBUG
|
||||
else
|
||||
OBJDIR := $(OBJDIR_BASE)/release
|
||||
DEF_FLAGS += -Ofast -DNDEBUG
|
||||
endif
|
||||
|
||||
include Makefile.common
|
||||
|
||||
DEF_FLAGS += $(INCLUDE_DIRS)
|
||||
LDFLAGS += $(CFLAGS) $(CXXFLAGS) $(DEF_FLAGS)
|
||||
CFLAGS += $(DEF_FLAGS)
|
||||
CXXFLAGS += $(DEF_FLAGS)
|
||||
|
||||
HEADERS = $(wildcard */*/*.h) $(wildcard */*.h) $(wildcard *.h)
|
||||
|
||||
Q := @
|
||||
|
||||
RARCH_OBJ := $(addprefix $(OBJDIR)/,$(OBJ))
|
||||
|
||||
define DESKTOP_ENTRY
|
||||
[Desktop Entry]
|
||||
Name=RetroArch
|
||||
Comment=Frontend for emulators, game engines
|
||||
Exec=retroarch
|
||||
Terminal=false
|
||||
Type=Application
|
||||
StartupNotify=true
|
||||
Icon=retroarch
|
||||
Categories=emulators;
|
||||
X-OD-NeedsDownscaling=true
|
||||
endef
|
||||
export DESKTOP_ENTRY
|
||||
|
||||
all: $(TARGET) opk
|
||||
|
||||
-include $(RARCH_OBJ:.o=.d)
|
||||
|
||||
SYMBOL_MAP := -Wl,-Map=output.map
|
||||
|
||||
$(TARGET): $(RARCH_OBJ)
|
||||
@$(if $(Q), $(shell echo echo LD $@),)
|
||||
$(Q)$(LINK) -o $@ $(RARCH_OBJ) $(LIBS) $(LDFLAGS) $(LIBRARY_DIRS)
|
||||
|
||||
$(OBJDIR)/%.o: %.c
|
||||
@mkdir -p $(dir $@)
|
||||
@$(if $(Q), $(shell echo echo CC $<),)
|
||||
$(Q)$(CC) $(CPPFLAGS) $(CFLAGS) $(DEFINES) -c -o $@ $<
|
||||
|
||||
$(OBJDIR)/%.o: %.cpp
|
||||
@mkdir -p $(dir $@)
|
||||
@$(if $(Q), $(shell echo echo CXX $<),)
|
||||
$(Q)$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) -MMD -c -o $@ $<
|
||||
|
||||
$(OBJDIR)/%.o: %.m
|
||||
@mkdir -p $(dir $@)
|
||||
@$(if $(Q), $(shell echo echo OBJC $<),)
|
||||
$(Q)$(CXX) $(OBJCFLAGS) $(DEFINES) -MMD -c -o $@ $<
|
||||
|
||||
$(OBJDIR)/%.o: %.S $(HEADERS)
|
||||
@mkdir -p $(dir $@)
|
||||
@$(if $(Q), $(shell echo echo AS $<),)
|
||||
$(Q)$(CC) $(CFLAGS) $(ASFLAGS) $(DEFINES) -c -o $@ $<
|
||||
|
||||
clean:
|
||||
rm -rf $(OBJDIR_BASE)
|
||||
rm -f $(TARGET)
|
||||
rm -f *.d
|
||||
rm -rf $(OPK_NAME)
|
||||
|
||||
opk: $(TARGET)
|
||||
echo "$$DESKTOP_ENTRY" > default.rs90.desktop
|
||||
rm -f $(OPK_NAME)
|
||||
cp media/ico_src/icon32.png retroarch.png
|
||||
ifeq ($STRIP_BIN, 1)
|
||||
$(STRIP) --strip-unneeded retroarch
|
||||
endif
|
||||
$(GCW0_MK_SQUASH_FS) retroarch default.rs90.desktop retroarch.png $(OPK_NAME) -all-root -no-xattrs -noappend -no-exports
|
||||
rm -f default.rs90.desktop retroarch.png
|
||||
|
||||
.PHONY: all clean opk
|
||||
|
||||
print-%:
|
||||
@echo '$*=$($*)'
|
||||
+11
-6
@@ -13,7 +13,7 @@ PC_DEVELOPMENT_UDP_PORT =
|
||||
OBJ :=
|
||||
|
||||
SCE_LIBC_SIZE := 4194304
|
||||
DEFINES := -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS
|
||||
DEFINES := -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_STB_VORBIS
|
||||
INCDIRS :=
|
||||
|
||||
ifeq ($(GRIFFIN_BUILD), 1)
|
||||
@@ -31,7 +31,6 @@ else
|
||||
HAVE_UPDATE_ASSETS := 1
|
||||
HAVE_ONLINE_UPDATER := 1
|
||||
HAVE_NEON := 1
|
||||
HAVE_MATH_NEON := 1
|
||||
HAVE_DSP_FILTER := 1
|
||||
HAVE_VIDEO_FILTER := 1
|
||||
HAVE_SCREENSHOTS := 1
|
||||
@@ -112,17 +111,23 @@ LD := $(CXX)
|
||||
|
||||
LIBDIRS := -L.
|
||||
|
||||
ARCHFLAGS := -march=armv7-a -mfpu=neon -mfloat-abi=hard -DVITA -DSCE_LIBC_SIZE=$(SCE_LIBC_SIZE)
|
||||
CFLAGS += $(ARCHFLAGS) -mword-relocations -fno-optimize-sibling-calls -O2
|
||||
ARCHFLAGS := -march=armv7-a -mfpu=neon -mfloat-abi=hard -DVITA
|
||||
ifeq ($(HAVE_VITAGLES), 1)
|
||||
ARCHFLAGS += -DSCE_LIBC_SIZE=$(SCE_LIBC_SIZE)
|
||||
endif
|
||||
|
||||
CFLAGS += $(ARCHFLAGS) -mword-relocations -fno-optimize-sibling-calls
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
CFLAGS += -g
|
||||
CFLAGS += -g -Og
|
||||
else
|
||||
CFLAGS += -O2
|
||||
endif
|
||||
|
||||
ASFLAGS := $(CFLAGS)
|
||||
LDFLAGS := -Wl,-q
|
||||
|
||||
CFLAGS += -Wall -ffast-math -g
|
||||
CFLAGS += -Wall -ffast-math
|
||||
CFLAGS += -DRARCH_INTERNAL -DHAVE_SCREENSHOTS -DRARCH_CONSOLE
|
||||
CFLAGS += -DHAVE_DSP_FILTER
|
||||
CFLAGS += -DHAVE_VIDEO_FILTER
|
||||
|
||||
+242
@@ -0,0 +1,242 @@
|
||||
include version.all
|
||||
|
||||
$(call assert,$(call seq,$(TARGET_PREFIX),arm-webos-linux-gnueabi-),webOS SDK isn't setup properly. See https://github.com/webosbrew/meta-lg-webos-ndk#compile-program-by-command-line)
|
||||
|
||||
WEBOS_FREETYPE_CONFIG ?= $(SDKTARGETSYSROOT)/usr/bin/freetype-config
|
||||
|
||||
WEBOS_INC_DIR ?= $(SDKTARGETSYSROOT)/usr/include
|
||||
WEBOS_LIB_DIR ?= $(SDKTARGETSYSROOT)/usr/lib
|
||||
|
||||
#########################
|
||||
#########################
|
||||
|
||||
PACKAGE_NAME = com.retroarch
|
||||
PACKAGE_VERSION := $(patsubst "%",%,$(RARCH_VERSION))
|
||||
|
||||
DEBUG ?= 0
|
||||
|
||||
HAVE_SCREENSHOTS = 0
|
||||
HAVE_REWIND = 1
|
||||
HAVE_7ZIP = 1
|
||||
HAVE_ACCESSIBILITY = 1
|
||||
HAVE_AL = 0
|
||||
# ALSA freezes when switching back from menu
|
||||
HAVE_ALSA = 0
|
||||
HAVE_ANGLE = 0
|
||||
HAVE_AUDIOIO = 0
|
||||
HAVE_AUDIOMIXER = 1
|
||||
HAVE_BLISSBOX = 0
|
||||
HAVE_BSV_MOVIE = 1
|
||||
HAVE_BUILTINBEARSSL = 0
|
||||
HAVE_BUILTINFLAC = 1
|
||||
HAVE_DSP_FILTER = 1
|
||||
HAVE_VIDEO_FILTER = 1
|
||||
HAVE_STATIC_VIDEO_FILTERS = 1
|
||||
HAVE_STATIC_AUDIO_FILTERS = 1
|
||||
HAVE_FILTERS_BUILTIN = 1
|
||||
HAVE_BUILTINMBEDTLS = 1
|
||||
HAVE_BUILTINZLIB = 1
|
||||
HAVE_C99 = 1
|
||||
HAVE_CC = 1
|
||||
HAVE_CC_RESAMPLER = 1
|
||||
HAVE_NEAREST_RESAMPLER = 1
|
||||
HAVE_CHD = 1
|
||||
HAVE_COMMAND = 1
|
||||
HAVE_CXX = 1
|
||||
HAVE_DR_MP3 = 1
|
||||
HAVE_DYNAMIC = 1
|
||||
HAVE_DYLIB = 1
|
||||
HAVE_EGL = 0
|
||||
HAVE_FREETYPE = 0
|
||||
HAVE_GDI = 1
|
||||
HAVE_GETADDRINFO = 1
|
||||
HAVE_GETOPT_LONG = 1
|
||||
HAVE_GLSL = 1
|
||||
HAVE_GLSLANG = 0
|
||||
HAVE_GLSLANG_HLSL = 0
|
||||
HAVE_GLSLANG_OGLCOMPILER = 0
|
||||
HAVE_GLSLANG_OSDEPENDENT = 0
|
||||
HAVE_GLSLANG_SPIRV = 0
|
||||
HAVE_GLSLANG_SPIRV_TOOLS = 0
|
||||
HAVE_GLSLANG_SPIRV_TOOLS_OPT = 0
|
||||
HAVE_HID = 1
|
||||
HAVE_IBXM = 1
|
||||
HAVE_IMAGEVIEWER = 1
|
||||
HAVE_LANGEXTRA = 1
|
||||
HAVE_LIBRETRODB = 1
|
||||
HAVE_MENU = 1
|
||||
HAVE_MENU_COMMON = 1
|
||||
HAVE_NEON = 1
|
||||
HAVE_NETPLAYDISCOVERY = 1
|
||||
HAVE_NETPLAYDISCOVERY = 1
|
||||
HAVE_NETWORK_CMD = 1
|
||||
HAVE_NETWORKGAMEPAD = 1
|
||||
HAVE_NETWORKING = 1
|
||||
HAVE_GFX_WIDGETS = 1
|
||||
HAVE_MMAP = 1
|
||||
HAVE_ONLINE_UPDATER = 1
|
||||
HAVE_OPENDINGUX_FBDEV = 0
|
||||
HAVE_OPENGL = 0
|
||||
HAVE_OPENGL1 = 0
|
||||
HAVE_OPENGL_CORE = 0
|
||||
HAVE_OPENGLES = 1
|
||||
HAVE_OPENGLES3 = 0
|
||||
HAVE_OPENGLES3_1 = 0
|
||||
HAVE_OPENGLES3_2 = 0
|
||||
HAVE_OPENSSL = 0
|
||||
HAVE_OVERLAY = 1
|
||||
HAVE_PULSE = 1
|
||||
HAVE_RBMP = 1
|
||||
HAVE_RJPEG = 1
|
||||
HAVE_RPILED = 0
|
||||
HAVE_RPNG = 1
|
||||
HAVE_RUNAHEAD = 1
|
||||
HAVE_SDL = 0
|
||||
HAVE_SDL2 = 1
|
||||
HAVE_SHADERPIPELINE = 1
|
||||
HAVE_STB_FONT = 1
|
||||
HAVE_STB_IMAGE = 1
|
||||
HAVE_STB_VORBIS = 1
|
||||
HAVE_STDIN_CMD = 0
|
||||
HAVE_STRCASESTR = 1
|
||||
HAVE_THREADS = 1
|
||||
HAVE_UDEV = 0
|
||||
HAVE_RGUI = 1
|
||||
HAVE_MATERIALUI = 0
|
||||
HAVE_XMB = 1
|
||||
HAVE_OZONE = 1
|
||||
HAVE_ZLIB = 1
|
||||
HAVE_CONFIGFILE = 1
|
||||
HAVE_PATCH = 1
|
||||
HAVE_CHEATS = 1
|
||||
HAVE_CHEEVOS = 1
|
||||
HAVE_LIBSHAKE = 1
|
||||
HAVE_UPDATE_ASSETS = 1
|
||||
HAVE_UPDATE_CORES = 1
|
||||
|
||||
OS = Linux
|
||||
TARGET = retroarch
|
||||
|
||||
OBJ :=
|
||||
LINK := $(CXX)
|
||||
DEF_FLAGS += -ffunction-sections -fdata-sections
|
||||
DEF_FLAGS += -I. -Ideps -Ideps/stb -DWEBOS=1 -MMD
|
||||
DEF_FLAGS += -Wall -Wno-unused-variable
|
||||
LIBS := -ldl -lz -lrt -pthread
|
||||
CFLAGS :=
|
||||
CXXFLAGS := -fno-exceptions -fno-rtti -std=c++11 -D__STDC_CONSTANT_MACROS
|
||||
ASFLAGS :=
|
||||
LDFLAGS := -Wl,--gc-sections
|
||||
INCLUDE_DIRS = -I$(WEBOS_INC_DIR)
|
||||
LIBRARY_DIRS = -L$(WEBOS_LIB_DIR)
|
||||
DEFINES := -DRARCH_INTERNAL -D_FILE_OFFSET_BITS=64 -UHAVE_STATIC_DUMMY
|
||||
DEFINES += -DHAVE_C99=1 -DHAVE_CXX=1 -D_GNU_SOURCE
|
||||
DEFINES += -DHAVE_GETOPT_LONG=1 -DHAVE_STRCASESTR=1 -DHAVE_DYNAMIC=1
|
||||
DEFINES += -DHAVE_FILTERS_BUILTIN
|
||||
DEFINES += -DHAVE_SDL2
|
||||
DEFINES += -DHAVE_PULSE
|
||||
DEFINES += -DHAVE_NETWORKING -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORES
|
||||
|
||||
SDL2_CFLAGS := $(shell pkg-config --cflags sdl2)
|
||||
SDL2_LIBS := $(shell pkg-config --libs sdl2)
|
||||
OPENGLES_LIBS = -lGLESv2
|
||||
PULSE_LIBS = $(shell pkg-config --libs libpulse)
|
||||
MMAP_LIBS = -lc
|
||||
NEON_CFLAGS = -mfpu=neon
|
||||
NEON_ASFLAGS = -mfpu=neon
|
||||
NETWORKING_LIBS = -lc
|
||||
|
||||
OBJDIR_BASE := obj-unix
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
OBJDIR := $(OBJDIR_BASE)/debug
|
||||
DEF_FLAGS += -O0 -g -DDEBUG -D_DEBUG
|
||||
else
|
||||
OBJDIR := $(OBJDIR_BASE)/release
|
||||
DEF_FLAGS += -O2 -DNDEBUG
|
||||
endif
|
||||
|
||||
include Makefile.common
|
||||
|
||||
DEF_FLAGS += $(INCLUDE_DIRS)
|
||||
LDFLAGS += $(CFLAGS) $(CXXFLAGS) $(DEF_FLAGS)
|
||||
CFLAGS += $(DEF_FLAGS)
|
||||
CXXFLAGS += $(DEF_FLAGS)
|
||||
|
||||
HEADERS = $(wildcard */*/*.h) $(wildcard */*.h) $(wildcard *.h)
|
||||
|
||||
Q := @
|
||||
|
||||
RARCH_OBJ := $(addprefix $(OBJDIR)/,$(OBJ))
|
||||
|
||||
define APPINFO
|
||||
{
|
||||
"id": "$(PACKAGE_NAME)",
|
||||
"version": "$(PACKAGE_VERSION)",
|
||||
"vendor": "webosbrew.org",
|
||||
"title": "RetroArch",
|
||||
"icon": "icon160.png",
|
||||
"main": "retroarch",
|
||||
"iconColor": "#333333",
|
||||
"type": "native",
|
||||
"appDescription": "Emulation frontend"
|
||||
}
|
||||
endef
|
||||
export APPINFO
|
||||
|
||||
all: $(TARGET) ipk
|
||||
|
||||
-include $(RARCH_OBJ:.o=.d)
|
||||
|
||||
SYMBOL_MAP := -Wl,-Map=output.map
|
||||
|
||||
$(TARGET): $(RARCH_OBJ)
|
||||
@$(if $(Q), $(shell echo echo LD $@),)
|
||||
$(Q)$(LINK) -o $@ $(RARCH_OBJ) $(LIBS) $(LDFLAGS) $(LIBRARY_DIRS)
|
||||
|
||||
$(OBJDIR)/%.o: %.c
|
||||
@mkdir -p $(dir $@)
|
||||
@$(if $(Q), $(shell echo echo CC $<),)
|
||||
$(Q)$(CC) $(CPPFLAGS) $(CFLAGS) $(DEFINES) -c -o $@ $<
|
||||
|
||||
$(OBJDIR)/%.o: %.cpp
|
||||
@mkdir -p $(dir $@)
|
||||
@$(if $(Q), $(shell echo echo CXX $<),)
|
||||
$(Q)$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) -MMD -c -o $@ $<
|
||||
|
||||
$(OBJDIR)/%.o: %.m
|
||||
@mkdir -p $(dir $@)
|
||||
@$(if $(Q), $(shell echo echo OBJC $<),)
|
||||
$(Q)$(CXX) $(OBJCFLAGS) $(DEFINES) -MMD -c -o $@ $<
|
||||
|
||||
$(OBJDIR)/%.o: %.S $(HEADERS)
|
||||
@mkdir -p $(dir $@)
|
||||
@$(if $(Q), $(shell echo echo AS $<),)
|
||||
$(Q)$(CC) $(CFLAGS) $(ASFLAGS) $(DEFINES) -c -o $@ $<
|
||||
|
||||
clean:
|
||||
rm -rf $(OBJDIR_BASE)
|
||||
rm -f $(TARGET)
|
||||
rm -f *.d
|
||||
rm -rf webos/*.ipk
|
||||
rm -rf webos/dist
|
||||
|
||||
ipk: $(TARGET)
|
||||
rm -rf webos/dist
|
||||
mkdir -p webos/dist/lib
|
||||
echo "$$APPINFO" > webos/dist/appinfo.json
|
||||
cp -t webos/dist -vf $(TARGET) webos/icon160.png
|
||||
cp -t webos/dist/lib -vf $(WEBOS_LIB_DIR)/libstdc++.so.6
|
||||
$(STRIP) webos/dist/$(TARGET)
|
||||
cd webos && ares-package dist
|
||||
|
||||
install: ipk
|
||||
ares-install webos/$(PACKAGE_NAME)_$(PACKAGE_VERSION)_$(ARCH).ipk
|
||||
|
||||
launch: install
|
||||
ares-launch com.retroarch
|
||||
|
||||
.PHONY: all clean ipk
|
||||
|
||||
print-%:
|
||||
@echo '$*=$($*)'
|
||||
+1
-1
@@ -131,7 +131,7 @@ RARCH_CONSOLE = 1
|
||||
#HAVE_LANGEXTRA := 1
|
||||
HAVE_WIIUSB_HID := 1
|
||||
HAVE_RARCH_EXEC := 1
|
||||
HAVE_RSOUND := 1
|
||||
HAVE_RSOUND := 0
|
||||
|
||||
APP_BOOTER_DIR = wii/app_booter
|
||||
PLATOBJS := $(APP_BOOTER_DIR)/app_booter.binobj
|
||||
|
||||
+15
-5
@@ -11,6 +11,7 @@ HAVE_RUNAHEAD = 1
|
||||
WIIU_LOG_RPX = 0
|
||||
BUILD_DIR = objs/wiiu
|
||||
PC_DEVELOPMENT_TCP_PORT ?=
|
||||
LOAD_WITHOUT_CORE_INFO ?= 0
|
||||
|
||||
ifeq ($(SALAMANDER_BUILD),1)
|
||||
BUILD_DIR := $(BUILD_DIR)-salamander
|
||||
@@ -85,6 +86,9 @@ else
|
||||
ifeq ($(HAVE_RUNAHEAD),1)
|
||||
DEFINES += -DHAVE_RUNAHEAD
|
||||
endif
|
||||
ifeq ($(LOAD_WITHOUT_CORE_INFO),1)
|
||||
DEFINES += -DLOAD_WITHOUT_CORE_INFO
|
||||
endif
|
||||
|
||||
OBJ += wiiu/shader_utils.o
|
||||
OBJ += gfx/drivers/gx2_shaders/tex.o
|
||||
@@ -102,7 +106,7 @@ endif
|
||||
|
||||
INCDIRS += -Ilibretro-common/include/compat/zlib
|
||||
# for stb, libfat, iosuhax
|
||||
INCDIRS += -Ideps -Ideps/libfat/include -Ideps/libiosuhax
|
||||
INCDIRS += -Ideps -Ideps/libfat/include -Ideps/libiosuhax/include
|
||||
# pad_functions uses wiiu/input.h
|
||||
INCDIRS += -Iinput/include
|
||||
INCDIRS += -Ideps/SPIRV-Cross
|
||||
@@ -327,17 +331,23 @@ $(BUILD_DIR)/$(TARGET).rpx.elf: $(OBJ) $(RPX_OBJ) libretro_wiiu.a wiiu/link_elf.
|
||||
@$(if $(Q), echo LD $@,)
|
||||
$(Q)$(LD) $(OBJ) $(RPX_OBJ) $(LDFLAGS) $(RPX_LDFLAGS) $(LIBDIRS) $(LIBS) -o $@
|
||||
|
||||
$(BUILD_DIR)/$(TARGET).rpx: $(BUILD_DIR)/$(TARGET).rpx.elf $(ELF2RPL) .$(TARGET).rpx.last
|
||||
$(BUILD_DIR)/$(TARGET).large.rpx: $(BUILD_DIR)/$(TARGET).rpx.elf $(ELF2RPL) .$(TARGET).rpx.large.last
|
||||
@$(if $(Q), echo ELF2RPL $@,)
|
||||
@touch .$(TARGET).rpx.last
|
||||
@touch .$(TARGET).rpx.large.last
|
||||
$(Q)-$(ELF2RPL) $< $@
|
||||
|
||||
$(BUILD_DIR)/$(TARGET).rpx: $(BUILD_DIR)/$(TARGET).large.rpx .$(TARGET).rpx.last
|
||||
@$(if $(Q), echo COMPRESS $@,)
|
||||
@touch .$(TARGET).rpx.large.last
|
||||
$(Q)wiiurpxtool -c $< $@
|
||||
|
||||
clean:
|
||||
@$(if $(Q), echo $@,)
|
||||
$(Q)rm -f $(OBJ) $(RPX_OBJ) $(HBL_ELF_OBJ) $(TARGET).elf $(TARGET).rpx.elf $(TARGET).rpx
|
||||
$(Q)rm -f $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).rpx.elf $(BUILD_DIR)/$(TARGET).rpx
|
||||
$(Q)rm -f .$(TARGET).elf.last .$(TARGET).rpx.elf.last .$(TARGET).rpx.last
|
||||
$(Q)rm -f $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).rpx.elf $(BUILD_DIR)/$(TARGET).large.rpx $(BUILD_DIR)/$(TARGET).rpx
|
||||
$(Q)rm -f .$(TARGET).elf.last .$(TARGET).rpx.elf.last .$(TARGET).rpx.large.last .$(TARGET).rpx.last
|
||||
$(Q)rm -f $(OBJ:.o=.depend) $(RPX_OBJ:.o=.depend) $(HBL_ELF_OBJ:.o=.depend)
|
||||
$(Q)$(MAKE) -C wiiu/wut/elf2rpl/ clean
|
||||
|
||||
.PHONY: clean all
|
||||
.PRECIOUS: %.depend %.last
|
||||
|
||||
@@ -546,7 +546,8 @@ static ssize_t dsound_write(void *data, const void *buf_, size_t size)
|
||||
break;
|
||||
|
||||
if (avail == 0)
|
||||
WaitForSingleObject(ds->event, INFINITE);
|
||||
if (!(WaitForSingleObject(ds->event, 50) == WAIT_OBJECT_0))
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include <retro_inline.h>
|
||||
|
||||
#include "../../retroarch.h"
|
||||
#include "../../defines/gx_defines.h"
|
||||
#include <defines/gx_defines.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#include "../../retroarch.h"
|
||||
|
||||
#include "../../defines/ps3_defines.h"
|
||||
#include <defines/ps3_defines.h>
|
||||
|
||||
#define AUDIO_BLOCKS 8
|
||||
#define AUDIO_CHANNELS 2
|
||||
|
||||
@@ -49,7 +49,7 @@ static void *rwebaudio_init(const char *device, unsigned rate, unsigned latency,
|
||||
rweb_audio_t *rwebaudio = (rweb_audio_t*)calloc(1, sizeof(rweb_audio_t));
|
||||
if (!rwebaudio)
|
||||
return NULL;
|
||||
if (RWebAudioInit(latency) == 1)
|
||||
if (RWebAudioInit(latency))
|
||||
*new_rate = RWebAudioSampleRate();
|
||||
return rwebaudio;
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ static void *libnx_audren_thread_audio_init(const char *device, unsigned rate, u
|
||||
int mpid;
|
||||
size_t mempool_size;
|
||||
unsigned real_latency;
|
||||
uint32_t thread_priority;
|
||||
int32_t thread_priority;
|
||||
|
||||
RARCH_LOG("[Audio]: Using libnx_audren_thread driver\n");
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ static void *switch_thread_audio_init(const char *device, unsigned rate, unsigne
|
||||
{
|
||||
Result rc;
|
||||
unsigned i;
|
||||
uint32_t prio;
|
||||
int32_t prio;
|
||||
#ifndef HAVE_LIBNX
|
||||
char names[8][0x20];
|
||||
uint32_t num_names = 0;
|
||||
|
||||
@@ -736,7 +736,7 @@ static ssize_t wasapi_write_ex(wasapi_t *w, const void * data, size_t size, DWOR
|
||||
if (!write_avail)
|
||||
{
|
||||
if (WaitForSingleObject(w->write_event, ms) != WAIT_OBJECT_0)
|
||||
return -1;
|
||||
return 0;
|
||||
|
||||
if (!wasapi_flush_buffer(w, w->engine_buffer_size))
|
||||
return -1;
|
||||
|
||||
@@ -371,7 +371,8 @@ static ssize_t xa_write(void *data, const void *buf, size_t size)
|
||||
XAUDIO2_BUFFER xa2buffer;
|
||||
|
||||
while (handle->buffers == MAX_BUFFERS - 1)
|
||||
WaitForSingleObject(handle->hEvent, INFINITE);
|
||||
if (!(WaitForSingleObject(handle->hEvent, 50) == WAIT_OBJECT_0))
|
||||
return -1;
|
||||
|
||||
xa2buffer.Flags = 0;
|
||||
xa2buffer.AudioBytes = handle->bufsize;
|
||||
|
||||
@@ -29,9 +29,9 @@
|
||||
|
||||
#include <audio/audio_resampler.h>
|
||||
|
||||
#if (defined(__ARM_NEON__) && !defined(DONT_WANT_ARM_OPTIMIZATIONS)) || defined(HAVE_NEON)
|
||||
#ifndef HAVE_ARM_NEON_OPTIMIZATIONS
|
||||
#define HAVE_ARM_NEON_OPTIMIZATIONS
|
||||
#if (defined(__ARM_NEON__) && !defined(DONT_WANT_ARM_ASM_OPTIMIZATIONS)) || defined(HAVE_NEON)
|
||||
#ifndef HAVE_ARM_NEON_ASM_OPTIMIZATIONS
|
||||
#define HAVE_ARM_NEON_ASM_OPTIMIZATIONS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -350,7 +350,7 @@ static void resampler_CC_upsample(void *re_, struct resampler_data *data)
|
||||
data->output_frames = outp - (audio_frame_float_t*)data->data_out;
|
||||
}
|
||||
|
||||
#elif defined(HAVE_ARM_NEON_OPTIMIZATIONS)
|
||||
#elif defined(HAVE_ARM_NEON_ASM_OPTIMIZATIONS)
|
||||
|
||||
#define CC_RESAMPLER_IDENT "NEON"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <errno.h>
|
||||
#include <reent.h>
|
||||
#include "../../defines/psp_defines.h"
|
||||
#include <defines/psp_defines.h>
|
||||
#include <psp2/kernel/sysmem.h>
|
||||
#include <psp2/kernel/threadmgr.h>
|
||||
|
||||
|
||||
+6
-6
@@ -1341,8 +1341,8 @@ void cheat_manager_apply_rumble(struct item_cheat *cheat, unsigned int curr_valu
|
||||
{
|
||||
cheat->rumble_primary_end_time = current_time + (cheat->rumble_primary_duration * 1000);
|
||||
cheat->rumble_secondary_end_time = current_time + (cheat->rumble_secondary_duration * 1000);
|
||||
input_driver_set_rumble_state(cheat->rumble_port, RETRO_RUMBLE_STRONG, cheat->rumble_primary_strength);
|
||||
input_driver_set_rumble_state(cheat->rumble_port, RETRO_RUMBLE_WEAK, cheat->rumble_secondary_strength);
|
||||
input_set_rumble_state(cheat->rumble_port, RETRO_RUMBLE_STRONG, cheat->rumble_primary_strength);
|
||||
input_set_rumble_state(cheat->rumble_port, RETRO_RUMBLE_WEAK, cheat->rumble_secondary_strength);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1354,24 +1354,24 @@ void cheat_manager_apply_rumble(struct item_cheat *cheat, unsigned int curr_valu
|
||||
if (cheat->rumble_primary_end_time <= current_time)
|
||||
{
|
||||
if (cheat->rumble_primary_end_time != 0)
|
||||
input_driver_set_rumble_state(cheat->rumble_port,
|
||||
input_set_rumble_state(cheat->rumble_port,
|
||||
RETRO_RUMBLE_STRONG, 0);
|
||||
cheat->rumble_primary_end_time = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
input_driver_set_rumble_state(cheat->rumble_port,
|
||||
input_set_rumble_state(cheat->rumble_port,
|
||||
RETRO_RUMBLE_STRONG, cheat->rumble_primary_strength);
|
||||
}
|
||||
|
||||
if (cheat->rumble_secondary_end_time <= current_time)
|
||||
{
|
||||
if (cheat->rumble_secondary_end_time != 0)
|
||||
input_driver_set_rumble_state(cheat->rumble_port, RETRO_RUMBLE_WEAK, 0);
|
||||
input_set_rumble_state(cheat->rumble_port, RETRO_RUMBLE_WEAK, 0);
|
||||
cheat->rumble_secondary_end_time = 0;
|
||||
}
|
||||
else
|
||||
input_driver_set_rumble_state(cheat->rumble_port, RETRO_RUMBLE_WEAK, cheat->rumble_secondary_strength);
|
||||
input_set_rumble_state(cheat->rumble_port, RETRO_RUMBLE_WEAK, cheat->rumble_secondary_strength);
|
||||
}
|
||||
|
||||
void cheat_manager_apply_retro_cheats(void)
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2015-2016 - Andre Leiradella
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <file/file_path.h>
|
||||
|
||||
#include "../file_path_special.h"
|
||||
#include "../configuration.h"
|
||||
#include "../gfx/gfx_display.h"
|
||||
|
||||
#include "badges.h"
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
|
||||
#define CHEEVOS_MENU_BADGE_LIMIT 256
|
||||
/* TODO/FIXME - public global variables */
|
||||
static uintptr_t cheevos_badge_menu_texture_list[CHEEVOS_MENU_BADGE_LIMIT] = { 0 };
|
||||
|
||||
void cheevos_reset_menu_badges(void)
|
||||
{
|
||||
int index;
|
||||
for (index = 0; index < CHEEVOS_MENU_BADGE_LIMIT; ++index)
|
||||
{
|
||||
if (cheevos_badge_menu_texture_list[index])
|
||||
video_driver_texture_unload(&cheevos_badge_menu_texture_list[index]);
|
||||
}
|
||||
|
||||
memset(&cheevos_badge_menu_texture_list, 0,
|
||||
sizeof(cheevos_badge_menu_texture_list));
|
||||
}
|
||||
|
||||
void cheevos_set_menu_badge(int index, const char *badge, bool locked)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
if (index >= CHEEVOS_MENU_BADGE_LIMIT)
|
||||
return;
|
||||
|
||||
if (!settings || !settings->bools.cheevos_badges_enable)
|
||||
cheevos_badge_menu_texture_list[index] = 0;
|
||||
else
|
||||
cheevos_badge_menu_texture_list[index] =
|
||||
cheevos_get_badge_texture(badge, locked);
|
||||
}
|
||||
|
||||
uintptr_t cheevos_get_menu_badge_texture(int index)
|
||||
{
|
||||
if (index < CHEEVOS_MENU_BADGE_LIMIT)
|
||||
return cheevos_badge_menu_texture_list[index];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
uintptr_t cheevos_get_badge_texture(const char *badge, bool locked)
|
||||
{
|
||||
char badge_file[24];
|
||||
char fullpath[PATH_MAX_LENGTH];
|
||||
uintptr_t tex = 0;
|
||||
|
||||
if (!badge)
|
||||
return 0;
|
||||
|
||||
fullpath[0] = badge_file[0] = '\0';
|
||||
|
||||
strlcpy(badge_file, badge, sizeof(badge_file));
|
||||
if (locked)
|
||||
strlcat(badge_file, "_lock", sizeof(badge_file));
|
||||
strlcat(badge_file, FILE_PATH_PNG_EXTENSION, sizeof(badge_file));
|
||||
|
||||
fill_pathname_application_special(fullpath, sizeof(fullpath),
|
||||
APPLICATION_SPECIAL_DIRECTORY_THUMBNAILS_CHEEVOS_BADGES);
|
||||
|
||||
if (!gfx_display_reset_textures_list(badge_file, fullpath,
|
||||
&tex, TEXTURE_FILTER_MIPMAP_LINEAR, NULL, NULL))
|
||||
tex = 0;
|
||||
|
||||
return tex;
|
||||
}
|
||||
+359
-1135
File diff suppressed because it is too large.
Load diff
+8
-33
@@ -21,64 +21,39 @@
|
||||
|
||||
#include <boolean.h>
|
||||
|
||||
#include "../verbosity.h"
|
||||
|
||||
#include <retro_common_api.h>
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
typedef struct rcheevos_ctx_desc
|
||||
{
|
||||
unsigned idx;
|
||||
char *s;
|
||||
size_t len;
|
||||
} rcheevos_ctx_desc_t;
|
||||
|
||||
enum
|
||||
{
|
||||
RCHEEVOS_ACTIVE_SOFTCORE = 1 << 0,
|
||||
RCHEEVOS_ACTIVE_HARDCORE = 1 << 1,
|
||||
RCHEEVOS_ACTIVE_UNOFFICIAL = 1 << 2
|
||||
};
|
||||
|
||||
bool rcheevos_load(const void *data);
|
||||
size_t rcheevos_get_serialize_size(void);
|
||||
bool rcheevos_get_serialized_data(void* buffer);
|
||||
bool rcheevos_set_serialized_data(void* buffer);
|
||||
|
||||
void rcheevos_reset_game(bool widgets_ready);
|
||||
|
||||
void rcheevos_populate_menu(void* data);
|
||||
void rcheevos_populate_hardcore_pause_menu(void* data);
|
||||
void rcheevos_get_achievement_state(unsigned index, char* buffer, size_t buffer_size);
|
||||
|
||||
bool rcheevos_get_description(rcheevos_ctx_desc_t *desc);
|
||||
|
||||
void rcheevos_pause_hardcore(void);
|
||||
|
||||
bool rcheevos_unload(void);
|
||||
|
||||
void rcheevos_test(void);
|
||||
|
||||
void rcheevos_reset_game(bool widgets_ready);
|
||||
|
||||
void rcheevos_pause_hardcore(void);
|
||||
void rcheevos_hardcore_enabled_changed(void);
|
||||
void rcheevos_toggle_hardcore_paused(void);
|
||||
bool rcheevos_hardcore_active(void);
|
||||
|
||||
void rcheevos_validate_config_settings(void);
|
||||
|
||||
void rcheevos_leaderboards_enabled_changed(void);
|
||||
|
||||
void rcheevos_test(void);
|
||||
|
||||
void rcheevos_set_support_cheevos(bool state);
|
||||
|
||||
bool rcheevos_get_support_cheevos(void);
|
||||
|
||||
const char* rcheevos_get_hash(void);
|
||||
|
||||
const char *rcheevos_get_richpresence(void);
|
||||
int rcheevos_get_richpresence(char buffer[], int buffer_size);
|
||||
uintptr_t rcheevos_get_badge_texture(const char *badge, bool locked);
|
||||
|
||||
uint8_t* rcheevos_patch_address(unsigned address);
|
||||
|
||||
bool rcheevos_hardcore_active(void);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif /* __RARCH_CHEEVOS_CHEEVOS_H */
|
||||
@@ -0,0 +1,675 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2019-2021 - Brian Weiss
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "cheevos_client.h"
|
||||
|
||||
#include "cheevos.h"
|
||||
|
||||
#include "../configuration.h"
|
||||
#include "../paths.h"
|
||||
#include "../version.h"
|
||||
|
||||
#include <string/stdstring.h>
|
||||
#include <features/features_cpu.h>
|
||||
|
||||
#include "../frontend/frontend_driver.h"
|
||||
#include "../network/net_http_special.h"
|
||||
#include "../tasks/tasks_internal.h"
|
||||
|
||||
#ifdef HAVE_DISCORD
|
||||
#include "../network/discord.h"
|
||||
#endif
|
||||
|
||||
#include "../deps/rcheevos/include/rc_api_runtime.h"
|
||||
|
||||
|
||||
|
||||
/* Define this macro to log URLs. */
|
||||
#undef CHEEVOS_LOG_URLS
|
||||
|
||||
/* Define this macro to have the password and token logged.
|
||||
* THIS WILL DISCLOSE THE USER'S PASSWORD, TAKE CARE! */
|
||||
#undef CHEEVOS_LOG_PASSWORD
|
||||
|
||||
|
||||
/* Number of usecs to wait between posting rich presence to the site. */
|
||||
/* Keep consistent with SERVER_PING_FREQUENCY from RAIntegration. */
|
||||
#define CHEEVOS_PING_FREQUENCY 2 * 60 * 1000000
|
||||
|
||||
|
||||
/****************************
|
||||
* data types *
|
||||
****************************/
|
||||
|
||||
enum rcheevos_async_io_type
|
||||
{
|
||||
CHEEVOS_ASYNC_RICHPRESENCE = 0,
|
||||
CHEEVOS_ASYNC_AWARD_ACHIEVEMENT,
|
||||
CHEEVOS_ASYNC_SUBMIT_LBOARD
|
||||
};
|
||||
|
||||
typedef void (*rcheevos_async_handler)(int id,
|
||||
http_transfer_data_t *data, char buffer[], size_t buffer_size);
|
||||
|
||||
typedef struct rcheevos_async_io_request
|
||||
{
|
||||
rc_api_request_t request;
|
||||
rcheevos_async_handler handler;
|
||||
int id;
|
||||
int attempt_count;
|
||||
const char* success_message;
|
||||
const char* failure_message;
|
||||
const char* user_agent;
|
||||
char type;
|
||||
} rcheevos_async_io_request;
|
||||
|
||||
|
||||
/****************************
|
||||
* forward declarations *
|
||||
****************************/
|
||||
|
||||
static retro_time_t rcheevos_client_prepare_ping(rcheevos_async_io_request* request);
|
||||
|
||||
static void rcheevos_async_http_task_callback(
|
||||
retro_task_t* task, void* task_data, void* user_data, const char* error);
|
||||
|
||||
|
||||
/****************************
|
||||
* user agent construction *
|
||||
****************************/
|
||||
|
||||
static int append_no_spaces(char* buffer, char* stop, const char* text)
|
||||
{
|
||||
char* ptr = buffer;
|
||||
|
||||
while (ptr < stop && *text)
|
||||
{
|
||||
if (*text == ' ')
|
||||
{
|
||||
*ptr++ = '_';
|
||||
++text;
|
||||
}
|
||||
else
|
||||
{
|
||||
*ptr++ = *text++;
|
||||
}
|
||||
}
|
||||
|
||||
*ptr = '\0';
|
||||
return (int)(ptr - buffer);
|
||||
}
|
||||
|
||||
void rcheevos_get_user_agent(rcheevos_locals_t *locals,
|
||||
char *buffer, size_t len)
|
||||
{
|
||||
struct retro_system_info *system = runloop_get_libretro_system_info();
|
||||
char* ptr;
|
||||
|
||||
/* if we haven't calculated the non-changing portion yet, do so now
|
||||
* [retroarch version + os version] */
|
||||
if (!locals->user_agent_prefix[0])
|
||||
{
|
||||
const frontend_ctx_driver_t *frontend = frontend_get_ptr();
|
||||
int major, minor;
|
||||
char tmp[64];
|
||||
|
||||
if (frontend && frontend->get_os)
|
||||
{
|
||||
frontend->get_os(tmp, sizeof(tmp), &major, &minor);
|
||||
snprintf(locals->user_agent_prefix, sizeof(locals->user_agent_prefix),
|
||||
"RetroArch/%s (%s %d.%d)", PACKAGE_VERSION, tmp, major, minor);
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(locals->user_agent_prefix, sizeof(locals->user_agent_prefix),
|
||||
"RetroArch/%s", PACKAGE_VERSION);
|
||||
}
|
||||
}
|
||||
|
||||
/* append the non-changing portion */
|
||||
ptr = buffer + strlcpy(buffer, locals->user_agent_prefix, len);
|
||||
|
||||
/* if a core is loaded, append its information */
|
||||
if (system && !string_is_empty(system->library_name))
|
||||
{
|
||||
char* stop = buffer + len - 1;
|
||||
const char* path = path_get(RARCH_PATH_CORE);
|
||||
*ptr++ = ' ';
|
||||
|
||||
if (!string_is_empty(path))
|
||||
{
|
||||
append_no_spaces(ptr, stop, path_basename(path));
|
||||
path_remove_extension(ptr);
|
||||
ptr += strlen(ptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr += append_no_spaces(ptr, stop, system->library_name);
|
||||
}
|
||||
|
||||
if (system->library_version)
|
||||
{
|
||||
*ptr++ = '/';
|
||||
ptr += append_no_spaces(ptr, stop, system->library_version);
|
||||
}
|
||||
}
|
||||
|
||||
*ptr = '\0';
|
||||
}
|
||||
|
||||
#ifdef CHEEVOS_LOG_URLS
|
||||
#ifndef CHEEVOS_LOG_PASSWORD
|
||||
static void rcheevos_filter_url_param(char* url, char* param)
|
||||
{
|
||||
char *next;
|
||||
size_t param_len = strlen(param);
|
||||
char *start = strchr(url, '?');
|
||||
if (!start)
|
||||
start = url;
|
||||
else
|
||||
++start;
|
||||
|
||||
do
|
||||
{
|
||||
next = strchr(start, '&');
|
||||
|
||||
if (start[param_len] == '=' && memcmp(start, param, param_len) == 0)
|
||||
{
|
||||
if (next)
|
||||
strcpy_literal(start, next + 1);
|
||||
else if (start > url)
|
||||
start[-1] = '\0';
|
||||
else
|
||||
*start = '\0';
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (!next)
|
||||
return;
|
||||
|
||||
start = next + 1;
|
||||
} while (1);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
void rcheevos_log_url(const char* api, const char* url)
|
||||
{
|
||||
#ifdef CHEEVOS_LOG_URLS
|
||||
#ifdef CHEEVOS_LOG_PASSWORD
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "GET %s\n", url);
|
||||
#else
|
||||
char copy[256];
|
||||
strlcpy(copy, url, sizeof(copy));
|
||||
rcheevos_filter_url_param(copy, "p");
|
||||
rcheevos_filter_url_param(copy, "t");
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "GET %s\n", copy);
|
||||
#endif
|
||||
#else
|
||||
(void)api;
|
||||
(void)url;
|
||||
#endif
|
||||
}
|
||||
|
||||
static void rcheevos_log_post_url(const char* url, const char* post)
|
||||
{
|
||||
#ifdef CHEEVOS_LOG_URLS
|
||||
#ifdef CHEEVOS_LOG_PASSWORD
|
||||
if (post && post[0])
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "POST %s %s\n", url, post);
|
||||
else
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "POST %s\n", url);
|
||||
#else
|
||||
if (post && post[0])
|
||||
{
|
||||
char post_copy[2048];
|
||||
strlcpy(post_copy, post, sizeof(post_copy));
|
||||
rcheevos_filter_url_param(post_copy, "p");
|
||||
rcheevos_filter_url_param(post_copy, "t");
|
||||
|
||||
if (post_copy[0])
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "POST %s %s\n", url, post_copy);
|
||||
else
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "POST %s\n", url);
|
||||
}
|
||||
else
|
||||
{
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "POST %s\n", url);
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
(void)url;
|
||||
(void)post;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/****************************
|
||||
* dispatch *
|
||||
****************************/
|
||||
|
||||
static void rcheevos_async_retry_request(retro_task_t* task)
|
||||
{
|
||||
rcheevos_async_io_request* request = (rcheevos_async_io_request*)
|
||||
task->user_data;
|
||||
|
||||
/* the timer task has done its job. let it dispose itself */
|
||||
task_set_finished(task, 1);
|
||||
|
||||
/* start a new task for the HTTP call */
|
||||
task_push_http_post_transfer_with_user_agent(request->request.url,
|
||||
request->request.post_data, true, "POST", request->user_agent,
|
||||
rcheevos_async_http_task_callback, request);
|
||||
}
|
||||
|
||||
static void rcheevos_async_retry_request_after_delay(rcheevos_async_io_request* request, const char* error)
|
||||
{
|
||||
retro_task_t* task = task_init();
|
||||
|
||||
/* Double the wait between each attempt until we hit
|
||||
* a maximum delay of two minutes.
|
||||
* 250ms -> 500ms -> 1s -> 2s -> 4s -> 8s -> 16s -> 32s -> 64s -> 120s -> 120s... */
|
||||
retro_time_t retry_delay = (request->attempt_count > 8)
|
||||
? (120 * 1000 * 1000)
|
||||
: ((250 * 1000) << request->attempt_count);
|
||||
|
||||
CHEEVOS_ERR(RCHEEVOS_TAG "%s %u: %s (automatic retry in %dms)\n", request->failure_message,
|
||||
request->id, error, (int)retry_delay / 1000);
|
||||
|
||||
task->when = cpu_features_get_time_usec() + retry_delay;
|
||||
task->handler = rcheevos_async_retry_request;
|
||||
task->user_data = request;
|
||||
task->progress = -1;
|
||||
|
||||
++request->attempt_count;
|
||||
task_queue_push(task);
|
||||
}
|
||||
|
||||
static void rcheevos_async_request_failed(rcheevos_async_io_request* request, const char* error)
|
||||
{
|
||||
if (request->type == CHEEVOS_ASYNC_RICHPRESENCE && request->attempt_count > 0)
|
||||
{
|
||||
/* only retry the ping once (in case of network hiccup), otherwise let
|
||||
* the timer handle it after the normal ping period has elapsed */
|
||||
CHEEVOS_ERR(RCHEEVOS_TAG "%s %u: %s\n", request->failure_message,
|
||||
request->id, error);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* automatically retry the request */
|
||||
rcheevos_async_retry_request_after_delay(request, error);
|
||||
}
|
||||
}
|
||||
|
||||
static void rcheevos_async_http_task_callback(
|
||||
retro_task_t* task, void* task_data, void* user_data, const char* error)
|
||||
{
|
||||
rcheevos_async_io_request *request = (rcheevos_async_io_request*)user_data;
|
||||
http_transfer_data_t *data = (http_transfer_data_t*)task_data;
|
||||
char buffer[224];
|
||||
|
||||
if (error)
|
||||
{
|
||||
/* there was a communication error */
|
||||
rcheevos_async_request_failed(request, error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!data)
|
||||
{
|
||||
/* Server did not return HTTP headers */
|
||||
strlcpy(buffer, "Server communication error", sizeof(buffer));
|
||||
}
|
||||
else if (!data->data || !data->len)
|
||||
{
|
||||
if (data->status <= 0)
|
||||
{
|
||||
/* something occurred which prevented the response from being processed.
|
||||
* assume the server request hasn't happened and try again. */
|
||||
snprintf(buffer, sizeof(buffer), "task status code %d", data->status);
|
||||
rcheevos_async_request_failed(request, buffer);
|
||||
return;
|
||||
}
|
||||
|
||||
if (data->status != 200)
|
||||
{
|
||||
/* Server returned an error via status code. */
|
||||
snprintf(buffer, sizeof(buffer), "HTTP error code %d", data->status);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Server sent an empty response without an error status code */
|
||||
strlcpy(buffer, "No response from server", sizeof(buffer));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
buffer[0] = '\0'; /* indicate success unless handler provides error */
|
||||
|
||||
/* Call appropriate handler to process the response */
|
||||
if (request->handler)
|
||||
{
|
||||
/* NOTE: data->data is not null-terminated. Most handlers assume the
|
||||
* response is properly formatted or will encounter a parse failure
|
||||
* before reading past the end of the data */
|
||||
request->handler(request->id, data, buffer, sizeof(buffer));
|
||||
}
|
||||
}
|
||||
|
||||
if (!buffer[0])
|
||||
{
|
||||
/* success */
|
||||
if (request->success_message)
|
||||
{
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "%s %u\n", request->success_message, request->id);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* encountered an error */
|
||||
char errbuf[256];
|
||||
snprintf(errbuf, sizeof(errbuf), "%s %u: %s",
|
||||
request->failure_message, request->id, buffer);
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "%s\n", errbuf);
|
||||
|
||||
switch (request->type)
|
||||
{
|
||||
case CHEEVOS_ASYNC_RICHPRESENCE:
|
||||
/* Don't bother informing user when
|
||||
* rich presence update fails */
|
||||
break;
|
||||
|
||||
default:
|
||||
runloop_msg_queue_push(errbuf, 0, 5 * 60, false, NULL,
|
||||
MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_ERROR);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
rc_api_destroy_request(&request->request);
|
||||
|
||||
/* rich presence request will be reused on next ping - reset the attempt
|
||||
* counter. for all other request types, free the request object */
|
||||
if (request->type == CHEEVOS_ASYNC_RICHPRESENCE)
|
||||
request->attempt_count = 0;
|
||||
else
|
||||
free(request);
|
||||
}
|
||||
|
||||
static void rcheevos_async_begin_request(rcheevos_async_io_request* request,
|
||||
rcheevos_async_handler handler, char type, int id,
|
||||
const char* success_message, const char* failure_message)
|
||||
{
|
||||
request->handler = handler;
|
||||
request->type = type;
|
||||
request->id = id;
|
||||
request->success_message = success_message;
|
||||
request->failure_message = failure_message;
|
||||
request->attempt_count = 0;
|
||||
|
||||
if (!request->user_agent)
|
||||
request->user_agent = get_rcheevos_locals()->user_agent_core;
|
||||
|
||||
rcheevos_log_post_url(request->request.url, request->request.post_data);
|
||||
|
||||
task_push_http_post_transfer_with_user_agent(request->request.url,
|
||||
request->request.post_data, true, "POST", request->user_agent,
|
||||
rcheevos_async_http_task_callback, request);
|
||||
}
|
||||
|
||||
static bool rcheevos_async_succeeded(int result,
|
||||
const rc_api_response_t* response, char buffer[], size_t buffer_size)
|
||||
{
|
||||
if (result != RC_OK)
|
||||
{
|
||||
strlcpy(buffer, rc_error_str(result), buffer_size);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!response->succeeded)
|
||||
{
|
||||
strlcpy(buffer, response->error_message, buffer_size);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/****************************
|
||||
* ping *
|
||||
****************************/
|
||||
|
||||
static retro_time_t rcheevos_client_prepare_ping(rcheevos_async_io_request* request)
|
||||
{
|
||||
const rcheevos_locals_t* rcheevos_locals = get_rcheevos_locals();
|
||||
const settings_t *settings = config_get_ptr();
|
||||
const bool cheevos_richpresence_enable =
|
||||
settings->bools.cheevos_richpresence_enable;
|
||||
rc_api_ping_request_t api_params;
|
||||
char buffer[256] = "";
|
||||
|
||||
memset(&api_params, 0, sizeof(api_params));
|
||||
api_params.username = rcheevos_locals->username;
|
||||
api_params.api_token = rcheevos_locals->token;
|
||||
api_params.game_id = request->id;
|
||||
|
||||
if (cheevos_richpresence_enable)
|
||||
{
|
||||
rcheevos_get_richpresence(buffer, sizeof(buffer));
|
||||
api_params.rich_presence = buffer;
|
||||
}
|
||||
|
||||
rc_api_init_ping_request(&request->request, &api_params);
|
||||
|
||||
rcheevos_log_post_url(request->request.url, request->request.post_data);
|
||||
|
||||
#ifdef HAVE_DISCORD
|
||||
if (settings->bools.discord_enable && discord_is_ready())
|
||||
discord_update(DISCORD_PRESENCE_RETROACHIEVEMENTS);
|
||||
#endif
|
||||
|
||||
/* Update rich presence every two minutes */
|
||||
if (cheevos_richpresence_enable)
|
||||
return cpu_features_get_time_usec() + CHEEVOS_PING_FREQUENCY;
|
||||
|
||||
/* Send ping every four minutes */
|
||||
return cpu_features_get_time_usec() + CHEEVOS_PING_FREQUENCY * 2;
|
||||
}
|
||||
|
||||
static void rcheevos_async_ping_handler(retro_task_t* task)
|
||||
{
|
||||
rcheevos_async_io_request* request = (rcheevos_async_io_request*)
|
||||
task->user_data;
|
||||
|
||||
const rcheevos_locals_t* rcheevos_locals = get_rcheevos_locals();
|
||||
if (request->id != (int)rcheevos_locals->patchdata.game_id)
|
||||
{
|
||||
/* game changed; stop the recurring task - a new one will
|
||||
* be scheduled if a new game is loaded */
|
||||
task_set_finished(task, 1);
|
||||
/* request->request was destroyed in rcheevos_async_http_task_callback */
|
||||
free(request);
|
||||
return;
|
||||
}
|
||||
|
||||
/* update the request and set the task to fire again in
|
||||
* two minutes */
|
||||
task->when = rcheevos_client_prepare_ping(request);
|
||||
|
||||
/* start the HTTP request */
|
||||
task_push_http_post_transfer_with_user_agent(request->request.url,
|
||||
request->request.post_data, true, "POST", request->user_agent,
|
||||
rcheevos_async_http_task_callback, request);
|
||||
}
|
||||
|
||||
|
||||
/****************************
|
||||
* start session *
|
||||
****************************/
|
||||
|
||||
void rcheevos_client_start_session(unsigned game_id)
|
||||
{
|
||||
rcheevos_locals_t* rcheevos_locals = get_rcheevos_locals();
|
||||
|
||||
/* the core won't change while a session is active, so only
|
||||
* calculate the user agent once */
|
||||
rcheevos_get_user_agent(rcheevos_locals,
|
||||
rcheevos_locals->user_agent_core,
|
||||
sizeof(rcheevos_locals->user_agent_core));
|
||||
|
||||
/* force non-HTTPS until everything uses RAPI */
|
||||
rc_api_set_host("http://retroachievements.org");
|
||||
|
||||
/* schedule the first rich presence call in 30 seconds */
|
||||
{
|
||||
rcheevos_async_io_request *request = (rcheevos_async_io_request*)
|
||||
calloc(1, sizeof(rcheevos_async_io_request));
|
||||
if (!request)
|
||||
{
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "Failed to allocate rich presence request\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
retro_task_t* task = task_init();
|
||||
|
||||
request->id = game_id;
|
||||
request->type = CHEEVOS_ASYNC_RICHPRESENCE;
|
||||
request->user_agent = rcheevos_locals->user_agent_core;
|
||||
request->failure_message = "Error sending ping";
|
||||
|
||||
task->handler = rcheevos_async_ping_handler;
|
||||
task->user_data = request;
|
||||
task->progress = -1;
|
||||
task->when = cpu_features_get_time_usec() +
|
||||
CHEEVOS_PING_FREQUENCY / 4;
|
||||
|
||||
task_queue_push(task);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/****************************
|
||||
* award achievement *
|
||||
****************************/
|
||||
|
||||
static void rcheevos_async_award_achievement_callback(int id,
|
||||
http_transfer_data_t *data, char buffer[], size_t buffer_size)
|
||||
{
|
||||
rc_api_award_achievement_response_t api_response;
|
||||
|
||||
int result = rc_api_process_award_achievement_response(&api_response, data->data);
|
||||
if (rcheevos_async_succeeded(result, &api_response.response, buffer, buffer_size))
|
||||
{
|
||||
if (api_response.awarded_achievement_id != id)
|
||||
{
|
||||
snprintf(buffer, buffer_size, "Achievement %u awarded instead",
|
||||
api_response.awarded_achievement_id);
|
||||
}
|
||||
else if (api_response.response.error_message)
|
||||
{
|
||||
/* previously unlocked achievements are returned as a "successful" error */
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "Achievement %u: %s\n",
|
||||
id, api_response.response.error_message);
|
||||
}
|
||||
}
|
||||
|
||||
rc_api_destroy_award_achievement_response(&api_response);
|
||||
}
|
||||
|
||||
void rcheevos_client_award_achievement(unsigned achievement_id)
|
||||
{
|
||||
rcheevos_async_io_request *request = (rcheevos_async_io_request*)
|
||||
calloc(1, sizeof(rcheevos_async_io_request));
|
||||
if (!request)
|
||||
{
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "Failed to allocate unlock request for achievement %u\n",
|
||||
achievement_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
const rcheevos_locals_t* rcheevos_locals = get_rcheevos_locals();
|
||||
rc_api_award_achievement_request_t api_params;
|
||||
|
||||
memset(&api_params, 0, sizeof(api_params));
|
||||
api_params.username = rcheevos_locals->username;
|
||||
api_params.api_token = rcheevos_locals->token;
|
||||
api_params.achievement_id = achievement_id;
|
||||
api_params.hardcore = rcheevos_locals->hardcore_active ? 1 : 0;
|
||||
api_params.game_hash = rcheevos_locals->hash;
|
||||
|
||||
rc_api_init_award_achievement_request(&request->request, &api_params);
|
||||
|
||||
rcheevos_async_begin_request(request,
|
||||
rcheevos_async_award_achievement_callback,
|
||||
CHEEVOS_ASYNC_AWARD_ACHIEVEMENT, achievement_id,
|
||||
"Awarded achievement",
|
||||
"Error awarding achievement");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/****************************
|
||||
* submit leaderboard *
|
||||
****************************/
|
||||
|
||||
static void rcheevos_async_submit_lboard_entry_callback(int id,
|
||||
http_transfer_data_t* data, char buffer[], size_t buffer_size)
|
||||
{
|
||||
rc_api_submit_lboard_entry_response_t api_response;
|
||||
|
||||
int result = rc_api_process_submit_lboard_entry_response(&api_response, data->data);
|
||||
|
||||
if (rcheevos_async_succeeded(result, &api_response.response, buffer, buffer_size))
|
||||
{
|
||||
/* not currently doing anything with the response */
|
||||
}
|
||||
|
||||
rc_api_destroy_submit_lboard_entry_response(&api_response);
|
||||
}
|
||||
|
||||
void rcheevos_client_submit_lboard_entry(unsigned leaderboard_id, int value)
|
||||
{
|
||||
rcheevos_async_io_request *request = (rcheevos_async_io_request*)
|
||||
calloc(1, sizeof(rcheevos_async_io_request));
|
||||
if (!request)
|
||||
{
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "Failed to allocate request for lboard %u submit\n",
|
||||
leaderboard_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
const rcheevos_locals_t* rcheevos_locals = get_rcheevos_locals();
|
||||
rc_api_submit_lboard_entry_request_t api_params;
|
||||
|
||||
memset(&api_params, 0, sizeof(api_params));
|
||||
api_params.username = rcheevos_locals->username;
|
||||
api_params.api_token = rcheevos_locals->token;
|
||||
api_params.leaderboard_id = leaderboard_id;
|
||||
api_params.score = value;
|
||||
api_params.game_hash = rcheevos_locals->hash;
|
||||
|
||||
rc_api_init_submit_lboard_entry_request(&request->request, &api_params);
|
||||
|
||||
rcheevos_async_begin_request(request,
|
||||
rcheevos_async_submit_lboard_entry_callback,
|
||||
CHEEVOS_ASYNC_SUBMIT_LBOARD, leaderboard_id,
|
||||
"Submitted leaderboard",
|
||||
"Error submitting leaderboard");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2015-2018 - Andre Leiradella
|
||||
* Copyright (C) 2019-2021 - Brian Weiss
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
@@ -13,23 +13,20 @@
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __RARCH_CHEEVOS_BADGE_H
|
||||
#define __RARCH_CHEEVOS_BADGE_H
|
||||
#ifndef __RARCH_CHEEVOS_CLIENT_H
|
||||
#define __RARCH_CHEEVOS_CLIENT_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <retro_common_api.h>
|
||||
#include <boolean.h>
|
||||
#include "cheevos_locals.h"
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
void cheevos_reset_menu_badges(void);
|
||||
void cheevos_set_menu_badge(int index, const char *badge, bool locked);
|
||||
uintptr_t cheevos_get_menu_badge_texture(int index);
|
||||
#endif
|
||||
void rcheevos_client_start_session(unsigned game_id);
|
||||
void rcheevos_client_award_achievement(unsigned achievement_id);
|
||||
void rcheevos_client_submit_lboard_entry(unsigned leaderboard_id, int value);
|
||||
|
||||
uintptr_t cheevos_get_badge_texture(const char* badge, bool locked);
|
||||
void rcheevos_log_url(const char* api, const char* url);
|
||||
void rcheevos_get_user_agent(rcheevos_locals_t *locals, char *buffer, size_t len);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
#endif /* __RARCH_CHEEVOS_MENU_H */
|
||||
@@ -0,0 +1,161 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2015-2018 - Andre Leiradella
|
||||
* Copyright (C) 2019-2021 - Brian Weiss
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __RARCH_CHEEVOS_LOCALS_H
|
||||
#define __RARCH_CHEEVOS_LOCALS_H
|
||||
|
||||
#include "../deps/rcheevos/include/rc_runtime.h"
|
||||
|
||||
#include "../deps/rcheevos/src/rcheevos/rc_libretro.h"
|
||||
|
||||
#include <../command.h>
|
||||
#include <../verbosity.h>
|
||||
#include <boolean.h>
|
||||
#include <queues/task_queue.h>
|
||||
|
||||
#ifdef HAVE_THREADS
|
||||
#include <rthreads/rthreads.h>
|
||||
#endif
|
||||
|
||||
#include <retro_common_api.h>
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
/************************************************************************
|
||||
* Logging *
|
||||
************************************************************************/
|
||||
|
||||
/* Define this macro to get extra-verbose log for cheevos. */
|
||||
#define CHEEVOS_VERBOSE
|
||||
|
||||
#define RCHEEVOS_TAG "[RCHEEVOS]: "
|
||||
#define CHEEVOS_FREE(p) do { void* q = (void*)p; if (q) free(q); } while (0)
|
||||
|
||||
#ifdef CHEEVOS_VERBOSE
|
||||
#define CHEEVOS_LOG RARCH_LOG
|
||||
#define CHEEVOS_ERR RARCH_ERR
|
||||
#else
|
||||
void rcheevos_log(const char *fmt, ...);
|
||||
#define CHEEVOS_LOG rcheevos_log
|
||||
#define CHEEVOS_ERR RARCH_ERR
|
||||
#endif
|
||||
|
||||
/************************************************************************
|
||||
* State *
|
||||
************************************************************************/
|
||||
|
||||
enum
|
||||
{
|
||||
RCHEEVOS_ACTIVE_SOFTCORE = 1 << 0,
|
||||
RCHEEVOS_ACTIVE_HARDCORE = 1 << 1,
|
||||
RCHEEVOS_ACTIVE_UNOFFICIAL = 1 << 2
|
||||
};
|
||||
|
||||
typedef struct rcheevos_racheevo_t
|
||||
{
|
||||
const char* title;
|
||||
const char* description;
|
||||
const char* badge;
|
||||
const char* memaddr;
|
||||
unsigned id;
|
||||
unsigned points;
|
||||
|
||||
retro_time_t unlock_time;
|
||||
uint8_t active;
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
uint8_t menu_bucket;
|
||||
uint8_t menu_progress;
|
||||
uint8_t menu_badge_grayscale;
|
||||
uintptr_t menu_badge_texture;
|
||||
#endif
|
||||
|
||||
} rcheevos_racheevo_t;
|
||||
|
||||
typedef struct rcheevos_ralboard_t
|
||||
{
|
||||
const char* title;
|
||||
const char* description;
|
||||
const char* mem;
|
||||
unsigned id;
|
||||
unsigned format;
|
||||
} rcheevos_ralboard_t;
|
||||
|
||||
typedef struct rcheevos_rapatchdata_t
|
||||
{
|
||||
char* title;
|
||||
rcheevos_racheevo_t* core;
|
||||
rcheevos_racheevo_t* unofficial;
|
||||
rcheevos_ralboard_t* lboards;
|
||||
char* richpresence_script;
|
||||
|
||||
unsigned game_id;
|
||||
unsigned console_id;
|
||||
unsigned core_count;
|
||||
unsigned unofficial_count;
|
||||
unsigned lboard_count;
|
||||
} rcheevos_rapatchdata_t;
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
|
||||
typedef struct rcheevos_menuitem_t
|
||||
{
|
||||
rcheevos_racheevo_t* cheevo;
|
||||
enum msg_hash_enums state_label_idx;
|
||||
} rcheevos_menuitem_t;
|
||||
|
||||
void rcheevos_menu_reset_badges(void);
|
||||
|
||||
#endif
|
||||
|
||||
typedef struct rcheevos_locals_t
|
||||
{
|
||||
rc_runtime_t runtime; /* rcheevos runtime state */
|
||||
rcheevos_rapatchdata_t patchdata; /* achievement/leaderboard data from the server */
|
||||
rc_libretro_memory_regions_t memory;/* achievement addresses to core memory mappings */
|
||||
|
||||
retro_task_t* task; /* load task */
|
||||
#ifdef HAVE_THREADS
|
||||
slock_t* task_lock; /* mutex for starting/stopping load task */
|
||||
enum event_command queued_command; /* action queued by background thread to be run on main thread */
|
||||
#endif
|
||||
|
||||
char username[32]; /* case-corrected username */
|
||||
char token[32]; /* user's session token */
|
||||
char hash[33]; /* retroachievements hash for current content */
|
||||
char user_agent_prefix[128]; /* RetroArch/OS version information */
|
||||
char user_agent_core[256]; /* RetroArch/OS/Core version information */
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
rcheevos_menuitem_t* menuitems; /* array of items for the achievements quick menu */
|
||||
unsigned menuitem_capacity; /* maximum number of items in the menuitems array */
|
||||
unsigned menuitem_count; /* current number of items in the menuitems array */
|
||||
#endif
|
||||
|
||||
bool hardcore_active; /* hardcore functionality is active */
|
||||
bool loaded; /* load task has completed */
|
||||
bool core_supports; /* false if core explicitly disables achievements */
|
||||
bool network_error; /* hash lookup or login failed with network error */
|
||||
bool leaderboards_enabled; /* leaderboards are enabled */
|
||||
bool leaderboard_notifications; /* leaderboard notifications are enabled */
|
||||
bool leaderboard_trackers; /* leaderboard trackers are enabled */
|
||||
} rcheevos_locals_t;
|
||||
|
||||
rcheevos_locals_t* get_rcheevos_locals(void);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif /* __RARCH_CHEEVOS_LOCALS_H */
|
||||
@@ -1,352 +0,0 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2015-2016 - Andre Leiradella
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "cheevos_memory.h"
|
||||
|
||||
#include "util.h"
|
||||
|
||||
#include "../retroarch.h"
|
||||
#include "../verbosity.h"
|
||||
|
||||
#include "../deps/rcheevos/include/rcheevos.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
uint8_t* rcheevos_memory_find(
|
||||
const rcheevos_memory_regions_t* regions, unsigned address)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < regions->count; ++i)
|
||||
{
|
||||
const size_t size = regions->size[i];
|
||||
if (address < size)
|
||||
{
|
||||
if (regions->data[i] == NULL)
|
||||
break;
|
||||
|
||||
return ®ions->data[i][address];
|
||||
}
|
||||
|
||||
address -= size;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static const char* rcheevos_memory_type(int type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case RC_MEMORY_TYPE_SAVE_RAM:
|
||||
return "SRAM";
|
||||
case RC_MEMORY_TYPE_VIDEO_RAM:
|
||||
return "VRAM";
|
||||
case RC_MEMORY_TYPE_UNUSED:
|
||||
return "UNUSED";
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return "SYSTEM RAM";
|
||||
}
|
||||
|
||||
static void rcheevos_memory_register_region(rcheevos_memory_regions_t* regions,
|
||||
int type, uint8_t* data, size_t size, const char* description)
|
||||
{
|
||||
if (size == 0)
|
||||
return;
|
||||
|
||||
if (regions->count == MAX_MEMORY_REGIONS)
|
||||
{
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "Too many memory memory regions to register\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!data && regions->count > 0 && !regions->data[regions->count - 1])
|
||||
{
|
||||
/* extend null region */
|
||||
regions->size[regions->count - 1] += size;
|
||||
}
|
||||
else if (data && regions->count > 0 &&
|
||||
data == (regions->data[regions->count - 1] + regions->size[regions->count - 1]))
|
||||
{
|
||||
/* extend non-null region */
|
||||
regions->size[regions->count - 1] += size;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* create new region */
|
||||
regions->data[regions->count] = data;
|
||||
regions->size[regions->count] = size;
|
||||
++regions->count;
|
||||
}
|
||||
|
||||
regions->total_size += size;
|
||||
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "Registered 0x%04X bytes of %s at $%06X (%s)\n", (unsigned)size,
|
||||
rcheevos_memory_type(type), (unsigned)(regions->total_size - size), description);
|
||||
}
|
||||
|
||||
static void rcheevos_memory_init_without_regions(
|
||||
rcheevos_memory_regions_t* regions)
|
||||
{
|
||||
/* no regions specified, assume system RAM followed by save RAM */
|
||||
char description[64];
|
||||
retro_ctx_memory_info_t meminfo;
|
||||
|
||||
snprintf(description, sizeof(description), "offset 0x%06x", 0);
|
||||
|
||||
meminfo.id = RETRO_MEMORY_SYSTEM_RAM;
|
||||
core_get_memory(&meminfo);
|
||||
rcheevos_memory_register_region(regions, RC_MEMORY_TYPE_SYSTEM_RAM, (uint8_t*)meminfo.data, meminfo.size, description);
|
||||
|
||||
meminfo.id = RETRO_MEMORY_SAVE_RAM;
|
||||
core_get_memory(&meminfo);
|
||||
rcheevos_memory_register_region(regions, RC_MEMORY_TYPE_SAVE_RAM, (uint8_t*)meminfo.data, meminfo.size, description);
|
||||
}
|
||||
|
||||
static const rarch_memory_descriptor_t* rcheevos_memory_get_descriptor(const rarch_memory_map_t* mmap, unsigned real_address)
|
||||
{
|
||||
const rarch_memory_descriptor_t* desc = mmap->descriptors;
|
||||
const rarch_memory_descriptor_t* end = desc + mmap->num_descriptors;
|
||||
|
||||
if (mmap->num_descriptors == 0)
|
||||
return NULL;
|
||||
|
||||
for (; desc < end; desc++)
|
||||
{
|
||||
if (desc->core.select == 0)
|
||||
{
|
||||
/* if select is 0, attempt to explcitly match the address */
|
||||
if (real_address >= desc->core.start && real_address < desc->core.start + desc->core.len)
|
||||
return desc;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* otherwise, attempt to match the address by matching the select bits */
|
||||
if (((desc->core.start ^ real_address) & desc->core.select) == 0)
|
||||
{
|
||||
/* sanity check - make sure the descriptor is large enough to hold the target address */
|
||||
if (real_address - desc->core.start < desc->core.len)
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void rcheevos_memory_init_from_memory_map(rcheevos_memory_regions_t* regions, const rarch_memory_map_t* mmap, const rc_memory_regions_t* console_regions)
|
||||
{
|
||||
char description[64];
|
||||
unsigned i;
|
||||
uint8_t* region_start;
|
||||
uint8_t* desc_start;
|
||||
size_t desc_size;
|
||||
size_t offset;
|
||||
|
||||
for (i = 0; i < console_regions->num_regions; ++i)
|
||||
{
|
||||
const rc_memory_region_t* console_region = &console_regions->region[i];
|
||||
size_t console_region_size = console_region->end_address - console_region->start_address + 1;
|
||||
unsigned real_address = console_region->real_address;
|
||||
|
||||
while (console_region_size > 0)
|
||||
{
|
||||
const rarch_memory_descriptor_t* desc = rcheevos_memory_get_descriptor(mmap, real_address);
|
||||
if (!desc)
|
||||
{
|
||||
if (console_region->type != RC_MEMORY_TYPE_UNUSED)
|
||||
{
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "Could not map region starting at $%06X\n",
|
||||
real_address - console_region->real_address + console_region->start_address);
|
||||
}
|
||||
|
||||
rcheevos_memory_register_region(regions, console_region->type, NULL, console_region_size, "null filler");
|
||||
break;
|
||||
}
|
||||
|
||||
offset = real_address - desc->core.start;
|
||||
snprintf(description, sizeof(description),
|
||||
"descriptor %u, offset 0x%06X",
|
||||
(int)(desc - mmap->descriptors) + 1, (int)offset);
|
||||
|
||||
if (desc->core.ptr)
|
||||
{
|
||||
desc_start = (uint8_t*)desc->core.ptr + desc->core.offset;
|
||||
region_start = desc_start + offset;
|
||||
}
|
||||
else
|
||||
region_start = NULL;
|
||||
|
||||
desc_size = desc->core.len - offset;
|
||||
|
||||
if (console_region_size > desc_size)
|
||||
{
|
||||
if (desc_size == 0)
|
||||
{
|
||||
if (console_region->type != RC_MEMORY_TYPE_UNUSED)
|
||||
{
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "Could not map region starting at $%06X\n",
|
||||
real_address - console_region->real_address + console_region->start_address);
|
||||
}
|
||||
|
||||
rcheevos_memory_register_region(regions, console_region->type, NULL, console_region_size, "null filler");
|
||||
console_region_size = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
rcheevos_memory_register_region(regions, console_region->type, region_start, desc_size, description);
|
||||
console_region_size -= desc_size;
|
||||
real_address += desc_size;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
rcheevos_memory_register_region(regions, console_region->type, region_start, console_region_size, description);
|
||||
console_region_size = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static unsigned rcheevos_memory_console_region_to_ram_type(int region_type)
|
||||
{
|
||||
switch (region_type)
|
||||
{
|
||||
case RC_MEMORY_TYPE_SAVE_RAM:
|
||||
return RETRO_MEMORY_SAVE_RAM;
|
||||
case RC_MEMORY_TYPE_VIDEO_RAM:
|
||||
return RETRO_MEMORY_VIDEO_RAM;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return RETRO_MEMORY_SYSTEM_RAM;
|
||||
}
|
||||
|
||||
static void rcheevos_memory_init_from_unmapped_memory(rcheevos_memory_regions_t* regions, const rc_memory_regions_t* console_regions, int console)
|
||||
{
|
||||
char description[64];
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < console_regions->num_regions; ++i)
|
||||
{
|
||||
size_t offset;
|
||||
unsigned j;
|
||||
retro_ctx_memory_info_t meminfo;
|
||||
const rc_memory_region_t* console_region = &console_regions->region[i];
|
||||
const size_t console_region_size =
|
||||
console_region->end_address - console_region->start_address + 1;
|
||||
unsigned base_address = 0;
|
||||
|
||||
meminfo.id = rcheevos_memory_console_region_to_ram_type(console_region->type);
|
||||
|
||||
for (j = 0; j <= i; ++j)
|
||||
{
|
||||
const rc_memory_region_t* console_region2 = &console_regions->region[j];
|
||||
if (rcheevos_memory_console_region_to_ram_type(
|
||||
console_region2->type) == meminfo.id)
|
||||
{
|
||||
base_address = console_region2->start_address;
|
||||
break;
|
||||
}
|
||||
}
|
||||
offset = console_region->start_address - base_address;
|
||||
|
||||
core_get_memory(&meminfo);
|
||||
|
||||
if (offset < meminfo.size)
|
||||
{
|
||||
meminfo.size -= offset;
|
||||
|
||||
if (meminfo.data)
|
||||
{
|
||||
snprintf(description, sizeof(description),
|
||||
"offset 0x%06X", (int)offset);
|
||||
meminfo.data = (uint8_t*)meminfo.data + offset;
|
||||
}
|
||||
else
|
||||
snprintf(description, sizeof(description), "null filler");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (console_region->type != RC_MEMORY_TYPE_UNUSED)
|
||||
{
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "Could not map region starting at $%06X\n", console_region->start_address);
|
||||
}
|
||||
|
||||
meminfo.data = NULL;
|
||||
meminfo.size = 0;
|
||||
}
|
||||
|
||||
if (console_region_size > meminfo.size)
|
||||
{
|
||||
/* want more than what is available, take what we can and null fill the rest */
|
||||
rcheevos_memory_register_region(regions, console_region->type, (uint8_t*)meminfo.data, meminfo.size, description);
|
||||
rcheevos_memory_register_region(regions, console_region->type, NULL, console_region_size - meminfo.size, "null filler");
|
||||
}
|
||||
else
|
||||
{
|
||||
/* only take as much as we need */
|
||||
rcheevos_memory_register_region(regions, console_region->type, (uint8_t*)meminfo.data, console_region_size, description);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void rcheevos_memory_destroy(rcheevos_memory_regions_t* regions)
|
||||
{
|
||||
memset(regions, 0, sizeof(*regions));
|
||||
}
|
||||
|
||||
bool rcheevos_memory_init(rcheevos_memory_regions_t* regions, int console)
|
||||
{
|
||||
unsigned i;
|
||||
const rc_memory_regions_t* console_regions = rc_console_memory_regions(console);
|
||||
rcheevos_memory_regions_t new_regions;
|
||||
bool has_valid_region = false;
|
||||
|
||||
if (!regions)
|
||||
return false;
|
||||
|
||||
memset(&new_regions, 0, sizeof(new_regions));
|
||||
|
||||
if (console_regions == NULL || console_regions->num_regions == 0)
|
||||
{
|
||||
rcheevos_memory_init_without_regions(&new_regions);
|
||||
}
|
||||
else
|
||||
{
|
||||
rarch_system_info_t* system = runloop_get_system_info();
|
||||
if (system->mmaps.num_descriptors != 0)
|
||||
rcheevos_memory_init_from_memory_map(&new_regions, &system->mmaps, console_regions);
|
||||
else
|
||||
rcheevos_memory_init_from_unmapped_memory(&new_regions, console_regions, console);
|
||||
}
|
||||
|
||||
/* determine if any valid regions were found */
|
||||
for (i = 0; i < new_regions.count; i++)
|
||||
{
|
||||
if (new_regions.data[i])
|
||||
{
|
||||
has_valid_region = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
memcpy(regions, &new_regions, sizeof(*regions));
|
||||
return has_valid_region;
|
||||
}
|
||||
@@ -0,0 +1,725 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2019-2021 - Brian Weiss
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "cheevos_locals.h"
|
||||
|
||||
#include "../gfx/gfx_display.h"
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
|
||||
#include "cheevos.h"
|
||||
|
||||
#include "../deps/rcheevos/include/rc_runtime_types.h"
|
||||
|
||||
#include "../file_path_special.h"
|
||||
#include "../menu/menu_driver.h"
|
||||
#include "../menu/menu_entries.h"
|
||||
|
||||
#include <features/features_cpu.h>
|
||||
|
||||
enum rcheevos_menuitem_bucket
|
||||
{
|
||||
RCHEEVOS_MENUITEM_BUCKET_UNKNOWN = 0,
|
||||
RCHEEVOS_MENUITEM_BUCKET_LOCKED,
|
||||
RCHEEVOS_MENUITEM_BUCKET_UNLOCKED,
|
||||
RCHEEVOS_MENUITEM_BUCKET_UNSUPPORTED,
|
||||
RCHEEVOS_MENUITEM_BUCKET_RECENTLY_UNLOCKED,
|
||||
RCHEEVOS_MENUITEM_BUCKET_ACTIVE_CHALLENGE,
|
||||
RCHEEVOS_MENUITEM_BUCKET_ALMOST_THERE
|
||||
};
|
||||
|
||||
static void rcheevos_menu_update_bucket(rcheevos_racheevo_t* cheevo)
|
||||
{
|
||||
cheevo->menu_progress = 0;
|
||||
|
||||
if (!cheevo->memaddr)
|
||||
{
|
||||
/* non-active unsupported achievement */
|
||||
cheevo->menu_bucket = RCHEEVOS_MENUITEM_BUCKET_UNSUPPORTED;
|
||||
}
|
||||
else if (!(cheevo->active & RCHEEVOS_ACTIVE_HARDCORE))
|
||||
{
|
||||
/* non-active unlocked in hardcore achievement */
|
||||
cheevo->menu_bucket = RCHEEVOS_MENUITEM_BUCKET_UNLOCKED;
|
||||
}
|
||||
else
|
||||
{
|
||||
const rcheevos_locals_t* rcheevos_locals = get_rcheevos_locals();
|
||||
rc_trigger_t* trigger;
|
||||
|
||||
if (!rcheevos_locals->hardcore_active && !(cheevo->active & RCHEEVOS_ACTIVE_SOFTCORE))
|
||||
{
|
||||
/* non-active unlocked in softcore achievement in softcore mode */
|
||||
cheevo->menu_bucket = RCHEEVOS_MENUITEM_BUCKET_UNLOCKED;
|
||||
return;
|
||||
}
|
||||
|
||||
/* active achievement */
|
||||
cheevo->menu_bucket = RCHEEVOS_MENUITEM_BUCKET_LOCKED;
|
||||
|
||||
trigger = rc_runtime_get_achievement(&rcheevos_locals->runtime, cheevo->id);
|
||||
if (trigger)
|
||||
{
|
||||
if (trigger->measured_value && trigger->measured_target)
|
||||
{
|
||||
const unsigned long clamped_value = (unsigned long)
|
||||
MIN(trigger->measured_value, trigger->measured_target);
|
||||
cheevo->menu_progress =
|
||||
(uint8_t)((clamped_value * 100) / trigger->measured_target);
|
||||
}
|
||||
|
||||
if (trigger->state == RC_TRIGGER_STATE_PRIMED)
|
||||
cheevo->menu_bucket = RCHEEVOS_MENUITEM_BUCKET_ACTIVE_CHALLENGE;
|
||||
else if (cheevo->menu_progress >= 80)
|
||||
cheevo->menu_bucket = RCHEEVOS_MENUITEM_BUCKET_ALMOST_THERE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void rcheevos_menu_update_buckets(bool cheevos_test_unofficial)
|
||||
{
|
||||
const rcheevos_locals_t* rcheevos_locals = get_rcheevos_locals();
|
||||
rcheevos_racheevo_t* cheevo = rcheevos_locals->patchdata.core;
|
||||
rcheevos_racheevo_t* stop = cheevo + rcheevos_locals->patchdata.core_count;
|
||||
|
||||
while (cheevo < stop)
|
||||
{
|
||||
rcheevos_menu_update_bucket(cheevo);
|
||||
++cheevo;
|
||||
}
|
||||
|
||||
if (cheevos_test_unofficial)
|
||||
{
|
||||
cheevo = rcheevos_locals->patchdata.unofficial;
|
||||
stop = cheevo + rcheevos_locals->patchdata.unofficial_count;
|
||||
|
||||
while (cheevo < stop)
|
||||
{
|
||||
rcheevos_menu_update_bucket(cheevo);
|
||||
++cheevo;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool rcheevos_menu_get_state(unsigned menu_offset, char *buffer, size_t len)
|
||||
{
|
||||
const rcheevos_locals_t* rcheevos_locals = get_rcheevos_locals();
|
||||
if (menu_offset < rcheevos_locals->menuitem_count)
|
||||
{
|
||||
const rcheevos_menuitem_t* menuitem = &rcheevos_locals->menuitems[menu_offset];
|
||||
const rcheevos_racheevo_t* cheevo = menuitem->cheevo;
|
||||
if (cheevo)
|
||||
{
|
||||
if (cheevo->menu_progress)
|
||||
{
|
||||
snprintf(buffer, len, "%s - %d%%",
|
||||
msg_hash_to_str(menuitem->state_label_idx),
|
||||
cheevo->menu_progress);
|
||||
}
|
||||
else
|
||||
{
|
||||
strlcpy(buffer, msg_hash_to_str(menuitem->state_label_idx), len);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (buffer)
|
||||
buffer[0] = '\0';
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool rcheevos_menu_get_sublabel(unsigned menu_offset, char *buffer, size_t len)
|
||||
{
|
||||
const rcheevos_locals_t* rcheevos_locals = get_rcheevos_locals();
|
||||
if (menu_offset < rcheevos_locals->menuitem_count)
|
||||
{
|
||||
const rcheevos_racheevo_t* cheevo = rcheevos_locals->menuitems[menu_offset].cheevo;
|
||||
if (cheevo && buffer)
|
||||
{
|
||||
strlcpy(buffer, cheevo->description, len);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (buffer)
|
||||
buffer[0] = '\0';
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void rcheevos_menu_reset_badges(void)
|
||||
{
|
||||
const rcheevos_locals_t* rcheevos_locals = get_rcheevos_locals();
|
||||
rcheevos_racheevo_t* cheevo = rcheevos_locals->patchdata.core;
|
||||
rcheevos_racheevo_t* stop = cheevo + rcheevos_locals->patchdata.core_count;
|
||||
|
||||
while (cheevo < stop)
|
||||
{
|
||||
if (cheevo->menu_badge_texture)
|
||||
video_driver_texture_unload(&cheevo->menu_badge_texture);
|
||||
++cheevo;
|
||||
}
|
||||
|
||||
cheevo = rcheevos_locals->patchdata.unofficial;
|
||||
stop = cheevo + rcheevos_locals->patchdata.unofficial_count;
|
||||
|
||||
while (cheevo < stop)
|
||||
{
|
||||
if (cheevo->menu_badge_texture)
|
||||
video_driver_texture_unload(&cheevo->menu_badge_texture);
|
||||
++cheevo;
|
||||
}
|
||||
}
|
||||
|
||||
static rcheevos_menuitem_t* rcheevos_menu_allocate(
|
||||
rcheevos_locals_t* rcheevos_locals, rcheevos_racheevo_t* cheevo)
|
||||
{
|
||||
rcheevos_menuitem_t* menuitem;
|
||||
|
||||
if (rcheevos_locals->menuitem_count == rcheevos_locals->menuitem_capacity)
|
||||
{
|
||||
if (rcheevos_locals->menuitems)
|
||||
{
|
||||
rcheevos_menuitem_t* new_menuitems;
|
||||
rcheevos_locals->menuitem_capacity += 32;
|
||||
new_menuitems = (rcheevos_menuitem_t*)realloc(rcheevos_locals->menuitems,
|
||||
rcheevos_locals->menuitem_capacity * sizeof(rcheevos_menuitem_t));
|
||||
|
||||
if (new_menuitems)
|
||||
{
|
||||
rcheevos_locals->menuitems = new_menuitems;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* realloc failed */
|
||||
CHEEVOS_ERR(RCHEEVOS_TAG " could not allocate space for %u menu items\n",
|
||||
rcheevos_locals->menuitem_capacity);
|
||||
rcheevos_locals->menuitem_capacity -= 32;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
rcheevos_locals->menuitem_capacity = 64;
|
||||
rcheevos_locals->menuitems = (rcheevos_menuitem_t*)
|
||||
malloc(rcheevos_locals->menuitem_capacity * sizeof(rcheevos_menuitem_t));
|
||||
|
||||
if (!rcheevos_locals->menuitems)
|
||||
{
|
||||
/* malloc failed */
|
||||
CHEEVOS_ERR(RCHEEVOS_TAG " could not allocate space for %u menu items\n",
|
||||
rcheevos_locals->menuitem_capacity);
|
||||
rcheevos_locals->menuitem_capacity = 0;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
menuitem = &rcheevos_locals->menuitems[rcheevos_locals->menuitem_count++];
|
||||
menuitem->cheevo = cheevo;
|
||||
menuitem->state_label_idx = MSG_UNKNOWN;
|
||||
return menuitem;
|
||||
}
|
||||
|
||||
static void rcheevos_menu_append_header(rcheevos_locals_t* rcheevos_locals,
|
||||
enum msg_hash_enums label)
|
||||
{
|
||||
rcheevos_menuitem_t* menuitem = rcheevos_menu_allocate(rcheevos_locals, NULL);
|
||||
if (menuitem)
|
||||
menuitem->state_label_idx = label;
|
||||
}
|
||||
|
||||
static void rcheevos_menu_update_badge(rcheevos_racheevo_t* cheevo)
|
||||
{
|
||||
bool badge_grayscale = false;
|
||||
switch (cheevo->menu_bucket)
|
||||
{
|
||||
case RCHEEVOS_MENUITEM_BUCKET_LOCKED:
|
||||
case RCHEEVOS_MENUITEM_BUCKET_UNSUPPORTED:
|
||||
case RCHEEVOS_MENUITEM_BUCKET_ALMOST_THERE:
|
||||
case RCHEEVOS_MENUITEM_BUCKET_ACTIVE_CHALLENGE:
|
||||
badge_grayscale = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
badge_grayscale = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!cheevo->menu_badge_texture || cheevo->menu_badge_grayscale != badge_grayscale)
|
||||
{
|
||||
uintptr_t new_badge_texture =
|
||||
rcheevos_get_badge_texture(cheevo->badge, badge_grayscale);
|
||||
|
||||
if (new_badge_texture)
|
||||
{
|
||||
if (cheevo->menu_badge_texture)
|
||||
video_driver_texture_unload(&cheevo->menu_badge_texture);
|
||||
|
||||
cheevo->menu_badge_texture = new_badge_texture;
|
||||
cheevo->menu_badge_grayscale = badge_grayscale;
|
||||
}
|
||||
/* menu_badge_grayscale is overloaded such that any value greater than 1 indicates
|
||||
* the server default image is being used */
|
||||
else if (cheevo->menu_badge_grayscale < 2)
|
||||
{
|
||||
if (cheevo->menu_badge_texture)
|
||||
video_driver_texture_unload(&cheevo->menu_badge_texture);
|
||||
|
||||
/* requested badge is not available, check for server default */
|
||||
cheevo->menu_badge_texture =
|
||||
rcheevos_get_badge_texture("00000", false);
|
||||
|
||||
if (cheevo->menu_badge_texture)
|
||||
cheevo->menu_badge_grayscale = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void rcheevos_menu_append_items(rcheevos_locals_t* rcheevos_locals,
|
||||
bool cheevos_test_unofficial, enum rcheevos_menuitem_bucket bucket)
|
||||
{
|
||||
const settings_t *settings = config_get_ptr();
|
||||
rcheevos_racheevo_t* cheevo = rcheevos_locals->patchdata.core;
|
||||
rcheevos_racheevo_t* stop = cheevo + rcheevos_locals->patchdata.core_count;
|
||||
bool processing_unofficial = false;
|
||||
const unsigned first_index = rcheevos_locals->menuitem_count;
|
||||
|
||||
do
|
||||
{
|
||||
if (cheevo == stop)
|
||||
{
|
||||
if (!cheevos_test_unofficial || processing_unofficial)
|
||||
break;
|
||||
|
||||
processing_unofficial = true;
|
||||
cheevo = rcheevos_locals->patchdata.unofficial;
|
||||
stop = cheevo + rcheevos_locals->patchdata.unofficial_count;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (cheevo->menu_bucket == bucket)
|
||||
{
|
||||
rcheevos_menuitem_t* menuitem = rcheevos_menu_allocate(rcheevos_locals, cheevo);
|
||||
if (!menuitem)
|
||||
return;
|
||||
|
||||
switch (cheevo->menu_bucket)
|
||||
{
|
||||
case RCHEEVOS_MENUITEM_BUCKET_UNSUPPORTED:
|
||||
menuitem->state_label_idx = MENU_ENUM_LABEL_VALUE_CHEEVOS_UNSUPPORTED_ENTRY;
|
||||
break;
|
||||
|
||||
case RCHEEVOS_MENUITEM_BUCKET_RECENTLY_UNLOCKED:
|
||||
{
|
||||
/* insert the item such that the unlock times are descending */
|
||||
unsigned entry_index = rcheevos_locals->menuitem_count - 1;
|
||||
while (entry_index > first_index)
|
||||
{
|
||||
rcheevos_menuitem_t* prev_menuitem = menuitem - 1;
|
||||
if (prev_menuitem->cheevo->unlock_time >= cheevo->unlock_time)
|
||||
break;
|
||||
|
||||
memcpy(menuitem, prev_menuitem, sizeof(rcheevos_menuitem_t));
|
||||
menuitem = prev_menuitem;
|
||||
--entry_index;
|
||||
}
|
||||
|
||||
menuitem->cheevo = cheevo;
|
||||
}
|
||||
/* fallthrough to RCHEEVOS_MENUITEM_BUCKET_UNLOCKED */
|
||||
|
||||
case RCHEEVOS_MENUITEM_BUCKET_UNLOCKED:
|
||||
if (!(cheevo->active & RCHEEVOS_ACTIVE_HARDCORE))
|
||||
menuitem->state_label_idx = MENU_ENUM_LABEL_VALUE_CHEEVOS_UNLOCKED_ENTRY_HARDCORE;
|
||||
else
|
||||
menuitem->state_label_idx = MENU_ENUM_LABEL_VALUE_CHEEVOS_UNLOCKED_ENTRY;
|
||||
break;
|
||||
|
||||
case RCHEEVOS_MENUITEM_BUCKET_ALMOST_THERE:
|
||||
{
|
||||
/* insert the item such that the progresses are descending */
|
||||
unsigned entry_index = rcheevos_locals->menuitem_count - 1;
|
||||
while (entry_index > first_index)
|
||||
{
|
||||
rcheevos_menuitem_t* prev_menuitem = menuitem - 1;
|
||||
if (prev_menuitem->cheevo->menu_progress >= cheevo->menu_progress)
|
||||
break;
|
||||
|
||||
memcpy(menuitem, prev_menuitem, sizeof(rcheevos_menuitem_t));
|
||||
menuitem = prev_menuitem;
|
||||
--entry_index;
|
||||
}
|
||||
|
||||
menuitem->cheevo = cheevo;
|
||||
}
|
||||
/* fallthrough to default */
|
||||
|
||||
default:
|
||||
if (processing_unofficial)
|
||||
menuitem->state_label_idx = MENU_ENUM_LABEL_VALUE_CHEEVOS_UNOFFICIAL_ENTRY;
|
||||
else if (!(cheevo->active & RCHEEVOS_ACTIVE_SOFTCORE))
|
||||
menuitem->state_label_idx = MENU_ENUM_LABEL_VALUE_CHEEVOS_UNLOCKED_ENTRY;
|
||||
else
|
||||
menuitem->state_label_idx = MENU_ENUM_LABEL_VALUE_CHEEVOS_LOCKED_ENTRY;
|
||||
break;
|
||||
}
|
||||
|
||||
if (cheevo->badge && cheevo->badge[0] && settings &&
|
||||
settings->bools.cheevos_badges_enable)
|
||||
{
|
||||
rcheevos_menu_update_badge(cheevo);
|
||||
}
|
||||
}
|
||||
|
||||
++cheevo;
|
||||
} while (true);
|
||||
}
|
||||
|
||||
uintptr_t rcheevos_menu_get_badge_texture(unsigned menu_offset)
|
||||
{
|
||||
const rcheevos_locals_t* rcheevos_locals = get_rcheevos_locals();
|
||||
if (menu_offset < rcheevos_locals->menuitem_count)
|
||||
{
|
||||
rcheevos_racheevo_t* cheevo = rcheevos_locals->menuitems[menu_offset].cheevo;
|
||||
if (cheevo)
|
||||
{
|
||||
/* if we're using the placeholder badge, check to see if the real badge
|
||||
* has become available (do this roughly once a second) */
|
||||
if (cheevo->menu_badge_grayscale >= 2)
|
||||
{
|
||||
if (++cheevo->menu_badge_grayscale == 64)
|
||||
{
|
||||
cheevo->menu_badge_grayscale = 2;
|
||||
rcheevos_menu_update_badge(cheevo);
|
||||
}
|
||||
}
|
||||
|
||||
return cheevo->menu_badge_texture;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void rcheevos_menu_populate_hardcore_pause_submenu(void* data)
|
||||
{
|
||||
const rcheevos_locals_t* rcheevos_locals = get_rcheevos_locals();
|
||||
menu_displaylist_info_t* info = (menu_displaylist_info_t*)data;
|
||||
const settings_t* settings = config_get_ptr();
|
||||
const bool cheevos_hardcore_mode_enable = settings->bools.cheevos_hardcore_mode_enable;
|
||||
|
||||
if (cheevos_hardcore_mode_enable && rcheevos_locals->loaded)
|
||||
{
|
||||
if (rcheevos_locals->hardcore_active)
|
||||
{
|
||||
menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ACHIEVEMENT_PAUSE_CANCEL),
|
||||
msg_hash_to_str(MENU_ENUM_SUBLABEL_ACHIEVEMENT_PAUSE_CANCEL),
|
||||
MENU_ENUM_LABEL_ACHIEVEMENT_PAUSE_CANCEL,
|
||||
MENU_SETTING_ACTION_CLOSE, 0, 0);
|
||||
menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ACHIEVEMENT_PAUSE),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_ACHIEVEMENT_PAUSE),
|
||||
MENU_ENUM_LABEL_ACHIEVEMENT_PAUSE,
|
||||
MENU_SETTING_ACTION_PAUSE_ACHIEVEMENTS, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ACHIEVEMENT_RESUME_CANCEL),
|
||||
msg_hash_to_str(MENU_ENUM_SUBLABEL_ACHIEVEMENT_RESUME_CANCEL),
|
||||
MENU_ENUM_LABEL_ACHIEVEMENT_RESUME_CANCEL,
|
||||
MENU_SETTING_ACTION_CLOSE, 0, 0);
|
||||
menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ACHIEVEMENT_RESUME),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_ACHIEVEMENT_RESUME),
|
||||
MENU_ENUM_LABEL_ACHIEVEMENT_RESUME,
|
||||
MENU_SETTING_ACTION_RESUME_ACHIEVEMENTS, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void rcheevos_menu_populate(void* data)
|
||||
{
|
||||
menu_displaylist_info_t* info = (menu_displaylist_info_t*)data;
|
||||
rcheevos_locals_t* rcheevos_locals = get_rcheevos_locals();
|
||||
const settings_t* settings = config_get_ptr();
|
||||
const bool cheevos_test_unofficial = settings->bools.cheevos_test_unofficial;
|
||||
unsigned num_locked = 0;
|
||||
unsigned num_unlocked = 0;
|
||||
unsigned num_recently_unlocked = 0;
|
||||
unsigned num_unsupported = 0;
|
||||
unsigned num_active_challenges = 0;
|
||||
unsigned num_almost_there = 0;
|
||||
|
||||
if (rcheevos_locals->loaded)
|
||||
{
|
||||
const retro_time_t now = cpu_features_get_time_usec();
|
||||
const retro_time_t recent_unlock_time = now - (10 * 60 * 1000000); /* 10 minutes ago */
|
||||
bool processing_unofficial = false;
|
||||
rcheevos_racheevo_t* cheevo = NULL;
|
||||
rcheevos_racheevo_t* stop = NULL;
|
||||
|
||||
/* first menu item is the Pause/Resume Hardcore option (unless hardcore is disabled) */
|
||||
if (settings->bools.cheevos_enable && settings->bools.cheevos_hardcore_mode_enable)
|
||||
{
|
||||
if (rcheevos_locals->hardcore_active)
|
||||
menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ACHIEVEMENT_PAUSE),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ACHIEVEMENT_PAUSE_MENU),
|
||||
MENU_ENUM_LABEL_ACHIEVEMENT_PAUSE_MENU,
|
||||
MENU_SETTING_ACTION_PAUSE_ACHIEVEMENTS, 0, 0);
|
||||
else
|
||||
menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ACHIEVEMENT_RESUME),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ACHIEVEMENT_PAUSE_MENU),
|
||||
MENU_ENUM_LABEL_ACHIEVEMENT_PAUSE_MENU,
|
||||
MENU_SETTING_ACTION_RESUME_ACHIEVEMENTS, 0, 0);
|
||||
}
|
||||
|
||||
/* update the bucket for each achievement */
|
||||
rcheevos_menu_update_buckets(cheevos_test_unofficial);
|
||||
|
||||
/* count items in each bucket */
|
||||
cheevo = rcheevos_locals->patchdata.core;
|
||||
stop = cheevo + rcheevos_locals->patchdata.core_count;
|
||||
|
||||
do
|
||||
{
|
||||
if (cheevo == stop)
|
||||
{
|
||||
if (!cheevos_test_unofficial || processing_unofficial)
|
||||
break;
|
||||
|
||||
processing_unofficial = true;
|
||||
cheevo = rcheevos_locals->patchdata.unofficial;
|
||||
stop = cheevo + rcheevos_locals->patchdata.unofficial_count;
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (cheevo->menu_bucket)
|
||||
{
|
||||
case RCHEEVOS_MENUITEM_BUCKET_UNLOCKED:
|
||||
if (cheevo->unlock_time && cheevo->unlock_time >= recent_unlock_time)
|
||||
{
|
||||
cheevo->menu_bucket = RCHEEVOS_MENUITEM_BUCKET_RECENTLY_UNLOCKED;
|
||||
++num_recently_unlocked;
|
||||
}
|
||||
else
|
||||
{
|
||||
++num_unlocked;
|
||||
}
|
||||
break;
|
||||
|
||||
case RCHEEVOS_MENUITEM_BUCKET_LOCKED:
|
||||
++num_locked;
|
||||
break;
|
||||
|
||||
case RCHEEVOS_MENUITEM_BUCKET_UNSUPPORTED:
|
||||
++num_unsupported;
|
||||
break;
|
||||
|
||||
case RCHEEVOS_MENUITEM_BUCKET_ACTIVE_CHALLENGE:
|
||||
++num_active_challenges;
|
||||
break;
|
||||
|
||||
case RCHEEVOS_MENUITEM_BUCKET_ALMOST_THERE:
|
||||
++num_almost_there;
|
||||
break;
|
||||
}
|
||||
|
||||
++cheevo;
|
||||
} while(true);
|
||||
|
||||
if (!rcheevos_locals->menuitems)
|
||||
{
|
||||
/* reserve space for all achievements and up to 6 headers before we need to realloc */
|
||||
rcheevos_locals->menuitem_capacity = rcheevos_locals->patchdata.core_count + 6;
|
||||
if (cheevos_test_unofficial)
|
||||
rcheevos_locals->menuitem_capacity += rcheevos_locals->patchdata.unofficial_count;
|
||||
|
||||
rcheevos_locals->menuitems = (rcheevos_menuitem_t*)
|
||||
malloc(rcheevos_locals->menuitem_capacity * sizeof(rcheevos_menuitem_t));
|
||||
if (!rcheevos_locals->menuitems)
|
||||
rcheevos_locals->menuitem_capacity = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* reset menu */
|
||||
rcheevos_locals->menuitem_count = 0;
|
||||
|
||||
/* active challenges */
|
||||
if (num_active_challenges)
|
||||
{
|
||||
rcheevos_menu_append_header(rcheevos_locals,
|
||||
MENU_ENUM_LABEL_VALUE_CHEEVOS_ACTIVE_CHALLENGES_ENTRY);
|
||||
|
||||
rcheevos_menu_append_items(rcheevos_locals, cheevos_test_unofficial,
|
||||
RCHEEVOS_MENUITEM_BUCKET_ACTIVE_CHALLENGE);
|
||||
}
|
||||
|
||||
/* recently unlocked */
|
||||
if (num_recently_unlocked)
|
||||
{
|
||||
rcheevos_menu_append_header(rcheevos_locals,
|
||||
MENU_ENUM_LABEL_VALUE_CHEEVOS_RECENTLY_UNLOCKED_ENTRY);
|
||||
|
||||
rcheevos_menu_append_items(rcheevos_locals, cheevos_test_unofficial,
|
||||
RCHEEVOS_MENUITEM_BUCKET_RECENTLY_UNLOCKED);
|
||||
}
|
||||
|
||||
/* almost there */
|
||||
if (num_almost_there)
|
||||
{
|
||||
rcheevos_menu_append_header(rcheevos_locals,
|
||||
MENU_ENUM_LABEL_VALUE_CHEEVOS_ALMOST_THERE_ENTRY);
|
||||
|
||||
rcheevos_menu_append_items(rcheevos_locals, cheevos_test_unofficial,
|
||||
RCHEEVOS_MENUITEM_BUCKET_ALMOST_THERE);
|
||||
}
|
||||
|
||||
/* locked */
|
||||
if (num_locked)
|
||||
{
|
||||
if (rcheevos_locals->menuitem_count > 0)
|
||||
{
|
||||
rcheevos_menu_append_header(rcheevos_locals,
|
||||
MENU_ENUM_LABEL_VALUE_CHEEVOS_LOCKED_ENTRY);
|
||||
}
|
||||
|
||||
rcheevos_menu_append_items(rcheevos_locals, cheevos_test_unofficial,
|
||||
RCHEEVOS_MENUITEM_BUCKET_LOCKED);
|
||||
}
|
||||
|
||||
/* unlocked */
|
||||
if (num_unlocked)
|
||||
{
|
||||
if (rcheevos_locals->menuitem_count > 0)
|
||||
{
|
||||
rcheevos_menu_append_header(rcheevos_locals,
|
||||
MENU_ENUM_LABEL_VALUE_CHEEVOS_UNLOCKED_ENTRY);
|
||||
}
|
||||
|
||||
rcheevos_menu_append_items(rcheevos_locals, cheevos_test_unofficial,
|
||||
RCHEEVOS_MENUITEM_BUCKET_UNLOCKED);
|
||||
}
|
||||
|
||||
if (rcheevos_locals->menuitem_count > 0)
|
||||
{
|
||||
/* convert to menu entries */
|
||||
rcheevos_menuitem_t* menuitem = rcheevos_locals->menuitems;
|
||||
rcheevos_menuitem_t* stop = menuitem + rcheevos_locals->menuitem_count;
|
||||
char buffer[128];
|
||||
unsigned idx = 0;
|
||||
|
||||
do
|
||||
{
|
||||
if (menuitem->cheevo)
|
||||
{
|
||||
menu_entries_append_enum(info->list, menuitem->cheevo->title,
|
||||
menuitem->cheevo->description,
|
||||
MENU_ENUM_LABEL_CHEEVOS_LOCKED_ENTRY,
|
||||
MENU_SETTINGS_CHEEVOS_START + idx, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(buffer, sizeof(buffer), "----- %s -----",
|
||||
msg_hash_to_str(menuitem->state_label_idx));
|
||||
|
||||
menu_entries_append_enum(info->list, buffer, "",
|
||||
MENU_ENUM_LABEL_CHEEVOS_LOCKED_ENTRY,
|
||||
MENU_SETTINGS_CHEEVOS_START + idx, 0, 0);
|
||||
}
|
||||
|
||||
++idx;
|
||||
++menuitem;
|
||||
} while (menuitem != stop);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* no achievements found */
|
||||
if (!rcheevos_locals->core_supports)
|
||||
{
|
||||
menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CANNOT_ACTIVATE_ACHIEVEMENTS_WITH_THIS_CORE),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_CANNOT_ACTIVATE_ACHIEVEMENTS_WITH_THIS_CORE),
|
||||
MENU_ENUM_LABEL_CANNOT_ACTIVATE_ACHIEVEMENTS_WITH_THIS_CORE,
|
||||
FILE_TYPE_NONE, 0, 0);
|
||||
}
|
||||
else if (rcheevos_locals->network_error)
|
||||
{
|
||||
menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETWORK_ERROR),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_NETWORK_ERROR),
|
||||
MENU_ENUM_LABEL_NETWORK_ERROR,
|
||||
FILE_TYPE_NONE, 0, 0);
|
||||
}
|
||||
else if (!rcheevos_locals->patchdata.game_id)
|
||||
{
|
||||
menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_UNKNOWN_GAME),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_UNKNOWN_GAME),
|
||||
MENU_ENUM_LABEL_UNKNOWN_GAME,
|
||||
FILE_TYPE_NONE, 0, 0);
|
||||
}
|
||||
else if (!rcheevos_locals->token[0])
|
||||
{
|
||||
menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NOT_LOGGED_IN),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_NOT_LOGGED_IN),
|
||||
MENU_ENUM_LABEL_NOT_LOGGED_IN,
|
||||
FILE_TYPE_NONE, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_ACHIEVEMENTS_TO_DISPLAY),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_NO_ACHIEVEMENTS_TO_DISPLAY),
|
||||
MENU_ENUM_LABEL_NO_ACHIEVEMENTS_TO_DISPLAY,
|
||||
FILE_TYPE_NONE, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* HAVE_MENU */
|
||||
|
||||
uintptr_t rcheevos_get_badge_texture(const char *badge, bool locked)
|
||||
{
|
||||
char badge_file[24];
|
||||
char fullpath[PATH_MAX_LENGTH];
|
||||
uintptr_t tex = 0;
|
||||
|
||||
if (!badge)
|
||||
return 0;
|
||||
|
||||
snprintf(badge_file, sizeof(badge_file), "%s%s%s", badge,
|
||||
locked ? "_lock" : "", FILE_PATH_PNG_EXTENSION);
|
||||
|
||||
fill_pathname_application_special(fullpath, sizeof(fullpath),
|
||||
APPLICATION_SPECIAL_DIRECTORY_THUMBNAILS_CHEEVOS_BADGES);
|
||||
|
||||
if (!gfx_display_reset_textures_list(badge_file, fullpath,
|
||||
&tex, TEXTURE_FILTER_MIPMAP_LINEAR, NULL, NULL))
|
||||
{
|
||||
tex = 0;
|
||||
}
|
||||
|
||||
return tex;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2015-2018 - Andre Leiradella
|
||||
* Copyright (C) 2019-2021 - Brian Weiss
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
@@ -12,33 +13,29 @@
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __RARCH_CHEEVOS_MEMORY_H
|
||||
#define __RARCH_CHEEVOS_MEMORY_H
|
||||
|
||||
#ifndef __RARCH_CHEEVOS_MENU_H
|
||||
#define __RARCH_CHEEVOS_MENU_H
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <boolean.h>
|
||||
|
||||
#include <retro_common_api.h>
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
#define MAX_MEMORY_REGIONS 32
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t* data[MAX_MEMORY_REGIONS];
|
||||
size_t size[MAX_MEMORY_REGIONS];
|
||||
size_t total_size;
|
||||
unsigned count;
|
||||
} rcheevos_memory_regions_t;
|
||||
|
||||
bool rcheevos_memory_init(rcheevos_memory_regions_t* regions, int console);
|
||||
void rcheevos_memory_destroy(rcheevos_memory_regions_t* regions);
|
||||
|
||||
uint8_t* rcheevos_memory_find(const rcheevos_memory_regions_t* regions,
|
||||
unsigned address);
|
||||
void rcheevos_menu_populate(void* data);
|
||||
void rcheevos_menu_populate_hardcore_pause_submenu(void* data);
|
||||
bool rcheevos_menu_get_state(unsigned menu_offset, char* buffer, size_t buffer_size);
|
||||
bool rcheevos_menu_get_sublabel(unsigned menu_offset, char* buffer, size_t buffer_size);
|
||||
uintptr_t rcheevos_menu_get_badge_texture(unsigned menu_offset);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
#endif /* HAVE_MENU */
|
||||
|
||||
#endif /* __RARCH_CHEEVOS_MENU_H */
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "cheevos_parser.h"
|
||||
|
||||
#include "util.h"
|
||||
#include "cheevos_locals.h"
|
||||
|
||||
#include <encodings/utf.h>
|
||||
#include <formats/rjson.h>
|
||||
@@ -23,6 +23,7 @@
|
||||
#define CHEEVOS_JSON_KEY_BADGENAME 0x887685d9U
|
||||
#define CHEEVOS_JSON_KEY_CONSOLE_ID 0x071656e5U
|
||||
#define CHEEVOS_JSON_KEY_TOKEN 0x0e2dbd26U
|
||||
#define CHEEVOS_JSON_KEY_USERNAME 0x7c8da264U
|
||||
#define CHEEVOS_JSON_KEY_FLAGS 0x0d2e96b2U
|
||||
#define CHEEVOS_JSON_KEY_LEADERBOARDS 0xf1247d2dU
|
||||
#define CHEEVOS_JSON_KEY_RICHPRESENCE 0xf18dd230U
|
||||
@@ -149,14 +150,16 @@ static int rcheevos_get_value(const char* json, unsigned key_hash,
|
||||
Returns the token or the error message
|
||||
*****************************************************************************/
|
||||
|
||||
int rcheevos_get_token(const char* json, char* token, size_t length)
|
||||
int rcheevos_get_token(const char* json, char* username, size_t username_length,
|
||||
char* token, size_t length)
|
||||
{
|
||||
rcheevos_get_value(json, CHEEVOS_JSON_KEY_ERROR, token, length);
|
||||
|
||||
if (!string_is_empty(token))
|
||||
return -1;
|
||||
|
||||
return rcheevos_get_value(json, CHEEVOS_JSON_KEY_TOKEN, token, length);
|
||||
return rcheevos_get_value(json, CHEEVOS_JSON_KEY_TOKEN, token, length) +
|
||||
rcheevos_get_value(json, CHEEVOS_JSON_KEY_USERNAME, username, username_length);
|
||||
}
|
||||
|
||||
int rcheevos_get_json_error(const char* json, char* token, size_t length)
|
||||
|
||||
@@ -16,53 +16,16 @@
|
||||
#ifndef __RARCH_CHEEVOS_PARSER_H
|
||||
#define __RARCH_CHEEVOS_PARSER_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <boolean.h>
|
||||
|
||||
#include <retro_common_api.h>
|
||||
#include "cheevos_locals.h"
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
typedef struct
|
||||
{
|
||||
const char* title;
|
||||
const char* description;
|
||||
const char* badge;
|
||||
const char* memaddr;
|
||||
unsigned points;
|
||||
unsigned id;
|
||||
unsigned active;
|
||||
} rcheevos_racheevo_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
const char* title;
|
||||
const char* description;
|
||||
const char* mem;
|
||||
unsigned id;
|
||||
unsigned format;
|
||||
} rcheevos_ralboard_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char* title;
|
||||
rcheevos_racheevo_t* core;
|
||||
rcheevos_racheevo_t* unofficial;
|
||||
rcheevos_ralboard_t* lboards;
|
||||
char* richpresence_script;
|
||||
|
||||
unsigned game_id;
|
||||
unsigned console_id;
|
||||
unsigned core_count;
|
||||
unsigned unofficial_count;
|
||||
unsigned lboard_count;
|
||||
} rcheevos_rapatchdata_t;
|
||||
|
||||
typedef void (*rcheevos_unlock_cb_t)(unsigned id, void* userdata);
|
||||
|
||||
int rcheevos_get_json_error(const char* json, char* token, size_t length);
|
||||
int rcheevos_get_token(const char* json, char* token, size_t length);
|
||||
|
||||
int rcheevos_get_token(const char* json, char* username, size_t username_length,
|
||||
char* token, size_t length);
|
||||
|
||||
int rcheevos_get_patchdata(const char* json, rcheevos_rapatchdata_t* patchdata);
|
||||
void rcheevos_free_patchdata(rcheevos_rapatchdata_t* patchdata);
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2015-2016 - Andre Leiradella
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __RARCH_CHEEVOS_UTIL_H
|
||||
#define __RARCH_CHEEVOS_UTIL_H
|
||||
|
||||
#include <retro_common_api.h>
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
/*****************************************************************************
|
||||
Setup - mainly for debugging
|
||||
*****************************************************************************/
|
||||
|
||||
/* Define this macro to get extra-verbose log for cheevos. */
|
||||
#define CHEEVOS_VERBOSE
|
||||
|
||||
/*****************************************************************************
|
||||
End of setup
|
||||
*****************************************************************************/
|
||||
|
||||
#define RCHEEVOS_TAG "[RCHEEVOS]: "
|
||||
#define CHEEVOS_FREE(p) do { void* q = (void*)p; if (q) free(q); } while (0)
|
||||
|
||||
#ifdef CHEEVOS_VERBOSE
|
||||
|
||||
#define CHEEVOS_LOG RARCH_LOG
|
||||
#define CHEEVOS_ERR RARCH_ERR
|
||||
|
||||
#else
|
||||
|
||||
#define CHEEVOS_LOG rcheevos_log
|
||||
#define CHEEVOS_ERR RARCH_ERR
|
||||
|
||||
void rcheevos_log(const char *fmt, ...);
|
||||
|
||||
#endif
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif /* __RARCH_CHEEVOS_UTIL_H */
|
||||
@@ -166,6 +166,7 @@ static void command_network_poll(command_t *handle)
|
||||
char buf[1024];
|
||||
|
||||
buf[0] = '\0';
|
||||
netcmd->cmd_source_len = sizeof(struct sockaddr_storage);
|
||||
ret = recvfrom(netcmd->net_fd, buf, sizeof(buf) - 1, 0,
|
||||
(struct sockaddr*)&netcmd->cmd_source,
|
||||
&netcmd->cmd_source_len);
|
||||
|
||||
+126
-23
@@ -48,6 +48,11 @@
|
||||
#include "menu/menu_screensaver.h"
|
||||
#endif
|
||||
|
||||
/* Required for 'show inputs on overlay' setting */
|
||||
#if defined(HAVE_OVERLAY)
|
||||
#include "../input/input_overlay.h"
|
||||
#endif
|
||||
|
||||
#if defined(HW_RVL)
|
||||
#define MAX_GAMMA_SETTING 30
|
||||
#elif defined(GEKKO)
|
||||
@@ -61,7 +66,7 @@
|
||||
#elif defined(_XBOX1) || defined(GEKKO) || defined(ANDROID)
|
||||
#define DEFAULT_ASPECT_RATIO 1.3333f
|
||||
#else
|
||||
#define DEFAULT_ASPECT_RATIO -1.0f
|
||||
#define DEFAULT_ASPECT_RATIO 1.3333f
|
||||
#endif
|
||||
|
||||
#if defined(GEKKO)
|
||||
@@ -70,7 +75,7 @@
|
||||
|
||||
#define DEFAULT_TOUCH_SCALE 1
|
||||
|
||||
#if defined(RARCH_MOBILE) || defined(HAVE_LIBNX) || defined(__WINRT__)
|
||||
#if defined(RARCH_MOBILE) || defined(HAVE_LIBNX) || defined(__WINRT__) || defined(EMSCRIPTEN)
|
||||
#define DEFAULT_POINTER_ENABLE true
|
||||
#else
|
||||
#define DEFAULT_POINTER_ENABLE false
|
||||
@@ -152,6 +157,8 @@
|
||||
|
||||
#define DEFAULT_CRT_SWITCH_PORCH_ADJUST 0
|
||||
|
||||
#define DEFAULT_CRT_SWITCH_HIRES_MENU true
|
||||
|
||||
#define DEFAULT_HISTORY_LIST_ENABLE true
|
||||
|
||||
#define DEFAULT_PLAYLIST_ENTRY_RENAME true
|
||||
@@ -194,32 +201,80 @@
|
||||
|
||||
/* To start in Fullscreen, or not. */
|
||||
|
||||
#if defined(HAVE_STEAM) || defined(DINGUX)
|
||||
/* Start in fullscreen mode for Steam and
|
||||
* Dingux builds */
|
||||
#if defined(HAVE_STEAM) || defined(DINGUX) || defined(__WINRT__) || defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
|
||||
/* Start in fullscreen mode for Steam and Dingux
|
||||
* WinRT and Winapi Family builds */
|
||||
#define DEFAULT_FULLSCREEN true
|
||||
#else
|
||||
#define DEFAULT_FULLSCREEN false
|
||||
#endif
|
||||
|
||||
/* To use windowed mode or not when going fullscreen. */
|
||||
#define DEFAULT_WINDOWED_FULLSCREEN true
|
||||
#if defined(__WINRT__) || defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
|
||||
/* Do not use windowed mode for WinRT and Winapi Family builds on the Xbox UWP with fixed resolution shrinks the image into the left top corner of the screen with some libretro cores */
|
||||
#define DEFAULT_WINDOWED_FULLSCREEN false
|
||||
#else
|
||||
#define DEFAULT_WINDOWED_FULLSCREEN true
|
||||
#endif
|
||||
|
||||
/* Which monitor to prefer. 0 is any monitor, 1 and up selects
|
||||
* specific monitors, 1 being the first monitor. */
|
||||
#define DEFAULT_MONITOR_INDEX 0
|
||||
|
||||
/* Window */
|
||||
/* Window size. A value of 0 uses window scale
|
||||
* multiplied by the core framebuffer size. */
|
||||
#define DEFAULT_WINDOW_WIDTH 1280
|
||||
|
||||
/* DEFAULT_WINDOW_DECORATIONS:
|
||||
Whether to show the usual window decorations like border, titlebar etc. */
|
||||
#ifdef WEBOS
|
||||
#define DEFAULT_WINDOW_DECORATIONS false
|
||||
#else
|
||||
#define DEFAULT_WINDOW_DECORATIONS true
|
||||
#endif
|
||||
|
||||
/* Amount of transparency to use for the main window.
|
||||
* 1 is the most transparent while 100 is opaque. */
|
||||
#define DEFAULT_WINDOW_OPACITY 100
|
||||
|
||||
/* DEFAULT_WINDOW_SAVE_POSITIONS:
|
||||
* Whether to remember window positions
|
||||
* NOTE: Only enabled for desktop Windows
|
||||
* at present. */
|
||||
#define DEFAULT_WINDOW_SAVE_POSITIONS false
|
||||
|
||||
/* Whether to use custom (fixed size)
|
||||
* window dimensions in windowed mode. */
|
||||
#ifdef WEBOS
|
||||
#define DEFAULT_WINDOW_CUSTOM_SIZE_ENABLE true
|
||||
#else
|
||||
#define DEFAULT_WINDOW_CUSTOM_SIZE_ENABLE false
|
||||
#endif
|
||||
|
||||
/* Window dimensions when using a fixed size
|
||||
* window. A value of 0 disables fixed size
|
||||
* windows, using nominal dimensions of
|
||||
* window scale multiplied by the core
|
||||
* framebuffer size. */
|
||||
#if defined(WEBOS)
|
||||
#define DEFAULT_WINDOW_WIDTH 1920
|
||||
#define DEFAULT_WINDOW_HEIGHT 1080
|
||||
#else
|
||||
#define DEFAULT_WINDOW_WIDTH 1280
|
||||
#define DEFAULT_WINDOW_HEIGHT 720
|
||||
#endif
|
||||
|
||||
/* Maximum auto-set window dimensions
|
||||
* when not using a fixed size window */
|
||||
#define DEFAULT_WINDOW_AUTO_WIDTH_MAX 1920
|
||||
#define DEFAULT_WINDOW_AUTO_HEIGHT_MAX 1080
|
||||
|
||||
/* Fullscreen resolution. A value of 0 uses the desktop
|
||||
* resolution. */
|
||||
#if defined(DINGUX)
|
||||
#define DEFAULT_FULLSCREEN_X 320
|
||||
#define DEFAULT_FULLSCREEN_Y 240
|
||||
#elif defined(__WINRT__) || defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
|
||||
#define DEFAULT_FULLSCREEN_X 1920
|
||||
#define DEFAULT_FULLSCREEN_Y 1080
|
||||
#else
|
||||
#define DEFAULT_FULLSCREEN_X 0
|
||||
#define DEFAULT_FULLSCREEN_Y 0
|
||||
@@ -228,14 +283,6 @@
|
||||
/* Number of threads to use for video recording */
|
||||
#define DEFAULT_VIDEO_RECORD_THREADS 2
|
||||
|
||||
/* Amount of transparency to use for the main window.
|
||||
* 1 is the most transparent while 100 is opaque.
|
||||
*/
|
||||
#define DEFAULT_WINDOW_OPACITY 100
|
||||
|
||||
/* Whether to show the usual window decorations like border, titlebar etc. */
|
||||
#define DEFAULT_WINDOW_DECORATIONS true
|
||||
|
||||
#if defined(RARCH_CONSOLE) || defined(__APPLE__)
|
||||
#define DEFAULT_LOAD_DUMMY_ON_CORE_SHUTDOWN false
|
||||
#else
|
||||
@@ -243,6 +290,15 @@
|
||||
#endif
|
||||
#define DEFAULT_CHECK_FIRMWARE_BEFORE_LOADING false
|
||||
|
||||
/* Specifies whether cores are allowed to
|
||||
* present core options in category submenus */
|
||||
#define DEFAULT_CORE_OPTION_CATEGORY_ENABLE true
|
||||
|
||||
/* Specifies whether to cache core info
|
||||
* into a single (compressed) file for improved
|
||||
* load times on platforms with slow IO */
|
||||
#define DEFAULT_CORE_INFO_CACHE_ENABLE true
|
||||
|
||||
/* Specifies whether to 'reload' (fork and quit)
|
||||
* RetroArch when launching content with the
|
||||
* currently loaded core
|
||||
@@ -281,6 +337,7 @@
|
||||
* Can reduce latency at cost of higher risk of stuttering.
|
||||
*/
|
||||
#define DEFAULT_FRAME_DELAY 0
|
||||
#define MAXIMUM_FRAME_DELAY 19
|
||||
|
||||
/* Inserts black frame(s) inbetween frames.
|
||||
* Useful for Higher Hz monitors (set to multiples of 60 Hz) who want to play 60 Hz
|
||||
@@ -364,8 +421,10 @@
|
||||
/* Only scale in integer steps.
|
||||
* The base size depends on system-reported geometry and aspect ratio.
|
||||
* If video_force_aspect is not set, X/Y will be integer scaled independently.
|
||||
* Overscale rounds up instead of down, default is downscale.
|
||||
*/
|
||||
#define DEFAULT_SCALE_INTEGER false
|
||||
#define DEFAULT_SCALE_INTEGER_OVERSCALE false
|
||||
|
||||
/* Controls aspect ratio handling. */
|
||||
|
||||
@@ -388,12 +447,22 @@
|
||||
#define DEFAULT_DINGUX_IPU_KEEP_ASPECT true
|
||||
/* Sets image filtering method when using the
|
||||
* IPU hardware scaler in Dingux devices */
|
||||
#if defined(RETROFW)
|
||||
#define DEFAULT_DINGUX_IPU_FILTER_TYPE DINGUX_IPU_FILTER_NEAREST
|
||||
#else
|
||||
#define DEFAULT_DINGUX_IPU_FILTER_TYPE DINGUX_IPU_FILTER_BICUBIC
|
||||
#endif
|
||||
|
||||
#if defined(DINGUX_BETA)
|
||||
/* Sets refresh rate of integral LCD panel
|
||||
* in Dingux devices */
|
||||
#define DEFAULT_DINGUX_REFRESH_RATE DINGUX_REFRESH_RATE_60HZ
|
||||
#endif
|
||||
#if defined(RS90)
|
||||
/* Sets image filtering method on the RS90
|
||||
* when integer scaling is disabled */
|
||||
#define DEFAULT_DINGUX_RS90_SOFTFILTER_TYPE DINGUX_RS90_SOFTFILTER_POINT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Save configuration file on exit. */
|
||||
@@ -527,6 +596,9 @@ static const bool quick_menu_show_start_streaming = true;
|
||||
static const bool quick_menu_show_set_core_association = true;
|
||||
static const bool quick_menu_show_reset_core_association = true;
|
||||
static const bool quick_menu_show_options = true;
|
||||
|
||||
#define DEFAULT_QUICK_MENU_SHOW_CORE_OPTIONS_FLUSH false
|
||||
|
||||
static const bool quick_menu_show_controls = true;
|
||||
static const bool quick_menu_show_cheats = true;
|
||||
static const bool quick_menu_show_shaders = true;
|
||||
@@ -713,7 +785,9 @@ static const bool default_savefiles_in_content_dir = false;
|
||||
static const bool default_systemfiles_in_content_dir = false;
|
||||
static const bool default_screenshots_in_content_dir = false;
|
||||
|
||||
#if defined(_XBOX1) || defined(__PS3__) || defined(_XBOX360) || defined(DINGUX)
|
||||
#if defined(RS90) || defined(RETROFW)
|
||||
#define DEFAULT_MENU_TOGGLE_GAMEPAD_COMBO INPUT_TOGGLE_START_SELECT
|
||||
#elif defined(_XBOX1) || defined(__PS3__) || defined(_XBOX360) || defined(DINGUX)
|
||||
#define DEFAULT_MENU_TOGGLE_GAMEPAD_COMBO INPUT_TOGGLE_L3_R3
|
||||
#elif defined(PS2) || defined(PSP)
|
||||
#define DEFAULT_MENU_TOGGLE_GAMEPAD_COMBO INPUT_TOGGLE_HOLD_START
|
||||
@@ -734,7 +808,15 @@ static const unsigned input_backtouch_toggle = false;
|
||||
|
||||
#define DEFAULT_OVERLAY_ENABLE_AUTOPREFERRED true
|
||||
|
||||
#define DEFAULT_SHOW_PHYSICAL_INPUTS true
|
||||
#if defined(HAVE_OVERLAY)
|
||||
#if defined(RARCH_MOBILE)
|
||||
#define DEFAULT_OVERLAY_SHOW_INPUTS OVERLAY_SHOW_INPUT_TOUCHED
|
||||
#else
|
||||
#define DEFAULT_OVERLAY_SHOW_INPUTS OVERLAY_SHOW_INPUT_PHYSICAL
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define DEFAULT_OVERLAY_SHOW_INPUTS_PORT 0
|
||||
|
||||
#define DEFAULT_ALL_USERS_CONTROL_MENU false
|
||||
|
||||
@@ -756,6 +838,8 @@ static const unsigned input_backtouch_toggle = false;
|
||||
/* Font size for on-screen messages. */
|
||||
#if defined(DINGUX)
|
||||
#define DEFAULT_FONT_SIZE 12
|
||||
#elif defined(PS2)
|
||||
#define DEFAULT_FONT_SIZE 16
|
||||
#else
|
||||
#define DEFAULT_FONT_SIZE 32
|
||||
#endif
|
||||
@@ -911,7 +995,7 @@ static const bool audio_enable_menu_bgm = false;
|
||||
/* Output samplerate. */
|
||||
#ifdef GEKKO
|
||||
#define DEFAULT_OUTPUT_RATE 32000
|
||||
#elif defined(_3DS)
|
||||
#elif defined(_3DS) || defined(RETROFW)
|
||||
#define DEFAULT_OUTPUT_RATE 32730
|
||||
#else
|
||||
#define DEFAULT_OUTPUT_RATE 48000
|
||||
@@ -922,7 +1006,7 @@ static const bool audio_enable_menu_bgm = false;
|
||||
|
||||
/* Desired audio latency in milliseconds. Might not be honored
|
||||
* if driver can't provide given latency. */
|
||||
#if defined(ANDROID) || defined(EMSCRIPTEN)
|
||||
#if defined(ANDROID) || defined(EMSCRIPTEN) || defined(RETROFW)
|
||||
/* For most Android devices, 64ms is way too low. */
|
||||
#define DEFAULT_OUT_LATENCY 128
|
||||
#else
|
||||
@@ -995,6 +1079,13 @@ static const bool audio_enable_menu_bgm = false;
|
||||
/* When set, all enabled cheats are auto-applied when a game is loaded. */
|
||||
#define DEFAULT_APPLY_CHEATS_AFTER_LOAD false
|
||||
|
||||
|
||||
#if defined(RETROFW)
|
||||
/*RETROFW jz4760 has signficant slowdown with default settings */
|
||||
#define DEFAULT_REWIND_BUFFER_SIZE (1 << 20)
|
||||
#define DEFAULT_REWIND_BUFFER_SIZE_STEP 1
|
||||
#define DEFAULT_REWIND_GRANULARITY 6
|
||||
#else
|
||||
/* The buffer size for the rewind buffer. This needs to be about
|
||||
* 15-20MB per minute. Very game dependant. */
|
||||
#define DEFAULT_REWIND_BUFFER_SIZE (20 << 20) /* 20MiB */
|
||||
@@ -1004,9 +1095,9 @@ static const bool audio_enable_menu_bgm = false;
|
||||
|
||||
/* How many frames to rewind at a time. */
|
||||
#define DEFAULT_REWIND_GRANULARITY 1
|
||||
|
||||
#endif
|
||||
/* Pause gameplay when gameplay loses focus. */
|
||||
#ifdef EMSCRIPTEN
|
||||
#if defined(EMSCRIPTEN) || defined(WEBOS)
|
||||
#define DEFAULT_PAUSE_NONACTIVE false
|
||||
#else
|
||||
#define DEFAULT_PAUSE_NONACTIVE true
|
||||
@@ -1185,6 +1276,10 @@ static const int default_content_favorites_size = 200;
|
||||
#define DEFAULT_PLAYLIST_SHOW_SUBLABELS true
|
||||
#endif
|
||||
|
||||
/* Show the indices of playlist entries in
|
||||
* a menu-driver-specific fashion */
|
||||
#define DEFAULT_PLAYLIST_SHOW_ENTRY_IDX true
|
||||
|
||||
#define DEFAULT_PLAYLIST_FUZZY_ARCHIVE_MATCH false
|
||||
|
||||
#define DEFAULT_PLAYLIST_PORTABLE_PATHS false
|
||||
@@ -1284,6 +1379,14 @@ static const unsigned menu_left_thumbnails_default = 0;
|
||||
static const unsigned gfx_thumbnail_upscale_threshold = 0;
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
#if defined(RS90)
|
||||
/* The RS-90 has a hardware clock that is neither
|
||||
* configurable nor persistent, rendering it useless.
|
||||
* We therefore hide it in the menu by default. */
|
||||
#define DEFAULT_MENU_TIMEDATE_ENABLE false
|
||||
#else
|
||||
#define DEFAULT_MENU_TIMEDATE_ENABLE true
|
||||
#endif
|
||||
#define DEFAULT_MENU_TIMEDATE_STYLE MENU_TIMEDATE_STYLE_DDMM_HM
|
||||
#define DEFAULT_MENU_TIMEDATE_DATE_SEPARATOR MENU_TIMEDATE_DATE_SEPARATOR_HYPHEN
|
||||
#endif
|
||||
|
||||
@@ -195,7 +195,7 @@ static const struct retro_keybind retro_keybinds_1[] = {
|
||||
NULL, NULL,
|
||||
AXIS_NONE, AXIS_NONE, AXIS_NONE,
|
||||
MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_TRIGGER, RETROK_UNKNOWN,
|
||||
RARCH_LIGHTGUN_TRIGGER, NO_BTN, NO_BTN, 0,
|
||||
RARCH_LIGHTGUN_TRIGGER, RETRO_DEVICE_ID_MOUSE_LEFT, NO_BTN, 0,
|
||||
true
|
||||
},
|
||||
{
|
||||
@@ -750,7 +750,7 @@ static const struct retro_keybind retro_keybinds_1[] = {
|
||||
NULL, NULL,
|
||||
AXIS_NONE, AXIS_NONE, AXIS_NONE,
|
||||
MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_TRIGGER, RETROK_UNKNOWN,
|
||||
RARCH_LIGHTGUN_TRIGGER, NO_BTN, NO_BTN, 0,
|
||||
RARCH_LIGHTGUN_TRIGGER, RETRO_DEVICE_ID_MOUSE_LEFT, NO_BTN, 0,
|
||||
true
|
||||
},
|
||||
{
|
||||
@@ -1304,7 +1304,7 @@ static const struct retro_keybind retro_keybinds_1[] = {
|
||||
NULL, NULL,
|
||||
AXIS_NONE, AXIS_NONE, AXIS_NONE,
|
||||
MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_TRIGGER, RETROK_UNKNOWN,
|
||||
RARCH_LIGHTGUN_TRIGGER, NO_BTN, NO_BTN, 0,
|
||||
RARCH_LIGHTGUN_TRIGGER, RETRO_DEVICE_ID_MOUSE_LEFT, NO_BTN, 0,
|
||||
true
|
||||
},
|
||||
{
|
||||
@@ -1872,7 +1872,7 @@ static const struct retro_keybind retro_keybinds_rest[] = {
|
||||
NULL, NULL,
|
||||
AXIS_NONE, AXIS_NONE, AXIS_NONE,
|
||||
MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_TRIGGER, RETROK_UNKNOWN,
|
||||
RARCH_LIGHTGUN_TRIGGER, NO_BTN, NO_BTN, 0,
|
||||
RARCH_LIGHTGUN_TRIGGER, RETRO_DEVICE_ID_MOUSE_LEFT, NO_BTN, 0,
|
||||
true
|
||||
},
|
||||
{
|
||||
|
||||
@@ -350,6 +350,12 @@
|
||||
#define SUPPORTS_CORETEXT false
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CHECK
|
||||
#define SUPPORTS_CHECK true
|
||||
#else
|
||||
#define SUPPORTS_CHECK false
|
||||
#endif
|
||||
|
||||
#if !defined(_WIN32) && !defined(GLOBAL_CONFIG_DIR)
|
||||
#if defined(__HAIKU__)
|
||||
#define GLOBAL_CONFIG_DIR "/system/settings"
|
||||
|
||||
+189
-51
@@ -45,7 +45,6 @@
|
||||
#include "paths.h"
|
||||
#include "retroarch.h"
|
||||
#include "verbosity.h"
|
||||
#include "lakka.h"
|
||||
|
||||
#include "gfx/gfx_animation.h"
|
||||
|
||||
@@ -58,6 +57,12 @@
|
||||
#include "uwp/uwp_func.h"
|
||||
#endif
|
||||
|
||||
#include "lakka.h"
|
||||
|
||||
#if defined(HAVE_LAKKA) || defined(HAVE_LIBNX)
|
||||
#include "switch_performance_profiles.h"
|
||||
#endif
|
||||
|
||||
enum video_driver_enum
|
||||
{
|
||||
VIDEO_GL = 0,
|
||||
@@ -70,6 +75,7 @@ enum video_driver_enum
|
||||
VIDEO_SDL,
|
||||
VIDEO_SDL2,
|
||||
VIDEO_SDL_DINGUX,
|
||||
VIDEO_SDL_RS90,
|
||||
VIDEO_EXT,
|
||||
VIDEO_WII,
|
||||
VIDEO_WIIU,
|
||||
@@ -93,6 +99,7 @@ enum video_driver_enum
|
||||
VIDEO_GDI,
|
||||
VIDEO_VGA,
|
||||
VIDEO_FPGA,
|
||||
VIDEO_RSX,
|
||||
VIDEO_NULL
|
||||
};
|
||||
|
||||
@@ -212,6 +219,7 @@ enum bluetooth_driver_enum
|
||||
enum wifi_driver_enum
|
||||
{
|
||||
WIFI_CONNMANCTL = BLUETOOTH_NULL + 1,
|
||||
WIFI_NMCLI,
|
||||
WIFI_NULL
|
||||
};
|
||||
|
||||
@@ -258,6 +266,9 @@ static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_GL;
|
||||
#else
|
||||
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_METAL;
|
||||
#endif
|
||||
#elif defined(__WINRT__) || defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
|
||||
/* Lets default to D3D11 in UWP, even when its compiled with ANGLE, since ANGLE is just calling D3D anyway.*/
|
||||
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_D3D11;
|
||||
#elif defined(HAVE_OPENGL1) && defined(_MSC_VER) && (_MSC_VER <= 1600)
|
||||
/* On Windows XP and earlier, use gl1 by default
|
||||
* (regular opengl has compatibility issues with
|
||||
@@ -306,7 +317,11 @@ static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_SDL;
|
||||
#elif defined(HAVE_SDL2)
|
||||
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_SDL2;
|
||||
#elif defined(HAVE_SDL_DINGUX)
|
||||
#if defined(RS90)
|
||||
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_SDL_RS90;
|
||||
#else
|
||||
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_SDL_DINGUX;
|
||||
#endif
|
||||
#elif defined(_WIN32) && !defined(_XBOX)
|
||||
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_GDI;
|
||||
#elif defined(DJGPP)
|
||||
@@ -315,6 +330,8 @@ static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_VGA;
|
||||
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_FPGA;
|
||||
#elif defined(HAVE_DYLIB) && !defined(ANDROID)
|
||||
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_EXT;
|
||||
#elif defined(__PSL1GHT__)
|
||||
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_RSX;
|
||||
#else
|
||||
static const enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_NULL;
|
||||
#endif
|
||||
@@ -335,9 +352,13 @@ static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_PS3;
|
||||
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_CTR;
|
||||
#elif defined(SWITCH)
|
||||
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_SWITCH;
|
||||
#elif defined(DINGUX_BETA) && defined(HAVE_ALSA)
|
||||
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_ALSA;
|
||||
#elif defined(DINGUX) && defined(HAVE_AL)
|
||||
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_AL;
|
||||
#elif defined(HAVE_PULSE)
|
||||
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_PULSE;
|
||||
#elif defined(HAVE_ALSA) && defined(HAVE_VIDEOCORE)
|
||||
#elif defined(HAVE_ALSA) && defined(HAVE_THREADS)
|
||||
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_ALSATHREAD;
|
||||
#elif defined(HAVE_ALSA)
|
||||
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_ALSA;
|
||||
@@ -379,7 +400,9 @@ static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_EXT;
|
||||
static const enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_NULL;
|
||||
#endif
|
||||
|
||||
#if defined(PSP) || defined(EMSCRIPTEN)
|
||||
#if defined(RS90)
|
||||
static const enum audio_resampler_driver_enum AUDIO_DEFAULT_RESAMPLER_DRIVER = AUDIO_RESAMPLER_NEAREST;
|
||||
#elif defined(PSP) || defined(EMSCRIPTEN)
|
||||
static const enum audio_resampler_driver_enum AUDIO_DEFAULT_RESAMPLER_DRIVER = AUDIO_RESAMPLER_CC;
|
||||
#else
|
||||
static const enum audio_resampler_driver_enum AUDIO_DEFAULT_RESAMPLER_DRIVER = AUDIO_RESAMPLER_SINC;
|
||||
@@ -393,7 +416,7 @@ static const enum record_driver_enum RECORD_DEFAULT_DRIVER = RECORD_NULL;
|
||||
|
||||
#ifdef HAVE_WINMM
|
||||
static const enum midi_driver_enum MIDI_DEFAULT_DRIVER = MIDI_WINMM;
|
||||
#elif defined(HAVE_ALSA) && !defined(HAVE_HAKCHI) && !defined(HAVE_SEGAM)
|
||||
#elif defined(HAVE_ALSA) && !defined(HAVE_HAKCHI) && !defined(HAVE_SEGAM) && !defined(DINGUX)
|
||||
static const enum midi_driver_enum MIDI_DEFAULT_DRIVER = MIDI_ALSA;
|
||||
#else
|
||||
static const enum midi_driver_enum MIDI_DEFAULT_DRIVER = MIDI_NULL;
|
||||
@@ -409,6 +432,8 @@ static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_XINPUT;
|
||||
static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_ANDROID;
|
||||
#elif defined(EMSCRIPTEN) && defined(HAVE_SDL2)
|
||||
static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_SDL2;
|
||||
#elif defined(WEBOS) && defined(HAVE_SDL2)
|
||||
static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_SDL2;
|
||||
#elif defined(EMSCRIPTEN)
|
||||
static const enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_RWEBINPUT;
|
||||
#elif defined(_WIN32) && defined(HAVE_DINPUT)
|
||||
@@ -461,11 +486,13 @@ static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_XINPUT;
|
||||
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_GX;
|
||||
#elif defined(WIIU)
|
||||
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_WIIU;
|
||||
#elif defined(WEBOS)
|
||||
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_SDL;
|
||||
#elif defined(_XBOX)
|
||||
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_XDK;
|
||||
#elif defined(PS2)
|
||||
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_PS2;
|
||||
#elif defined(__PS3__) && !defined(__PSL1GHT__)
|
||||
#elif defined(__PS3__) || defined(__PSL1GHT__)
|
||||
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_PS3;
|
||||
#elif defined(ORBIS)
|
||||
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_PS4;
|
||||
@@ -843,6 +870,8 @@ const char *config_get_default_video(void)
|
||||
return "xvideo";
|
||||
case VIDEO_SDL_DINGUX:
|
||||
return "sdl_dingux";
|
||||
case VIDEO_SDL_RS90:
|
||||
return "sdl_rs90";
|
||||
case VIDEO_SDL:
|
||||
return "sdl";
|
||||
case VIDEO_SDL2:
|
||||
@@ -867,6 +896,8 @@ const char *config_get_default_video(void)
|
||||
return "vga";
|
||||
case VIDEO_FPGA:
|
||||
return "fpga";
|
||||
case VIDEO_RSX:
|
||||
return "rsx";
|
||||
case VIDEO_NULL:
|
||||
break;
|
||||
}
|
||||
@@ -1085,6 +1116,8 @@ const char *config_get_default_wifi(void)
|
||||
{
|
||||
case WIFI_CONNMANCTL:
|
||||
return "connmanctl";
|
||||
case WIFI_NMCLI:
|
||||
return "nmcli";
|
||||
case WIFI_NULL:
|
||||
break;
|
||||
}
|
||||
@@ -1279,6 +1312,10 @@ static struct config_array_setting *populate_settings_array(settings_t *settings
|
||||
SETTING_ARRAY("discord_app_id", settings->arrays.discord_app_id, true, DEFAULT_DISCORD_APP_ID, true);
|
||||
SETTING_ARRAY("ai_service_url", settings->arrays.ai_service_url, true, DEFAULT_AI_SERVICE_URL, true);
|
||||
SETTING_ARRAY("crt_switch_timings", settings->arrays.crt_switch_timings, false, NULL, true);
|
||||
#ifdef HAVE_LAKKA
|
||||
SETTING_ARRAY("cpu_main_gov", settings->arrays.cpu_main_gov, false, NULL, true);
|
||||
SETTING_ARRAY("cpu_menu_gov", settings->arrays.cpu_menu_gov, false, NULL, true);
|
||||
#endif
|
||||
|
||||
*size = count;
|
||||
|
||||
@@ -1448,6 +1485,7 @@ static struct config_bool_setting *populate_settings_bool(
|
||||
SETTING_BOOL("frame_time_counter_reset_after_load_state", &settings->bools.frame_time_counter_reset_after_load_state, true, false, false);
|
||||
SETTING_BOOL("frame_time_counter_reset_after_save_state", &settings->bools.frame_time_counter_reset_after_save_state, true, false, false);
|
||||
SETTING_BOOL("crt_switch_resolution_use_custom_refresh_rate", &settings->bools.crt_switch_custom_refresh_enable, true, false, false);
|
||||
SETTING_BOOL("crt_switch_hires_menu", &settings->bools.crt_switch_hires_menu, true, false, true);
|
||||
SETTING_BOOL("ui_companion_start_on_boot", &settings->bools.ui_companion_start_on_boot, true, ui_companion_start_on_boot, false);
|
||||
SETTING_BOOL("ui_companion_enable", &settings->bools.ui_companion_enable, true, ui_companion_enable, false);
|
||||
SETTING_BOOL("ui_companion_toggle", &settings->bools.ui_companion_toggle, false, ui_companion_toggle, false);
|
||||
@@ -1485,6 +1523,12 @@ static struct config_bool_setting *populate_settings_bool(
|
||||
SETTING_BOOL("input_descriptor_hide_unbound", &settings->bools.input_descriptor_hide_unbound, true, input_descriptor_hide_unbound, false);
|
||||
SETTING_BOOL("load_dummy_on_core_shutdown", &settings->bools.load_dummy_on_core_shutdown, true, DEFAULT_LOAD_DUMMY_ON_CORE_SHUTDOWN, false);
|
||||
SETTING_BOOL("check_firmware_before_loading", &settings->bools.check_firmware_before_loading, true, DEFAULT_CHECK_FIRMWARE_BEFORE_LOADING, false);
|
||||
SETTING_BOOL("core_option_category_enable", &settings->bools.core_option_category_enable, true, DEFAULT_CORE_OPTION_CATEGORY_ENABLE, false);
|
||||
#if defined(__WINRT__) || defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
|
||||
SETTING_BOOL("core_info_cache_enable", &settings->bools.core_info_cache_enable, false, DEFAULT_CORE_INFO_CACHE_ENABLE, false);
|
||||
#else
|
||||
SETTING_BOOL("core_info_cache_enable", &settings->bools.core_info_cache_enable, true, DEFAULT_CORE_INFO_CACHE_ENABLE, false);
|
||||
#endif
|
||||
#ifndef HAVE_DYNAMIC
|
||||
SETTING_BOOL("always_reload_core_on_run_content", &settings->bools.always_reload_core_on_run_content, true, DEFAULT_ALWAYS_RELOAD_CORE_ON_RUN_CONTENT, false);
|
||||
#endif
|
||||
@@ -1516,6 +1560,7 @@ static struct config_bool_setting *populate_settings_bool(
|
||||
SETTING_BOOL("video_windowed_fullscreen", &settings->bools.video_windowed_fullscreen, true, DEFAULT_WINDOWED_FULLSCREEN, false);
|
||||
SETTING_BOOL("video_crop_overscan", &settings->bools.video_crop_overscan, true, DEFAULT_CROP_OVERSCAN, false);
|
||||
SETTING_BOOL("video_scale_integer", &settings->bools.video_scale_integer, true, DEFAULT_SCALE_INTEGER, false);
|
||||
SETTING_BOOL("video_scale_integer_overscale", &settings->bools.video_scale_integer_overscale, true, DEFAULT_SCALE_INTEGER_OVERSCALE, false);
|
||||
SETTING_BOOL("video_smooth", &settings->bools.video_smooth, true, DEFAULT_VIDEO_SMOOTH, false);
|
||||
SETTING_BOOL("video_ctx_scaling", &settings->bools.video_ctx_scaling, true, DEFAULT_VIDEO_CTX_SCALING, false);
|
||||
SETTING_BOOL("video_force_aspect", &settings->bools.video_force_aspect, true, DEFAULT_FORCE_ASPECT, false);
|
||||
@@ -1593,7 +1638,7 @@ static struct config_bool_setting *populate_settings_bool(
|
||||
SETTING_BOOL("menu_insert_disk_resume", &settings->bools.menu_insert_disk_resume, true, DEFAULT_MENU_INSERT_DISK_RESUME, false);
|
||||
SETTING_BOOL("menu_mouse_enable", &settings->bools.menu_mouse_enable, true, DEFAULT_MOUSE_ENABLE, false);
|
||||
SETTING_BOOL("menu_pointer_enable", &settings->bools.menu_pointer_enable, true, DEFAULT_POINTER_ENABLE, false);
|
||||
SETTING_BOOL("menu_timedate_enable", &settings->bools.menu_timedate_enable, true, true, false);
|
||||
SETTING_BOOL("menu_timedate_enable", &settings->bools.menu_timedate_enable, true, DEFAULT_MENU_TIMEDATE_ENABLE, false);
|
||||
SETTING_BOOL("menu_battery_level_enable", &settings->bools.menu_battery_level_enable, true, true, false);
|
||||
SETTING_BOOL("menu_core_enable", &settings->bools.menu_core_enable, true, true, false);
|
||||
SETTING_BOOL("menu_show_sublabels", &settings->bools.menu_show_sublabels, true, menu_show_sublabels, false);
|
||||
@@ -1638,6 +1683,7 @@ static struct config_bool_setting *populate_settings_bool(
|
||||
SETTING_BOOL("quick_menu_show_set_core_association", &settings->bools.quick_menu_show_set_core_association, true, quick_menu_show_set_core_association, false);
|
||||
SETTING_BOOL("quick_menu_show_reset_core_association", &settings->bools.quick_menu_show_reset_core_association, true, quick_menu_show_reset_core_association, false);
|
||||
SETTING_BOOL("quick_menu_show_options", &settings->bools.quick_menu_show_options, true, quick_menu_show_options, false);
|
||||
SETTING_BOOL("quick_menu_show_core_options_flush", &settings->bools.quick_menu_show_core_options_flush, true, DEFAULT_QUICK_MENU_SHOW_CORE_OPTIONS_FLUSH, false);
|
||||
SETTING_BOOL("quick_menu_show_controls", &settings->bools.quick_menu_show_controls, true, quick_menu_show_controls, false);
|
||||
SETTING_BOOL("quick_menu_show_cheats", &settings->bools.quick_menu_show_cheats, true, quick_menu_show_cheats, false);
|
||||
SETTING_BOOL("quick_menu_show_shaders", &settings->bools.quick_menu_show_shaders, true, quick_menu_show_shaders, false);
|
||||
@@ -1726,6 +1772,7 @@ static struct config_bool_setting *populate_settings_bool(
|
||||
SETTING_BOOL("cheevos_enable", &settings->bools.cheevos_enable, true, DEFAULT_CHEEVOS_ENABLE, false);
|
||||
SETTING_BOOL("cheevos_test_unofficial", &settings->bools.cheevos_test_unofficial, true, false, false);
|
||||
SETTING_BOOL("cheevos_hardcore_mode_enable", &settings->bools.cheevos_hardcore_mode_enable, true, false, false);
|
||||
SETTING_BOOL("cheevos_challenge_indicators", &settings->bools.cheevos_challenge_indicators, true, true, false);
|
||||
SETTING_BOOL("cheevos_richpresence_enable", &settings->bools.cheevos_richpresence_enable, true, true, false);
|
||||
SETTING_BOOL("cheevos_unlock_sound_enable", &settings->bools.cheevos_unlock_sound_enable, true, false, false);
|
||||
SETTING_BOOL("cheevos_verbose_enable", &settings->bools.cheevos_verbose_enable, true, false, false);
|
||||
@@ -1736,7 +1783,6 @@ static struct config_bool_setting *populate_settings_bool(
|
||||
#ifdef HAVE_OVERLAY
|
||||
SETTING_BOOL("input_overlay_enable", &settings->bools.input_overlay_enable, true, config_overlay_enable_default(), false);
|
||||
SETTING_BOOL("input_overlay_enable_autopreferred", &settings->bools.input_overlay_enable_autopreferred, true, DEFAULT_OVERLAY_ENABLE_AUTOPREFERRED, false);
|
||||
SETTING_BOOL("input_overlay_show_physical_inputs", &settings->bools.input_overlay_show_physical_inputs, true, DEFAULT_SHOW_PHYSICAL_INPUTS, false);
|
||||
SETTING_BOOL("input_overlay_hide_in_menu", &settings->bools.input_overlay_hide_in_menu, true, DEFAULT_OVERLAY_HIDE_IN_MENU, false);
|
||||
SETTING_BOOL("input_overlay_hide_when_gamepad_connected", &settings->bools.input_overlay_hide_when_gamepad_connected, true, DEFAULT_OVERLAY_HIDE_WHEN_GAMEPAD_CONNECTED, false);
|
||||
SETTING_BOOL("input_overlay_show_mouse_cursor", &settings->bools.input_overlay_show_mouse_cursor, true, DEFAULT_OVERLAY_SHOW_MOUSE_CURSOR, false);
|
||||
@@ -1780,6 +1826,7 @@ static struct config_bool_setting *populate_settings_bool(
|
||||
SETTING_BOOL("show_hidden_files", &settings->bools.show_hidden_files, true, DEFAULT_SHOW_HIDDEN_FILES, false);
|
||||
SETTING_BOOL("use_last_start_directory", &settings->bools.use_last_start_directory, true, DEFAULT_USE_LAST_START_DIRECTORY, false);
|
||||
SETTING_BOOL("input_autodetect_enable", &settings->bools.input_autodetect_enable, true, input_autodetect_enable, false);
|
||||
SETTING_BOOL("input_auto_mouse_grab", &settings->bools.input_auto_mouse_grab, true, false, false);
|
||||
#if defined(HAVE_DINPUT) || defined(HAVE_WINRAWINPUT)
|
||||
SETTING_BOOL("input_nowinkey_enable", &settings->bools.input_nowinkey_enable, true, false, false);
|
||||
#endif
|
||||
@@ -1797,7 +1844,8 @@ static struct config_bool_setting *populate_settings_bool(
|
||||
|
||||
SETTING_BOOL("video_msg_bgcolor_enable", &settings->bools.video_msg_bgcolor_enable, true, message_bgcolor_enable, false);
|
||||
SETTING_BOOL("video_window_show_decorations", &settings->bools.video_window_show_decorations, true, DEFAULT_WINDOW_DECORATIONS, false);
|
||||
SETTING_BOOL("video_window_save_positions", &settings->bools.video_window_save_positions, true, false, false);
|
||||
SETTING_BOOL("video_window_save_positions", &settings->bools.video_window_save_positions, true, DEFAULT_WINDOW_SAVE_POSITIONS, false);
|
||||
SETTING_BOOL("video_window_custom_size_enable", &settings->bools.video_window_custom_size_enable, true, DEFAULT_WINDOW_CUSTOM_SIZE_ENABLE, false);
|
||||
|
||||
SETTING_BOOL("sustained_performance_mode", &settings->bools.sustained_performance_mode, true, sustained_performance_mode, false);
|
||||
|
||||
@@ -1810,6 +1858,7 @@ static struct config_bool_setting *populate_settings_bool(
|
||||
SETTING_BOOL("content_runtime_log", &settings->bools.content_runtime_log, true, DEFAULT_CONTENT_RUNTIME_LOG, false);
|
||||
SETTING_BOOL("content_runtime_log_aggregate", &settings->bools.content_runtime_log_aggregate, true, DEFAULT_CONTENT_RUNTIME_LOG_AGGREGATE, false);
|
||||
SETTING_BOOL("playlist_show_sublabels", &settings->bools.playlist_show_sublabels, true, DEFAULT_PLAYLIST_SHOW_SUBLABELS, false);
|
||||
SETTING_BOOL("playlist_show_entry_idx", &settings->bools.playlist_show_entry_idx, true, DEFAULT_PLAYLIST_SHOW_ENTRY_IDX, false);
|
||||
SETTING_BOOL("playlist_sort_alphabetical", &settings->bools.playlist_sort_alphabetical, true, DEFAULT_PLAYLIST_SORT_ALPHABETICAL, false);
|
||||
SETTING_BOOL("playlist_fuzzy_archive_match", &settings->bools.playlist_fuzzy_archive_match, true, DEFAULT_PLAYLIST_FUZZY_ARCHIVE_MATCH, false);
|
||||
SETTING_BOOL("playlist_portable_paths", &settings->bools.playlist_portable_paths, true, DEFAULT_PLAYLIST_PORTABLE_PATHS, false);
|
||||
@@ -1891,7 +1940,7 @@ static struct config_float_setting *populate_settings_float(
|
||||
SETTING_FLOAT("video_font_size", &settings->floats.video_font_size, true, DEFAULT_FONT_SIZE, false);
|
||||
SETTING_FLOAT("fastforward_ratio", &settings->floats.fastforward_ratio, true, DEFAULT_FASTFORWARD_RATIO, false);
|
||||
SETTING_FLOAT("slowmotion_ratio", &settings->floats.slowmotion_ratio, true, DEFAULT_SLOWMOTION_RATIO, false);
|
||||
SETTING_FLOAT("input_axis_threshold", input_driver_get_float(INPUT_ACTION_AXIS_THRESHOLD), true, DEFAULT_AXIS_THRESHOLD, false);
|
||||
SETTING_FLOAT("input_axis_threshold", &settings->floats.input_axis_threshold, true, DEFAULT_AXIS_THRESHOLD, false);
|
||||
SETTING_FLOAT("input_analog_deadzone", &settings->floats.input_analog_deadzone, true, DEFAULT_ANALOG_DEADZONE, false);
|
||||
SETTING_FLOAT("input_analog_sensitivity", &settings->floats.input_analog_sensitivity, true, DEFAULT_ANALOG_SENSITIVITY, false);
|
||||
SETTING_FLOAT("video_msg_bgcolor_opacity", &settings->floats.video_msg_bgcolor_opacity, true, message_bgcolor_opacity, false);
|
||||
@@ -1922,7 +1971,7 @@ static struct config_uint_setting *populate_settings_uint(
|
||||
SETTING_UINT("input_duty_cycle", &settings->uints.input_turbo_duty_cycle, true, turbo_duty_cycle, false);
|
||||
SETTING_UINT("input_turbo_mode", &settings->uints.input_turbo_mode, true, turbo_mode, false);
|
||||
SETTING_UINT("input_turbo_default_button", &settings->uints.input_turbo_default_button, true, turbo_default_btn, false);
|
||||
SETTING_UINT("input_max_users", input_driver_get_uint(INPUT_ACTION_MAX_USERS), true, input_max_users, false);
|
||||
SETTING_UINT("input_max_users", &settings->uints.input_max_users, true, input_max_users, false);
|
||||
SETTING_UINT("fps_update_interval", &settings->uints.fps_update_interval, true, DEFAULT_FPS_UPDATE_INTERVAL, false);
|
||||
SETTING_UINT("memory_update_interval", &settings->uints.memory_update_interval, true, DEFAULT_MEMORY_UPDATE_INTERVAL, false);
|
||||
SETTING_UINT("input_menu_toggle_gamepad_combo", &settings->uints.input_menu_toggle_gamepad_combo, true, DEFAULT_MENU_TOGGLE_GAMEPAD_COMBO, false);
|
||||
@@ -2023,7 +2072,7 @@ static struct config_uint_setting *populate_settings_uint(
|
||||
SETTING_UINT("ozone_menu_color_theme", &settings->uints.menu_ozone_color_theme, true, DEFAULT_OZONE_COLOR_THEME, false);
|
||||
#endif
|
||||
#endif
|
||||
SETTING_UINT("audio_out_rate", &settings->uints.audio_out_rate, true, DEFAULT_OUTPUT_RATE, false);
|
||||
SETTING_UINT("audio_out_rate", &settings->uints.audio_output_sample_rate, true, DEFAULT_OUTPUT_RATE, false);
|
||||
SETTING_UINT("custom_viewport_width", &settings->video_viewport_custom.width, false, 0 /* TODO */, false);
|
||||
SETTING_UINT("crt_switch_resolution_super", &settings->uints.crt_switch_resolution_super, true, DEFAULT_CRT_SWITCH_RESOLUTION_SUPER, false);
|
||||
SETTING_UINT("custom_viewport_height", &settings->video_viewport_custom.height, false, 0 /* TODO */, false);
|
||||
@@ -2060,7 +2109,12 @@ static struct config_uint_setting *populate_settings_uint(
|
||||
SETTING_UINT("bundle_assets_extract_version_current", &settings->uints.bundle_assets_extract_version_current, true, 0, false);
|
||||
#endif
|
||||
SETTING_UINT("bundle_assets_extract_last_version", &settings->uints.bundle_assets_extract_last_version, true, 0, false);
|
||||
SETTING_UINT("input_overlay_show_physical_inputs_port", &settings->uints.input_overlay_show_physical_inputs_port, true, 0, false);
|
||||
|
||||
#if defined(HAVE_OVERLAY)
|
||||
SETTING_UINT("input_overlay_show_inputs", &settings->uints.input_overlay_show_inputs, true, DEFAULT_OVERLAY_SHOW_INPUTS, false);
|
||||
SETTING_UINT("input_overlay_show_inputs_port", &settings->uints.input_overlay_show_inputs_port, true, DEFAULT_OVERLAY_SHOW_INPUTS_PORT, false);
|
||||
#endif
|
||||
|
||||
SETTING_UINT("video_msg_bgcolor_red", &settings->uints.video_msg_bgcolor_red, true, message_bgcolor_red, false);
|
||||
SETTING_UINT("video_msg_bgcolor_green", &settings->uints.video_msg_bgcolor_green, true, message_bgcolor_green, false);
|
||||
SETTING_UINT("video_msg_bgcolor_blue", &settings->uints.video_msg_bgcolor_blue, true, message_bgcolor_blue, false);
|
||||
@@ -2076,8 +2130,10 @@ static struct config_uint_setting *populate_settings_uint(
|
||||
SETTING_UINT("video_stream_scale_factor", &settings->uints.video_stream_scale_factor, true, 1, false);
|
||||
SETTING_UINT("video_windowed_position_x", &settings->uints.window_position_x, true, 0, false);
|
||||
SETTING_UINT("video_windowed_position_y", &settings->uints.window_position_y, true, 0, false);
|
||||
SETTING_UINT("video_windowed_position_width", &settings->uints.window_position_width, true, DEFAULT_WINDOW_WIDTH, false);
|
||||
SETTING_UINT("video_windowed_position_height", &settings->uints.window_position_height, true, DEFAULT_WINDOW_HEIGHT, false);
|
||||
SETTING_UINT("video_windowed_position_width", &settings->uints.window_position_width, true, DEFAULT_WINDOW_WIDTH, false);
|
||||
SETTING_UINT("video_windowed_position_height", &settings->uints.window_position_height, true, DEFAULT_WINDOW_HEIGHT, false);
|
||||
SETTING_UINT("video_window_auto_width_max", &settings->uints.window_auto_width_max, true, DEFAULT_WINDOW_AUTO_WIDTH_MAX, false);
|
||||
SETTING_UINT("video_window_auto_height_max", &settings->uints.window_auto_height_max, true, DEFAULT_WINDOW_AUTO_HEIGHT_MAX, false);
|
||||
SETTING_UINT("ai_service_mode", &settings->uints.ai_service_mode, true, DEFAULT_AI_SERVICE_MODE, false);
|
||||
SETTING_UINT("ai_service_target_lang", &settings->uints.ai_service_target_lang, true, 0, false);
|
||||
SETTING_UINT("ai_service_source_lang", &settings->uints.ai_service_source_lang, true, 0, false);
|
||||
@@ -2097,6 +2153,9 @@ static struct config_uint_setting *populate_settings_uint(
|
||||
#if defined(DINGUX_BETA)
|
||||
SETTING_UINT("video_dingux_refresh_rate", &settings->uints.video_dingux_refresh_rate, true, DEFAULT_DINGUX_REFRESH_RATE, false);
|
||||
#endif
|
||||
#if defined(RS90)
|
||||
SETTING_UINT("video_dingux_rs90_softfilter_type", &settings->uints.video_dingux_rs90_softfilter_type, true, DEFAULT_DINGUX_RS90_SOFTFILTER_TYPE, false);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
@@ -2112,6 +2171,12 @@ static struct config_uint_setting *populate_settings_uint(
|
||||
|
||||
SETTING_UINT("video_black_frame_insertion", &settings->uints.video_black_frame_insertion, true, DEFAULT_BLACK_FRAME_INSERTION, false);
|
||||
|
||||
#ifdef HAVE_LAKKA
|
||||
SETTING_UINT("cpu_scaling_mode", &settings->uints.cpu_scaling_mode, true, 0, false);
|
||||
SETTING_UINT("cpu_min_freq", &settings->uints.cpu_min_freq, true, 1, false);
|
||||
SETTING_UINT("cpu_max_freq", &settings->uints.cpu_max_freq, true, ~0U, false);
|
||||
#endif
|
||||
|
||||
*size = count;
|
||||
|
||||
return tmp;
|
||||
@@ -2406,10 +2471,8 @@ void config_set_defaults(void *data)
|
||||
#endif
|
||||
|
||||
input_config_reset();
|
||||
#ifdef HAVE_CONFIGFILE
|
||||
input_remapping_deinit();
|
||||
input_remapping_set_defaults();
|
||||
#endif
|
||||
input_remapping_set_defaults(false);
|
||||
|
||||
/* Verify that binds are in proper order. */
|
||||
for (i = 0; i < MAX_USERS; i++)
|
||||
@@ -2432,14 +2495,14 @@ void config_set_defaults(void *data)
|
||||
|
||||
for (i = 0; i < MAX_USERS; i++)
|
||||
{
|
||||
settings->uints.input_joypad_map[i] = i;
|
||||
settings->uints.input_joypad_index[i] = i;
|
||||
#ifdef SWITCH /* Switch prefered default dpad mode */
|
||||
settings->uints.input_analog_dpad_mode[i] = ANALOG_DPAD_LSTICK;
|
||||
#else
|
||||
settings->uints.input_analog_dpad_mode[i] = ANALOG_DPAD_NONE;
|
||||
#endif
|
||||
input_config_set_device(i, RETRO_DEVICE_JOYPAD);
|
||||
settings->uints.input_mouse_index[i] = 0;
|
||||
settings->uints.input_mouse_index[i] = i;
|
||||
}
|
||||
|
||||
video_driver_reset_custom_viewport();
|
||||
@@ -3023,6 +3086,7 @@ static bool config_load_file(global_t *global,
|
||||
bool ret = false;
|
||||
unsigned tmp_uint = 0;
|
||||
bool tmp_bool = false;
|
||||
static bool first_load = true;
|
||||
unsigned msg_color = 0;
|
||||
char *save = NULL;
|
||||
char *override_username = NULL;
|
||||
@@ -3114,13 +3178,24 @@ static bool config_load_file(global_t *global,
|
||||
settings->bools.network_remote_enable_user[i], tmp_bool);
|
||||
}
|
||||
#endif
|
||||
if (config_get_bool(conf, "log_verbosity", &tmp_bool))
|
||||
/* Set verbosity according to config only if the 'v' command line argument was not used
|
||||
* or if it is not the first config load. */
|
||||
if (config_get_bool(conf, "log_verbosity", &tmp_bool) &&
|
||||
(!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_VERBOSITY, NULL) ||
|
||||
!first_load))
|
||||
{
|
||||
if (tmp_bool)
|
||||
verbosity_enable();
|
||||
else
|
||||
verbosity_disable();
|
||||
}
|
||||
/* On first config load, make sure log_to_file is true if 'log-file' command line
|
||||
* argument was used. */
|
||||
if (retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_LOG_TO_FILE, NULL) &&
|
||||
first_load)
|
||||
{
|
||||
configuration_set_bool(settings,settings->bools.log_to_file,true);
|
||||
}
|
||||
if (config_get_uint(conf, "frontend_log_level", &tmp_uint))
|
||||
{
|
||||
verbosity_set_log_level(tmp_uint);
|
||||
@@ -3167,7 +3242,7 @@ static bool config_load_file(global_t *global,
|
||||
buf[0] = '\0';
|
||||
|
||||
snprintf(buf, sizeof(buf), "input_player%u_joypad_index", i + 1);
|
||||
CONFIG_GET_INT_BASE(conf, settings, uints.input_joypad_map[i], buf);
|
||||
CONFIG_GET_INT_BASE(conf, settings, uints.input_joypad_index[i], buf);
|
||||
|
||||
snprintf(buf, sizeof(buf), "input_player%u_analog_dpad_mode", i + 1);
|
||||
CONFIG_GET_INT_BASE(conf, settings, uints.input_analog_dpad_mode[i], buf);
|
||||
@@ -3251,8 +3326,8 @@ static bool config_load_file(global_t *global,
|
||||
if (settings->uints.video_hard_sync_frames > 3)
|
||||
settings->uints.video_hard_sync_frames = 3;
|
||||
|
||||
if (settings->uints.video_frame_delay > 15)
|
||||
settings->uints.video_frame_delay = 15;
|
||||
if (settings->uints.video_frame_delay > MAXIMUM_FRAME_DELAY)
|
||||
settings->uints.video_frame_delay = MAXIMUM_FRAME_DELAY;
|
||||
|
||||
settings->uints.video_swap_interval = MAX(settings->uints.video_swap_interval, 1);
|
||||
settings->uints.video_swap_interval = MIN(settings->uints.video_swap_interval, 4);
|
||||
@@ -3551,6 +3626,7 @@ end:
|
||||
free(path_settings);
|
||||
if (size_settings)
|
||||
free(size_settings);
|
||||
first_load = false;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -3641,20 +3717,23 @@ bool config_load_override(void *data)
|
||||
{
|
||||
char temp_path[PATH_MAX_LENGTH];
|
||||
|
||||
temp_path[0] = '\0';
|
||||
|
||||
RARCH_LOG("[Overrides]: Content dir-specific overrides found at \"%s\".\n",
|
||||
content_path);
|
||||
|
||||
if (should_append)
|
||||
{
|
||||
RARCH_LOG("[Overrides]: Content dir-specific overrides stacking on top of previous overrides.\n");
|
||||
strlcpy(temp_path, path_get(RARCH_PATH_CONFIG_APPEND), sizeof(temp_path));
|
||||
strlcat(temp_path, "|", sizeof(temp_path));
|
||||
strlcat(temp_path, content_path, sizeof(temp_path));
|
||||
snprintf(temp_path, sizeof(temp_path),
|
||||
"%s|%s",
|
||||
path_get(RARCH_PATH_CONFIG_APPEND),
|
||||
content_path
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
temp_path[0] = '\0';
|
||||
strlcpy(temp_path, content_path, sizeof(temp_path));
|
||||
}
|
||||
|
||||
path_set(RARCH_PATH_CONFIG_APPEND, temp_path);
|
||||
|
||||
@@ -3670,20 +3749,23 @@ bool config_load_override(void *data)
|
||||
{
|
||||
char temp_path[PATH_MAX_LENGTH];
|
||||
|
||||
temp_path[0] = '\0';
|
||||
|
||||
RARCH_LOG("[Overrides]: Game-specific overrides found at \"%s\".\n",
|
||||
game_path);
|
||||
|
||||
if (should_append)
|
||||
{
|
||||
RARCH_LOG("[Overrides]: Game-specific overrides stacking on top of previous overrides.\n");
|
||||
strlcpy(temp_path, path_get(RARCH_PATH_CONFIG_APPEND), sizeof(temp_path));
|
||||
strlcat(temp_path, "|", sizeof(temp_path));
|
||||
strlcat(temp_path, game_path, sizeof(temp_path));
|
||||
snprintf(temp_path, sizeof(temp_path),
|
||||
"%s|%s",
|
||||
path_get(RARCH_PATH_CONFIG_APPEND),
|
||||
game_path
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
temp_path[0] = '\0';
|
||||
strlcpy(temp_path, game_path, sizeof(temp_path));
|
||||
}
|
||||
|
||||
path_set(RARCH_PATH_CONFIG_APPEND, temp_path);
|
||||
|
||||
@@ -3821,9 +3903,7 @@ bool config_load_remap(const char *directory_input_remapping,
|
||||
FILE_PATH_REMAP_EXTENSION,
|
||||
sizeof(game_path));
|
||||
|
||||
#ifdef HAVE_CONFIGFILE
|
||||
input_remapping_set_defaults();
|
||||
#endif
|
||||
input_remapping_set_defaults(false);
|
||||
|
||||
/* If a game remap file exists, load it. */
|
||||
if ((new_conf = config_file_new_from_path_to_string(game_path)))
|
||||
@@ -3893,15 +3973,15 @@ success:
|
||||
*/
|
||||
static void config_parse_file(global_t *global)
|
||||
{
|
||||
const char *config_path = path_get(RARCH_PATH_CONFIG);
|
||||
if (path_is_empty(RARCH_PATH_CONFIG))
|
||||
{
|
||||
RARCH_LOG("[Config]: Loading default config.\n");
|
||||
}
|
||||
else
|
||||
RARCH_LOG("[Config]: Loading config from: \"%s\".\n", config_path);
|
||||
|
||||
{
|
||||
const char *config_path = path_get(RARCH_PATH_CONFIG);
|
||||
RARCH_LOG("[Config]: Loading config from: \"%s\".\n", config_path);
|
||||
|
||||
if (!config_load_file(global, config_path, config_get_ptr()))
|
||||
{
|
||||
RARCH_ERR("[Config]: Couldn't find config at path: \"%s\".\n",
|
||||
@@ -4194,7 +4274,7 @@ bool config_save_file(const char *path)
|
||||
snprintf(cfg, sizeof(cfg), "input_device_p%u", i + 1);
|
||||
config_set_int(conf, cfg, settings->uints.input_device[i]);
|
||||
snprintf(cfg, sizeof(cfg), "input_player%u_joypad_index", i + 1);
|
||||
config_set_int(conf, cfg, settings->uints.input_joypad_map[i]);
|
||||
config_set_int(conf, cfg, settings->uints.input_joypad_index[i]);
|
||||
snprintf(cfg, sizeof(cfg), "input_libretro_device_p%u", i + 1);
|
||||
config_set_int(conf, cfg, input_config_get_device(i));
|
||||
snprintf(cfg, sizeof(cfg), "input_player%u_analog_dpad_mode", i + 1);
|
||||
@@ -4457,11 +4537,11 @@ bool config_save_overrides(enum override_type type, void *data)
|
||||
config_set_int(conf, cfg, overrides->uints.input_device[i]);
|
||||
}
|
||||
|
||||
if (settings->uints.input_joypad_map[i]
|
||||
!= overrides->uints.input_joypad_map[i])
|
||||
if (settings->uints.input_joypad_index[i]
|
||||
!= overrides->uints.input_joypad_index[i])
|
||||
{
|
||||
snprintf(cfg, sizeof(cfg), "input_player%u_joypad_index", i + 1);
|
||||
config_set_int(conf, cfg, overrides->uints.input_joypad_map[i]);
|
||||
config_set_int(conf, cfg, overrides->uints.input_joypad_index[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4574,7 +4654,7 @@ bool input_remapping_load_file(void *data, const char *path)
|
||||
if (!string_is_empty(global->name.remapfile))
|
||||
{
|
||||
input_remapping_deinit();
|
||||
input_remapping_set_defaults();
|
||||
input_remapping_set_defaults(false);
|
||||
}
|
||||
global->name.remapfile = strdup(path);
|
||||
|
||||
@@ -4582,9 +4662,6 @@ bool input_remapping_load_file(void *data, const char *path)
|
||||
{
|
||||
char s1[32], s2[32], s3[32];
|
||||
|
||||
global->old_analog_dpad_mode[i] = settings->uints.input_analog_dpad_mode[i];
|
||||
global->old_libretro_device[i] = settings->uints.input_libretro_device[i];
|
||||
|
||||
s1[0] = '\0';
|
||||
s2[0] = '\0';
|
||||
s3[0] = '\0';
|
||||
@@ -4628,10 +4705,13 @@ bool input_remapping_load_file(void *data, const char *path)
|
||||
}
|
||||
else
|
||||
{
|
||||
char stk_ident[128];
|
||||
char stk_ident[256];
|
||||
char key_ident[128];
|
||||
int stk_remap = -1;
|
||||
int key_remap = -1;
|
||||
|
||||
stk_ident[0] = '\0';
|
||||
key_ident[0] = '\0';
|
||||
|
||||
fill_pathname_join_delim(stk_ident, s3,
|
||||
key_string, '$', sizeof(stk_ident));
|
||||
@@ -4650,6 +4730,15 @@ bool input_remapping_load_file(void *data, const char *path)
|
||||
configuration_set_uint(settings,
|
||||
settings->uints.input_remap_ids[i][j], stk_remap);
|
||||
}
|
||||
|
||||
fill_pathname_join_delim(key_ident, s2,
|
||||
key_string, '_', sizeof(key_ident));
|
||||
|
||||
if (!config_get_int(conf, key_ident, &key_remap))
|
||||
key_remap = RETROK_UNKNOWN;
|
||||
|
||||
configuration_set_uint(settings,
|
||||
settings->uints.input_keymapper_ids[i][j], key_remap);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4658,8 +4747,18 @@ bool input_remapping_load_file(void *data, const char *path)
|
||||
|
||||
snprintf(s1, sizeof(s1), "input_libretro_device_p%u", i + 1);
|
||||
CONFIG_GET_INT_BASE(conf, settings, uints.input_libretro_device[i], s1);
|
||||
|
||||
snprintf(s1, sizeof(s1), "input_remap_port_p%u", i + 1);
|
||||
CONFIG_GET_INT_BASE(conf, settings, uints.input_remap_ports[i], s1);
|
||||
}
|
||||
|
||||
input_remapping_update_port_map();
|
||||
|
||||
/* Whenever a remap file is loaded, subsequent
|
||||
* changes to global remap-related parameters
|
||||
* must be reset at the next core deinitialisation */
|
||||
input_remapping_enable_global_config_restore();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -4682,8 +4781,8 @@ bool input_remapping_save_file(const char *path)
|
||||
"a", "x", "l", "r", "l2", "r2",
|
||||
"l3", "r3", "l_x+", "l_x-", "l_y+", "l_y-", "r_x+", "r_x-", "r_y+", "r_y-" };
|
||||
config_file_t *conf = NULL;
|
||||
unsigned max_users = *(input_driver_get_uint(INPUT_ACTION_MAX_USERS));
|
||||
settings_t *settings = config_get_ptr();
|
||||
unsigned max_users = settings->uints.input_max_users;
|
||||
const char *dir_input_remapping = settings->paths.directory_input_remapping;
|
||||
|
||||
remap_file[0] = '\0';
|
||||
@@ -4698,14 +4797,38 @@ bool input_remapping_save_file(const char *path)
|
||||
return false;
|
||||
}
|
||||
|
||||
for (i = 0; i < max_users; i++)
|
||||
for (i = 0; i < MAX_USERS; i++)
|
||||
{
|
||||
char s1[32], s2[32], s3[32];
|
||||
bool skip_port = true;
|
||||
char s1[32];
|
||||
char s2[32];
|
||||
char s3[32];
|
||||
|
||||
s1[0] = '\0';
|
||||
s2[0] = '\0';
|
||||
s3[0] = '\0';
|
||||
|
||||
/* We must include all mapped ports + all those
|
||||
* with an index less than max_users */
|
||||
if (i < max_users)
|
||||
skip_port = false;
|
||||
else
|
||||
{
|
||||
/* Check whether current port is mapped
|
||||
* to an input device */
|
||||
for (j = 0; j < max_users; j++)
|
||||
{
|
||||
if (i == settings->uints.input_remap_ports[j])
|
||||
{
|
||||
skip_port = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (skip_port)
|
||||
continue;
|
||||
|
||||
snprintf(s1, sizeof(s1), "input_player%u_btn", i + 1);
|
||||
snprintf(s2, sizeof(s2), "input_player%u_key", i + 1);
|
||||
snprintf(s3, sizeof(s3), "input_player%u_stk", i + 1);
|
||||
@@ -4747,6 +4870,7 @@ bool input_remapping_save_file(const char *path)
|
||||
{
|
||||
char stk_ident[128];
|
||||
unsigned remap_id = settings->uints.input_remap_ids[i][j];
|
||||
unsigned keymap_id = settings->uints.input_keymapper_ids[i][j];
|
||||
const char *key_string = key_strings[j];
|
||||
stk_ident[0] = '\0';
|
||||
fill_pathname_join_delim(stk_ident, s3,
|
||||
@@ -4763,12 +4887,26 @@ bool input_remapping_save_file(const char *path)
|
||||
config_set_int(conf, stk_ident,
|
||||
settings->uints.input_remap_ids[i][j]);
|
||||
}
|
||||
|
||||
if (keymap_id != RETROK_UNKNOWN)
|
||||
{
|
||||
char key_ident[128];
|
||||
key_ident[0] = '\0';
|
||||
fill_pathname_join_delim(key_ident, s2,
|
||||
key_string, '_', sizeof(key_ident));
|
||||
config_set_int(conf, key_ident,
|
||||
settings->uints.input_keymapper_ids[i][j]);
|
||||
}
|
||||
}
|
||||
|
||||
snprintf(s1, sizeof(s1), "input_libretro_device_p%u", i + 1);
|
||||
config_set_int(conf, s1, input_config_get_device(i));
|
||||
|
||||
snprintf(s1, sizeof(s1), "input_player%u_analog_dpad_mode", i + 1);
|
||||
config_set_int(conf, s1, settings->uints.input_analog_dpad_mode[i]);
|
||||
|
||||
snprintf(s1, sizeof(s1), "input_remap_port_p%u", i + 1);
|
||||
config_set_int(conf, s1, settings->uints.input_remap_ports[i]);
|
||||
}
|
||||
|
||||
ret = config_file_write(conf, remap_file, true);
|
||||
|
||||
+32
-7
@@ -67,7 +67,9 @@ enum crt_switch_type
|
||||
{
|
||||
CRT_SWITCH_NONE = 0,
|
||||
CRT_SWITCH_15KHZ,
|
||||
CRT_SWITCH_31KHZ
|
||||
CRT_SWITCH_31KHZ,
|
||||
CRT_SWITCH_32_120,
|
||||
CRT_SWITCH_INI
|
||||
};
|
||||
|
||||
enum override_type
|
||||
@@ -120,7 +122,7 @@ typedef struct settings
|
||||
unsigned placeholder;
|
||||
|
||||
unsigned input_split_joycon[MAX_USERS];
|
||||
unsigned input_joypad_map[MAX_USERS];
|
||||
unsigned input_joypad_index[MAX_USERS];
|
||||
unsigned input_device[MAX_USERS];
|
||||
unsigned input_mouse_index[MAX_USERS];
|
||||
/* Set by autoconfiguration in joypad_autoconfig_dir.
|
||||
@@ -128,13 +130,14 @@ typedef struct settings
|
||||
unsigned input_libretro_device[MAX_USERS];
|
||||
unsigned input_analog_dpad_mode[MAX_USERS];
|
||||
|
||||
unsigned input_keymapper_ids[MAX_USERS][RARCH_CUSTOM_BIND_LIST_END];
|
||||
|
||||
unsigned input_remap_ports[MAX_USERS];
|
||||
unsigned input_remap_ids[MAX_USERS][RARCH_CUSTOM_BIND_LIST_END];
|
||||
unsigned input_keymapper_ids[MAX_USERS][RARCH_CUSTOM_BIND_LIST_END];
|
||||
unsigned input_remap_port_map[MAX_USERS][MAX_USERS + 1];
|
||||
|
||||
unsigned led_map[MAX_LEDS];
|
||||
|
||||
unsigned audio_out_rate;
|
||||
unsigned audio_output_sample_rate;
|
||||
unsigned audio_block_frames;
|
||||
unsigned audio_latency;
|
||||
|
||||
@@ -162,6 +165,7 @@ typedef struct settings
|
||||
unsigned input_poll_type_behavior;
|
||||
unsigned input_dingux_rumble_gain;
|
||||
unsigned input_auto_game_focus;
|
||||
unsigned input_max_users;
|
||||
|
||||
unsigned netplay_port;
|
||||
unsigned netplay_input_latency_frames_min;
|
||||
@@ -206,6 +210,7 @@ typedef struct settings
|
||||
unsigned video_3ds_display_mode;
|
||||
unsigned video_dingux_ipu_filter_type;
|
||||
unsigned video_dingux_refresh_rate;
|
||||
unsigned video_dingux_rs90_softfilter_type;
|
||||
#ifdef HAVE_VIDEO_LAYOUT
|
||||
unsigned video_layout_selected_view;
|
||||
#endif
|
||||
@@ -266,7 +271,8 @@ typedef struct settings
|
||||
unsigned camera_width;
|
||||
unsigned camera_height;
|
||||
|
||||
unsigned input_overlay_show_physical_inputs_port;
|
||||
unsigned input_overlay_show_inputs;
|
||||
unsigned input_overlay_show_inputs_port;
|
||||
|
||||
unsigned run_ahead_frames;
|
||||
|
||||
@@ -277,6 +283,8 @@ typedef struct settings
|
||||
unsigned window_position_y;
|
||||
unsigned window_position_width;
|
||||
unsigned window_position_height;
|
||||
unsigned window_auto_width_max;
|
||||
unsigned window_auto_height_max;
|
||||
|
||||
unsigned video_record_threads;
|
||||
|
||||
@@ -288,6 +296,12 @@ typedef struct settings
|
||||
unsigned core_updater_auto_backup_history_size;
|
||||
unsigned video_black_frame_insertion;
|
||||
unsigned quit_on_close_content;
|
||||
|
||||
#ifdef HAVE_LAKKA
|
||||
unsigned cpu_scaling_mode;
|
||||
unsigned cpu_min_freq;
|
||||
unsigned cpu_max_freq;
|
||||
#endif
|
||||
} uints;
|
||||
|
||||
struct
|
||||
@@ -339,6 +353,7 @@ typedef struct settings
|
||||
float slowmotion_ratio;
|
||||
float fastforward_ratio;
|
||||
float input_analog_deadzone;
|
||||
float input_axis_threshold;
|
||||
float input_analog_sensitivity;
|
||||
} floats;
|
||||
|
||||
@@ -387,6 +402,8 @@ typedef struct settings
|
||||
char crt_switch_timings[255];
|
||||
#ifdef HAVE_LAKKA
|
||||
char timezone[TIMEZONE_LENGTH];
|
||||
char cpu_main_gov[32];
|
||||
char cpu_menu_gov[32];
|
||||
#endif
|
||||
} arrays;
|
||||
|
||||
@@ -485,6 +502,7 @@ typedef struct settings
|
||||
bool video_aspect_ratio_auto;
|
||||
bool video_dingux_ipu_keep_aspect;
|
||||
bool video_scale_integer;
|
||||
bool video_scale_integer_overscale;
|
||||
bool video_shader_enable;
|
||||
bool video_shader_watch_files;
|
||||
bool video_shader_remember_last_dir;
|
||||
@@ -533,7 +551,6 @@ typedef struct settings
|
||||
bool input_overlay_enable_autopreferred;
|
||||
bool input_overlay_hide_in_menu;
|
||||
bool input_overlay_hide_when_gamepad_connected;
|
||||
bool input_overlay_show_physical_inputs;
|
||||
bool input_overlay_show_mouse_cursor;
|
||||
bool input_overlay_auto_rotate;
|
||||
bool input_overlay_auto_scale;
|
||||
@@ -544,6 +561,7 @@ typedef struct settings
|
||||
bool input_backtouch_toggle;
|
||||
bool input_small_keyboard_enable;
|
||||
bool input_keyboard_gamepad_enable;
|
||||
bool input_auto_mouse_grab;
|
||||
#if defined(HAVE_DINPUT) || defined(HAVE_WINRAWINPUT)
|
||||
bool input_nowinkey_enable;
|
||||
#endif
|
||||
@@ -675,6 +693,7 @@ typedef struct settings
|
||||
bool quick_menu_show_set_core_association;
|
||||
bool quick_menu_show_reset_core_association;
|
||||
bool quick_menu_show_options;
|
||||
bool quick_menu_show_core_options_flush;
|
||||
bool quick_menu_show_controls;
|
||||
bool quick_menu_show_cheats;
|
||||
bool quick_menu_show_shaders;
|
||||
@@ -688,6 +707,7 @@ typedef struct settings
|
||||
bool kiosk_mode_enable;
|
||||
|
||||
bool crt_switch_custom_refresh_enable;
|
||||
bool crt_switch_hires_menu;
|
||||
|
||||
/* Netplay */
|
||||
bool netplay_public_announce;
|
||||
@@ -723,6 +743,7 @@ typedef struct settings
|
||||
bool cheevos_auto_screenshot;
|
||||
bool cheevos_start_active;
|
||||
bool cheevos_unlock_sound_enable;
|
||||
bool cheevos_challenge_indicators;
|
||||
|
||||
/* Camera */
|
||||
bool camera_allow;
|
||||
@@ -777,6 +798,8 @@ typedef struct settings
|
||||
bool network_remote_enable_user[MAX_USERS];
|
||||
bool load_dummy_on_core_shutdown;
|
||||
bool check_firmware_before_loading;
|
||||
bool core_option_category_enable;
|
||||
bool core_info_cache_enable;
|
||||
#ifndef HAVE_DYNAMIC
|
||||
bool always_reload_core_on_run_content;
|
||||
#endif
|
||||
@@ -807,6 +830,7 @@ typedef struct settings
|
||||
|
||||
bool video_window_show_decorations;
|
||||
bool video_window_save_positions;
|
||||
bool video_window_custom_size_enable;
|
||||
|
||||
bool sustained_performance_mode;
|
||||
bool playlist_use_old_format;
|
||||
@@ -816,6 +840,7 @@ typedef struct settings
|
||||
|
||||
bool playlist_sort_alphabetical;
|
||||
bool playlist_show_sublabels;
|
||||
bool playlist_show_entry_idx;
|
||||
bool playlist_fuzzy_archive_match;
|
||||
bool playlist_portable_paths;
|
||||
|
||||
|
||||
@@ -124,6 +124,10 @@ bool content_set_subsystem_by_name(const char* subsystem_name);
|
||||
/* Get the current subsystem "friendly name" */
|
||||
void content_get_subsystem_friendly_name(const char* subsystem_name, char* subsystem_friendly_name, size_t len);
|
||||
|
||||
/* Sets overrides which modify frontend handling of
|
||||
* specific content file types */
|
||||
bool content_file_override_set(const struct retro_system_content_info_override *overrides);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
+3
-18
@@ -116,7 +116,6 @@ bool core_backup_get_backup_path(
|
||||
const char *core_path, uint32_t crc, enum core_backup_mode backup_mode,
|
||||
const char *dir_core_assets, char *backup_path, size_t len)
|
||||
{
|
||||
int n;
|
||||
time_t current_time;
|
||||
struct tm time_info;
|
||||
const char *core_filename = NULL;
|
||||
@@ -152,7 +151,7 @@ bool core_backup_get_backup_path(
|
||||
rtime_localtime(¤t_time, &time_info);
|
||||
|
||||
/* Generate backup filename */
|
||||
n = snprintf(backup_filename, sizeof(backup_filename),
|
||||
snprintf(backup_filename, sizeof(backup_filename),
|
||||
"%s.%04u%02u%02uT%02u%02u%02u.%08x.%u%s",
|
||||
core_filename,
|
||||
(unsigned)time_info.tm_year + 1900,
|
||||
@@ -165,10 +164,6 @@ bool core_backup_get_backup_path(
|
||||
(unsigned)backup_mode,
|
||||
FILE_PATH_CORE_BACKUP_EXTENSION);
|
||||
|
||||
if ((n < 0) || (n >= 128))
|
||||
n = 0; /* Silence GCC warnings... */
|
||||
|
||||
(void)n;
|
||||
/* Build final path */
|
||||
fill_pathname_join(backup_path, backup_dir,
|
||||
backup_filename, len);
|
||||
@@ -712,7 +707,6 @@ bool core_backup_list_get_entry_timestamp_str(
|
||||
enum core_backup_date_separator_type date_separator,
|
||||
char *timestamp, size_t len)
|
||||
{
|
||||
int n;
|
||||
const char *format_str = "";
|
||||
|
||||
if (!entry || (len < 20))
|
||||
@@ -732,7 +726,7 @@ bool core_backup_list_get_entry_timestamp_str(
|
||||
break;
|
||||
}
|
||||
|
||||
n = snprintf(timestamp, len,
|
||||
snprintf(timestamp, len,
|
||||
format_str,
|
||||
entry->date.year,
|
||||
entry->date.month,
|
||||
@@ -741,9 +735,6 @@ bool core_backup_list_get_entry_timestamp_str(
|
||||
entry->date.minute,
|
||||
entry->date.second);
|
||||
|
||||
if ((n < 0) || (n >= 32))
|
||||
n = 0; /* Silence GCC warnings... */
|
||||
(void)n;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -754,15 +745,9 @@ bool core_backup_list_get_entry_crc_str(
|
||||
const core_backup_list_entry_t *entry,
|
||||
char *crc, size_t len)
|
||||
{
|
||||
int n;
|
||||
|
||||
if (!entry || (len < 9))
|
||||
return false;
|
||||
|
||||
n = snprintf(crc, len, "%08x", entry->crc);
|
||||
|
||||
if ((n < 0) || (n >= 32))
|
||||
n = 0; /* Silence GCC warnings... */
|
||||
(void)n;
|
||||
snprintf(crc, len, "%08x", entry->crc);
|
||||
return true;
|
||||
}
|
||||
+1457
-96
File diff suppressed because it is too large.
Load diff
+9
-1
@@ -89,6 +89,7 @@ typedef struct
|
||||
bool database_match_archive_member;
|
||||
bool is_experimental;
|
||||
bool is_locked;
|
||||
bool is_installed;
|
||||
} core_info_t;
|
||||
|
||||
/* A subset of core_info parameters required for
|
||||
@@ -156,7 +157,8 @@ bool core_info_get_current_core(core_info_t **core);
|
||||
void core_info_deinit_list(void);
|
||||
|
||||
bool core_info_init_list(const char *path_info, const char *dir_cores,
|
||||
const char *exts, bool show_hidden_files);
|
||||
const char *exts, bool show_hidden_files,
|
||||
bool enable_cache, bool *cache_supported);
|
||||
|
||||
bool core_info_get_list(core_info_list_t **core);
|
||||
|
||||
@@ -203,6 +205,12 @@ core_info_state_t *coreinfo_get_ptr(void);
|
||||
|
||||
bool core_info_core_file_id_is_equal(const char *core_path_a, const char *core_path_b);
|
||||
|
||||
/* When called, generates a temporary file
|
||||
* that will force an info cache refresh the
|
||||
* next time that core info is initialised with
|
||||
* caching enabled */
|
||||
bool core_info_cache_force_refresh(const char *path_info);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif /* CORE_INFO_H_ */
|
||||
File diff suppressed because it is too large.
Load diff
+374
-29
@@ -22,6 +22,7 @@
|
||||
#include <boolean.h>
|
||||
#include <retro_common_api.h>
|
||||
#include <lists/string_list.h>
|
||||
#include <lists/nested_list.h>
|
||||
|
||||
#include "retroarch.h"
|
||||
|
||||
@@ -30,99 +31,443 @@ RETRO_BEGIN_DECLS
|
||||
struct core_option
|
||||
{
|
||||
char *desc;
|
||||
char *desc_categorized;
|
||||
char *info;
|
||||
char *info_categorized;
|
||||
char *key;
|
||||
char *category_key;
|
||||
struct string_list *vals;
|
||||
struct string_list *val_labels;
|
||||
/* opt_idx: option index, used for internal
|
||||
* bookkeeping */
|
||||
size_t opt_idx;
|
||||
/* default_index, index: correspond to
|
||||
* option *value* indices */
|
||||
size_t default_index;
|
||||
size_t index;
|
||||
uint32_t key_hash;
|
||||
bool visible;
|
||||
};
|
||||
|
||||
struct core_catagory
|
||||
{
|
||||
char *key;
|
||||
char *desc;
|
||||
char *info;
|
||||
uint32_t key_hash;
|
||||
};
|
||||
|
||||
/* TODO/FIXME: This struct should be made
|
||||
* 'private', with restricted access to its
|
||||
* members via interface functions. This
|
||||
* requires significant refactoring... */
|
||||
struct core_option_manager
|
||||
{
|
||||
config_file_t *conf;
|
||||
char conf_path[PATH_MAX_LENGTH];
|
||||
|
||||
struct core_catagory *cats;
|
||||
struct core_option *opts;
|
||||
nested_list_t *option_map;
|
||||
|
||||
size_t cats_size;
|
||||
size_t size;
|
||||
|
||||
bool updated;
|
||||
};
|
||||
|
||||
typedef struct core_option_manager core_option_manager_t;
|
||||
|
||||
/*********************/
|
||||
/* Option Conversion */
|
||||
/*********************/
|
||||
|
||||
/**
|
||||
* core_option_manager_set_default:
|
||||
* @opt : pointer to core option manager object.
|
||||
* @idx : index of core option to be reset to defaults.
|
||||
* core_option_manager_convert_v1:
|
||||
*
|
||||
* Reset core option specified by @idx and sets default value for option.
|
||||
* @options_v1 : an array of retro_core_option_definition
|
||||
* structs
|
||||
*
|
||||
* Converts an array of core option v1 definitions into
|
||||
* a v2 core options struct. Returned pointer must be
|
||||
* freed using core_option_manager_free_converted().
|
||||
*
|
||||
* Returns: Valid pointer to a new v2 core options struct
|
||||
* if successful, otherwise NULL.
|
||||
**/
|
||||
void core_option_manager_set_default(core_option_manager_t *opt, size_t idx);
|
||||
struct retro_core_options_v2 *core_option_manager_convert_v1(
|
||||
const struct retro_core_option_definition *options_v1);
|
||||
|
||||
/**
|
||||
* core_option_manager_convert_v1_intl:
|
||||
*
|
||||
* @options_v1_intl : pointer to a retro_core_options_intl
|
||||
* struct
|
||||
*
|
||||
* Converts a v1 'international' core options definition
|
||||
* struct into a v2 core options struct. Returned pointer
|
||||
* must be freed using core_option_manager_free_converted().
|
||||
*
|
||||
* Returns: Valid pointer to a new v2 core options struct
|
||||
* if successful, otherwise NULL.
|
||||
**/
|
||||
struct retro_core_options_v2 *core_option_manager_convert_v1_intl(
|
||||
const struct retro_core_options_intl *options_v1_intl);
|
||||
|
||||
/**
|
||||
* core_option_manager_convert_v2_intl:
|
||||
*
|
||||
* @options_v2_intl : pointer to a retro_core_options_v2_intl
|
||||
* struct
|
||||
*
|
||||
* Converts a v2 'international' core options struct
|
||||
* into a regular v2 core options struct. Returned pointer
|
||||
* must be freed using core_option_manager_free_converted().
|
||||
*
|
||||
* Returns: Valid pointer to a new v2 core options struct
|
||||
* if successful, otherwise NULL.
|
||||
**/
|
||||
struct retro_core_options_v2 *core_option_manager_convert_v2_intl(
|
||||
const struct retro_core_options_v2_intl *options_v2_intl);
|
||||
|
||||
/**
|
||||
* core_option_manager_free_converted:
|
||||
*
|
||||
* @options_v2 : pointer to a retro_core_options_v2
|
||||
* struct
|
||||
*
|
||||
* Frees the pointer returned by any
|
||||
* core_option_manager_convert_*() function.
|
||||
**/
|
||||
void core_option_manager_free_converted(
|
||||
struct retro_core_options_v2 *options_v2);
|
||||
|
||||
/**************************************/
|
||||
/* Initialisation / De-Initialisation */
|
||||
/**************************************/
|
||||
|
||||
/**
|
||||
* core_option_manager_new_vars:
|
||||
*
|
||||
* @conf_path : Filesystem path to write core option
|
||||
* config file to
|
||||
* @src_conf_path : Filesystem path from which to load
|
||||
* initial config settings.
|
||||
* @vars : Pointer to core option variable array
|
||||
* handle
|
||||
*
|
||||
* Legacy version of core_option_manager_new().
|
||||
* Creates and initializes a core manager handle.
|
||||
*
|
||||
* Returns: handle to new core manager handle if successful,
|
||||
* otherwise NULL.
|
||||
**/
|
||||
core_option_manager_t *core_option_manager_new_vars(
|
||||
const char *conf_path, const char *src_conf_path,
|
||||
const struct retro_variable *vars);
|
||||
|
||||
/**
|
||||
* core_option_manager_new:
|
||||
*
|
||||
* @conf_path : Filesystem path to write core option
|
||||
* config file to
|
||||
* @src_conf_path : Filesystem path from which to load
|
||||
* initial config settings.
|
||||
* @options_v2 : Pointer to retro_core_options_v2 struct
|
||||
* @categorized : Flag specifying whether core option
|
||||
* category information should be read
|
||||
* from @options_v2
|
||||
*
|
||||
* Creates and initializes a core manager handle. Parses
|
||||
* information from a retro_core_options_v2 struct.
|
||||
* If @categorized is false, all option category
|
||||
* assignments will be ignored.
|
||||
*
|
||||
* Returns: handle to new core manager handle if successful,
|
||||
* otherwise NULL.
|
||||
**/
|
||||
core_option_manager_t *core_option_manager_new(
|
||||
const char *conf_path, const char *src_conf_path,
|
||||
const struct retro_core_options_v2 *options_v2,
|
||||
bool categorized);
|
||||
|
||||
/**
|
||||
* core_option_manager_free:
|
||||
*
|
||||
* @opt : options manager handle
|
||||
*
|
||||
* Frees specified core options manager handle.
|
||||
**/
|
||||
void core_option_manager_free(core_option_manager_t *opt);
|
||||
|
||||
/********************/
|
||||
/* Category Getters */
|
||||
/********************/
|
||||
|
||||
/**
|
||||
* core_option_manager_get_category_desc:
|
||||
*
|
||||
* @opt : options manager handle
|
||||
* @key : core option category id string
|
||||
*
|
||||
* Fetches the 'description' text of the core option
|
||||
* category identified by @key (used as the
|
||||
* category label in the menu).
|
||||
*
|
||||
* Returns: description string (menu label) of the
|
||||
* specified option category if successful,
|
||||
* otherwise NULL.
|
||||
**/
|
||||
const char *core_option_manager_get_category_desc(core_option_manager_t *opt,
|
||||
const char *key);
|
||||
|
||||
/**
|
||||
* core_option_manager_get_category_info:
|
||||
*
|
||||
* @opt : options manager handle
|
||||
* @key : core option category id string
|
||||
*
|
||||
* Fetches the 'info' text of the core option
|
||||
* category identified by @key (used as the category
|
||||
* sublabel in the menu).
|
||||
*
|
||||
* Returns: information string (menu sublabel) of
|
||||
* the specified option category if successful,
|
||||
* otherwise NULL.
|
||||
**/
|
||||
const char *core_option_manager_get_category_info(core_option_manager_t *opt,
|
||||
const char *key);
|
||||
|
||||
/**
|
||||
* core_option_manager_get_category_visible:
|
||||
*
|
||||
* @opt : options manager handle
|
||||
* @key : core option category id string
|
||||
*
|
||||
* Queries whether the core option category
|
||||
* identified by @key should be displayed in
|
||||
* the frontend menu. (A category is deemed to
|
||||
* be visible if at least one of the options
|
||||
* in the category is visible)
|
||||
*
|
||||
* Returns: true if option category should be
|
||||
* displayed by the frontend, otherwise false.
|
||||
**/
|
||||
bool core_option_manager_get_category_visible(core_option_manager_t *opt,
|
||||
const char *key);
|
||||
|
||||
/******************/
|
||||
/* Option Getters */
|
||||
/******************/
|
||||
|
||||
/**
|
||||
* core_option_manager_get_idx:
|
||||
*
|
||||
* @opt : options manager handle
|
||||
* @key : core option key string (variable to query
|
||||
* in RETRO_ENVIRONMENT_GET_VARIABLE)
|
||||
* @idx : index of core option corresponding
|
||||
* to @key
|
||||
*
|
||||
* Fetches the index of the core option identified
|
||||
* by the specified @key.
|
||||
*
|
||||
* Returns: true if option matching the specified
|
||||
* key was found, otherwise false.
|
||||
**/
|
||||
bool core_option_manager_get_idx(core_option_manager_t *opt,
|
||||
const char *key, size_t *idx);
|
||||
|
||||
/**
|
||||
* core_option_manager_get_desc:
|
||||
* @opt : options manager handle
|
||||
* @idx : idx identifier of the option
|
||||
*
|
||||
* Gets description for an option.
|
||||
* @opt : options manager handle
|
||||
* @idx : core option index
|
||||
* @categorized : flag specifying whether to
|
||||
* fetch the categorised description
|
||||
* or the legacy fallback
|
||||
*
|
||||
* Returns: Description for an option.
|
||||
* Fetches the 'description' of the core option at
|
||||
* index @idx (used as the option label in the menu).
|
||||
* If menu has option category support, @categorized
|
||||
* should be true. (At present, only the Qt interface
|
||||
* requires @categorized to be false)
|
||||
*
|
||||
* Returns: description string (menu label) of the
|
||||
* specified option if successful, otherwise NULL.
|
||||
**/
|
||||
const char *core_option_manager_get_desc(core_option_manager_t *opt,
|
||||
size_t idx);
|
||||
size_t idx, bool categorized);
|
||||
|
||||
/**
|
||||
* core_option_manager_get_info:
|
||||
* @opt : options manager handle
|
||||
* @idx : idx identifier of the option
|
||||
*
|
||||
* Gets information text for an option.
|
||||
* @opt : options manager handle
|
||||
* @idx : core option index
|
||||
* @categorized : flag specifying whether to
|
||||
* fetch the categorised information
|
||||
* or the legacy fallback
|
||||
*
|
||||
* Returns: Information text for an option.
|
||||
* Fetches the 'info' text of the core option at
|
||||
* index @idx (used as the option sublabel in the
|
||||
* menu). If menu has option category support,
|
||||
* @categorized should be true. (At present, only
|
||||
* the Qt interface requires @categorized to be false)
|
||||
*
|
||||
* Returns: information string (menu sublabel) of the
|
||||
* specified option if successful, otherwise NULL.
|
||||
**/
|
||||
const char *core_option_manager_get_info(core_option_manager_t *opt,
|
||||
size_t idx);
|
||||
size_t idx, bool categorized);
|
||||
|
||||
/**
|
||||
* core_option_manager_get_val:
|
||||
* @opt : options manager handle
|
||||
* @idx : idx identifier of the option
|
||||
*
|
||||
* Gets value for an option.
|
||||
* @opt : options manager handle
|
||||
* @idx : core option index
|
||||
*
|
||||
* Returns: Value for an option.
|
||||
* Fetches the string representation of the current
|
||||
* value of the core option at index @idx.
|
||||
*
|
||||
* Returns: core option value string if successful,
|
||||
* otherwise NULL.
|
||||
**/
|
||||
const char *core_option_manager_get_val(core_option_manager_t *opt,
|
||||
size_t idx);
|
||||
|
||||
/**
|
||||
* core_option_manager_get_val_label:
|
||||
* @opt : options manager handle
|
||||
* @idx : idx identifier of the option
|
||||
*
|
||||
* Gets value label for an option.
|
||||
* @opt : options manager handle
|
||||
* @idx : core option index
|
||||
*
|
||||
* Returns: Value label for an option.
|
||||
* Fetches the 'label' text (used for display purposes
|
||||
* in the menu) for the current value of the core
|
||||
* option at index @idx.
|
||||
*
|
||||
* Returns: core option value label string if
|
||||
* successful, otherwise NULL.
|
||||
**/
|
||||
const char *core_option_manager_get_val_label(core_option_manager_t *opt,
|
||||
size_t idx);
|
||||
|
||||
/**
|
||||
* core_option_manager_get_visible:
|
||||
* @opt : options manager handle
|
||||
* @idx : idx identifier of the option
|
||||
*
|
||||
* Gets whether option should be visible when displaying
|
||||
* core options in the frontend
|
||||
* @opt : options manager handle
|
||||
* @idx : core option index
|
||||
*
|
||||
* Returns: 'true' if option should be displayed by the frontend.
|
||||
* Queries whether the core option at index @idx
|
||||
* should be displayed in the frontend menu.
|
||||
*
|
||||
* Returns: true if option should be displayed by
|
||||
* the frontend, otherwise false.
|
||||
**/
|
||||
bool core_option_manager_get_visible(core_option_manager_t *opt,
|
||||
size_t idx);
|
||||
|
||||
/******************/
|
||||
/* Option Setters */
|
||||
/******************/
|
||||
|
||||
/**
|
||||
* core_option_manager_set_val:
|
||||
*
|
||||
* @opt : options manager handle
|
||||
* @idx : core option index
|
||||
* @val_idx : index of the value to set
|
||||
* @refresh_menu : flag specifying whether menu
|
||||
* should be refreshed if changes
|
||||
* to option visibility are detected
|
||||
*
|
||||
* Sets the core option at index @idx to the
|
||||
* option value corresponding to @val_idx.
|
||||
* After setting the option value, a request
|
||||
* will be made for the core to update the
|
||||
* in-menu visibility of all options; if
|
||||
* visibility changes are detected and
|
||||
* @refresh_menu is true, the menu will be
|
||||
* redrawn.
|
||||
**/
|
||||
void core_option_manager_set_val(core_option_manager_t *opt,
|
||||
size_t idx, size_t val_idx);
|
||||
size_t idx, size_t val_idx, bool refresh_menu);
|
||||
|
||||
/**
|
||||
* core_option_manager_adjust_val:
|
||||
*
|
||||
* @opt : options manager handle
|
||||
* @idx : core option index
|
||||
* @adjustment : offset to apply from current
|
||||
* value index
|
||||
* @refresh_menu : flag specifying whether menu
|
||||
* should be refreshed if changes
|
||||
* to option visibility are detected
|
||||
*
|
||||
* Modifies the value of the core option at
|
||||
* index @idx by incrementing the current option
|
||||
* value index by @adjustment.
|
||||
* After setting the option value, a request
|
||||
* will be made for the core to update the
|
||||
* in-menu visibility of all options; if
|
||||
* visibility changes are detected and
|
||||
* @refresh_menu is true, the menu will be
|
||||
* redrawn.
|
||||
**/
|
||||
void core_option_manager_adjust_val(core_option_manager_t* opt,
|
||||
size_t idx, int adjustment, bool refresh_menu);
|
||||
|
||||
/**
|
||||
* core_option_manager_set_default:
|
||||
*
|
||||
* @opt : options manager handle
|
||||
* @idx : core option index
|
||||
* @refresh_menu : flag specifying whether menu
|
||||
* should be refreshed if changes
|
||||
* to option visibility are detected
|
||||
*
|
||||
* Resets the core option at index @idx to
|
||||
* its default value.
|
||||
* After setting the option value, a request
|
||||
* will be made for the core to update the
|
||||
* in-menu visibility of all options; if
|
||||
* visibility changes are detected and
|
||||
* @refresh_menu is true, the menu will be
|
||||
* redrawn.
|
||||
**/
|
||||
void core_option_manager_set_default(core_option_manager_t *opt,
|
||||
size_t idx, bool refresh_menu);
|
||||
|
||||
/**
|
||||
* core_option_manager_set_visible:
|
||||
*
|
||||
* @opt : options manager handle
|
||||
* @key : core option key string (variable to query
|
||||
* in RETRO_ENVIRONMENT_GET_VARIABLE)
|
||||
* @visible : flag specifying whether option should
|
||||
* be shown in the menu
|
||||
*
|
||||
* Sets the in-menu visibility of the core option
|
||||
* identified by the specified @key.
|
||||
**/
|
||||
void core_option_manager_set_visible(core_option_manager_t *opt,
|
||||
const char *key, bool visible);
|
||||
|
||||
/**********************/
|
||||
/* Configuration File */
|
||||
/**********************/
|
||||
|
||||
/**
|
||||
* core_option_manager_flush:
|
||||
*
|
||||
* @opt : options manager handle
|
||||
* @conf : configuration file handle
|
||||
*
|
||||
* Writes all core option key-pair values from the
|
||||
* specified core option manager handle to the
|
||||
* specified configuration file struct.
|
||||
**/
|
||||
void core_option_manager_flush(core_option_manager_t *opt,
|
||||
config_file_t *conf);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
|
||||
+17
-2
@@ -281,8 +281,23 @@ static int database_cursor_iterate(libretrodb_cursor_t *cur,
|
||||
else if (string_is_equal(str, "size"))
|
||||
db_info->size = (unsigned)val->val.uint_;
|
||||
else if (string_is_equal(str, "crc"))
|
||||
db_info->crc32 = swap_if_little32(
|
||||
*(uint32_t*)val->val.binary.buff);
|
||||
{
|
||||
switch (val->val.binary.len)
|
||||
{
|
||||
case 1:
|
||||
db_info->crc32 = *(uint8_t*)val->val.binary.buff;
|
||||
break;
|
||||
case 2:
|
||||
db_info->crc32 = swap_if_little16(*(uint16_t*)val->val.binary.buff);
|
||||
break;
|
||||
case 4:
|
||||
db_info->crc32 = swap_if_little32(*(uint32_t*)val->val.binary.buff);
|
||||
break;
|
||||
default:
|
||||
db_info->crc32 = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (string_is_equal(str, "sha1"))
|
||||
db_info->sha1 = bin_to_hex_alloc(
|
||||
(uint8_t*)val->val.binary.buff, val->val.binary.len);
|
||||
|
||||
Vendored
+33
-33
@@ -24,15 +24,15 @@ typedef struct
|
||||
typedef struct
|
||||
{
|
||||
size_t PropsOffset;
|
||||
UInt32 MethodID;
|
||||
uint32_t MethodID;
|
||||
Byte NumStreams;
|
||||
Byte PropsSize;
|
||||
} CSzCoderInfo;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UInt32 InIndex;
|
||||
UInt32 OutIndex;
|
||||
uint32_t InIndex;
|
||||
uint32_t OutIndex;
|
||||
} CSzBond;
|
||||
|
||||
#define SZ_NUM_CODERS_IN_FOLDER_MAX 4
|
||||
@@ -41,11 +41,11 @@ typedef struct
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UInt32 NumCoders;
|
||||
UInt32 NumBonds;
|
||||
UInt32 NumPackStreams;
|
||||
UInt32 UnpackStream;
|
||||
UInt32 PackStreams[SZ_NUM_PACK_STREAMS_IN_FOLDER_MAX];
|
||||
uint32_t NumCoders;
|
||||
uint32_t NumBonds;
|
||||
uint32_t NumPackStreams;
|
||||
uint32_t UnpackStream;
|
||||
uint32_t PackStreams[SZ_NUM_PACK_STREAMS_IN_FOLDER_MAX];
|
||||
CSzBond Bonds[SZ_NUM_BONDS_IN_FOLDER_MAX];
|
||||
CSzCoderInfo Coders[SZ_NUM_CODERS_IN_FOLDER_MAX];
|
||||
} CSzFolder;
|
||||
@@ -55,20 +55,20 @@ SRes SzGetNextFolderItem(CSzFolder *f, CSzData *sd);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UInt32 Low;
|
||||
UInt32 High;
|
||||
uint32_t Low;
|
||||
uint32_t High;
|
||||
} CNtfsFileTime;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Byte *Defs; /* MSB 0 bit numbering */
|
||||
UInt32 *Vals;
|
||||
uint32_t *Vals;
|
||||
} CSzBitUi32s;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Byte *Defs; /* MSB 0 bit numbering */
|
||||
/* UInt64 *Vals; */
|
||||
/* uint64_t *Vals; */
|
||||
CNtfsFileTime *Vals;
|
||||
} CSzBitUi64s;
|
||||
|
||||
@@ -78,25 +78,25 @@ typedef struct
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UInt32 NumPackStreams;
|
||||
UInt32 NumFolders;
|
||||
uint32_t NumPackStreams;
|
||||
uint32_t NumFolders;
|
||||
|
||||
UInt64 *PackPositions; /* NumPackStreams + 1 */
|
||||
uint64_t *PackPositions; /* NumPackStreams + 1 */
|
||||
CSzBitUi32s FolderCRCs; /* NumFolders */
|
||||
|
||||
size_t *FoCodersOffsets; /* NumFolders + 1 */
|
||||
UInt32 *FoStartPackStreamIndex; /* NumFolders + 1 */
|
||||
UInt32 *FoToCoderUnpackSizes; /* NumFolders + 1 */
|
||||
uint32_t *FoStartPackStreamIndex; /* NumFolders + 1 */
|
||||
uint32_t *FoToCoderUnpackSizes; /* NumFolders + 1 */
|
||||
Byte *FoToMainUnpackSizeIndex; /* NumFolders */
|
||||
UInt64 *CoderUnpackSizes; /* for all coders in all folders */
|
||||
uint64_t *CoderUnpackSizes; /* for all coders in all folders */
|
||||
|
||||
Byte *CodersData;
|
||||
} CSzAr;
|
||||
|
||||
UInt64 SzAr_GetFolderUnpackSize(const CSzAr *p, UInt32 folderIndex);
|
||||
uint64_t SzAr_GetFolderUnpackSize(const CSzAr *p, uint32_t folderIndex);
|
||||
|
||||
SRes SzAr_DecodeFolder(const CSzAr *p, UInt32 folderIndex,
|
||||
ILookInStream *stream, UInt64 startPos,
|
||||
SRes SzAr_DecodeFolder(const CSzAr *p, uint32_t folderIndex,
|
||||
ILookInStream *stream, uint64_t startPos,
|
||||
Byte *outBuffer, size_t outSize,
|
||||
ISzAllocPtr allocMain);
|
||||
|
||||
@@ -104,12 +104,12 @@ typedef struct
|
||||
{
|
||||
CSzAr db;
|
||||
|
||||
UInt64 startPosAfterHeader;
|
||||
UInt64 dataPos;
|
||||
uint64_t startPosAfterHeader;
|
||||
uint64_t dataPos;
|
||||
|
||||
UInt32 NumFiles;
|
||||
uint32_t NumFiles;
|
||||
|
||||
UInt64 *UnpackPositions; /* NumFiles + 1 */
|
||||
uint64_t *UnpackPositions; /* NumFiles + 1 */
|
||||
/* Byte *IsEmptyFiles; */
|
||||
Byte *IsDirs;
|
||||
CSzBitUi32s CRCs;
|
||||
@@ -119,8 +119,8 @@ typedef struct
|
||||
CSzBitUi64s MTime;
|
||||
CSzBitUi64s CTime;
|
||||
|
||||
UInt32 *FolderToFile; /* NumFolders + 1 */
|
||||
UInt32 *FileToFolder; /* NumFiles */
|
||||
uint32_t *FolderToFile; /* NumFolders + 1 */
|
||||
uint32_t *FileToFolder; /* NumFiles */
|
||||
|
||||
size_t *FileNameOffsets; /* in 2-byte steps */
|
||||
Byte *FileNames; /* UTF-16-LE */
|
||||
@@ -132,8 +132,8 @@ typedef struct
|
||||
|
||||
void SzArEx_Init(CSzArEx *p);
|
||||
void SzArEx_Free(CSzArEx *p, ISzAllocPtr alloc);
|
||||
UInt64 SzArEx_GetFolderStreamPos(const CSzArEx *p, UInt32 folderIndex, UInt32 indexInFolder);
|
||||
int SzArEx_GetFolderFullPackSize(const CSzArEx *p, UInt32 folderIndex, UInt64 *resSize);
|
||||
uint64_t SzArEx_GetFolderStreamPos(const CSzArEx *p, uint32_t folderIndex, uint32_t indexInFolder);
|
||||
int SzArEx_GetFolderFullPackSize(const CSzArEx *p, uint32_t folderIndex, uint64_t *resSize);
|
||||
|
||||
/*
|
||||
if dest == NULL, the return value specifies the required size of the buffer,
|
||||
@@ -141,11 +141,11 @@ if dest == NULL, the return value specifies the required size of the buffer,
|
||||
if dest != NULL, the return value specifies the number of 16-bit characters that
|
||||
are written to the dest, including the null-terminating character. */
|
||||
|
||||
size_t SzArEx_GetFileNameUtf16(const CSzArEx *p, size_t fileIndex, UInt16 *dest);
|
||||
size_t SzArEx_GetFileNameUtf16(const CSzArEx *p, size_t fileIndex, uint16_t *dest);
|
||||
|
||||
/*
|
||||
size_t SzArEx_GetFullNameLen(const CSzArEx *p, size_t fileIndex);
|
||||
UInt16 *SzArEx_GetFullNameUtf16_Back(const CSzArEx *p, size_t fileIndex, UInt16 *dest);
|
||||
uint16_t *SzArEx_GetFullNameUtf16_Back(const CSzArEx *p, size_t fileIndex, uint16_t *dest);
|
||||
*/
|
||||
|
||||
|
||||
@@ -173,8 +173,8 @@ UInt16 *SzArEx_GetFullNameUtf16_Back(const CSzArEx *p, size_t fileIndex, UInt16
|
||||
SRes SzArEx_Extract(
|
||||
const CSzArEx *db,
|
||||
ILookInStream *inStream,
|
||||
UInt32 fileIndex, /* index of file */
|
||||
UInt32 *blockIndex, /* index of solid block */
|
||||
uint32_t fileIndex, /* index of file */
|
||||
uint32_t *blockIndex, /* index of solid block */
|
||||
Byte **outBuffer, /* pointer to pointer to output buffer (allocated with allocMain) */
|
||||
size_t *outBufferSize, /* buffer size for output buffer */
|
||||
size_t *offset, /* offset of stream for required file in *outBuffer */
|
||||
|
||||
Vendored
+142
-142
@@ -70,7 +70,7 @@ static SRes SzBitUi32s_Alloc(CSzBitUi32s *p, size_t num, ISzAllocPtr alloc)
|
||||
else
|
||||
{
|
||||
MY_ALLOC(Byte, p->Defs, (num + 7) >> 3, alloc);
|
||||
MY_ALLOC(UInt32, p->Vals, num, alloc);
|
||||
MY_ALLOC(uint32_t, p->Vals, num, alloc);
|
||||
}
|
||||
return SZ_OK;
|
||||
}
|
||||
@@ -190,11 +190,11 @@ static int TestSignatureCandidate(const Byte *testBytes)
|
||||
#define SZ_READ_32(dest) if (sd.Size < 4) return SZ_ERROR_ARCHIVE; \
|
||||
dest = GetUi32(sd.Data); SKIP_DATA2(sd, 4);
|
||||
|
||||
static MY_NO_INLINE SRes ReadNumber(CSzData *sd, UInt64 *value)
|
||||
static MY_NO_INLINE SRes ReadNumber(CSzData *sd, uint64_t *value)
|
||||
{
|
||||
Byte firstByte, mask;
|
||||
unsigned i;
|
||||
UInt32 v;
|
||||
uint32_t v;
|
||||
|
||||
SZ_READ_BYTE(firstByte);
|
||||
if ((firstByte & 0x80) == 0)
|
||||
@@ -205,33 +205,33 @@ static MY_NO_INLINE SRes ReadNumber(CSzData *sd, UInt64 *value)
|
||||
SZ_READ_BYTE(v);
|
||||
if ((firstByte & 0x40) == 0)
|
||||
{
|
||||
*value = (((UInt32)firstByte & 0x3F) << 8) | v;
|
||||
*value = (((uint32_t)firstByte & 0x3F) << 8) | v;
|
||||
return SZ_OK;
|
||||
}
|
||||
SZ_READ_BYTE(mask);
|
||||
*value = v | ((UInt32)mask << 8);
|
||||
*value = v | ((uint32_t)mask << 8);
|
||||
mask = 0x20;
|
||||
for (i = 2; i < 8; i++)
|
||||
{
|
||||
Byte b;
|
||||
if ((firstByte & mask) == 0)
|
||||
{
|
||||
UInt64 highPart = (unsigned)firstByte & (unsigned)(mask - 1);
|
||||
uint64_t highPart = (unsigned)firstByte & (unsigned)(mask - 1);
|
||||
*value |= (highPart << (8 * i));
|
||||
return SZ_OK;
|
||||
}
|
||||
SZ_READ_BYTE(b);
|
||||
*value |= ((UInt64)b << (8 * i));
|
||||
*value |= ((uint64_t)b << (8 * i));
|
||||
mask >>= 1;
|
||||
}
|
||||
return SZ_OK;
|
||||
}
|
||||
|
||||
|
||||
static MY_NO_INLINE SRes SzReadNumber32(CSzData *sd, UInt32 *value)
|
||||
static MY_NO_INLINE SRes SzReadNumber32(CSzData *sd, uint32_t *value)
|
||||
{
|
||||
Byte firstByte;
|
||||
UInt64 value64;
|
||||
uint64_t value64;
|
||||
if (sd->Size == 0)
|
||||
return SZ_ERROR_ARCHIVE;
|
||||
firstByte = *sd->Data;
|
||||
@@ -243,11 +243,11 @@ static MY_NO_INLINE SRes SzReadNumber32(CSzData *sd, UInt32 *value)
|
||||
return SZ_OK;
|
||||
}
|
||||
RINOK(ReadNumber(sd, &value64));
|
||||
if (value64 >= (UInt32)0x80000000 - 1)
|
||||
if (value64 >= (uint32_t)0x80000000 - 1)
|
||||
return SZ_ERROR_UNSUPPORTED;
|
||||
if (value64 >= ((UInt64)(1) << ((sizeof(size_t) - 1) * 8 + 4)))
|
||||
if (value64 >= ((uint64_t)(1) << ((sizeof(size_t) - 1) * 8 + 4)))
|
||||
return SZ_ERROR_UNSUPPORTED;
|
||||
*value = (UInt32)value64;
|
||||
*value = (uint32_t)value64;
|
||||
return SZ_OK;
|
||||
}
|
||||
|
||||
@@ -255,7 +255,7 @@ static MY_NO_INLINE SRes SzReadNumber32(CSzData *sd, UInt32 *value)
|
||||
|
||||
static SRes SkipData(CSzData *sd)
|
||||
{
|
||||
UInt64 size;
|
||||
uint64_t size;
|
||||
RINOK(ReadNumber(sd, &size));
|
||||
if (size > sd->Size)
|
||||
return SZ_ERROR_ARCHIVE;
|
||||
@@ -263,11 +263,11 @@ static SRes SkipData(CSzData *sd)
|
||||
return SZ_OK;
|
||||
}
|
||||
|
||||
static SRes WaitId(CSzData *sd, UInt32 id)
|
||||
static SRes WaitId(CSzData *sd, uint32_t id)
|
||||
{
|
||||
for (;;)
|
||||
{
|
||||
UInt64 type;
|
||||
uint64_t type;
|
||||
RINOK(ReadID(sd, &type));
|
||||
if (type == id)
|
||||
return SZ_OK;
|
||||
@@ -277,9 +277,9 @@ static SRes WaitId(CSzData *sd, UInt32 id)
|
||||
}
|
||||
}
|
||||
|
||||
static SRes RememberBitVector(CSzData *sd, UInt32 numItems, const Byte **v)
|
||||
static SRes RememberBitVector(CSzData *sd, uint32_t numItems, const Byte **v)
|
||||
{
|
||||
UInt32 numBytes = (numItems + 7) >> 3;
|
||||
uint32_t numBytes = (numItems + 7) >> 3;
|
||||
if (numBytes > sd->Size)
|
||||
return SZ_ERROR_ARCHIVE;
|
||||
*v = sd->Data;
|
||||
@@ -287,11 +287,11 @@ static SRes RememberBitVector(CSzData *sd, UInt32 numItems, const Byte **v)
|
||||
return SZ_OK;
|
||||
}
|
||||
|
||||
static UInt32 CountDefinedBits(const Byte *bits, UInt32 numItems)
|
||||
static uint32_t CountDefinedBits(const Byte *bits, uint32_t numItems)
|
||||
{
|
||||
Byte b = 0;
|
||||
unsigned m = 0;
|
||||
UInt32 sum = 0;
|
||||
uint32_t sum = 0;
|
||||
for (; numItems != 0; numItems--)
|
||||
{
|
||||
if (m == 0)
|
||||
@@ -305,11 +305,11 @@ static UInt32 CountDefinedBits(const Byte *bits, UInt32 numItems)
|
||||
return sum;
|
||||
}
|
||||
|
||||
static MY_NO_INLINE SRes ReadBitVector(CSzData *sd, UInt32 numItems, Byte **v, ISzAllocPtr alloc)
|
||||
static MY_NO_INLINE SRes ReadBitVector(CSzData *sd, uint32_t numItems, Byte **v, ISzAllocPtr alloc)
|
||||
{
|
||||
Byte allAreDefined;
|
||||
Byte *v2;
|
||||
UInt32 numBytes = (numItems + 7) >> 3;
|
||||
uint32_t numBytes = (numItems + 7) >> 3;
|
||||
*v = NULL;
|
||||
SZ_READ_BYTE(allAreDefined);
|
||||
if (numBytes == 0)
|
||||
@@ -328,18 +328,18 @@ static MY_NO_INLINE SRes ReadBitVector(CSzData *sd, UInt32 numItems, Byte **v, I
|
||||
{
|
||||
unsigned numBits = (unsigned)numItems & 7;
|
||||
if (numBits != 0)
|
||||
v2[(size_t)numBytes - 1] = (Byte)((((UInt32)1 << numBits) - 1) << (8 - numBits));
|
||||
v2[(size_t)numBytes - 1] = (Byte)((((uint32_t)1 << numBits) - 1) << (8 - numBits));
|
||||
}
|
||||
return SZ_OK;
|
||||
}
|
||||
|
||||
static MY_NO_INLINE SRes ReadUi32s(CSzData *sd2, UInt32 numItems, CSzBitUi32s *crcs, ISzAllocPtr alloc)
|
||||
static MY_NO_INLINE SRes ReadUi32s(CSzData *sd2, uint32_t numItems, CSzBitUi32s *crcs, ISzAllocPtr alloc)
|
||||
{
|
||||
UInt32 i;
|
||||
uint32_t i;
|
||||
CSzData sd;
|
||||
UInt32 *vals;
|
||||
uint32_t *vals;
|
||||
const Byte *defs;
|
||||
MY_ALLOC_ZE(UInt32, crcs->Vals, numItems, alloc);
|
||||
MY_ALLOC_ZE(uint32_t, crcs->Vals, numItems, alloc);
|
||||
sd = *sd2;
|
||||
defs = crcs->Defs;
|
||||
vals = crcs->Vals;
|
||||
@@ -354,17 +354,17 @@ static MY_NO_INLINE SRes ReadUi32s(CSzData *sd2, UInt32 numItems, CSzBitUi32s *c
|
||||
return SZ_OK;
|
||||
}
|
||||
|
||||
static SRes ReadBitUi32s(CSzData *sd, UInt32 numItems, CSzBitUi32s *crcs, ISzAllocPtr alloc)
|
||||
static SRes ReadBitUi32s(CSzData *sd, uint32_t numItems, CSzBitUi32s *crcs, ISzAllocPtr alloc)
|
||||
{
|
||||
SzBitUi32s_Free(crcs, alloc);
|
||||
RINOK(ReadBitVector(sd, numItems, &crcs->Defs, alloc));
|
||||
return ReadUi32s(sd, numItems, crcs, alloc);
|
||||
}
|
||||
|
||||
static SRes SkipBitUi32s(CSzData *sd, UInt32 numItems)
|
||||
static SRes SkipBitUi32s(CSzData *sd, uint32_t numItems)
|
||||
{
|
||||
Byte allAreDefined;
|
||||
UInt32 numDefined = numItems;
|
||||
uint32_t numDefined = numItems;
|
||||
SZ_READ_BYTE(allAreDefined);
|
||||
if (!allAreDefined)
|
||||
{
|
||||
@@ -385,14 +385,14 @@ static SRes ReadPackInfo(CSzAr *p, CSzData *sd, ISzAllocPtr alloc)
|
||||
RINOK(SzReadNumber32(sd, &p->NumPackStreams));
|
||||
|
||||
RINOK(WaitId(sd, k7zIdSize));
|
||||
MY_ALLOC(UInt64, p->PackPositions, (size_t)p->NumPackStreams + 1, alloc);
|
||||
MY_ALLOC(uint64_t, p->PackPositions, (size_t)p->NumPackStreams + 1, alloc);
|
||||
{
|
||||
UInt64 sum = 0;
|
||||
UInt32 i;
|
||||
UInt32 numPackStreams = p->NumPackStreams;
|
||||
uint64_t sum = 0;
|
||||
uint32_t i;
|
||||
uint32_t numPackStreams = p->NumPackStreams;
|
||||
for (i = 0; i < numPackStreams; i++)
|
||||
{
|
||||
UInt64 packSize;
|
||||
uint64_t packSize;
|
||||
p->PackPositions[i] = sum;
|
||||
RINOK(ReadNumber(sd, &packSize));
|
||||
sum += packSize;
|
||||
@@ -404,7 +404,7 @@ static SRes ReadPackInfo(CSzAr *p, CSzData *sd, ISzAllocPtr alloc)
|
||||
|
||||
for (;;)
|
||||
{
|
||||
UInt64 type;
|
||||
uint64_t type;
|
||||
RINOK(ReadID(sd, &type));
|
||||
if (type == k7zIdEnd)
|
||||
return SZ_OK;
|
||||
@@ -431,8 +431,8 @@ static SRes SzReadSwitch(CSzData *sd)
|
||||
|
||||
SRes SzGetNextFolderItem(CSzFolder *f, CSzData *sd)
|
||||
{
|
||||
UInt32 numCoders, i;
|
||||
UInt32 numInStreams = 0;
|
||||
uint32_t numCoders, i;
|
||||
uint32_t numInStreams = 0;
|
||||
const Byte *dataStart = sd->Data;
|
||||
|
||||
f->NumCoders = 0;
|
||||
@@ -449,7 +449,7 @@ SRes SzGetNextFolderItem(CSzFolder *f, CSzData *sd)
|
||||
Byte mainByte;
|
||||
CSzCoderInfo *coder = f->Coders + i;
|
||||
unsigned idSize, j;
|
||||
UInt64 id;
|
||||
uint64_t id;
|
||||
|
||||
SZ_READ_BYTE(mainByte);
|
||||
if ((mainByte & 0xC0) != 0)
|
||||
@@ -467,9 +467,9 @@ SRes SzGetNextFolderItem(CSzFolder *f, CSzData *sd)
|
||||
sd->Data++;
|
||||
sd->Size--;
|
||||
}
|
||||
if (id > (UInt32)0xFFFFFFFF)
|
||||
if (id > (uint32_t)0xFFFFFFFF)
|
||||
return SZ_ERROR_UNSUPPORTED;
|
||||
coder->MethodID = (UInt32)id;
|
||||
coder->MethodID = (uint32_t)id;
|
||||
|
||||
coder->NumStreams = 1;
|
||||
coder->PropsOffset = 0;
|
||||
@@ -477,7 +477,7 @@ SRes SzGetNextFolderItem(CSzFolder *f, CSzData *sd)
|
||||
|
||||
if ((mainByte & 0x10) != 0)
|
||||
{
|
||||
UInt32 numStreams;
|
||||
uint32_t numStreams;
|
||||
|
||||
RINOK(SzReadNumber32(sd, &numStreams));
|
||||
if (numStreams > k_NumCodersStreams_in_Folder_MAX)
|
||||
@@ -496,7 +496,7 @@ SRes SzGetNextFolderItem(CSzFolder *f, CSzData *sd)
|
||||
|
||||
if ((mainByte & 0x20) != 0)
|
||||
{
|
||||
UInt32 propsSize = 0;
|
||||
uint32_t propsSize = 0;
|
||||
RINOK(SzReadNumber32(sd, &propsSize));
|
||||
if (propsSize > sd->Size)
|
||||
return SZ_ERROR_ARCHIVE;
|
||||
@@ -519,7 +519,7 @@ SRes SzGetNextFolderItem(CSzFolder *f, CSzData *sd)
|
||||
*/
|
||||
{
|
||||
Byte streamUsed[k_NumCodersStreams_in_Folder_MAX];
|
||||
UInt32 numBonds, numPackStreams;
|
||||
uint32_t numBonds, numPackStreams;
|
||||
|
||||
numBonds = numCoders - 1;
|
||||
if (numInStreams < numBonds)
|
||||
@@ -581,7 +581,7 @@ SRes SzGetNextFolderItem(CSzFolder *f, CSzData *sd)
|
||||
else
|
||||
for (i = 0; i < numPackStreams; i++)
|
||||
{
|
||||
UInt32 index;
|
||||
uint32_t index;
|
||||
RINOK(SzReadNumber32(sd, &index));
|
||||
if (index >= numInStreams || streamUsed[index])
|
||||
return SZ_ERROR_ARCHIVE;
|
||||
@@ -596,7 +596,7 @@ SRes SzGetNextFolderItem(CSzFolder *f, CSzData *sd)
|
||||
}
|
||||
|
||||
|
||||
static MY_NO_INLINE SRes SkipNumbers(CSzData *sd2, UInt32 num)
|
||||
static MY_NO_INLINE SRes SkipNumbers(CSzData *sd2, uint32_t num)
|
||||
{
|
||||
CSzData sd;
|
||||
sd = *sd2;
|
||||
@@ -633,13 +633,13 @@ static MY_NO_INLINE SRes SkipNumbers(CSzData *sd2, UInt32 num)
|
||||
|
||||
static SRes ReadUnpackInfo(CSzAr *p,
|
||||
CSzData *sd2,
|
||||
UInt32 numFoldersMax,
|
||||
const CBuf *tempBufs, UInt32 numTempBufs,
|
||||
uint32_t numFoldersMax,
|
||||
const CBuf *tempBufs, uint32_t numTempBufs,
|
||||
ISzAllocPtr alloc)
|
||||
{
|
||||
CSzData sd;
|
||||
|
||||
UInt32 fo, numFolders, numCodersOutStreams, packStreamIndex;
|
||||
uint32_t fo, numFolders, numCodersOutStreams, packStreamIndex;
|
||||
const Byte *startBufPtr;
|
||||
Byte external;
|
||||
|
||||
@@ -655,7 +655,7 @@ static SRes ReadUnpackInfo(CSzAr *p,
|
||||
sd = *sd2;
|
||||
else
|
||||
{
|
||||
UInt32 index;
|
||||
uint32_t index;
|
||||
RINOK(SzReadNumber32(sd2, &index));
|
||||
if (index >= numTempBufs)
|
||||
return SZ_ERROR_ARCHIVE;
|
||||
@@ -664,8 +664,8 @@ static SRes ReadUnpackInfo(CSzAr *p,
|
||||
}
|
||||
|
||||
MY_ALLOC(size_t, p->FoCodersOffsets, (size_t)numFolders + 1, alloc);
|
||||
MY_ALLOC(UInt32, p->FoStartPackStreamIndex, (size_t)numFolders + 1, alloc);
|
||||
MY_ALLOC(UInt32, p->FoToCoderUnpackSizes, (size_t)numFolders + 1, alloc);
|
||||
MY_ALLOC(uint32_t, p->FoStartPackStreamIndex, (size_t)numFolders + 1, alloc);
|
||||
MY_ALLOC(uint32_t, p->FoToCoderUnpackSizes, (size_t)numFolders + 1, alloc);
|
||||
MY_ALLOC_ZE(Byte, p->FoToMainUnpackSizeIndex, (size_t)numFolders, alloc);
|
||||
|
||||
startBufPtr = sd.Data;
|
||||
@@ -675,7 +675,7 @@ static SRes ReadUnpackInfo(CSzAr *p,
|
||||
|
||||
for (fo = 0; fo < numFolders; fo++)
|
||||
{
|
||||
UInt32 numCoders, ci, numInStreams = 0;
|
||||
uint32_t numCoders, ci, numInStreams = 0;
|
||||
|
||||
p->FoCodersOffsets[fo] = sd.Data - startBufPtr;
|
||||
|
||||
@@ -687,7 +687,7 @@ static SRes ReadUnpackInfo(CSzAr *p,
|
||||
{
|
||||
Byte mainByte;
|
||||
unsigned idSize;
|
||||
UInt32 coderInStreams;
|
||||
uint32_t coderInStreams;
|
||||
|
||||
SZ_READ_BYTE_2(mainByte);
|
||||
if ((mainByte & 0xC0) != 0)
|
||||
@@ -703,7 +703,7 @@ static SRes ReadUnpackInfo(CSzAr *p,
|
||||
|
||||
if ((mainByte & 0x10) != 0)
|
||||
{
|
||||
UInt32 coderOutStreams;
|
||||
uint32_t coderOutStreams;
|
||||
RINOK(SzReadNumber32(&sd, &coderInStreams));
|
||||
RINOK(SzReadNumber32(&sd, &coderOutStreams));
|
||||
if (coderInStreams > k_Scan_NumCodersStreams_in_Folder_MAX || coderOutStreams != 1)
|
||||
@@ -714,7 +714,7 @@ static SRes ReadUnpackInfo(CSzAr *p,
|
||||
|
||||
if ((mainByte & 0x20) != 0)
|
||||
{
|
||||
UInt32 propsSize;
|
||||
uint32_t propsSize;
|
||||
RINOK(SzReadNumber32(&sd, &propsSize));
|
||||
if (propsSize > sd.Size)
|
||||
return SZ_ERROR_ARCHIVE;
|
||||
@@ -723,16 +723,16 @@ static SRes ReadUnpackInfo(CSzAr *p,
|
||||
}
|
||||
|
||||
{
|
||||
UInt32 indexOfMainStream = 0;
|
||||
UInt32 numPackStreams = 1;
|
||||
uint32_t indexOfMainStream = 0;
|
||||
uint32_t numPackStreams = 1;
|
||||
|
||||
if (numCoders != 1 || numInStreams != 1)
|
||||
{
|
||||
Byte streamUsed[k_Scan_NumCodersStreams_in_Folder_MAX];
|
||||
Byte coderUsed[k_Scan_NumCoders_MAX];
|
||||
|
||||
UInt32 i;
|
||||
UInt32 numBonds = numCoders - 1;
|
||||
uint32_t i;
|
||||
uint32_t numBonds = numCoders - 1;
|
||||
if (numInStreams < numBonds)
|
||||
return SZ_ERROR_ARCHIVE;
|
||||
|
||||
@@ -746,7 +746,7 @@ static SRes ReadUnpackInfo(CSzAr *p,
|
||||
|
||||
for (i = 0; i < numBonds; i++)
|
||||
{
|
||||
UInt32 index;
|
||||
uint32_t index;
|
||||
|
||||
RINOK(SzReadNumber32(&sd, &index));
|
||||
if (index >= numInStreams || streamUsed[index])
|
||||
@@ -764,7 +764,7 @@ static SRes ReadUnpackInfo(CSzAr *p,
|
||||
if (numPackStreams != 1)
|
||||
for (i = 0; i < numPackStreams; i++)
|
||||
{
|
||||
UInt32 index;
|
||||
uint32_t index;
|
||||
RINOK(SzReadNumber32(&sd, &index));
|
||||
if (index >= numInStreams || streamUsed[index])
|
||||
return SZ_ERROR_ARCHIVE;
|
||||
@@ -812,9 +812,9 @@ static SRes ReadUnpackInfo(CSzAr *p,
|
||||
|
||||
RINOK(WaitId(&sd, k7zIdCodersUnpackSize));
|
||||
|
||||
MY_ALLOC_ZE(UInt64, p->CoderUnpackSizes, (size_t)numCodersOutStreams, alloc);
|
||||
MY_ALLOC_ZE(uint64_t, p->CoderUnpackSizes, (size_t)numCodersOutStreams, alloc);
|
||||
{
|
||||
UInt32 i;
|
||||
uint32_t i;
|
||||
for (i = 0; i < numCodersOutStreams; i++)
|
||||
{
|
||||
RINOK(ReadNumber(&sd, p->CoderUnpackSizes + i));
|
||||
@@ -823,7 +823,7 @@ static SRes ReadUnpackInfo(CSzAr *p,
|
||||
|
||||
for (;;)
|
||||
{
|
||||
UInt64 type;
|
||||
uint64_t type;
|
||||
RINOK(ReadID(&sd, &type));
|
||||
if (type == k7zIdEnd)
|
||||
{
|
||||
@@ -840,7 +840,7 @@ static SRes ReadUnpackInfo(CSzAr *p,
|
||||
}
|
||||
|
||||
|
||||
UInt64 SzAr_GetFolderUnpackSize(const CSzAr *p, UInt32 folderIndex)
|
||||
uint64_t SzAr_GetFolderUnpackSize(const CSzAr *p, uint32_t folderIndex)
|
||||
{
|
||||
return p->CoderUnpackSizes[p->FoToCoderUnpackSizes[folderIndex] + p->FoToMainUnpackSizeIndex[folderIndex]];
|
||||
}
|
||||
@@ -848,8 +848,8 @@ UInt64 SzAr_GetFolderUnpackSize(const CSzAr *p, UInt32 folderIndex)
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UInt32 NumTotalSubStreams;
|
||||
UInt32 NumSubDigests;
|
||||
uint32_t NumTotalSubStreams;
|
||||
uint32_t NumSubDigests;
|
||||
CSzData sdNumSubStreams;
|
||||
CSzData sdSizes;
|
||||
CSzData sdCRCs;
|
||||
@@ -858,24 +858,24 @@ typedef struct
|
||||
|
||||
static SRes ReadSubStreamsInfo(CSzAr *p, CSzData *sd, CSubStreamInfo *ssi)
|
||||
{
|
||||
UInt64 type = 0;
|
||||
UInt32 numSubDigests = 0;
|
||||
UInt32 numFolders = p->NumFolders;
|
||||
UInt32 numUnpackStreams = numFolders;
|
||||
UInt32 numUnpackSizesInData = 0;
|
||||
uint64_t type = 0;
|
||||
uint32_t numSubDigests = 0;
|
||||
uint32_t numFolders = p->NumFolders;
|
||||
uint32_t numUnpackStreams = numFolders;
|
||||
uint32_t numUnpackSizesInData = 0;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
RINOK(ReadID(sd, &type));
|
||||
if (type == k7zIdNumUnpackStream)
|
||||
{
|
||||
UInt32 i;
|
||||
uint32_t i;
|
||||
ssi->sdNumSubStreams.Data = sd->Data;
|
||||
numUnpackStreams = 0;
|
||||
numSubDigests = 0;
|
||||
for (i = 0; i < numFolders; i++)
|
||||
{
|
||||
UInt32 numStreams;
|
||||
uint32_t numStreams;
|
||||
RINOK(SzReadNumber32(sd, &numStreams));
|
||||
if (numUnpackStreams > numUnpackStreams + numStreams)
|
||||
return SZ_ERROR_UNSUPPORTED;
|
||||
@@ -931,12 +931,12 @@ static SRes ReadSubStreamsInfo(CSzAr *p, CSzData *sd, CSubStreamInfo *ssi)
|
||||
|
||||
static SRes SzReadStreamsInfo(CSzAr *p,
|
||||
CSzData *sd,
|
||||
UInt32 numFoldersMax, const CBuf *tempBufs, UInt32 numTempBufs,
|
||||
UInt64 *dataOffset,
|
||||
uint32_t numFoldersMax, const CBuf *tempBufs, uint32_t numTempBufs,
|
||||
uint64_t *dataOffset,
|
||||
CSubStreamInfo *ssi,
|
||||
ISzAllocPtr alloc)
|
||||
{
|
||||
UInt64 type;
|
||||
uint64_t type;
|
||||
|
||||
SzData_Clear(&ssi->sdSizes);
|
||||
SzData_Clear(&ssi->sdCRCs);
|
||||
@@ -973,13 +973,13 @@ static SRes SzReadAndDecodePackedStreams(
|
||||
ILookInStream *inStream,
|
||||
CSzData *sd,
|
||||
CBuf *tempBufs,
|
||||
UInt32 numFoldersMax,
|
||||
UInt64 baseOffset,
|
||||
uint32_t numFoldersMax,
|
||||
uint64_t baseOffset,
|
||||
CSzAr *p,
|
||||
ISzAllocPtr allocTemp)
|
||||
{
|
||||
UInt64 dataStartPos;
|
||||
UInt32 fo;
|
||||
uint64_t dataStartPos;
|
||||
uint32_t fo;
|
||||
CSubStreamInfo ssi;
|
||||
|
||||
RINOK(SzReadStreamsInfo(p, sd, numFoldersMax, NULL, 0, &dataStartPos, &ssi, allocTemp));
|
||||
@@ -994,7 +994,7 @@ static SRes SzReadAndDecodePackedStreams(
|
||||
for (fo = 0; fo < p->NumFolders; fo++)
|
||||
{
|
||||
CBuf *tempBuf = tempBufs + fo;
|
||||
UInt64 unpackSize = SzAr_GetFolderUnpackSize(p, fo);
|
||||
uint64_t unpackSize = SzAr_GetFolderUnpackSize(p, fo);
|
||||
if ((size_t)unpackSize != unpackSize)
|
||||
return SZ_ERROR_MEM;
|
||||
if (!Buf_Create(tempBuf, (size_t)unpackSize, allocTemp))
|
||||
@@ -1011,7 +1011,7 @@ static SRes SzReadAndDecodePackedStreams(
|
||||
return SZ_OK;
|
||||
}
|
||||
|
||||
static SRes SzReadFileNames(const Byte *data, size_t size, UInt32 numFiles, size_t *offsets)
|
||||
static SRes SzReadFileNames(const Byte *data, size_t size, uint32_t numFiles, size_t *offsets)
|
||||
{
|
||||
size_t pos = 0;
|
||||
*offsets++ = 0;
|
||||
@@ -1028,7 +1028,7 @@ static SRes SzReadFileNames(const Byte *data, size_t size, UInt32 numFiles, size
|
||||
return SZ_ERROR_ARCHIVE;
|
||||
for (p = data + pos;
|
||||
#ifdef _WIN32
|
||||
*(const UInt16 *)p != 0
|
||||
*(const uint16_t *)p != 0
|
||||
#else
|
||||
p[0] != 0 || p[1] != 0
|
||||
#endif
|
||||
@@ -1040,13 +1040,13 @@ static SRes SzReadFileNames(const Byte *data, size_t size, UInt32 numFiles, size
|
||||
return (pos == size) ? SZ_OK : SZ_ERROR_ARCHIVE;
|
||||
}
|
||||
|
||||
static MY_NO_INLINE SRes ReadTime(CSzBitUi64s *p, UInt32 num,
|
||||
static MY_NO_INLINE SRes ReadTime(CSzBitUi64s *p, uint32_t num,
|
||||
CSzData *sd2,
|
||||
const CBuf *tempBufs, UInt32 numTempBufs,
|
||||
const CBuf *tempBufs, uint32_t numTempBufs,
|
||||
ISzAllocPtr alloc)
|
||||
{
|
||||
CSzData sd;
|
||||
UInt32 i;
|
||||
uint32_t i;
|
||||
CNtfsFileTime *vals;
|
||||
Byte *defs;
|
||||
Byte external;
|
||||
@@ -1058,7 +1058,7 @@ static MY_NO_INLINE SRes ReadTime(CSzBitUi64s *p, UInt32 num,
|
||||
sd = *sd2;
|
||||
else
|
||||
{
|
||||
UInt32 index;
|
||||
uint32_t index;
|
||||
RINOK(SzReadNumber32(sd2, &index));
|
||||
if (index >= numTempBufs)
|
||||
return SZ_ERROR_ARCHIVE;
|
||||
@@ -1095,7 +1095,7 @@ static SRes SzReadHeader2(
|
||||
CSzArEx *p, /* allocMain */
|
||||
CSzData *sd,
|
||||
ILookInStream *inStream,
|
||||
CBuf *tempBufs, UInt32 *numTempBufs,
|
||||
CBuf *tempBufs, uint32_t *numTempBufs,
|
||||
ISzAllocPtr allocMain,
|
||||
ISzAllocPtr allocTemp
|
||||
)
|
||||
@@ -1103,7 +1103,7 @@ static SRes SzReadHeader2(
|
||||
CSubStreamInfo ssi;
|
||||
|
||||
{
|
||||
UInt64 type;
|
||||
uint64_t type;
|
||||
|
||||
SzData_Clear(&ssi.sdSizes);
|
||||
SzData_Clear(&ssi.sdCRCs);
|
||||
@@ -1118,7 +1118,7 @@ static SRes SzReadHeader2(
|
||||
{
|
||||
for (;;)
|
||||
{
|
||||
UInt64 type2;
|
||||
uint64_t type2;
|
||||
RINOK(ReadID(sd, &type2));
|
||||
if (type2 == k7zIdEnd)
|
||||
break;
|
||||
@@ -1145,7 +1145,7 @@ static SRes SzReadHeader2(
|
||||
|
||||
if (type == k7zIdMainStreamsInfo)
|
||||
{
|
||||
RINOK(SzReadStreamsInfo(&p->db, sd, (UInt32)1 << 30, tempBufs, *numTempBufs,
|
||||
RINOK(SzReadStreamsInfo(&p->db, sd, (uint32_t)1 << 30, tempBufs, *numTempBufs,
|
||||
&p->dataPos, &ssi, allocMain));
|
||||
p->dataPos += p->startPosAfterHeader;
|
||||
RINOK(ReadID(sd, &type));
|
||||
@@ -1161,8 +1161,8 @@ static SRes SzReadHeader2(
|
||||
}
|
||||
|
||||
{
|
||||
UInt32 numFiles = 0;
|
||||
UInt32 numEmptyStreams = 0;
|
||||
uint32_t numFiles = 0;
|
||||
uint32_t numEmptyStreams = 0;
|
||||
const Byte *emptyStreams = NULL;
|
||||
const Byte *emptyFiles = NULL;
|
||||
|
||||
@@ -1171,8 +1171,8 @@ static SRes SzReadHeader2(
|
||||
|
||||
for (;;)
|
||||
{
|
||||
UInt64 type;
|
||||
UInt64 size;
|
||||
uint64_t type;
|
||||
uint64_t size;
|
||||
RINOK(ReadID(sd, &type));
|
||||
if (type == k7zIdEnd)
|
||||
break;
|
||||
@@ -1180,7 +1180,7 @@ static SRes SzReadHeader2(
|
||||
if (size > sd->Size)
|
||||
return SZ_ERROR_ARCHIVE;
|
||||
|
||||
if (type >= ((UInt32)1 << 8))
|
||||
if (type >= ((uint32_t)1 << 8))
|
||||
{
|
||||
SKIP_DATA(sd, size);
|
||||
}
|
||||
@@ -1200,7 +1200,7 @@ static SRes SzReadHeader2(
|
||||
}
|
||||
else
|
||||
{
|
||||
UInt32 index;
|
||||
uint32_t index;
|
||||
RINOK(SzReadNumber32(sd, &index));
|
||||
if (index >= *numTempBufs)
|
||||
return SZ_ERROR_ARCHIVE;
|
||||
@@ -1244,7 +1244,7 @@ static SRes SzReadHeader2(
|
||||
sdPtr = sd;
|
||||
else
|
||||
{
|
||||
UInt32 index;
|
||||
uint32_t index;
|
||||
RINOK(SzReadNumber32(sd, &index));
|
||||
if (index >= *numTempBufs)
|
||||
return SZ_ERROR_ARCHIVE;
|
||||
@@ -1279,7 +1279,7 @@ static SRes SzReadHeader2(
|
||||
|
||||
for (;;)
|
||||
{
|
||||
UInt64 type;
|
||||
uint64_t type;
|
||||
RINOK(ReadID(sd, &type));
|
||||
if (type == k7zIdEnd)
|
||||
break;
|
||||
@@ -1287,24 +1287,24 @@ static SRes SzReadHeader2(
|
||||
}
|
||||
|
||||
{
|
||||
UInt32 i;
|
||||
UInt32 emptyFileIndex = 0;
|
||||
UInt32 folderIndex = 0;
|
||||
UInt32 remSubStreams = 0;
|
||||
UInt32 numSubStreams = 0;
|
||||
UInt64 unpackPos = 0;
|
||||
uint32_t i;
|
||||
uint32_t emptyFileIndex = 0;
|
||||
uint32_t folderIndex = 0;
|
||||
uint32_t remSubStreams = 0;
|
||||
uint32_t numSubStreams = 0;
|
||||
uint64_t unpackPos = 0;
|
||||
const Byte *digestsDefs = NULL;
|
||||
const Byte *digestsVals = NULL;
|
||||
UInt32 digestsValsIndex = 0;
|
||||
UInt32 digestIndex;
|
||||
uint32_t digestsValsIndex = 0;
|
||||
uint32_t digestIndex;
|
||||
Byte allDigestsDefined = 0;
|
||||
Byte isDirMask = 0;
|
||||
Byte crcMask = 0;
|
||||
Byte mask = 0x80;
|
||||
|
||||
MY_ALLOC(UInt32, p->FolderToFile, p->db.NumFolders + 1, allocMain);
|
||||
MY_ALLOC_ZE(UInt32, p->FileToFolder, p->NumFiles, allocMain);
|
||||
MY_ALLOC(UInt64, p->UnpackPositions, p->NumFiles + 1, allocMain);
|
||||
MY_ALLOC(uint32_t, p->FolderToFile, p->db.NumFolders + 1, allocMain);
|
||||
MY_ALLOC_ZE(uint32_t, p->FileToFolder, p->NumFiles, allocMain);
|
||||
MY_ALLOC(uint64_t, p->UnpackPositions, p->NumFiles + 1, allocMain);
|
||||
MY_ALLOC_ZE(Byte, p->IsDirs, (p->NumFiles + 7) >> 3, allocMain);
|
||||
|
||||
RINOK(SzBitUi32s_Alloc(&p->CRCs, p->NumFiles, allocMain));
|
||||
@@ -1328,7 +1328,7 @@ static SRes SzReadHeader2(
|
||||
{
|
||||
if (mask == 0)
|
||||
{
|
||||
UInt32 byteIndex = (i - 1) >> 3;
|
||||
uint32_t byteIndex = (i - 1) >> 3;
|
||||
p->IsDirs[byteIndex] = isDirMask;
|
||||
p->CRCs.Defs[byteIndex] = crcMask;
|
||||
isDirMask = 0;
|
||||
@@ -1351,7 +1351,7 @@ static SRes SzReadHeader2(
|
||||
isDirMask |= mask;
|
||||
if (remSubStreams == 0)
|
||||
{
|
||||
p->FileToFolder[i] = (UInt32)-1;
|
||||
p->FileToFolder[i] = (uint32_t)-1;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -1372,7 +1372,7 @@ static SRes SzReadHeader2(
|
||||
if (numSubStreams != 0)
|
||||
break;
|
||||
{
|
||||
UInt64 folderUnpackSize = SzAr_GetFolderUnpackSize(&p->db, folderIndex);
|
||||
uint64_t folderUnpackSize = SzAr_GetFolderUnpackSize(&p->db, folderIndex);
|
||||
unpackPos += folderUnpackSize;
|
||||
if (unpackPos < folderUnpackSize)
|
||||
return SZ_ERROR_ARCHIVE;
|
||||
@@ -1389,8 +1389,8 @@ static SRes SzReadHeader2(
|
||||
|
||||
if (--remSubStreams == 0)
|
||||
{
|
||||
UInt64 folderUnpackSize = SzAr_GetFolderUnpackSize(&p->db, folderIndex);
|
||||
UInt64 startFolderUnpackPos = p->UnpackPositions[p->FolderToFile[folderIndex]];
|
||||
uint64_t folderUnpackSize = SzAr_GetFolderUnpackSize(&p->db, folderIndex);
|
||||
uint64_t startFolderUnpackPos = p->UnpackPositions[p->FolderToFile[folderIndex]];
|
||||
if (folderUnpackSize < unpackPos - startFolderUnpackPos)
|
||||
return SZ_ERROR_ARCHIVE;
|
||||
unpackPos = startFolderUnpackPos + folderUnpackSize;
|
||||
@@ -1413,7 +1413,7 @@ static SRes SzReadHeader2(
|
||||
}
|
||||
else
|
||||
{
|
||||
UInt64 v;
|
||||
uint64_t v;
|
||||
RINOK(ReadNumber(&ssi.sdSizes, &v));
|
||||
unpackPos += v;
|
||||
if (unpackPos < v)
|
||||
@@ -1429,7 +1429,7 @@ static SRes SzReadHeader2(
|
||||
|
||||
if (mask != 0x80)
|
||||
{
|
||||
UInt32 byteIndex = (i - 1) >> 3;
|
||||
uint32_t byteIndex = (i - 1) >> 3;
|
||||
p->IsDirs[byteIndex] = isDirMask;
|
||||
p->CRCs.Defs[byteIndex] = crcMask;
|
||||
}
|
||||
@@ -1451,7 +1451,7 @@ static SRes SzReadHeader2(
|
||||
return SZ_ERROR_ARCHIVE;
|
||||
/*
|
||||
{
|
||||
UInt64 folderUnpackSize = SzAr_GetFolderUnpackSize(&p->db, folderIndex);
|
||||
uint64_t folderUnpackSize = SzAr_GetFolderUnpackSize(&p->db, folderIndex);
|
||||
unpackPos += folderUnpackSize;
|
||||
if (unpackPos < folderUnpackSize)
|
||||
return SZ_ERROR_ARCHIVE;
|
||||
@@ -1475,8 +1475,8 @@ static SRes SzReadHeader(
|
||||
ISzAllocPtr allocMain,
|
||||
ISzAllocPtr allocTemp)
|
||||
{
|
||||
UInt32 i;
|
||||
UInt32 numTempBufs = 0;
|
||||
uint32_t i;
|
||||
uint32_t numTempBufs = 0;
|
||||
SRes res;
|
||||
CBuf tempBufs[NUM_ADDITIONAL_STREAMS_MAX];
|
||||
|
||||
@@ -1505,10 +1505,10 @@ static SRes SzArEx_Open2(
|
||||
ISzAllocPtr allocTemp)
|
||||
{
|
||||
Byte header[k7zStartHeaderSize];
|
||||
Int64 startArcPos;
|
||||
UInt64 nextHeaderOffset, nextHeaderSize;
|
||||
int64_t startArcPos;
|
||||
uint64_t nextHeaderOffset, nextHeaderSize;
|
||||
size_t nextHeaderSizeT;
|
||||
UInt32 nextHeaderCRC;
|
||||
uint32_t nextHeaderCRC;
|
||||
CBuf buf;
|
||||
SRes res;
|
||||
|
||||
@@ -1541,11 +1541,11 @@ static SRes SzArEx_Open2(
|
||||
return SZ_ERROR_NO_ARCHIVE;
|
||||
|
||||
{
|
||||
Int64 pos = 0;
|
||||
int64_t pos = 0;
|
||||
RINOK(ILookInStream_Seek(inStream, &pos, SZ_SEEK_END));
|
||||
if ((UInt64)pos < startArcPos + nextHeaderOffset ||
|
||||
(UInt64)pos < startArcPos + k7zStartHeaderSize + nextHeaderOffset ||
|
||||
(UInt64)pos < startArcPos + k7zStartHeaderSize + nextHeaderOffset + nextHeaderSize)
|
||||
if ((uint64_t)pos < startArcPos + nextHeaderOffset ||
|
||||
(uint64_t)pos < startArcPos + k7zStartHeaderSize + nextHeaderOffset ||
|
||||
(uint64_t)pos < startArcPos + k7zStartHeaderSize + nextHeaderOffset + nextHeaderSize)
|
||||
return SZ_ERROR_INPUT_EOF;
|
||||
}
|
||||
|
||||
@@ -1562,7 +1562,7 @@ static SRes SzArEx_Open2(
|
||||
if (CrcCalc(buf.data, nextHeaderSizeT) == nextHeaderCRC)
|
||||
{
|
||||
CSzData sd;
|
||||
UInt64 type;
|
||||
uint64_t type;
|
||||
sd.Data = buf.data;
|
||||
sd.Size = buf.size;
|
||||
|
||||
@@ -1635,8 +1635,8 @@ SRes SzArEx_Open(CSzArEx *p, ILookInStream *inStream,
|
||||
SRes SzArEx_Extract(
|
||||
const CSzArEx *p,
|
||||
ILookInStream *inStream,
|
||||
UInt32 fileIndex,
|
||||
UInt32 *blockIndex,
|
||||
uint32_t fileIndex,
|
||||
uint32_t *blockIndex,
|
||||
Byte **tempBuf,
|
||||
size_t *outBufferSize,
|
||||
size_t *offset,
|
||||
@@ -1644,13 +1644,13 @@ SRes SzArEx_Extract(
|
||||
ISzAllocPtr allocMain,
|
||||
ISzAllocPtr allocTemp)
|
||||
{
|
||||
UInt32 folderIndex = p->FileToFolder[fileIndex];
|
||||
uint32_t folderIndex = p->FileToFolder[fileIndex];
|
||||
SRes res = SZ_OK;
|
||||
|
||||
*offset = 0;
|
||||
*outSizeProcessed = 0;
|
||||
|
||||
if (folderIndex == (UInt32)-1)
|
||||
if (folderIndex == (uint32_t)-1)
|
||||
{
|
||||
ISzAlloc_Free(allocMain, *tempBuf);
|
||||
*blockIndex = folderIndex;
|
||||
@@ -1661,9 +1661,9 @@ SRes SzArEx_Extract(
|
||||
|
||||
if (*tempBuf == NULL || *blockIndex != folderIndex)
|
||||
{
|
||||
UInt64 unpackSizeSpec = SzAr_GetFolderUnpackSize(&p->db, folderIndex);
|
||||
uint64_t unpackSizeSpec = SzAr_GetFolderUnpackSize(&p->db, folderIndex);
|
||||
/*
|
||||
UInt64 unpackSizeSpec =
|
||||
uint64_t unpackSizeSpec =
|
||||
p->UnpackPositions[p->FolderToFile[(size_t)folderIndex + 1]] -
|
||||
p->UnpackPositions[p->FolderToFile[folderIndex]];
|
||||
*/
|
||||
@@ -1695,7 +1695,7 @@ SRes SzArEx_Extract(
|
||||
|
||||
if (res == SZ_OK)
|
||||
{
|
||||
UInt64 unpackPos = p->UnpackPositions[fileIndex];
|
||||
uint64_t unpackPos = p->UnpackPositions[fileIndex];
|
||||
*offset = (size_t)(unpackPos - p->UnpackPositions[p->FolderToFile[folderIndex]]);
|
||||
*outSizeProcessed = (size_t)(p->UnpackPositions[(size_t)fileIndex + 1] - unpackPos);
|
||||
if (*offset + *outSizeProcessed > *outBufferSize)
|
||||
@@ -1709,7 +1709,7 @@ SRes SzArEx_Extract(
|
||||
}
|
||||
|
||||
|
||||
size_t SzArEx_GetFileNameUtf16(const CSzArEx *p, size_t fileIndex, UInt16 *dest)
|
||||
size_t SzArEx_GetFileNameUtf16(const CSzArEx *p, size_t fileIndex, uint16_t *dest)
|
||||
{
|
||||
size_t offs = p->FileNameOffsets[fileIndex];
|
||||
size_t len = p->FileNameOffsets[fileIndex + 1] - offs;
|
||||
@@ -1732,17 +1732,17 @@ size_t SzArEx_GetFullNameLen(const CSzArEx *p, size_t fileIndex)
|
||||
len = 0;
|
||||
for (;;)
|
||||
{
|
||||
UInt32 parent = (UInt32)(Int32)-1;
|
||||
uint32_t parent = (uint32_t)(Int32)-1;
|
||||
len += p->FileNameOffsets[fileIndex + 1] - p->FileNameOffsets[fileIndex];
|
||||
if SzBitWithVals_Check(&p->Parents, fileIndex)
|
||||
parent = p->Parents.Vals[fileIndex];
|
||||
if (parent == (UInt32)(Int32)-1)
|
||||
if (parent == (uint32_t)(Int32)-1)
|
||||
return len;
|
||||
fileIndex = parent;
|
||||
}
|
||||
}
|
||||
|
||||
UInt16 *SzArEx_GetFullNameUtf16_Back(const CSzArEx *p, size_t fileIndex, UInt16 *dest)
|
||||
uint16_t *SzArEx_GetFullNameUtf16_Back(const CSzArEx *p, size_t fileIndex, uint16_t *dest)
|
||||
{
|
||||
BoolInt needSlash;
|
||||
if (!p->FileNameOffsets)
|
||||
@@ -1753,7 +1753,7 @@ UInt16 *SzArEx_GetFullNameUtf16_Back(const CSzArEx *p, size_t fileIndex, UInt16
|
||||
needSlash = False;
|
||||
for (;;)
|
||||
{
|
||||
UInt32 parent = (UInt32)(Int32)-1;
|
||||
uint32_t parent = (uint32_t)(Int32)-1;
|
||||
size_t curLen = p->FileNameOffsets[fileIndex + 1] - p->FileNameOffsets[fileIndex];
|
||||
SzArEx_GetFileNameUtf16(p, fileIndex, dest - curLen);
|
||||
if (needSlash)
|
||||
@@ -1763,7 +1763,7 @@ UInt16 *SzArEx_GetFullNameUtf16_Back(const CSzArEx *p, size_t fileIndex, UInt16
|
||||
|
||||
if SzBitWithVals_Check(&p->Parents, fileIndex)
|
||||
parent = p->Parents.Vals[fileIndex];
|
||||
if (parent == (UInt32)(Int32)-1)
|
||||
if (parent == (uint32_t)(Int32)-1)
|
||||
return dest;
|
||||
fileIndex = parent;
|
||||
}
|
||||
|
||||
Vendored
+15
-15
@@ -15,36 +15,36 @@
|
||||
|
||||
#define CRC_UINT32_SWAP(v) ((v >> 24) | ((v >> 8) & 0xFF00) | ((v << 8) & 0xFF0000) | (v << 24))
|
||||
|
||||
UInt32 MY_FAST_CALL CrcUpdateT1_BeT4(UInt32 v, const void *data, size_t size, const UInt32 *table);
|
||||
UInt32 MY_FAST_CALL CrcUpdateT1_BeT8(UInt32 v, const void *data, size_t size, const UInt32 *table);
|
||||
uint32_t MY_FAST_CALL CrcUpdateT1_BeT4(uint32_t v, const void *data, size_t size, const uint32_t *table);
|
||||
uint32_t MY_FAST_CALL CrcUpdateT1_BeT8(uint32_t v, const void *data, size_t size, const uint32_t *table);
|
||||
#endif
|
||||
|
||||
#ifndef MY_CPU_BE
|
||||
UInt32 MY_FAST_CALL CrcUpdateT4(UInt32 v, const void *data, size_t size, const UInt32 *table);
|
||||
UInt32 MY_FAST_CALL CrcUpdateT8(UInt32 v, const void *data, size_t size, const UInt32 *table);
|
||||
uint32_t MY_FAST_CALL CrcUpdateT4(uint32_t v, const void *data, size_t size, const uint32_t *table);
|
||||
uint32_t MY_FAST_CALL CrcUpdateT8(uint32_t v, const void *data, size_t size, const uint32_t *table);
|
||||
#endif
|
||||
|
||||
typedef UInt32 (MY_FAST_CALL *CRC_FUNC)(UInt32 v, const void *data, size_t size, const UInt32 *table);
|
||||
typedef uint32_t (MY_FAST_CALL *CRC_FUNC)(uint32_t v, const void *data, size_t size, const uint32_t *table);
|
||||
|
||||
CRC_FUNC g_CrcUpdateT4;
|
||||
CRC_FUNC g_CrcUpdateT8;
|
||||
CRC_FUNC g_CrcUpdate;
|
||||
|
||||
UInt32 g_CrcTable[256 * CRC_NUM_TABLES];
|
||||
uint32_t g_CrcTable[256 * CRC_NUM_TABLES];
|
||||
|
||||
UInt32 MY_FAST_CALL CrcUpdate(UInt32 v, const void *data, size_t size)
|
||||
uint32_t MY_FAST_CALL CrcUpdate(uint32_t v, const void *data, size_t size)
|
||||
{
|
||||
return g_CrcUpdate(v, data, size, g_CrcTable);
|
||||
}
|
||||
|
||||
UInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size)
|
||||
uint32_t MY_FAST_CALL CrcCalc(const void *data, size_t size)
|
||||
{
|
||||
return g_CrcUpdate(CRC_INIT_VAL, data, size, g_CrcTable) ^ CRC_INIT_VAL;
|
||||
}
|
||||
|
||||
#define CRC_UPDATE_BYTE_2(crc, b) (table[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))
|
||||
|
||||
UInt32 MY_FAST_CALL CrcUpdateT1(UInt32 v, const void *data, size_t size, const UInt32 *table)
|
||||
uint32_t MY_FAST_CALL CrcUpdateT1(uint32_t v, const void *data, size_t size, const uint32_t *table)
|
||||
{
|
||||
const Byte *p = (const Byte *)data;
|
||||
const Byte *pEnd = p + size;
|
||||
@@ -55,18 +55,18 @@ UInt32 MY_FAST_CALL CrcUpdateT1(UInt32 v, const void *data, size_t size, const U
|
||||
|
||||
void MY_FAST_CALL CrcGenerateTable()
|
||||
{
|
||||
UInt32 i;
|
||||
uint32_t i;
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
UInt32 r = i;
|
||||
uint32_t r = i;
|
||||
unsigned j;
|
||||
for (j = 0; j < 8; j++)
|
||||
r = (r >> 1) ^ (kCrcPoly & ((UInt32)0 - (r & 1)));
|
||||
r = (r >> 1) ^ (kCrcPoly & ((uint32_t)0 - (r & 1)));
|
||||
g_CrcTable[i] = r;
|
||||
}
|
||||
for (i = 256; i < 256 * CRC_NUM_TABLES; i++)
|
||||
{
|
||||
UInt32 r = g_CrcTable[(size_t)i - 256];
|
||||
uint32_t r = g_CrcTable[(size_t)i - 256];
|
||||
g_CrcTable[i] = g_CrcTable[r & 0xFF] ^ (r >> 8);
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ void MY_FAST_CALL CrcGenerateTable()
|
||||
#else
|
||||
{
|
||||
#ifndef MY_CPU_BE
|
||||
UInt32 k = 0x01020304;
|
||||
uint32_t k = 0x01020304;
|
||||
const Byte *p = (const Byte *)&k;
|
||||
if (p[0] == 4 && p[1] == 3)
|
||||
{
|
||||
@@ -111,7 +111,7 @@ void MY_FAST_CALL CrcGenerateTable()
|
||||
{
|
||||
for (i = 256 * CRC_NUM_TABLES - 1; i >= 256; i--)
|
||||
{
|
||||
UInt32 x = g_CrcTable[(size_t)i - 256];
|
||||
uint32_t x = g_CrcTable[(size_t)i - 256];
|
||||
g_CrcTable[i] = CRC_UINT32_SWAP(x);
|
||||
}
|
||||
g_CrcUpdateT4 = CrcUpdateT1_BeT4;
|
||||
|
||||
Vendored
+3
-3
@@ -8,7 +8,7 @@
|
||||
|
||||
EXTERN_C_BEGIN
|
||||
|
||||
extern UInt32 g_CrcTable[];
|
||||
extern uint32_t g_CrcTable[];
|
||||
|
||||
/* Call CrcGenerateTable one time before other CRC functions */
|
||||
void MY_FAST_CALL CrcGenerateTable(void);
|
||||
@@ -17,8 +17,8 @@ void MY_FAST_CALL CrcGenerateTable(void);
|
||||
#define CRC_GET_DIGEST(crc) ((crc) ^ CRC_INIT_VAL)
|
||||
#define CRC_UPDATE_BYTE(crc, b) (g_CrcTable[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))
|
||||
|
||||
UInt32 MY_FAST_CALL CrcUpdate(UInt32 crc, const void *data, size_t size);
|
||||
UInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size);
|
||||
uint32_t MY_FAST_CALL CrcUpdate(uint32_t crc, const void *data, size_t size);
|
||||
uint32_t MY_FAST_CALL CrcCalc(const void *data, size_t size);
|
||||
|
||||
EXTERN_C_END
|
||||
|
||||
|
||||
Vendored
+12
-12
@@ -9,14 +9,14 @@
|
||||
|
||||
#define CRC_UPDATE_BYTE_2(crc, b) (table[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))
|
||||
|
||||
UInt32 MY_FAST_CALL CrcUpdateT4(UInt32 v, const void *data, size_t size, const UInt32 *table)
|
||||
uint32_t MY_FAST_CALL CrcUpdateT4(uint32_t v, const void *data, size_t size, const uint32_t *table)
|
||||
{
|
||||
const Byte *p = (const Byte *)data;
|
||||
for (; size > 0 && ((unsigned)(ptrdiff_t)p & 3) != 0; size--, p++)
|
||||
v = CRC_UPDATE_BYTE_2(v, *p);
|
||||
for (; size >= 4; size -= 4, p += 4)
|
||||
{
|
||||
v ^= *(const UInt32 *)p;
|
||||
v ^= *(const uint32_t *)p;
|
||||
v =
|
||||
(table + 0x300)[((v ) & 0xFF)]
|
||||
^ (table + 0x200)[((v >> 8) & 0xFF)]
|
||||
@@ -28,21 +28,21 @@ UInt32 MY_FAST_CALL CrcUpdateT4(UInt32 v, const void *data, size_t size, const U
|
||||
return v;
|
||||
}
|
||||
|
||||
UInt32 MY_FAST_CALL CrcUpdateT8(UInt32 v, const void *data, size_t size, const UInt32 *table)
|
||||
uint32_t MY_FAST_CALL CrcUpdateT8(uint32_t v, const void *data, size_t size, const uint32_t *table)
|
||||
{
|
||||
const Byte *p = (const Byte *)data;
|
||||
for (; size > 0 && ((unsigned)(ptrdiff_t)p & 7) != 0; size--, p++)
|
||||
v = CRC_UPDATE_BYTE_2(v, *p);
|
||||
for (; size >= 8; size -= 8, p += 8)
|
||||
{
|
||||
UInt32 d;
|
||||
v ^= *(const UInt32 *)p;
|
||||
uint32_t d;
|
||||
v ^= *(const uint32_t *)p;
|
||||
v =
|
||||
(table + 0x700)[((v ) & 0xFF)]
|
||||
^ (table + 0x600)[((v >> 8) & 0xFF)]
|
||||
^ (table + 0x500)[((v >> 16) & 0xFF)]
|
||||
^ (table + 0x400)[((v >> 24))];
|
||||
d = *((const UInt32 *)p + 1);
|
||||
d = *((const uint32_t *)p + 1);
|
||||
v ^=
|
||||
(table + 0x300)[((d ) & 0xFF)]
|
||||
^ (table + 0x200)[((d >> 8) & 0xFF)]
|
||||
@@ -63,7 +63,7 @@ UInt32 MY_FAST_CALL CrcUpdateT8(UInt32 v, const void *data, size_t size, const U
|
||||
|
||||
#define CRC_UPDATE_BYTE_2_BE(crc, b) (table[(((crc) >> 24) ^ (b))] ^ ((crc) << 8))
|
||||
|
||||
UInt32 MY_FAST_CALL CrcUpdateT1_BeT4(UInt32 v, const void *data, size_t size, const UInt32 *table)
|
||||
uint32_t MY_FAST_CALL CrcUpdateT1_BeT4(uint32_t v, const void *data, size_t size, const uint32_t *table)
|
||||
{
|
||||
const Byte *p = (const Byte *)data;
|
||||
table += 0x100;
|
||||
@@ -72,7 +72,7 @@ UInt32 MY_FAST_CALL CrcUpdateT1_BeT4(UInt32 v, const void *data, size_t size, co
|
||||
v = CRC_UPDATE_BYTE_2_BE(v, *p);
|
||||
for (; size >= 4; size -= 4, p += 4)
|
||||
{
|
||||
v ^= *(const UInt32 *)p;
|
||||
v ^= *(const uint32_t *)p;
|
||||
v =
|
||||
(table + 0x000)[((v ) & 0xFF)]
|
||||
^ (table + 0x100)[((v >> 8) & 0xFF)]
|
||||
@@ -84,7 +84,7 @@ UInt32 MY_FAST_CALL CrcUpdateT1_BeT4(UInt32 v, const void *data, size_t size, co
|
||||
return CRC_UINT32_SWAP(v);
|
||||
}
|
||||
|
||||
UInt32 MY_FAST_CALL CrcUpdateT1_BeT8(UInt32 v, const void *data, size_t size, const UInt32 *table)
|
||||
uint32_t MY_FAST_CALL CrcUpdateT1_BeT8(uint32_t v, const void *data, size_t size, const uint32_t *table)
|
||||
{
|
||||
const Byte *p = (const Byte *)data;
|
||||
table += 0x100;
|
||||
@@ -93,14 +93,14 @@ UInt32 MY_FAST_CALL CrcUpdateT1_BeT8(UInt32 v, const void *data, size_t size, co
|
||||
v = CRC_UPDATE_BYTE_2_BE(v, *p);
|
||||
for (; size >= 8; size -= 8, p += 8)
|
||||
{
|
||||
UInt32 d;
|
||||
v ^= *(const UInt32 *)p;
|
||||
uint32_t d;
|
||||
v ^= *(const uint32_t *)p;
|
||||
v =
|
||||
(table + 0x400)[((v ) & 0xFF)]
|
||||
^ (table + 0x500)[((v >> 8) & 0xFF)]
|
||||
^ (table + 0x600)[((v >> 16) & 0xFF)]
|
||||
^ (table + 0x700)[((v >> 24))];
|
||||
d = *((const UInt32 *)p + 1);
|
||||
d = *((const uint32_t *)p + 1);
|
||||
v ^=
|
||||
(table + 0x000)[((d ) & 0xFF)]
|
||||
^ (table + 0x100)[((d >> 8) & 0xFF)]
|
||||
|
||||
Vendored
+26
-26
@@ -43,7 +43,7 @@ typedef struct
|
||||
const Byte *cur;
|
||||
const Byte *end;
|
||||
const Byte *begin;
|
||||
UInt64 processed;
|
||||
uint64_t processed;
|
||||
BoolInt extra;
|
||||
SRes res;
|
||||
const ILookInStream *inStream;
|
||||
@@ -70,7 +70,7 @@ static Byte ReadByte(const IByteIn *pp)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static SRes SzDecodePpmd(const Byte *props, unsigned propsSize, UInt64 inSize, const ILookInStream *inStream,
|
||||
static SRes SzDecodePpmd(const Byte *props, unsigned propsSize, uint64_t inSize, const ILookInStream *inStream,
|
||||
Byte *outBuffer, SizeT outSize, ISzAllocPtr allocMain)
|
||||
{
|
||||
CPpmd7 ppmd;
|
||||
@@ -89,7 +89,7 @@ static SRes SzDecodePpmd(const Byte *props, unsigned propsSize, UInt64 inSize, c
|
||||
|
||||
{
|
||||
unsigned order = props[0];
|
||||
UInt32 memSize = GetUi32(props + 1);
|
||||
uint32_t memSize = GetUi32(props + 1);
|
||||
if (order < PPMD7_MIN_ORDER ||
|
||||
order > PPMD7_MAX_ORDER ||
|
||||
memSize < PPMD7_MIN_MEM_SIZE ||
|
||||
@@ -131,7 +131,7 @@ static SRes SzDecodePpmd(const Byte *props, unsigned propsSize, UInt64 inSize, c
|
||||
#endif
|
||||
|
||||
|
||||
static SRes SzDecodeLzma(const Byte *props, unsigned propsSize, UInt64 inSize, ILookInStream *inStream,
|
||||
static SRes SzDecodeLzma(const Byte *props, unsigned propsSize, uint64_t inSize, ILookInStream *inStream,
|
||||
Byte *outBuffer, SizeT outSize, ISzAllocPtr allocMain)
|
||||
{
|
||||
CLzmaDec state;
|
||||
@@ -191,7 +191,7 @@ static SRes SzDecodeLzma(const Byte *props, unsigned propsSize, UInt64 inSize, I
|
||||
|
||||
#ifndef _7Z_NO_METHOD_LZMA2
|
||||
|
||||
static SRes SzDecodeLzma2(const Byte *props, unsigned propsSize, UInt64 inSize, ILookInStream *inStream,
|
||||
static SRes SzDecodeLzma2(const Byte *props, unsigned propsSize, uint64_t inSize, ILookInStream *inStream,
|
||||
Byte *outBuffer, SizeT outSize, ISzAllocPtr allocMain)
|
||||
{
|
||||
CLzma2Dec state;
|
||||
@@ -250,7 +250,7 @@ static SRes SzDecodeLzma2(const Byte *props, unsigned propsSize, UInt64 inSize,
|
||||
#endif
|
||||
|
||||
|
||||
static SRes SzDecodeCopy(UInt64 inSize, ILookInStream *inStream, Byte *outBuffer)
|
||||
static SRes SzDecodeCopy(uint64_t inSize, ILookInStream *inStream, Byte *outBuffer)
|
||||
{
|
||||
while (inSize > 0)
|
||||
{
|
||||
@@ -269,7 +269,7 @@ static SRes SzDecodeCopy(UInt64 inSize, ILookInStream *inStream, Byte *outBuffer
|
||||
return SZ_OK;
|
||||
}
|
||||
|
||||
static BoolInt IS_MAIN_METHOD(UInt32 m)
|
||||
static BoolInt IS_MAIN_METHOD(uint32_t m)
|
||||
{
|
||||
switch (m)
|
||||
{
|
||||
@@ -290,8 +290,8 @@ static BoolInt IS_SUPPORTED_CODER(const CSzCoderInfo *c)
|
||||
{
|
||||
return
|
||||
c->NumStreams == 1
|
||||
/* && c->MethodID <= (UInt32)0xFFFFFFFF */
|
||||
&& IS_MAIN_METHOD((UInt32)c->MethodID);
|
||||
/* && c->MethodID <= (uint32_t)0xFFFFFFFF */
|
||||
&& IS_MAIN_METHOD((uint32_t)c->MethodID);
|
||||
}
|
||||
|
||||
#define IS_BCJ2(c) ((c)->MethodID == k_BCJ2 && (c)->NumStreams == 4)
|
||||
@@ -316,7 +316,7 @@ static SRes CheckSupportedFolder(const CSzFolder *f)
|
||||
{
|
||||
const CSzCoderInfo *c = &f->Coders[1];
|
||||
if (
|
||||
/* c->MethodID > (UInt32)0xFFFFFFFF || */
|
||||
/* c->MethodID > (uint32_t)0xFFFFFFFF || */
|
||||
c->NumStreams != 1
|
||||
|| f->NumPackStreams != 1
|
||||
|| f->PackStreams[0] != 0
|
||||
@@ -324,7 +324,7 @@ static SRes CheckSupportedFolder(const CSzFolder *f)
|
||||
|| f->Bonds[0].InIndex != 1
|
||||
|| f->Bonds[0].OutIndex != 0)
|
||||
return SZ_ERROR_UNSUPPORTED;
|
||||
switch ((UInt32)c->MethodID)
|
||||
switch ((uint32_t)c->MethodID)
|
||||
{
|
||||
case k_Delta:
|
||||
case k_BCJ:
|
||||
@@ -369,13 +369,13 @@ static SRes CheckSupportedFolder(const CSzFolder *f)
|
||||
|
||||
static SRes SzFolder_Decode2(const CSzFolder *folder,
|
||||
const Byte *propsData,
|
||||
const UInt64 *unpackSizes,
|
||||
const UInt64 *packPositions,
|
||||
ILookInStream *inStream, UInt64 startPos,
|
||||
const uint64_t *unpackSizes,
|
||||
const uint64_t *packPositions,
|
||||
ILookInStream *inStream, uint64_t startPos,
|
||||
Byte *outBuffer, SizeT outSize, ISzAllocPtr allocMain,
|
||||
Byte *tempBuf[])
|
||||
{
|
||||
UInt32 ci;
|
||||
uint32_t ci;
|
||||
SizeT tempSizes[3] = { 0, 0, 0};
|
||||
SizeT tempSize3 = 0;
|
||||
Byte *tempBuf3 = 0;
|
||||
@@ -386,17 +386,17 @@ static SRes SzFolder_Decode2(const CSzFolder *folder,
|
||||
{
|
||||
const CSzCoderInfo *coder = &folder->Coders[ci];
|
||||
|
||||
if (IS_MAIN_METHOD((UInt32)coder->MethodID))
|
||||
if (IS_MAIN_METHOD((uint32_t)coder->MethodID))
|
||||
{
|
||||
UInt32 si = 0;
|
||||
UInt64 offset;
|
||||
UInt64 inSize;
|
||||
uint32_t si = 0;
|
||||
uint64_t offset;
|
||||
uint64_t inSize;
|
||||
Byte *outBufCur = outBuffer;
|
||||
SizeT outSizeCur = outSize;
|
||||
if (folder->NumCoders == 4)
|
||||
{
|
||||
UInt32 indices[] = { 3, 2, 0 };
|
||||
UInt64 unpackSize = unpackSizes[ci];
|
||||
uint32_t indices[] = { 3, 2, 0 };
|
||||
uint64_t unpackSize = unpackSizes[ci];
|
||||
si = indices[ci];
|
||||
if (ci < 2)
|
||||
{
|
||||
@@ -451,8 +451,8 @@ static SRes SzFolder_Decode2(const CSzFolder *folder,
|
||||
}
|
||||
else if (coder->MethodID == k_BCJ2)
|
||||
{
|
||||
UInt64 offset = packPositions[1];
|
||||
UInt64 s3Size = packPositions[2] - offset;
|
||||
uint64_t offset = packPositions[1];
|
||||
uint64_t s3Size = packPositions[2] - offset;
|
||||
|
||||
if (ci != 3)
|
||||
return SZ_ERROR_UNSUPPORTED;
|
||||
@@ -522,7 +522,7 @@ static SRes SzFolder_Decode2(const CSzFolder *folder,
|
||||
{
|
||||
case k_BCJ:
|
||||
{
|
||||
UInt32 state;
|
||||
uint32_t state;
|
||||
x86_Convert_Init(state);
|
||||
x86_Convert(outBuffer, outSize, 0, &state, 0);
|
||||
break;
|
||||
@@ -546,8 +546,8 @@ static SRes SzFolder_Decode2(const CSzFolder *folder,
|
||||
}
|
||||
|
||||
|
||||
SRes SzAr_DecodeFolder(const CSzAr *p, UInt32 folderIndex,
|
||||
ILookInStream *inStream, UInt64 startPos,
|
||||
SRes SzAr_DecodeFolder(const CSzAr *p, uint32_t folderIndex,
|
||||
ILookInStream *inStream, uint64_t startPos,
|
||||
Byte *outBuffer, size_t outSize,
|
||||
ISzAllocPtr allocMain)
|
||||
{
|
||||
|
||||
Vendored
+6
-6
@@ -166,14 +166,14 @@ WRes File_Write(CSzFile *p, const void *data, size_t *size)
|
||||
#endif
|
||||
}
|
||||
|
||||
WRes File_Seek(CSzFile *p, Int64 *pos, ESzSeek origin)
|
||||
WRes File_Seek(CSzFile *p, int64_t *pos, ESzSeek origin)
|
||||
{
|
||||
#ifdef USE_WINDOWS_FILE
|
||||
|
||||
LARGE_INTEGER value;
|
||||
DWORD moveMethod;
|
||||
value.LowPart = (DWORD)*pos;
|
||||
value.HighPart = (LONG)((UInt64)*pos >> 16 >> 16); /* for case when UInt64 is 32-bit only */
|
||||
value.HighPart = (LONG)((uint64_t)*pos >> 16 >> 16); /* for case when uint64_t is 32-bit only */
|
||||
switch (origin)
|
||||
{
|
||||
case SZ_SEEK_SET: moveMethod = FILE_BEGIN; break;
|
||||
@@ -188,7 +188,7 @@ WRes File_Seek(CSzFile *p, Int64 *pos, ESzSeek origin)
|
||||
if (res != NO_ERROR)
|
||||
return res;
|
||||
}
|
||||
*pos = ((Int64)value.HighPart << 32) | value.LowPart;
|
||||
*pos = ((int64_t)value.HighPart << 32) | value.LowPart;
|
||||
return 0;
|
||||
|
||||
#else
|
||||
@@ -209,7 +209,7 @@ WRes File_Seek(CSzFile *p, Int64 *pos, ESzSeek origin)
|
||||
#endif
|
||||
}
|
||||
|
||||
WRes File_GetLength(CSzFile *p, UInt64 *length)
|
||||
WRes File_GetLength(CSzFile *p, uint64_t *length)
|
||||
{
|
||||
#ifdef USE_WINDOWS_FILE
|
||||
|
||||
@@ -221,7 +221,7 @@ WRes File_GetLength(CSzFile *p, UInt64 *length)
|
||||
if (res != NO_ERROR)
|
||||
return res;
|
||||
}
|
||||
*length = (((UInt64)sizeHigh) << 32) + sizeLow;
|
||||
*length = (((uint64_t)sizeHigh) << 32) + sizeLow;
|
||||
return 0;
|
||||
|
||||
#else
|
||||
@@ -258,7 +258,7 @@ static SRes FileInStream_Read(const ISeekInStream *pp, void *buf, size_t *size)
|
||||
return (File_Read(&p->file, buf, size) == 0) ? SZ_OK : SZ_ERROR_READ;
|
||||
}
|
||||
|
||||
static SRes FileInStream_Seek(const ISeekInStream *pp, Int64 *pos, ESzSeek origin)
|
||||
static SRes FileInStream_Seek(const ISeekInStream *pp, int64_t *pos, ESzSeek origin)
|
||||
{
|
||||
CFileInStream *p = CONTAINER_FROM_VTBL(pp, CFileInStream, vt);
|
||||
return File_Seek(&p->file, pos, origin);
|
||||
|
||||
Vendored
+2
-2
@@ -46,8 +46,8 @@ WRes File_Read(CSzFile *p, void *data, size_t *size);
|
||||
/* writes *size bytes */
|
||||
WRes File_Write(CSzFile *p, const void *data, size_t *size);
|
||||
|
||||
WRes File_Seek(CSzFile *p, Int64 *pos, ESzSeek origin);
|
||||
WRes File_GetLength(CSzFile *p, UInt64 *length);
|
||||
WRes File_Seek(CSzFile *p, int64_t *pos, ESzSeek origin);
|
||||
WRes File_GetLength(CSzFile *p, uint64_t *length);
|
||||
|
||||
|
||||
/* ---------- FileInStream ---------- */
|
||||
|
||||
Vendored
+3
-3
@@ -35,9 +35,9 @@ SRes SeqInStream_ReadByte(const ISeqInStream *stream, Byte *buf)
|
||||
|
||||
|
||||
|
||||
SRes LookInStream_SeekTo(const ILookInStream *stream, UInt64 offset)
|
||||
SRes LookInStream_SeekTo(const ILookInStream *stream, uint64_t offset)
|
||||
{
|
||||
Int64 t = offset;
|
||||
int64_t t = offset;
|
||||
return ILookInStream_Seek(stream, &t, SZ_SEEK_SET);
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ static SRes LookToRead2_Read(const ILookInStream *pp, void *buf, size_t *size)
|
||||
return SZ_OK;
|
||||
}
|
||||
|
||||
static SRes LookToRead2_Seek(const ILookInStream *pp, Int64 *pos, ESzSeek origin)
|
||||
static SRes LookToRead2_Seek(const ILookInStream *pp, int64_t *pos, ESzSeek origin)
|
||||
{
|
||||
GET_LookToRead2
|
||||
p->pos = p->size = 0;
|
||||
|
||||
Vendored
+7
-23
@@ -4,11 +4,8 @@
|
||||
#ifndef __7Z_TYPES_H
|
||||
#define __7Z_TYPES_H
|
||||
|
||||
#ifdef _WIN32
|
||||
/* #include <windows.h> */
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifndef EXTERN_C_BEGIN
|
||||
#ifdef __cplusplus
|
||||
@@ -67,15 +64,6 @@ typedef int WRes;
|
||||
typedef unsigned char Byte;
|
||||
#endif
|
||||
typedef short Int16;
|
||||
typedef unsigned short UInt16;
|
||||
|
||||
#if defined(_LZMA_UINT32_IS_ULONG) && !defined(__LP64__)
|
||||
typedef long Int32;
|
||||
typedef unsigned long UInt32;
|
||||
#else
|
||||
typedef int Int32;
|
||||
typedef unsigned int UInt32;
|
||||
#endif
|
||||
|
||||
#ifdef _SZ_NO_INT_64
|
||||
|
||||
@@ -83,24 +71,20 @@ typedef unsigned int UInt32;
|
||||
NOTES: Some code will work incorrectly in that case! */
|
||||
|
||||
typedef long Int64;
|
||||
typedef unsigned long UInt64;
|
||||
|
||||
#else
|
||||
|
||||
#if defined(_MSC_VER) || defined(__BORLANDC__)
|
||||
typedef __int64 Int64;
|
||||
typedef unsigned __int64 UInt64;
|
||||
#define UINT64_CONST(n) n
|
||||
#else
|
||||
typedef long long int Int64;
|
||||
typedef unsigned long long int UInt64;
|
||||
#define UINT64_CONST(n) n ## ULL
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef _LZMA_NO_SYSTEM_SIZE_T
|
||||
typedef UInt32 SizeT;
|
||||
typedef uint32_t SizeT;
|
||||
#else
|
||||
typedef size_t SizeT;
|
||||
#endif
|
||||
@@ -204,7 +188,7 @@ typedef struct ISeekInStream ISeekInStream;
|
||||
struct ISeekInStream
|
||||
{
|
||||
SRes (*Read)(const ISeekInStream *p, void *buf, size_t *size); /* same as ISeqInStream::Read */
|
||||
SRes (*Seek)(const ISeekInStream *p, Int64 *pos, ESzSeek origin);
|
||||
SRes (*Seek)(const ISeekInStream *p, int64_t *pos, ESzSeek origin);
|
||||
};
|
||||
#define ISeekInStream_Read(p, buf, size) (p)->Read(p, buf, size)
|
||||
#define ISeekInStream_Seek(p, pos, origin) (p)->Seek(p, pos, origin)
|
||||
@@ -222,7 +206,7 @@ struct ILookInStream
|
||||
|
||||
SRes (*Read)(const ILookInStream *p, void *buf, size_t *size);
|
||||
/* reads directly (without buffer). It's same as ISeqInStream::Read */
|
||||
SRes (*Seek)(const ILookInStream *p, Int64 *pos, ESzSeek origin);
|
||||
SRes (*Seek)(const ILookInStream *p, int64_t *pos, ESzSeek origin);
|
||||
};
|
||||
|
||||
#define ILookInStream_Look(p, buf, size) (p)->Look(p, buf, size)
|
||||
@@ -232,7 +216,7 @@ struct ILookInStream
|
||||
|
||||
|
||||
SRes LookInStream_LookRead(const ILookInStream *stream, void *buf, size_t *size);
|
||||
SRes LookInStream_SeekTo(const ILookInStream *stream, UInt64 offset);
|
||||
SRes LookInStream_SeekTo(const ILookInStream *stream, uint64_t offset);
|
||||
|
||||
/* reads via ILookInStream::Read */
|
||||
SRes LookInStream_Read2(const ILookInStream *stream, void *buf, size_t size, SRes errorType);
|
||||
@@ -281,9 +265,9 @@ typedef struct ICompressProgress ICompressProgress;
|
||||
|
||||
struct ICompressProgress
|
||||
{
|
||||
SRes (*Progress)(const ICompressProgress *p, UInt64 inSize, UInt64 outSize);
|
||||
SRes (*Progress)(const ICompressProgress *p, uint64_t inSize, uint64_t outSize);
|
||||
/* Returns: result. (result != SZ_OK) means break.
|
||||
Value (UInt64)(Int64)-1 for size means unknown value. */
|
||||
Value (uint64_t)(int64_t)-1 for size means unknown value. */
|
||||
};
|
||||
#define ICompressProgress_Progress(p, inSize, outSize) (p)->Progress(p, inSize, outSize)
|
||||
|
||||
|
||||
Vendored
+9
-7
@@ -6,10 +6,12 @@
|
||||
#include "Bcj2.h"
|
||||
#include "CpuArch.h"
|
||||
|
||||
#define CProb UInt16
|
||||
#define CProb uint16_t
|
||||
|
||||
#define kTopValue ((UInt32)1 << 24)
|
||||
#undef kTopValue
|
||||
#define kTopValue ((uint32_t)1 << 24)
|
||||
#define kNumModelBits 11
|
||||
#undef kBitModelTotal
|
||||
#define kBitModelTotal (1 << kNumModelBits)
|
||||
#define kNumMoveBits 5
|
||||
|
||||
@@ -76,7 +78,7 @@ SRes Bcj2Dec_Decode(CBcj2Dec *p)
|
||||
p->bufs[p->state] = cur + 4;
|
||||
|
||||
{
|
||||
UInt32 val;
|
||||
uint32_t val;
|
||||
Byte *dest;
|
||||
SizeT rem;
|
||||
|
||||
@@ -174,7 +176,7 @@ SRes Bcj2Dec_Decode(CBcj2Dec *p)
|
||||
{
|
||||
p->temp[3] = src[-1];
|
||||
p->bufs[BCJ2_STREAM_MAIN] = src;
|
||||
p->ip += (UInt32)num;
|
||||
p->ip += (uint32_t)num;
|
||||
p->dest += num;
|
||||
p->state =
|
||||
p->bufs[BCJ2_STREAM_MAIN] ==
|
||||
@@ -185,7 +187,7 @@ SRes Bcj2Dec_Decode(CBcj2Dec *p)
|
||||
}
|
||||
|
||||
{
|
||||
UInt32 bound, ttt;
|
||||
uint32_t bound, ttt;
|
||||
CProb *prob;
|
||||
Byte b = src[0];
|
||||
Byte prev = (Byte)(num == 0 ? p->temp[3] : src[-1]);
|
||||
@@ -193,7 +195,7 @@ SRes Bcj2Dec_Decode(CBcj2Dec *p)
|
||||
p->temp[3] = b;
|
||||
p->bufs[BCJ2_STREAM_MAIN] = src + 1;
|
||||
num++;
|
||||
p->ip += (UInt32)num;
|
||||
p->ip += (uint32_t)num;
|
||||
p->dest += num;
|
||||
|
||||
prob = p->probs + (unsigned)(b == 0xE8 ? 2 + (unsigned)prev : (b == 0xE9 ? 1 : 0));
|
||||
@@ -210,7 +212,7 @@ SRes Bcj2Dec_Decode(CBcj2Dec *p)
|
||||
}
|
||||
|
||||
{
|
||||
UInt32 val;
|
||||
uint32_t val;
|
||||
unsigned cj = (p->temp[3] == 0xE8) ? BCJ2_STREAM_CALL : BCJ2_STREAM_JUMP;
|
||||
const Byte *cur = p->bufs[cj];
|
||||
Byte *dest;
|
||||
|
||||
Vendored
+15
-15
@@ -68,11 +68,11 @@ typedef struct
|
||||
|
||||
unsigned state; /* BCJ2_STREAM_MAIN has more priority than BCJ2_STATE_ORIG */
|
||||
|
||||
UInt32 ip;
|
||||
uint32_t ip;
|
||||
Byte temp[4];
|
||||
UInt32 range;
|
||||
UInt32 code;
|
||||
UInt16 probs[2 + 256];
|
||||
uint32_t range;
|
||||
uint32_t code;
|
||||
uint16_t probs[2 + 256];
|
||||
} CBcj2Dec;
|
||||
|
||||
void Bcj2Dec_Init(CBcj2Dec *p);
|
||||
@@ -104,28 +104,28 @@ typedef struct
|
||||
Byte prevByte;
|
||||
|
||||
Byte cache;
|
||||
UInt32 range;
|
||||
UInt64 low;
|
||||
UInt64 cacheSize;
|
||||
uint32_t range;
|
||||
uint64_t low;
|
||||
uint64_t cacheSize;
|
||||
|
||||
UInt32 ip;
|
||||
uint32_t ip;
|
||||
|
||||
/* 32-bit ralative offset in JUMP/CALL commands is
|
||||
- (mod 4 GB) in 32-bit mode
|
||||
- signed Int32 in 64-bit mode
|
||||
We use (mod 4 GB) check for fileSize.
|
||||
Use fileSize up to 2 GB, if you want to support 32-bit and 64-bit code conversion. */
|
||||
UInt32 fileIp;
|
||||
UInt32 fileSize; /* (fileSize <= ((UInt32)1 << 31)), 0 means no_limit */
|
||||
UInt32 relatLimit; /* (relatLimit <= ((UInt32)1 << 31)), 0 means desable_conversion */
|
||||
uint32_t fileIp;
|
||||
uint32_t fileSize; /* (fileSize <= ((uint32_t)1 << 31)), 0 means no_limit */
|
||||
uint32_t relatLimit; /* (relatLimit <= ((uint32_t)1 << 31)), 0 means desable_conversion */
|
||||
|
||||
UInt32 tempTarget;
|
||||
uint32_t tempTarget;
|
||||
unsigned tempPos;
|
||||
Byte temp[4 * 2];
|
||||
|
||||
unsigned flushPos;
|
||||
|
||||
UInt16 probs[2 + 256];
|
||||
uint16_t probs[2 + 256];
|
||||
} CBcj2Enc;
|
||||
|
||||
void Bcj2Enc_Init(CBcj2Enc *p);
|
||||
@@ -136,10 +136,10 @@ void Bcj2Enc_Encode(CBcj2Enc *p);
|
||||
|
||||
|
||||
#define BCJ2_RELAT_LIMIT_NUM_BITS 26
|
||||
#define BCJ2_RELAT_LIMIT ((UInt32)1 << BCJ2_RELAT_LIMIT_NUM_BITS)
|
||||
#define BCJ2_RELAT_LIMIT ((uint32_t)1 << BCJ2_RELAT_LIMIT_NUM_BITS)
|
||||
|
||||
/* limit for CBcj2Enc::fileSize variable */
|
||||
#define BCJ2_FileSize_MAX ((UInt32)1 << 31)
|
||||
#define BCJ2_FileSize_MAX ((uint32_t)1 << 31)
|
||||
|
||||
EXTERN_C_END
|
||||
|
||||
|
||||
Vendored
+35
-35
@@ -6,7 +6,7 @@
|
||||
#include "CpuArch.h"
|
||||
#include "Bra.h"
|
||||
|
||||
SizeT ARM_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
|
||||
SizeT ARM_Convert(Byte *data, SizeT size, uint32_t ip, int encoding)
|
||||
{
|
||||
Byte *p;
|
||||
const Byte *lim;
|
||||
@@ -28,9 +28,9 @@ SizeT ARM_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
|
||||
break;
|
||||
}
|
||||
{
|
||||
UInt32 v = GetUi32(p - 4);
|
||||
uint32_t v = GetUi32(p - 4);
|
||||
v <<= 2;
|
||||
v += ip + (UInt32)(p - data);
|
||||
v += ip + (uint32_t)(p - data);
|
||||
v >>= 2;
|
||||
v &= 0x00FFFFFF;
|
||||
v |= 0xEB000000;
|
||||
@@ -49,9 +49,9 @@ SizeT ARM_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
|
||||
break;
|
||||
}
|
||||
{
|
||||
UInt32 v = GetUi32(p - 4);
|
||||
uint32_t v = GetUi32(p - 4);
|
||||
v <<= 2;
|
||||
v -= ip + (UInt32)(p - data);
|
||||
v -= ip + (uint32_t)(p - data);
|
||||
v >>= 2;
|
||||
v &= 0x00FFFFFF;
|
||||
v |= 0xEB000000;
|
||||
@@ -61,7 +61,7 @@ SizeT ARM_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
|
||||
}
|
||||
|
||||
|
||||
SizeT ARMT_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
|
||||
SizeT ARMT_Convert(Byte *data, SizeT size, uint32_t ip, int encoding)
|
||||
{
|
||||
Byte *p;
|
||||
const Byte *lim;
|
||||
@@ -73,10 +73,10 @@ SizeT ARMT_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
|
||||
|
||||
for (;;)
|
||||
{
|
||||
UInt32 b1;
|
||||
uint32_t b1;
|
||||
for (;;)
|
||||
{
|
||||
UInt32 b3;
|
||||
uint32_t b3;
|
||||
if (p > lim)
|
||||
return p - data;
|
||||
b1 = p[1];
|
||||
@@ -87,15 +87,15 @@ SizeT ARMT_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
|
||||
break;
|
||||
}
|
||||
{
|
||||
UInt32 v =
|
||||
((UInt32)b1 << 19)
|
||||
+ (((UInt32)p[1] & 0x7) << 8)
|
||||
+ (((UInt32)p[-2] << 11))
|
||||
uint32_t v =
|
||||
((uint32_t)b1 << 19)
|
||||
+ (((uint32_t)p[1] & 0x7) << 8)
|
||||
+ (((uint32_t)p[-2] << 11))
|
||||
+ (p[0]);
|
||||
|
||||
p += 2;
|
||||
{
|
||||
UInt32 cur = (ip + (UInt32)(p - data)) >> 1;
|
||||
uint32_t cur = (ip + (uint32_t)(p - data)) >> 1;
|
||||
v += cur;
|
||||
}
|
||||
|
||||
@@ -108,10 +108,10 @@ SizeT ARMT_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
|
||||
|
||||
for (;;)
|
||||
{
|
||||
UInt32 b1;
|
||||
uint32_t b1;
|
||||
for (;;)
|
||||
{
|
||||
UInt32 b3;
|
||||
uint32_t b3;
|
||||
if (p > lim)
|
||||
return p - data;
|
||||
b1 = p[1];
|
||||
@@ -122,21 +122,21 @@ SizeT ARMT_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
|
||||
break;
|
||||
}
|
||||
{
|
||||
UInt32 v =
|
||||
((UInt32)b1 << 19)
|
||||
+ (((UInt32)p[1] & 0x7) << 8)
|
||||
+ (((UInt32)p[-2] << 11))
|
||||
uint32_t v =
|
||||
((uint32_t)b1 << 19)
|
||||
+ (((uint32_t)p[1] & 0x7) << 8)
|
||||
+ (((uint32_t)p[-2] << 11))
|
||||
+ (p[0]);
|
||||
|
||||
p += 2;
|
||||
{
|
||||
UInt32 cur = (ip + (UInt32)(p - data)) >> 1;
|
||||
uint32_t cur = (ip + (uint32_t)(p - data)) >> 1;
|
||||
v -= cur;
|
||||
}
|
||||
|
||||
/*
|
||||
SetUi16(p - 4, (UInt16)(((v >> 11) & 0x7FF) | 0xF000));
|
||||
SetUi16(p - 2, (UInt16)(v | 0xF800));
|
||||
SetUi16(p - 4, (uint16_t)(((v >> 11) & 0x7FF) | 0xF000));
|
||||
SetUi16(p - 2, (uint16_t)(v | 0xF800));
|
||||
*/
|
||||
|
||||
p[-4] = (Byte)(v >> 11);
|
||||
@@ -148,7 +148,7 @@ SizeT ARMT_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
|
||||
}
|
||||
|
||||
|
||||
SizeT PPC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
|
||||
SizeT PPC_Convert(Byte *data, SizeT size, uint32_t ip, int encoding)
|
||||
{
|
||||
Byte *p;
|
||||
const Byte *lim;
|
||||
@@ -169,11 +169,11 @@ SizeT PPC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
|
||||
break;
|
||||
}
|
||||
{
|
||||
UInt32 v = GetBe32(p - 4);
|
||||
uint32_t v = GetBe32(p - 4);
|
||||
if (encoding)
|
||||
v += ip + (UInt32)(p - data);
|
||||
v += ip + (uint32_t)(p - data);
|
||||
else
|
||||
v -= ip + (UInt32)(p - data);
|
||||
v -= ip + (uint32_t)(p - data);
|
||||
v &= 0x03FFFFFF;
|
||||
v |= 0x48000000;
|
||||
SetBe32(p - 4, v);
|
||||
@@ -182,7 +182,7 @@ SizeT PPC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
|
||||
}
|
||||
|
||||
|
||||
SizeT SPARC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
|
||||
SizeT SPARC_Convert(Byte *data, SizeT size, uint32_t ip, int encoding)
|
||||
{
|
||||
Byte *p;
|
||||
const Byte *lim;
|
||||
@@ -200,10 +200,10 @@ SizeT SPARC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
|
||||
/*
|
||||
v = GetBe32(p);
|
||||
p += 4;
|
||||
m = v + ((UInt32)5 << 29);
|
||||
m ^= (UInt32)7 << 29;
|
||||
m += (UInt32)1 << 22;
|
||||
if ((m & ((UInt32)0x1FF << 23)) == 0)
|
||||
m = v + ((uint32_t)5 << 29);
|
||||
m ^= (uint32_t)7 << 29;
|
||||
m += (uint32_t)1 << 22;
|
||||
if ((m & ((uint32_t)0x1FF << 23)) == 0)
|
||||
break;
|
||||
*/
|
||||
p += 4;
|
||||
@@ -212,15 +212,15 @@ SizeT SPARC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
|
||||
break;
|
||||
}
|
||||
{
|
||||
UInt32 v = GetBe32(p - 4);
|
||||
uint32_t v = GetBe32(p - 4);
|
||||
v <<= 2;
|
||||
if (encoding)
|
||||
v += ip + (UInt32)(p - data);
|
||||
v += ip + (uint32_t)(p - data);
|
||||
else
|
||||
v -= ip + (UInt32)(p - data);
|
||||
v -= ip + (uint32_t)(p - data);
|
||||
|
||||
v &= 0x01FFFFFF;
|
||||
v -= (UInt32)1 << 24;
|
||||
v -= (uint32_t)1 << 24;
|
||||
v ^= 0xFF000000;
|
||||
v >>= 2;
|
||||
v |= 0x40000000;
|
||||
|
||||
Vendored
+7
-7
@@ -40,7 +40,7 @@ in CALL instructions to increase the compression ratio.
|
||||
|
||||
Example:
|
||||
|
||||
UInt32 ip = 0;
|
||||
uint32_t ip = 0;
|
||||
for ()
|
||||
{
|
||||
; size must be >= Alignment + LookAhead, if it's not last block
|
||||
@@ -52,12 +52,12 @@ in CALL instructions to increase the compression ratio.
|
||||
*/
|
||||
|
||||
#define x86_Convert_Init(state) { state = 0; }
|
||||
SizeT x86_Convert(Byte *data, SizeT size, UInt32 ip, UInt32 *state, int encoding);
|
||||
SizeT ARM_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);
|
||||
SizeT ARMT_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);
|
||||
SizeT PPC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);
|
||||
SizeT SPARC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);
|
||||
SizeT IA64_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);
|
||||
SizeT x86_Convert(Byte *data, SizeT size, uint32_t ip, uint32_t *state, int encoding);
|
||||
SizeT ARM_Convert(Byte *data, SizeT size, uint32_t ip, int encoding);
|
||||
SizeT ARMT_Convert(Byte *data, SizeT size, uint32_t ip, int encoding);
|
||||
SizeT PPC_Convert(Byte *data, SizeT size, uint32_t ip, int encoding);
|
||||
SizeT SPARC_Convert(Byte *data, SizeT size, uint32_t ip, int encoding);
|
||||
SizeT IA64_Convert(Byte *data, SizeT size, uint32_t ip, int encoding);
|
||||
|
||||
EXTERN_C_END
|
||||
|
||||
|
||||
Vendored
+5
-5
@@ -7,10 +7,10 @@
|
||||
|
||||
#define Test86MSByte(b) ((((b) + 1) & 0xFE) == 0)
|
||||
|
||||
SizeT x86_Convert(Byte *data, SizeT size, UInt32 ip, UInt32 *state, int encoding)
|
||||
SizeT x86_Convert(Byte *data, SizeT size, uint32_t ip, uint32_t *state, int encoding)
|
||||
{
|
||||
SizeT pos = 0;
|
||||
UInt32 mask = *state & 7;
|
||||
uint32_t mask = *state & 7;
|
||||
if (size < 5)
|
||||
return 0;
|
||||
size -= 4;
|
||||
@@ -48,8 +48,8 @@ SizeT x86_Convert(Byte *data, SizeT size, UInt32 ip, UInt32 *state, int encoding
|
||||
|
||||
if (Test86MSByte(p[4]))
|
||||
{
|
||||
UInt32 v = ((UInt32)p[4] << 24) | ((UInt32)p[3] << 16) | ((UInt32)p[2] << 8) | ((UInt32)p[1]);
|
||||
UInt32 cur = ip + (UInt32)pos;
|
||||
uint32_t v = ((uint32_t)p[4] << 24) | ((uint32_t)p[3] << 16) | ((uint32_t)p[2] << 8) | ((uint32_t)p[1]);
|
||||
uint32_t cur = ip + (uint32_t)pos;
|
||||
pos += 5;
|
||||
if (encoding)
|
||||
v += cur;
|
||||
@@ -60,7 +60,7 @@ SizeT x86_Convert(Byte *data, SizeT size, UInt32 ip, UInt32 *state, int encoding
|
||||
unsigned sh = (mask & 6) << 2;
|
||||
if (Test86MSByte((Byte)(v >> sh)))
|
||||
{
|
||||
v ^= (((UInt32)0x100 << sh) - 1);
|
||||
v ^= (((uint32_t)0x100 << sh) - 1);
|
||||
if (encoding)
|
||||
v += cur;
|
||||
else
|
||||
|
||||
Vendored
+6
-6
@@ -6,7 +6,7 @@
|
||||
#include "CpuArch.h"
|
||||
#include "Bra.h"
|
||||
|
||||
SizeT IA64_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
|
||||
SizeT IA64_Convert(Byte *data, SizeT size, uint32_t ip, int encoding)
|
||||
{
|
||||
SizeT i;
|
||||
if (size < 16)
|
||||
@@ -15,7 +15,7 @@ SizeT IA64_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
|
||||
i = 0;
|
||||
do
|
||||
{
|
||||
unsigned m = ((UInt32)0x334B0000 >> (data[i] & 0x1E)) & 3;
|
||||
unsigned m = ((uint32_t)0x334B0000 >> (data[i] & 0x1E)) & 3;
|
||||
if (m)
|
||||
{
|
||||
m++;
|
||||
@@ -23,7 +23,7 @@ SizeT IA64_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
|
||||
{
|
||||
Byte *p = data + (i + (size_t)m * 5 - 8);
|
||||
if (((p[3] >> m) & 15) == 5
|
||||
&& (((p[-1] | ((UInt32)p[0] << 8)) >> m) & 0x70) == 0)
|
||||
&& (((p[-1] | ((uint32_t)p[0] << 8)) >> m) & 0x70) == 0)
|
||||
{
|
||||
unsigned raw = GetUi32(p);
|
||||
unsigned v = raw >> m;
|
||||
@@ -31,15 +31,15 @@ SizeT IA64_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
|
||||
|
||||
v <<= 4;
|
||||
if (encoding)
|
||||
v += ip + (UInt32)i;
|
||||
v += ip + (uint32_t)i;
|
||||
else
|
||||
v -= ip + (UInt32)i;
|
||||
v -= ip + (uint32_t)i;
|
||||
v >>= 4;
|
||||
|
||||
v &= 0x1FFFFF;
|
||||
v += 0x700000;
|
||||
v &= 0x8FFFFF;
|
||||
raw &= ~((UInt32)0x8FFFFF << m);
|
||||
raw &= ~((uint32_t)0x8FFFFF << m);
|
||||
raw |= (v << m);
|
||||
SetUi32(p, raw);
|
||||
}
|
||||
|
||||
Vendored
+12
-12
@@ -16,7 +16,7 @@
|
||||
#endif
|
||||
|
||||
#if defined(USE_ASM) && !defined(MY_CPU_AMD64)
|
||||
static UInt32 CheckFlag(UInt32 flag)
|
||||
static uint32_t CheckFlag(uint32_t flag)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
__asm pushfd;
|
||||
@@ -55,13 +55,13 @@ static UInt32 CheckFlag(UInt32 flag)
|
||||
#define CHECK_CPUID_IS_SUPPORTED
|
||||
#endif
|
||||
|
||||
void MyCPUID(UInt32 function, UInt32 *a, UInt32 *b, UInt32 *c, UInt32 *d)
|
||||
void MyCPUID(uint32_t function, uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d)
|
||||
{
|
||||
#ifdef USE_ASM
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
||||
UInt32 a2, b2, c2, d2;
|
||||
uint32_t a2, b2, c2, d2;
|
||||
__asm xor EBX, EBX;
|
||||
__asm xor ECX, ECX;
|
||||
__asm xor EDX, EDX;
|
||||
@@ -123,7 +123,7 @@ BoolInt x86cpuid_CheckAndRead(Cx86cpuid *p)
|
||||
return True;
|
||||
}
|
||||
|
||||
static const UInt32 kVendors[][3] =
|
||||
static const uint32_t kVendors[][3] =
|
||||
{
|
||||
{ 0x756E6547, 0x49656E69, 0x6C65746E},
|
||||
{ 0x68747541, 0x69746E65, 0x444D4163},
|
||||
@@ -135,7 +135,7 @@ int x86cpuid_GetFirm(const Cx86cpuid *p)
|
||||
unsigned i;
|
||||
for (i = 0; i < sizeof(kVendors) / sizeof(kVendors[i]); i++)
|
||||
{
|
||||
const UInt32 *v = kVendors[i];
|
||||
const uint32_t *v = kVendors[i];
|
||||
if (v[0] == p->vendor[0] &&
|
||||
v[1] == p->vendor[1] &&
|
||||
v[2] == p->vendor[2])
|
||||
@@ -144,11 +144,11 @@ int x86cpuid_GetFirm(const Cx86cpuid *p)
|
||||
return -1;
|
||||
}
|
||||
|
||||
BoolInt CPU_Is_InOrder()
|
||||
BoolInt CPU_Is_InOrder(void)
|
||||
{
|
||||
Cx86cpuid p;
|
||||
int firm;
|
||||
UInt32 family, model;
|
||||
uint32_t family, model;
|
||||
if (!x86cpuid_CheckAndRead(&p))
|
||||
return True;
|
||||
|
||||
@@ -175,7 +175,7 @@ BoolInt CPU_Is_InOrder()
|
||||
|
||||
#if !defined(MY_CPU_AMD64) && defined(_WIN32)
|
||||
#include <windows.h>
|
||||
static BoolInt CPU_Sys_Is_SSE_Supported()
|
||||
static BoolInt CPU_Sys_Is_SSE_Supported(void)
|
||||
{
|
||||
OSVERSIONINFO vi;
|
||||
vi.dwOSVersionInfoSize = sizeof(vi);
|
||||
@@ -188,7 +188,7 @@ static BoolInt CPU_Sys_Is_SSE_Supported()
|
||||
#define CHECK_SYS_SSE_SUPPORT
|
||||
#endif
|
||||
|
||||
BoolInt CPU_Is_Aes_Supported()
|
||||
BoolInt CPU_Is_Aes_Supported(void)
|
||||
{
|
||||
Cx86cpuid p;
|
||||
CHECK_SYS_SSE_SUPPORT
|
||||
@@ -197,19 +197,19 @@ BoolInt CPU_Is_Aes_Supported()
|
||||
return (p.c >> 25) & 1;
|
||||
}
|
||||
|
||||
BoolInt CPU_IsSupported_PageGB()
|
||||
BoolInt CPU_IsSupported_PageGB(void)
|
||||
{
|
||||
Cx86cpuid cpuid;
|
||||
if (!x86cpuid_CheckAndRead(&cpuid))
|
||||
return False;
|
||||
{
|
||||
UInt32 d[4] = { 0 };
|
||||
uint32_t d[4] = { 0 };
|
||||
MyCPUID(0x80000000, &d[0], &d[1], &d[2], &d[3]);
|
||||
if (d[0] < 0x80000001)
|
||||
return False;
|
||||
}
|
||||
{
|
||||
UInt32 d[4] = { 0 };
|
||||
uint32_t d[4] = { 0 };
|
||||
MyCPUID(0x80000001, &d[0], &d[1], &d[2], &d[3]);
|
||||
return (d[3] >> 26) & 1;
|
||||
}
|
||||
|
||||
Vendored
+42
-42
@@ -198,41 +198,41 @@ MY_CPU_LE_UNALIGN means that CPU is LITTLE ENDIAN and CPU supports unaligned mem
|
||||
|
||||
#ifdef MY_CPU_LE_UNALIGN
|
||||
|
||||
#define GetUi16(p) (*(const UInt16 *)(const void *)(p))
|
||||
#define GetUi32(p) (*(const UInt32 *)(const void *)(p))
|
||||
#define GetUi64(p) (*(const UInt64 *)(const void *)(p))
|
||||
#define GetUi16(p) (*(const uint16_t *)(const void *)(p))
|
||||
#define GetUi32(p) (*(const uint32_t *)(const void *)(p))
|
||||
#define GetUi64(p) (*(const uint64_t *)(const void *)(p))
|
||||
|
||||
#define SetUi16(p, v) { *(UInt16 *)(p) = (v); }
|
||||
#define SetUi32(p, v) { *(UInt32 *)(p) = (v); }
|
||||
#define SetUi64(p, v) { *(UInt64 *)(p) = (v); }
|
||||
#define SetUi16(p, v) { *(uint16_t *)(p) = (v); }
|
||||
#define SetUi32(p, v) { *(uint32_t *)(p) = (v); }
|
||||
#define SetUi64(p, v) { *(uint64_t *)(p) = (v); }
|
||||
|
||||
#else
|
||||
|
||||
#define GetUi16(p) ( (UInt16) ( \
|
||||
#define GetUi16(p) ( (uint16_t) ( \
|
||||
((const Byte *)(p))[0] | \
|
||||
((UInt16)((const Byte *)(p))[1] << 8) ))
|
||||
((uint16_t)((const Byte *)(p))[1] << 8) ))
|
||||
|
||||
#define GetUi32(p) ( \
|
||||
((const Byte *)(p))[0] | \
|
||||
((UInt32)((const Byte *)(p))[1] << 8) | \
|
||||
((UInt32)((const Byte *)(p))[2] << 16) | \
|
||||
((UInt32)((const Byte *)(p))[3] << 24))
|
||||
((uint32_t)((const Byte *)(p))[1] << 8) | \
|
||||
((uint32_t)((const Byte *)(p))[2] << 16) | \
|
||||
((uint32_t)((const Byte *)(p))[3] << 24))
|
||||
|
||||
#define GetUi64(p) (GetUi32(p) | ((UInt64)GetUi32(((const Byte *)(p)) + 4) << 32))
|
||||
#define GetUi64(p) (GetUi32(p) | ((uint64_t)GetUi32(((const Byte *)(p)) + 4) << 32))
|
||||
|
||||
#define SetUi16(p, v) { Byte *_ppp_ = (Byte *)(p); UInt32 _vvv_ = (v); \
|
||||
#define SetUi16(p, v) { Byte *_ppp_ = (Byte *)(p); uint32_t _vvv_ = (v); \
|
||||
_ppp_[0] = (Byte)_vvv_; \
|
||||
_ppp_[1] = (Byte)(_vvv_ >> 8); }
|
||||
|
||||
#define SetUi32(p, v) { Byte *_ppp_ = (Byte *)(p); UInt32 _vvv_ = (v); \
|
||||
#define SetUi32(p, v) { Byte *_ppp_ = (Byte *)(p); uint32_t _vvv_ = (v); \
|
||||
_ppp_[0] = (Byte)_vvv_; \
|
||||
_ppp_[1] = (Byte)(_vvv_ >> 8); \
|
||||
_ppp_[2] = (Byte)(_vvv_ >> 16); \
|
||||
_ppp_[3] = (Byte)(_vvv_ >> 24); }
|
||||
|
||||
#define SetUi64(p, v) { Byte *_ppp2_ = (Byte *)(p); UInt64 _vvv2_ = (v); \
|
||||
SetUi32(_ppp2_ , (UInt32)_vvv2_); \
|
||||
SetUi32(_ppp2_ + 4, (UInt32)(_vvv2_ >> 32)); }
|
||||
#define SetUi64(p, v) { Byte *_ppp2_ = (Byte *)(p); uint64_t _vvv2_ = (v); \
|
||||
SetUi32(_ppp2_ , (uint32_t)_vvv2_); \
|
||||
SetUi32(_ppp2_ + 4, (uint32_t)(_vvv2_ >> 32)); }
|
||||
|
||||
#endif
|
||||
|
||||
@@ -252,33 +252,33 @@ MY_CPU_LE_UNALIGN means that CPU is LITTLE ENDIAN and CPU supports unaligned mem
|
||||
#pragma intrinsic(_byteswap_ulong)
|
||||
#pragma intrinsic(_byteswap_uint64)
|
||||
|
||||
/* #define GetBe16(p) _byteswap_ushort(*(const UInt16 *)(const Byte *)(p)) */
|
||||
#define GetBe32(p) _byteswap_ulong(*(const UInt32 *)(const Byte *)(p))
|
||||
#define GetBe64(p) _byteswap_uint64(*(const UInt64 *)(const Byte *)(p))
|
||||
/* #define GetBe16(p) _byteswap_ushort(*(const uint16_t *)(const Byte *)(p)) */
|
||||
#define GetBe32(p) _byteswap_ulong(*(const uint32_t *)(const Byte *)(p))
|
||||
#define GetBe64(p) _byteswap_uint64(*(const uint64_t *)(const Byte *)(p))
|
||||
|
||||
#define SetBe32(p, v) (*(UInt32 *)(void *)(p)) = _byteswap_ulong(v)
|
||||
#define SetBe32(p, v) (*(uint32_t *)(void *)(p)) = _byteswap_ulong(v)
|
||||
|
||||
#elif defined(MY_CPU_LE_UNALIGN) && ( \
|
||||
(defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) \
|
||||
|| (defined(__clang__) && MY__has_builtin(__builtin_bswap16)) )
|
||||
|
||||
/* #define GetBe16(p) __builtin_bswap16(*(const UInt16 *)(const Byte *)(p)) */
|
||||
#define GetBe32(p) __builtin_bswap32(*(const UInt32 *)(const Byte *)(p))
|
||||
#define GetBe64(p) __builtin_bswap64(*(const UInt64 *)(const Byte *)(p))
|
||||
/* #define GetBe16(p) __builtin_bswap16(*(const uint16_t *)(const Byte *)(p)) */
|
||||
#define GetBe32(p) __builtin_bswap32(*(const uint32_t *)(const Byte *)(p))
|
||||
#define GetBe64(p) __builtin_bswap64(*(const uint64_t *)(const Byte *)(p))
|
||||
|
||||
#define SetBe32(p, v) (*(UInt32 *)(void *)(p)) = __builtin_bswap32(v)
|
||||
#define SetBe32(p, v) (*(uint32_t *)(void *)(p)) = __builtin_bswap32(v)
|
||||
|
||||
#else
|
||||
|
||||
#define GetBe32(p) ( \
|
||||
((UInt32)((const Byte *)(p))[0] << 24) | \
|
||||
((UInt32)((const Byte *)(p))[1] << 16) | \
|
||||
((UInt32)((const Byte *)(p))[2] << 8) | \
|
||||
((uint32_t)((const Byte *)(p))[0] << 24) | \
|
||||
((uint32_t)((const Byte *)(p))[1] << 16) | \
|
||||
((uint32_t)((const Byte *)(p))[2] << 8) | \
|
||||
((const Byte *)(p))[3] )
|
||||
|
||||
#define GetBe64(p) (((UInt64)GetBe32(p) << 32) | GetBe32(((const Byte *)(p)) + 4))
|
||||
#define GetBe64(p) (((uint64_t)GetBe32(p) << 32) | GetBe32(((const Byte *)(p)) + 4))
|
||||
|
||||
#define SetBe32(p, v) { Byte *_ppp_ = (Byte *)(p); UInt32 _vvv_ = (v); \
|
||||
#define SetBe32(p, v) { Byte *_ppp_ = (Byte *)(p); uint32_t _vvv_ = (v); \
|
||||
_ppp_[0] = (Byte)(_vvv_ >> 24); \
|
||||
_ppp_[1] = (Byte)(_vvv_ >> 16); \
|
||||
_ppp_[2] = (Byte)(_vvv_ >> 8); \
|
||||
@@ -289,8 +289,8 @@ MY_CPU_LE_UNALIGN means that CPU is LITTLE ENDIAN and CPU supports unaligned mem
|
||||
|
||||
#ifndef GetBe16
|
||||
|
||||
#define GetBe16(p) ( (UInt16) ( \
|
||||
((UInt16)((const Byte *)(p))[0] << 8) | \
|
||||
#define GetBe16(p) ( (uint16_t) ( \
|
||||
((uint16_t)((const Byte *)(p))[0] << 8) | \
|
||||
((const Byte *)(p))[1] ))
|
||||
|
||||
#endif
|
||||
@@ -301,12 +301,12 @@ MY_CPU_LE_UNALIGN means that CPU is LITTLE ENDIAN and CPU supports unaligned mem
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UInt32 maxFunc;
|
||||
UInt32 vendor[3];
|
||||
UInt32 ver;
|
||||
UInt32 b;
|
||||
UInt32 c;
|
||||
UInt32 d;
|
||||
uint32_t maxFunc;
|
||||
uint32_t vendor[3];
|
||||
uint32_t ver;
|
||||
uint32_t b;
|
||||
uint32_t c;
|
||||
uint32_t d;
|
||||
} Cx86cpuid;
|
||||
|
||||
enum
|
||||
@@ -316,7 +316,7 @@ enum
|
||||
CPU_FIRM_VIA
|
||||
};
|
||||
|
||||
void MyCPUID(UInt32 function, UInt32 *a, UInt32 *b, UInt32 *c, UInt32 *d);
|
||||
void MyCPUID(uint32_t function, uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d);
|
||||
|
||||
BoolInt x86cpuid_CheckAndRead(Cx86cpuid *p);
|
||||
int x86cpuid_GetFirm(const Cx86cpuid *p);
|
||||
@@ -325,9 +325,9 @@ int x86cpuid_GetFirm(const Cx86cpuid *p);
|
||||
#define x86cpuid_GetModel(ver) (((ver >> 12) & 0xF0) | ((ver >> 4) & 0xF))
|
||||
#define x86cpuid_GetStepping(ver) (ver & 0xF)
|
||||
|
||||
BoolInt CPU_Is_InOrder();
|
||||
BoolInt CPU_Is_Aes_Supported();
|
||||
BoolInt CPU_IsSupported_PageGB();
|
||||
BoolInt CPU_Is_InOrder(void);
|
||||
BoolInt CPU_Is_Aes_Supported(void);
|
||||
BoolInt CPU_IsSupported_PageGB(void);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Vendored
+93
-93
@@ -9,10 +9,10 @@
|
||||
#include "LzHash.h"
|
||||
|
||||
#define kEmptyHashValue 0
|
||||
#define kMaxValForNormalize ((UInt32)0xFFFFFFFF)
|
||||
#define kMaxValForNormalize ((uint32_t)0xFFFFFFFF)
|
||||
#define kNormalizeStepMin (1 << 10) /* it must be power of 2 */
|
||||
#define kNormalizeMask (~(UInt32)(kNormalizeStepMin - 1))
|
||||
#define kMaxHistorySize ((UInt32)7 << 29)
|
||||
#define kNormalizeMask (~(uint32_t)(kNormalizeStepMin - 1))
|
||||
#define kMaxHistorySize ((uint32_t)7 << 29)
|
||||
|
||||
#define kStartMaxLen 3
|
||||
|
||||
@@ -27,9 +27,9 @@ static void LzInWindow_Free(CMatchFinder *p, ISzAllocPtr alloc)
|
||||
|
||||
/* keepSizeBefore + keepSizeAfter + keepSizeReserv must be < 4G) */
|
||||
|
||||
static int LzInWindow_Create(CMatchFinder *p, UInt32 keepSizeReserv, ISzAllocPtr alloc)
|
||||
static int LzInWindow_Create(CMatchFinder *p, uint32_t keepSizeReserv, ISzAllocPtr alloc)
|
||||
{
|
||||
UInt32 blockSize = p->keepSizeBefore + p->keepSizeAfter + keepSizeReserv;
|
||||
uint32_t blockSize = p->keepSizeBefore + p->keepSizeAfter + keepSizeReserv;
|
||||
if (p->directInput)
|
||||
{
|
||||
p->blockSize = blockSize;
|
||||
@@ -46,9 +46,9 @@ static int LzInWindow_Create(CMatchFinder *p, UInt32 keepSizeReserv, ISzAllocPtr
|
||||
|
||||
Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p) { return p->buffer; }
|
||||
|
||||
UInt32 MatchFinder_GetNumAvailableBytes(CMatchFinder *p) { return p->streamPos - p->pos; }
|
||||
uint32_t MatchFinder_GetNumAvailableBytes(CMatchFinder *p) { return p->streamPos - p->pos; }
|
||||
|
||||
void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue)
|
||||
void MatchFinder_ReduceOffsets(CMatchFinder *p, uint32_t subValue)
|
||||
{
|
||||
p->posLimit -= subValue;
|
||||
p->pos -= subValue;
|
||||
@@ -64,9 +64,9 @@ static void MatchFinder_ReadBlock(CMatchFinder *p)
|
||||
|
||||
if (p->directInput)
|
||||
{
|
||||
UInt32 curSize = 0xFFFFFFFF - (p->streamPos - p->pos);
|
||||
uint32_t curSize = 0xFFFFFFFF - (p->streamPos - p->pos);
|
||||
if (curSize > p->directInputRem)
|
||||
curSize = (UInt32)p->directInputRem;
|
||||
curSize = (uint32_t)p->directInputRem;
|
||||
p->directInputRem -= curSize;
|
||||
p->streamPos += curSize;
|
||||
if (p->directInputRem == 0)
|
||||
@@ -89,7 +89,7 @@ static void MatchFinder_ReadBlock(CMatchFinder *p)
|
||||
p->streamEndWasReached = 1;
|
||||
return;
|
||||
}
|
||||
p->streamPos += (UInt32)size;
|
||||
p->streamPos += (uint32_t)size;
|
||||
if (p->streamPos - p->pos > p->keepSizeAfter)
|
||||
return;
|
||||
}
|
||||
@@ -142,15 +142,15 @@ void MatchFinder_Construct(CMatchFinder *p)
|
||||
p->bufferBase = NULL;
|
||||
p->directInput = 0;
|
||||
p->hash = NULL;
|
||||
p->expectedDataSize = (UInt64)(Int64)-1;
|
||||
p->expectedDataSize = (uint64_t)(int64_t)-1;
|
||||
MatchFinder_SetDefaultSettings(p);
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
UInt32 r = (UInt32)i;
|
||||
uint32_t r = (uint32_t)i;
|
||||
unsigned j;
|
||||
for (j = 0; j < 8; j++)
|
||||
r = (r >> 1) ^ (kCrcPoly & ((UInt32)0 - (r & 1)));
|
||||
r = (r >> 1) ^ (kCrcPoly & ((uint32_t)0 - (r & 1)));
|
||||
p->crc[i] = r;
|
||||
}
|
||||
}
|
||||
@@ -175,11 +175,11 @@ static CLzRef* AllocRefs(size_t num, ISzAllocPtr alloc)
|
||||
return (CLzRef *)ISzAlloc_Alloc(alloc, sizeInBytes);
|
||||
}
|
||||
|
||||
int MatchFinder_Create(CMatchFinder *p, UInt32 historySize,
|
||||
UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter,
|
||||
int MatchFinder_Create(CMatchFinder *p, uint32_t historySize,
|
||||
uint32_t keepAddBufferBefore, uint32_t matchMaxLen, uint32_t keepAddBufferAfter,
|
||||
ISzAllocPtr alloc)
|
||||
{
|
||||
UInt32 sizeReserv;
|
||||
uint32_t sizeReserv;
|
||||
|
||||
if (historySize > kMaxHistorySize)
|
||||
{
|
||||
@@ -188,8 +188,8 @@ int MatchFinder_Create(CMatchFinder *p, UInt32 historySize,
|
||||
}
|
||||
|
||||
sizeReserv = historySize >> 1;
|
||||
if (historySize >= ((UInt32)3 << 30)) sizeReserv = historySize >> 3;
|
||||
else if (historySize >= ((UInt32)2 << 30)) sizeReserv = historySize >> 2;
|
||||
if (historySize >= ((uint32_t)3 << 30)) sizeReserv = historySize >> 3;
|
||||
else if (historySize >= ((uint32_t)2 << 30)) sizeReserv = historySize >> 2;
|
||||
|
||||
sizeReserv += (keepAddBufferBefore + matchMaxLen + keepAddBufferAfter) / 2 + (1 << 19);
|
||||
|
||||
@@ -200,8 +200,8 @@ int MatchFinder_Create(CMatchFinder *p, UInt32 historySize,
|
||||
|
||||
if (LzInWindow_Create(p, sizeReserv, alloc))
|
||||
{
|
||||
UInt32 newCyclicBufferSize = historySize + 1;
|
||||
UInt32 hs;
|
||||
uint32_t newCyclicBufferSize = historySize + 1;
|
||||
uint32_t hs;
|
||||
p->matchMaxLen = matchMaxLen;
|
||||
{
|
||||
p->fixedHashSize = 0;
|
||||
@@ -211,7 +211,7 @@ int MatchFinder_Create(CMatchFinder *p, UInt32 historySize,
|
||||
{
|
||||
hs = historySize;
|
||||
if (hs > p->expectedDataSize)
|
||||
hs = (UInt32)p->expectedDataSize;
|
||||
hs = (uint32_t)p->expectedDataSize;
|
||||
if (hs != 0)
|
||||
hs--;
|
||||
hs |= (hs >> 1);
|
||||
@@ -270,8 +270,8 @@ int MatchFinder_Create(CMatchFinder *p, UInt32 historySize,
|
||||
|
||||
static void MatchFinder_SetLimits(CMatchFinder *p)
|
||||
{
|
||||
UInt32 limit = kMaxValForNormalize - p->pos;
|
||||
UInt32 limit2 = p->cyclicBufferSize - p->cyclicBufferPos;
|
||||
uint32_t limit = kMaxValForNormalize - p->pos;
|
||||
uint32_t limit2 = p->cyclicBufferSize - p->cyclicBufferPos;
|
||||
|
||||
if (limit2 < limit)
|
||||
limit = limit2;
|
||||
@@ -289,7 +289,7 @@ static void MatchFinder_SetLimits(CMatchFinder *p)
|
||||
limit = limit2;
|
||||
|
||||
{
|
||||
UInt32 lenLimit = p->streamPos - p->pos;
|
||||
uint32_t lenLimit = p->streamPos - p->pos;
|
||||
if (lenLimit > p->matchMaxLen)
|
||||
lenLimit = p->matchMaxLen;
|
||||
p->lenLimit = lenLimit;
|
||||
@@ -342,17 +342,17 @@ void MatchFinder_Init(CMatchFinder *p)
|
||||
}
|
||||
|
||||
|
||||
static UInt32 MatchFinder_GetSubValue(CMatchFinder *p)
|
||||
static uint32_t MatchFinder_GetSubValue(CMatchFinder *p)
|
||||
{
|
||||
return (p->pos - p->historySize - 1) & kNormalizeMask;
|
||||
}
|
||||
|
||||
void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, size_t numItems)
|
||||
void MatchFinder_Normalize3(uint32_t subValue, CLzRef *items, size_t numItems)
|
||||
{
|
||||
size_t i;
|
||||
for (i = 0; i < numItems; i++)
|
||||
{
|
||||
UInt32 value = items[i];
|
||||
uint32_t value = items[i];
|
||||
if (value <= subValue)
|
||||
value = kEmptyHashValue;
|
||||
else
|
||||
@@ -363,7 +363,7 @@ void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, size_t numItems)
|
||||
|
||||
static void MatchFinder_Normalize(CMatchFinder *p)
|
||||
{
|
||||
UInt32 subValue = MatchFinder_GetSubValue(p);
|
||||
uint32_t subValue = MatchFinder_GetSubValue(p);
|
||||
MatchFinder_Normalize3(subValue, p->hash, p->numRefs);
|
||||
MatchFinder_ReduceOffsets(p, subValue);
|
||||
}
|
||||
@@ -386,15 +386,15 @@ static void MatchFinder_CheckLimits(CMatchFinder *p)
|
||||
(lenLimit > maxLen)
|
||||
*/
|
||||
MY_FORCE_INLINE
|
||||
static UInt32 * Hc_GetMatchesSpec(unsigned lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son,
|
||||
UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue,
|
||||
UInt32 *distances, unsigned maxLen)
|
||||
static uint32_t * Hc_GetMatchesSpec(unsigned lenLimit, uint32_t curMatch, uint32_t pos, const Byte *cur, CLzRef *son,
|
||||
uint32_t _cyclicBufferPos, uint32_t _cyclicBufferSize, uint32_t cutValue,
|
||||
uint32_t *distances, unsigned maxLen)
|
||||
{
|
||||
/*
|
||||
son[_cyclicBufferPos] = curMatch;
|
||||
for (;;)
|
||||
{
|
||||
UInt32 delta = pos - curMatch;
|
||||
uint32_t delta = pos - curMatch;
|
||||
if (cutValue-- == 0 || delta >= _cyclicBufferSize)
|
||||
return distances;
|
||||
{
|
||||
@@ -402,7 +402,7 @@ static UInt32 * Hc_GetMatchesSpec(unsigned lenLimit, UInt32 curMatch, UInt32 pos
|
||||
curMatch = son[_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)];
|
||||
if (pb[maxLen] == cur[maxLen] && *pb == *cur)
|
||||
{
|
||||
UInt32 len = 0;
|
||||
uint32_t len = 0;
|
||||
while (++len != lenLimit)
|
||||
if (pb[len] != cur[len])
|
||||
break;
|
||||
@@ -423,7 +423,7 @@ static UInt32 * Hc_GetMatchesSpec(unsigned lenLimit, UInt32 curMatch, UInt32 pos
|
||||
son[_cyclicBufferPos] = curMatch;
|
||||
do
|
||||
{
|
||||
UInt32 delta = pos - curMatch;
|
||||
uint32_t delta = pos - curMatch;
|
||||
if (delta >= _cyclicBufferSize)
|
||||
break;
|
||||
{
|
||||
@@ -437,7 +437,7 @@ static UInt32 * Hc_GetMatchesSpec(unsigned lenLimit, UInt32 curMatch, UInt32 pos
|
||||
{
|
||||
if (++c == lim)
|
||||
{
|
||||
distances[0] = (UInt32)(lim - cur);
|
||||
distances[0] = (uint32_t)(lim - cur);
|
||||
distances[1] = delta - 1;
|
||||
return distances + 2;
|
||||
}
|
||||
@@ -447,7 +447,7 @@ static UInt32 * Hc_GetMatchesSpec(unsigned lenLimit, UInt32 curMatch, UInt32 pos
|
||||
if (maxLen < len)
|
||||
{
|
||||
maxLen = len;
|
||||
distances[0] = (UInt32)len;
|
||||
distances[0] = (uint32_t)len;
|
||||
distances[1] = delta - 1;
|
||||
distances += 2;
|
||||
}
|
||||
@@ -462,16 +462,16 @@ static UInt32 * Hc_GetMatchesSpec(unsigned lenLimit, UInt32 curMatch, UInt32 pos
|
||||
|
||||
|
||||
MY_FORCE_INLINE
|
||||
UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son,
|
||||
UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue,
|
||||
UInt32 *distances, UInt32 maxLen)
|
||||
uint32_t * GetMatchesSpec1(uint32_t lenLimit, uint32_t curMatch, uint32_t pos, const Byte *cur, CLzRef *son,
|
||||
uint32_t _cyclicBufferPos, uint32_t _cyclicBufferSize, uint32_t cutValue,
|
||||
uint32_t *distances, uint32_t maxLen)
|
||||
{
|
||||
CLzRef *ptr0 = son + ((size_t)_cyclicBufferPos << 1) + 1;
|
||||
CLzRef *ptr1 = son + ((size_t)_cyclicBufferPos << 1);
|
||||
unsigned len0 = 0, len1 = 0;
|
||||
for (;;)
|
||||
{
|
||||
UInt32 delta = pos - curMatch;
|
||||
uint32_t delta = pos - curMatch;
|
||||
if (cutValue-- == 0 || delta >= _cyclicBufferSize)
|
||||
{
|
||||
*ptr0 = *ptr1 = kEmptyHashValue;
|
||||
@@ -481,7 +481,7 @@ UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byt
|
||||
CLzRef *pair = son + ((size_t)(_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1);
|
||||
const Byte *pb = cur - delta;
|
||||
unsigned len = (len0 < len1 ? len0 : len1);
|
||||
UInt32 pair0 = pair[0];
|
||||
uint32_t pair0 = pair[0];
|
||||
if (pb[len] == cur[len])
|
||||
{
|
||||
if (++len != lenLimit && pb[len] == cur[len])
|
||||
@@ -490,8 +490,8 @@ UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byt
|
||||
break;
|
||||
if (maxLen < len)
|
||||
{
|
||||
maxLen = (UInt32)len;
|
||||
*distances++ = (UInt32)len;
|
||||
maxLen = (uint32_t)len;
|
||||
*distances++ = (uint32_t)len;
|
||||
*distances++ = delta - 1;
|
||||
if (len == lenLimit)
|
||||
{
|
||||
@@ -519,15 +519,15 @@ UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byt
|
||||
}
|
||||
}
|
||||
|
||||
static void SkipMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son,
|
||||
UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue)
|
||||
static void SkipMatchesSpec(uint32_t lenLimit, uint32_t curMatch, uint32_t pos, const Byte *cur, CLzRef *son,
|
||||
uint32_t _cyclicBufferPos, uint32_t _cyclicBufferSize, uint32_t cutValue)
|
||||
{
|
||||
CLzRef *ptr0 = son + ((size_t)_cyclicBufferPos << 1) + 1;
|
||||
CLzRef *ptr1 = son + ((size_t)_cyclicBufferPos << 1);
|
||||
unsigned len0 = 0, len1 = 0;
|
||||
for (;;)
|
||||
{
|
||||
UInt32 delta = pos - curMatch;
|
||||
uint32_t delta = pos - curMatch;
|
||||
if (cutValue-- == 0 || delta >= _cyclicBufferSize)
|
||||
{
|
||||
*ptr0 = *ptr1 = kEmptyHashValue;
|
||||
@@ -574,12 +574,12 @@ static void SkipMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const
|
||||
p->buffer++; \
|
||||
if (++p->pos == p->posLimit) MatchFinder_CheckLimits(p);
|
||||
|
||||
#define MOVE_POS_RET MOVE_POS return (UInt32)offset;
|
||||
#define MOVE_POS_RET MOVE_POS return (uint32_t)offset;
|
||||
|
||||
static void MatchFinder_MovePos(CMatchFinder *p) { MOVE_POS; }
|
||||
|
||||
#define GET_MATCHES_HEADER2(minLen, ret_op) \
|
||||
unsigned lenLimit; UInt32 hv; const Byte *cur; UInt32 curMatch; \
|
||||
unsigned lenLimit; uint32_t hv; const Byte *cur; uint32_t curMatch; \
|
||||
lenLimit = (unsigned)p->lenLimit; { if (lenLimit < minLen) { MatchFinder_MovePos(p); ret_op; }} \
|
||||
cur = p->buffer;
|
||||
|
||||
@@ -589,11 +589,11 @@ static void MatchFinder_MovePos(CMatchFinder *p) { MOVE_POS; }
|
||||
#define MF_PARAMS(p) p->pos, p->buffer, p->son, p->cyclicBufferPos, p->cyclicBufferSize, p->cutValue
|
||||
|
||||
#define GET_MATCHES_FOOTER(offset, maxLen) \
|
||||
offset = (unsigned)(GetMatchesSpec1((UInt32)lenLimit, curMatch, MF_PARAMS(p), \
|
||||
distances + offset, (UInt32)maxLen) - distances); MOVE_POS_RET;
|
||||
offset = (unsigned)(GetMatchesSpec1((uint32_t)lenLimit, curMatch, MF_PARAMS(p), \
|
||||
distances + offset, (uint32_t)maxLen) - distances); MOVE_POS_RET;
|
||||
|
||||
#define SKIP_FOOTER \
|
||||
SkipMatchesSpec((UInt32)lenLimit, curMatch, MF_PARAMS(p)); MOVE_POS;
|
||||
SkipMatchesSpec((uint32_t)lenLimit, curMatch, MF_PARAMS(p)); MOVE_POS;
|
||||
|
||||
#define UPDATE_maxLen { \
|
||||
ptrdiff_t diff = (ptrdiff_t)0 - d2; \
|
||||
@@ -602,7 +602,7 @@ static void MatchFinder_MovePos(CMatchFinder *p) { MOVE_POS; }
|
||||
for (; c != lim; c++) if (*(c + diff) != *c) break; \
|
||||
maxLen = (unsigned)(c - cur); }
|
||||
|
||||
static UInt32 Bt2_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
|
||||
static uint32_t Bt2_MatchFinder_GetMatches(CMatchFinder *p, uint32_t *distances)
|
||||
{
|
||||
unsigned offset;
|
||||
GET_MATCHES_HEADER(2)
|
||||
@@ -613,7 +613,7 @@ static UInt32 Bt2_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
|
||||
GET_MATCHES_FOOTER(offset, 1)
|
||||
}
|
||||
|
||||
UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
|
||||
uint32_t Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, uint32_t *distances)
|
||||
{
|
||||
unsigned offset;
|
||||
GET_MATCHES_HEADER(3)
|
||||
@@ -624,11 +624,11 @@ UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
|
||||
GET_MATCHES_FOOTER(offset, 2)
|
||||
}
|
||||
|
||||
static UInt32 Bt3_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
|
||||
static uint32_t Bt3_MatchFinder_GetMatches(CMatchFinder *p, uint32_t *distances)
|
||||
{
|
||||
UInt32 h2, d2, pos;
|
||||
uint32_t h2, d2, pos;
|
||||
unsigned maxLen, offset;
|
||||
UInt32 *hash;
|
||||
uint32_t *hash;
|
||||
GET_MATCHES_HEADER(3)
|
||||
|
||||
HASH3_CALC;
|
||||
@@ -649,12 +649,12 @@ static UInt32 Bt3_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
|
||||
if (d2 < p->cyclicBufferSize && *(cur - d2) == *cur)
|
||||
{
|
||||
UPDATE_maxLen
|
||||
distances[0] = (UInt32)maxLen;
|
||||
distances[0] = (uint32_t)maxLen;
|
||||
distances[1] = d2 - 1;
|
||||
offset = 2;
|
||||
if (maxLen == lenLimit)
|
||||
{
|
||||
SkipMatchesSpec((UInt32)lenLimit, curMatch, MF_PARAMS(p));
|
||||
SkipMatchesSpec((uint32_t)lenLimit, curMatch, MF_PARAMS(p));
|
||||
MOVE_POS_RET;
|
||||
}
|
||||
}
|
||||
@@ -662,11 +662,11 @@ static UInt32 Bt3_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
|
||||
GET_MATCHES_FOOTER(offset, maxLen)
|
||||
}
|
||||
|
||||
static UInt32 Bt4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
|
||||
static uint32_t Bt4_MatchFinder_GetMatches(CMatchFinder *p, uint32_t *distances)
|
||||
{
|
||||
UInt32 h2, h3, d2, d3, pos;
|
||||
uint32_t h2, h3, d2, d3, pos;
|
||||
unsigned maxLen, offset;
|
||||
UInt32 *hash;
|
||||
uint32_t *hash;
|
||||
GET_MATCHES_HEADER(4)
|
||||
|
||||
HASH4_CALC;
|
||||
@@ -705,10 +705,10 @@ static UInt32 Bt4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
|
||||
if (offset != 0)
|
||||
{
|
||||
UPDATE_maxLen
|
||||
distances[(size_t)offset - 2] = (UInt32)maxLen;
|
||||
distances[(size_t)offset - 2] = (uint32_t)maxLen;
|
||||
if (maxLen == lenLimit)
|
||||
{
|
||||
SkipMatchesSpec((UInt32)lenLimit, curMatch, MF_PARAMS(p));
|
||||
SkipMatchesSpec((uint32_t)lenLimit, curMatch, MF_PARAMS(p));
|
||||
MOVE_POS_RET;
|
||||
}
|
||||
}
|
||||
@@ -720,10 +720,10 @@ static UInt32 Bt4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
|
||||
}
|
||||
|
||||
/*
|
||||
static UInt32 Bt5_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
|
||||
static uint32_t Bt5_MatchFinder_GetMatches(CMatchFinder *p, uint32_t *distances)
|
||||
{
|
||||
UInt32 h2, h3, h4, d2, d3, d4, maxLen, offset, pos;
|
||||
UInt32 *hash;
|
||||
uint32_t h2, h3, h4, d2, d3, d4, maxLen, offset, pos;
|
||||
uint32_t *hash;
|
||||
GET_MATCHES_HEADER(5)
|
||||
|
||||
HASH5_CALC;
|
||||
@@ -796,11 +796,11 @@ static UInt32 Bt5_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
|
||||
}
|
||||
*/
|
||||
|
||||
static UInt32 Hc4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
|
||||
static uint32_t Hc4_MatchFinder_GetMatches(CMatchFinder *p, uint32_t *distances)
|
||||
{
|
||||
UInt32 h2, h3, d2, d3, pos;
|
||||
uint32_t h2, h3, d2, d3, pos;
|
||||
unsigned maxLen, offset;
|
||||
UInt32 *hash;
|
||||
uint32_t *hash;
|
||||
GET_MATCHES_HEADER(4)
|
||||
|
||||
HASH4_CALC;
|
||||
@@ -838,7 +838,7 @@ static UInt32 Hc4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
|
||||
if (offset != 0)
|
||||
{
|
||||
UPDATE_maxLen
|
||||
distances[(size_t)offset - 2] = (UInt32)maxLen;
|
||||
distances[(size_t)offset - 2] = (uint32_t)maxLen;
|
||||
if (maxLen == lenLimit)
|
||||
{
|
||||
p->son[p->cyclicBufferPos] = curMatch;
|
||||
@@ -855,10 +855,10 @@ static UInt32 Hc4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
|
||||
}
|
||||
|
||||
/*
|
||||
static UInt32 Hc5_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
|
||||
static uint32_t Hc5_MatchFinder_GetMatches(CMatchFinder *p, uint32_t *distances)
|
||||
{
|
||||
UInt32 h2, h3, h4, d2, d3, d4, maxLen, offset, pos
|
||||
UInt32 *hash;
|
||||
uint32_t h2, h3, h4, d2, d3, d4, maxLen, offset, pos
|
||||
uint32_t *hash;
|
||||
GET_MATCHES_HEADER(5)
|
||||
|
||||
HASH5_CALC;
|
||||
@@ -927,13 +927,13 @@ static UInt32 Hc5_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
|
||||
if (maxLen < 4)
|
||||
maxLen = 4;
|
||||
|
||||
offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p),
|
||||
offset = (uint32_t)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p),
|
||||
distances + offset, maxLen) - (distances));
|
||||
MOVE_POS_RET
|
||||
}
|
||||
*/
|
||||
|
||||
UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
|
||||
uint32_t Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, uint32_t *distances)
|
||||
{
|
||||
unsigned offset;
|
||||
GET_MATCHES_HEADER(3)
|
||||
@@ -945,7 +945,7 @@ UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
|
||||
MOVE_POS_RET
|
||||
}
|
||||
|
||||
static void Bt2_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
|
||||
static void Bt2_MatchFinder_Skip(CMatchFinder *p, uint32_t num)
|
||||
{
|
||||
do
|
||||
{
|
||||
@@ -958,7 +958,7 @@ static void Bt2_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
|
||||
while (--num != 0);
|
||||
}
|
||||
|
||||
void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
|
||||
void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, uint32_t num)
|
||||
{
|
||||
do
|
||||
{
|
||||
@@ -971,12 +971,12 @@ void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
|
||||
while (--num != 0);
|
||||
}
|
||||
|
||||
static void Bt3_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
|
||||
static void Bt3_MatchFinder_Skip(CMatchFinder *p, uint32_t num)
|
||||
{
|
||||
do
|
||||
{
|
||||
UInt32 h2;
|
||||
UInt32 *hash;
|
||||
uint32_t h2;
|
||||
uint32_t *hash;
|
||||
SKIP_HEADER(3)
|
||||
HASH3_CALC;
|
||||
hash = p->hash;
|
||||
@@ -988,12 +988,12 @@ static void Bt3_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
|
||||
while (--num != 0);
|
||||
}
|
||||
|
||||
static void Bt4_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
|
||||
static void Bt4_MatchFinder_Skip(CMatchFinder *p, uint32_t num)
|
||||
{
|
||||
do
|
||||
{
|
||||
UInt32 h2, h3;
|
||||
UInt32 *hash;
|
||||
uint32_t h2, h3;
|
||||
uint32_t *hash;
|
||||
SKIP_HEADER(4)
|
||||
HASH4_CALC;
|
||||
hash = p->hash;
|
||||
@@ -1007,12 +1007,12 @@ static void Bt4_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
|
||||
}
|
||||
|
||||
/*
|
||||
static void Bt5_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
|
||||
static void Bt5_MatchFinder_Skip(CMatchFinder *p, uint32_t num)
|
||||
{
|
||||
do
|
||||
{
|
||||
UInt32 h2, h3, h4;
|
||||
UInt32 *hash;
|
||||
uint32_t h2, h3, h4;
|
||||
uint32_t *hash;
|
||||
SKIP_HEADER(5)
|
||||
HASH5_CALC;
|
||||
hash = p->hash;
|
||||
@@ -1027,12 +1027,12 @@ static void Bt5_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
|
||||
}
|
||||
*/
|
||||
|
||||
static void Hc4_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
|
||||
static void Hc4_MatchFinder_Skip(CMatchFinder *p, uint32_t num)
|
||||
{
|
||||
do
|
||||
{
|
||||
UInt32 h2, h3;
|
||||
UInt32 *hash;
|
||||
uint32_t h2, h3;
|
||||
uint32_t *hash;
|
||||
SKIP_HEADER(4)
|
||||
HASH4_CALC;
|
||||
hash = p->hash;
|
||||
@@ -1047,12 +1047,12 @@ static void Hc4_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
|
||||
}
|
||||
|
||||
/*
|
||||
static void Hc5_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
|
||||
static void Hc5_MatchFinder_Skip(CMatchFinder *p, uint32_t num)
|
||||
{
|
||||
do
|
||||
{
|
||||
UInt32 h2, h3, h4;
|
||||
UInt32 *hash;
|
||||
uint32_t h2, h3, h4;
|
||||
uint32_t *hash;
|
||||
SKIP_HEADER(5)
|
||||
HASH5_CALC;
|
||||
hash = p->hash;
|
||||
@@ -1068,7 +1068,7 @@ static void Hc5_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
|
||||
}
|
||||
*/
|
||||
|
||||
void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
|
||||
void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, uint32_t num)
|
||||
{
|
||||
do
|
||||
{
|
||||
|
||||
Vendored
+33
-33
@@ -8,47 +8,47 @@
|
||||
|
||||
EXTERN_C_BEGIN
|
||||
|
||||
typedef UInt32 CLzRef;
|
||||
typedef uint32_t CLzRef;
|
||||
|
||||
typedef struct _CMatchFinder
|
||||
{
|
||||
Byte *buffer;
|
||||
UInt32 pos;
|
||||
UInt32 posLimit;
|
||||
UInt32 streamPos;
|
||||
UInt32 lenLimit;
|
||||
uint32_t pos;
|
||||
uint32_t posLimit;
|
||||
uint32_t streamPos;
|
||||
uint32_t lenLimit;
|
||||
|
||||
UInt32 cyclicBufferPos;
|
||||
UInt32 cyclicBufferSize; /* it must be = (historySize + 1) */
|
||||
uint32_t cyclicBufferPos;
|
||||
uint32_t cyclicBufferSize; /* it must be = (historySize + 1) */
|
||||
|
||||
Byte streamEndWasReached;
|
||||
Byte btMode;
|
||||
Byte bigHash;
|
||||
Byte directInput;
|
||||
|
||||
UInt32 matchMaxLen;
|
||||
uint32_t matchMaxLen;
|
||||
CLzRef *hash;
|
||||
CLzRef *son;
|
||||
UInt32 hashMask;
|
||||
UInt32 cutValue;
|
||||
uint32_t hashMask;
|
||||
uint32_t cutValue;
|
||||
|
||||
Byte *bufferBase;
|
||||
ISeqInStream *stream;
|
||||
|
||||
UInt32 blockSize;
|
||||
UInt32 keepSizeBefore;
|
||||
UInt32 keepSizeAfter;
|
||||
uint32_t blockSize;
|
||||
uint32_t keepSizeBefore;
|
||||
uint32_t keepSizeAfter;
|
||||
|
||||
UInt32 numHashBytes;
|
||||
uint32_t numHashBytes;
|
||||
size_t directInputRem;
|
||||
UInt32 historySize;
|
||||
UInt32 fixedHashSize;
|
||||
UInt32 hashSizeSum;
|
||||
uint32_t historySize;
|
||||
uint32_t fixedHashSize;
|
||||
uint32_t hashSizeSum;
|
||||
SRes result;
|
||||
UInt32 crc[256];
|
||||
uint32_t crc[256];
|
||||
size_t numRefs;
|
||||
|
||||
UInt64 expectedDataSize;
|
||||
uint64_t expectedDataSize;
|
||||
} CMatchFinder;
|
||||
|
||||
#define Inline_MatchFinder_GetPointerToCurrentPos(p) ((p)->buffer)
|
||||
@@ -71,16 +71,16 @@ void MatchFinder_Construct(CMatchFinder *p);
|
||||
historySize <= 3 GB
|
||||
keepAddBufferBefore + matchMaxLen + keepAddBufferAfter < 511MB
|
||||
*/
|
||||
int MatchFinder_Create(CMatchFinder *p, UInt32 historySize,
|
||||
UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter,
|
||||
int MatchFinder_Create(CMatchFinder *p, uint32_t historySize,
|
||||
uint32_t keepAddBufferBefore, uint32_t matchMaxLen, uint32_t keepAddBufferAfter,
|
||||
ISzAllocPtr alloc);
|
||||
void MatchFinder_Free(CMatchFinder *p, ISzAllocPtr alloc);
|
||||
void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, size_t numItems);
|
||||
void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue);
|
||||
void MatchFinder_Normalize3(uint32_t subValue, CLzRef *items, size_t numItems);
|
||||
void MatchFinder_ReduceOffsets(CMatchFinder *p, uint32_t subValue);
|
||||
|
||||
UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *buffer, CLzRef *son,
|
||||
UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 _cutValue,
|
||||
UInt32 *distances, UInt32 maxLen);
|
||||
uint32_t * GetMatchesSpec1(uint32_t lenLimit, uint32_t curMatch, uint32_t pos, const Byte *buffer, CLzRef *son,
|
||||
uint32_t _cyclicBufferPos, uint32_t _cyclicBufferSize, uint32_t _cutValue,
|
||||
uint32_t *distances, uint32_t maxLen);
|
||||
|
||||
/*
|
||||
Conditions:
|
||||
@@ -89,10 +89,10 @@ Conditions:
|
||||
*/
|
||||
|
||||
typedef void (*Mf_Init_Func)(void *object);
|
||||
typedef UInt32 (*Mf_GetNumAvailableBytes_Func)(void *object);
|
||||
typedef uint32_t (*Mf_GetNumAvailableBytes_Func)(void *object);
|
||||
typedef const Byte * (*Mf_GetPointerToCurrentPos_Func)(void *object);
|
||||
typedef UInt32 (*Mf_GetMatches_Func)(void *object, UInt32 *distances);
|
||||
typedef void (*Mf_Skip_Func)(void *object, UInt32);
|
||||
typedef uint32_t (*Mf_GetMatches_Func)(void *object, uint32_t *distances);
|
||||
typedef void (*Mf_Skip_Func)(void *object, uint32_t);
|
||||
|
||||
typedef struct _IMatchFinder
|
||||
{
|
||||
@@ -110,11 +110,11 @@ void MatchFinder_Init_HighHash(CMatchFinder *p);
|
||||
void MatchFinder_Init_3(CMatchFinder *p, int readData);
|
||||
void MatchFinder_Init(CMatchFinder *p);
|
||||
|
||||
UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances);
|
||||
UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances);
|
||||
uint32_t Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, uint32_t *distances);
|
||||
uint32_t Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, uint32_t *distances);
|
||||
|
||||
void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num);
|
||||
void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num);
|
||||
void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, uint32_t num);
|
||||
void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, uint32_t num);
|
||||
|
||||
EXTERN_C_END
|
||||
|
||||
|
||||
Vendored
+13
-13
@@ -12,45 +12,45 @@
|
||||
#define kFix4HashSize (kHash2Size + kHash3Size)
|
||||
#define kFix5HashSize (kHash2Size + kHash3Size + kHash4Size)
|
||||
|
||||
#define HASH2_CALC hv = cur[0] | ((UInt32)cur[1] << 8);
|
||||
#define HASH2_CALC hv = cur[0] | ((uint32_t)cur[1] << 8);
|
||||
|
||||
#define HASH3_CALC { \
|
||||
UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
|
||||
uint32_t temp = p->crc[cur[0]] ^ cur[1]; \
|
||||
h2 = temp & (kHash2Size - 1); \
|
||||
hv = (temp ^ ((UInt32)cur[2] << 8)) & p->hashMask; }
|
||||
hv = (temp ^ ((uint32_t)cur[2] << 8)) & p->hashMask; }
|
||||
|
||||
#define HASH4_CALC { \
|
||||
UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
|
||||
uint32_t temp = p->crc[cur[0]] ^ cur[1]; \
|
||||
h2 = temp & (kHash2Size - 1); \
|
||||
temp ^= ((UInt32)cur[2] << 8); \
|
||||
temp ^= ((uint32_t)cur[2] << 8); \
|
||||
h3 = temp & (kHash3Size - 1); \
|
||||
hv = (temp ^ (p->crc[cur[3]] << 5)) & p->hashMask; }
|
||||
|
||||
#define HASH5_CALC { \
|
||||
UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
|
||||
uint32_t temp = p->crc[cur[0]] ^ cur[1]; \
|
||||
h2 = temp & (kHash2Size - 1); \
|
||||
temp ^= ((UInt32)cur[2] << 8); \
|
||||
temp ^= ((uint32_t)cur[2] << 8); \
|
||||
h3 = temp & (kHash3Size - 1); \
|
||||
temp ^= (p->crc[cur[3]] << 5); \
|
||||
h4 = temp & (kHash4Size - 1); \
|
||||
hv = (temp ^ (p->crc[cur[4]] << 3)) & p->hashMask; }
|
||||
|
||||
/* #define HASH_ZIP_CALC hv = ((cur[0] | ((UInt32)cur[1] << 8)) ^ p->crc[cur[2]]) & 0xFFFF; */
|
||||
#define HASH_ZIP_CALC hv = ((cur[2] | ((UInt32)cur[0] << 8)) ^ p->crc[cur[1]]) & 0xFFFF;
|
||||
/* #define HASH_ZIP_CALC hv = ((cur[0] | ((uint32_t)cur[1] << 8)) ^ p->crc[cur[2]]) & 0xFFFF; */
|
||||
#define HASH_ZIP_CALC hv = ((cur[2] | ((uint32_t)cur[0] << 8)) ^ p->crc[cur[1]]) & 0xFFFF;
|
||||
|
||||
|
||||
#define MT_HASH2_CALC \
|
||||
h2 = (p->crc[cur[0]] ^ cur[1]) & (kHash2Size - 1);
|
||||
|
||||
#define MT_HASH3_CALC { \
|
||||
UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
|
||||
uint32_t temp = p->crc[cur[0]] ^ cur[1]; \
|
||||
h2 = temp & (kHash2Size - 1); \
|
||||
h3 = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); }
|
||||
h3 = (temp ^ ((uint32_t)cur[2] << 8)) & (kHash3Size - 1); }
|
||||
|
||||
#define MT_HASH4_CALC { \
|
||||
UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
|
||||
uint32_t temp = p->crc[cur[0]] ^ cur[1]; \
|
||||
h2 = temp & (kHash2Size - 1); \
|
||||
temp ^= ((UInt32)cur[2] << 8); \
|
||||
temp ^= ((uint32_t)cur[2] << 8); \
|
||||
h3 = temp & (kHash3Size - 1); \
|
||||
h4 = (temp ^ (p->crc[cur[3]] << 5)) & (kHash4Size - 1); }
|
||||
|
||||
|
||||
Vendored
+14
-14
@@ -32,7 +32,7 @@
|
||||
#define LZMA2_IS_UNCOMPRESSED_STATE(p) (((p)->control & (1 << 7)) == 0)
|
||||
|
||||
#define LZMA2_LCLP_MAX 4
|
||||
#define LZMA2_DIC_SIZE_FROM_PROP(p) (((UInt32)2 | ((p) & 1)) << ((p) / 2 + 11))
|
||||
#define LZMA2_DIC_SIZE_FROM_PROP(p) (((uint32_t)2 | ((p) & 1)) << ((p) / 2 + 11))
|
||||
|
||||
#ifdef SHOW_DEBUG_INFO
|
||||
#define PRF(x) x
|
||||
@@ -56,7 +56,7 @@ typedef enum
|
||||
|
||||
static SRes Lzma2Dec_GetOldProps(Byte prop, Byte *props)
|
||||
{
|
||||
UInt32 dicSize;
|
||||
uint32_t dicSize;
|
||||
if (prop > 40)
|
||||
return SZ_ERROR_UNSUPPORTED;
|
||||
dicSize = (prop == 40) ? 0xFFFFFFFF : LZMA2_DIC_SIZE_FROM_PROP(prop);
|
||||
@@ -116,26 +116,26 @@ static ELzma2State Lzma2Dec_UpdateState(CLzma2Dec *p, Byte b)
|
||||
if (b < p->needInitLevel)
|
||||
return LZMA2_STATE_ERROR;
|
||||
p->needInitLevel = 0;
|
||||
p->unpackSize = (UInt32)(b & 0x1F) << 16;
|
||||
p->unpackSize = (uint32_t)(b & 0x1F) << 16;
|
||||
}
|
||||
return LZMA2_STATE_UNPACK0;
|
||||
|
||||
case LZMA2_STATE_UNPACK0:
|
||||
p->unpackSize |= (UInt32)b << 8;
|
||||
p->unpackSize |= (uint32_t)b << 8;
|
||||
return LZMA2_STATE_UNPACK1;
|
||||
|
||||
case LZMA2_STATE_UNPACK1:
|
||||
p->unpackSize |= (UInt32)b;
|
||||
p->unpackSize |= (uint32_t)b;
|
||||
p->unpackSize++;
|
||||
PRF(printf(" %7u", (unsigned)p->unpackSize));
|
||||
return LZMA2_IS_UNCOMPRESSED_STATE(p) ? LZMA2_STATE_DATA : LZMA2_STATE_PACK0;
|
||||
|
||||
case LZMA2_STATE_PACK0:
|
||||
p->packSize = (UInt32)b << 8;
|
||||
p->packSize = (uint32_t)b << 8;
|
||||
return LZMA2_STATE_PACK1;
|
||||
|
||||
case LZMA2_STATE_PACK1:
|
||||
p->packSize |= (UInt32)b;
|
||||
p->packSize |= (uint32_t)b;
|
||||
p->packSize++;
|
||||
/* if (p->packSize < 5) return LZMA2_STATE_ERROR; */
|
||||
PRF(printf(" %5u", (unsigned)p->packSize));
|
||||
@@ -166,7 +166,7 @@ static void LzmaDec_UpdateWithUncompressed(CLzmaDec *p, const Byte *src, SizeT s
|
||||
p->dicPos += size;
|
||||
if (p->checkDicSize == 0 && p->prop.dicSize - p->processedPos <= size)
|
||||
p->checkDicSize = p->prop.dicSize;
|
||||
p->processedPos += (UInt32)size;
|
||||
p->processedPos += (uint32_t)size;
|
||||
}
|
||||
|
||||
void LzmaDec_InitDicAndState(CLzmaDec *p, BoolInt initDic, BoolInt initState);
|
||||
@@ -245,7 +245,7 @@ SRes Lzma2Dec_DecodeToDic(CLzma2Dec *p, SizeT dicLimit,
|
||||
|
||||
src += inCur;
|
||||
*srcLen += inCur;
|
||||
p->unpackSize -= (UInt32)inCur;
|
||||
p->unpackSize -= (uint32_t)inCur;
|
||||
p->state = (p->unpackSize == 0) ? LZMA2_STATE_CONTROL : LZMA2_STATE_DATA_CONT;
|
||||
}
|
||||
else
|
||||
@@ -267,9 +267,9 @@ SRes Lzma2Dec_DecodeToDic(CLzma2Dec *p, SizeT dicLimit,
|
||||
|
||||
src += inCur;
|
||||
*srcLen += inCur;
|
||||
p->packSize -= (UInt32)inCur;
|
||||
p->packSize -= (uint32_t)inCur;
|
||||
outCur = p->decoder.dicPos - dicPos;
|
||||
p->unpackSize -= (UInt32)outCur;
|
||||
p->unpackSize -= (uint32_t)outCur;
|
||||
|
||||
if (res != 0)
|
||||
break;
|
||||
@@ -371,7 +371,7 @@ ELzma2ParseStatus Lzma2Dec_Parse(CLzma2Dec *p,
|
||||
src += inCur;
|
||||
*srcLen += inCur;
|
||||
outSize -= inCur;
|
||||
p->unpackSize -= (UInt32)inCur;
|
||||
p->unpackSize -= (uint32_t)inCur;
|
||||
p->state = (p->unpackSize == 0) ? LZMA2_STATE_CONTROL : LZMA2_STATE_DATA_CONT;
|
||||
}
|
||||
else
|
||||
@@ -400,7 +400,7 @@ ELzma2ParseStatus Lzma2Dec_Parse(CLzma2Dec *p,
|
||||
|
||||
src += inCur;
|
||||
*srcLen += inCur;
|
||||
p->packSize -= (UInt32)inCur;
|
||||
p->packSize -= (uint32_t)inCur;
|
||||
|
||||
if (p->packSize == 0)
|
||||
{
|
||||
@@ -408,7 +408,7 @@ ELzma2ParseStatus Lzma2Dec_Parse(CLzma2Dec *p,
|
||||
if (rem > p->unpackSize)
|
||||
rem = p->unpackSize;
|
||||
p->decoder.dicPos += rem;
|
||||
p->unpackSize -= (UInt32)rem;
|
||||
p->unpackSize -= (uint32_t)rem;
|
||||
outSize -= rem;
|
||||
if (p->unpackSize == 0)
|
||||
p->state = LZMA2_STATE_CONTROL;
|
||||
|
||||
Vendored
+2
-2
@@ -17,8 +17,8 @@ typedef struct
|
||||
Byte needInitLevel;
|
||||
Byte isExtraMode;
|
||||
Byte _pad_;
|
||||
UInt32 packSize;
|
||||
UInt32 unpackSize;
|
||||
uint32_t packSize;
|
||||
uint32_t unpackSize;
|
||||
CLzmaDec decoder;
|
||||
} CLzma2Dec;
|
||||
|
||||
|
||||
Vendored
+38
-38
@@ -9,7 +9,7 @@
|
||||
#include "LzmaDec.h"
|
||||
|
||||
#define kNumTopBits 24
|
||||
#define kTopValue ((UInt32)1 << kNumTopBits)
|
||||
#define kTopValue ((uint32_t)1 << kNumTopBits)
|
||||
|
||||
#define kNumBitModelTotalBits 11
|
||||
#define kBitModelTotal (1 << kNumBitModelTotalBits)
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#define NORMALIZE if (range < kTopValue) { range <<= 8; code = (code << 8) | (*buf++); }
|
||||
|
||||
#define IF_BIT_0(p) ttt = *(p); NORMALIZE; bound = (range >> kNumBitModelTotalBits) * (UInt32)ttt; if (code < bound)
|
||||
#define IF_BIT_0(p) ttt = *(p); NORMALIZE; bound = (range >> kNumBitModelTotalBits) * (uint32_t)ttt; if (code < bound)
|
||||
#define UPDATE_0(p) range = bound; *(p) = (CLzmaProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits));
|
||||
#define UPDATE_1(p) range -= bound; code -= bound; *(p) = (CLzmaProb)(ttt - (ttt >> kNumMoveBits));
|
||||
#define GET_BIT2(p, i, A0, A1) IF_BIT_0(p) \
|
||||
@@ -66,7 +66,7 @@
|
||||
|
||||
#define NORMALIZE_CHECK if (range < kTopValue) { if (buf >= bufLimit) return DUMMY_ERROR; range <<= 8; code = (code << 8) | (*buf++); }
|
||||
|
||||
#define IF_BIT_0_CHECK(p) ttt = *(p); NORMALIZE_CHECK; bound = (range >> kNumBitModelTotalBits) * (UInt32)ttt; if (code < bound)
|
||||
#define IF_BIT_0_CHECK(p) ttt = *(p); NORMALIZE_CHECK; bound = (range >> kNumBitModelTotalBits) * (uint32_t)ttt; if (code < bound)
|
||||
#define UPDATE_0_CHECK range = bound;
|
||||
#define UPDATE_1_CHECK range -= bound; code -= bound;
|
||||
#define GET_BIT2_CHECK(p, i, A0, A1) IF_BIT_0_CHECK(p) \
|
||||
@@ -155,7 +155,7 @@
|
||||
|
||||
#define LZMA_LIT_SIZE 0x300
|
||||
|
||||
#define LzmaProps_GetNumProbs(p) (NUM_BASE_PROBS + ((UInt32)LZMA_LIT_SIZE << ((p)->lc + (p)->lp)))
|
||||
#define LzmaProps_GetNumProbs(p) (NUM_BASE_PROBS + ((uint32_t)LZMA_LIT_SIZE << ((p)->lc + (p)->lp)))
|
||||
|
||||
|
||||
#define CALC_POS_STATE(processedPos, pbMask) (((processedPos) & (pbMask)) << 4)
|
||||
@@ -219,7 +219,7 @@ int MY_FAST_CALL LZMA_DECODE_REAL(CLzmaDec *p, SizeT limit, const Byte *bufLimit
|
||||
{
|
||||
CLzmaProb *probs = GET_PROBS;
|
||||
unsigned state = (unsigned)p->state;
|
||||
UInt32 rep0 = p->reps[0], rep1 = p->reps[1], rep2 = p->reps[2], rep3 = p->reps[3];
|
||||
uint32_t rep0 = p->reps[0], rep1 = p->reps[1], rep2 = p->reps[2], rep3 = p->reps[3];
|
||||
unsigned pbMask = ((unsigned)1 << (p->prop.pb)) - 1;
|
||||
unsigned lc = p->prop.lc;
|
||||
unsigned lpMask = ((unsigned)0x100 << p->prop.lp) - ((unsigned)0x100 >> lc);
|
||||
@@ -228,18 +228,18 @@ int MY_FAST_CALL LZMA_DECODE_REAL(CLzmaDec *p, SizeT limit, const Byte *bufLimit
|
||||
SizeT dicBufSize = p->dicBufSize;
|
||||
SizeT dicPos = p->dicPos;
|
||||
|
||||
UInt32 processedPos = p->processedPos;
|
||||
UInt32 checkDicSize = p->checkDicSize;
|
||||
uint32_t processedPos = p->processedPos;
|
||||
uint32_t checkDicSize = p->checkDicSize;
|
||||
unsigned len = 0;
|
||||
|
||||
const Byte *buf = p->buf;
|
||||
UInt32 range = p->range;
|
||||
UInt32 code = p->code;
|
||||
uint32_t range = p->range;
|
||||
uint32_t code = p->code;
|
||||
|
||||
do
|
||||
{
|
||||
CLzmaProb *prob;
|
||||
UInt32 bound;
|
||||
uint32_t bound;
|
||||
unsigned ttt;
|
||||
unsigned posState = CALC_POS_STATE(processedPos, pbMask);
|
||||
|
||||
@@ -250,7 +250,7 @@ int MY_FAST_CALL LZMA_DECODE_REAL(CLzmaDec *p, SizeT limit, const Byte *bufLimit
|
||||
UPDATE_0(prob);
|
||||
prob = probs + Literal;
|
||||
if (processedPos != 0 || checkDicSize != 0)
|
||||
prob += (UInt32)3 * ((((processedPos << 8) + dic[(dicPos == 0 ? dicBufSize : dicPos) - 1]) & lpMask) << lc);
|
||||
prob += (uint32_t)3 * ((((processedPos << 8) + dic[(dicPos == 0 ? dicBufSize : dicPos) - 1]) & lpMask) << lc);
|
||||
processedPos++;
|
||||
|
||||
if (state < kNumLitStates)
|
||||
@@ -339,7 +339,7 @@ int MY_FAST_CALL LZMA_DECODE_REAL(CLzmaDec *p, SizeT limit, const Byte *bufLimit
|
||||
}
|
||||
else
|
||||
{
|
||||
UInt32 distance;
|
||||
uint32_t distance;
|
||||
UPDATE_1(prob);
|
||||
prob = probs + IsRepG1 + state;
|
||||
IF_BIT_0(prob)
|
||||
@@ -443,7 +443,7 @@ int MY_FAST_CALL LZMA_DECODE_REAL(CLzmaDec *p, SizeT limit, const Byte *bufLimit
|
||||
|
||||
if (state >= kNumStates)
|
||||
{
|
||||
UInt32 distance;
|
||||
uint32_t distance;
|
||||
prob = probs + PosSlot +
|
||||
((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) << kNumPosSlotBits);
|
||||
TREE_6_DECODE(prob, distance);
|
||||
@@ -457,7 +457,7 @@ int MY_FAST_CALL LZMA_DECODE_REAL(CLzmaDec *p, SizeT limit, const Byte *bufLimit
|
||||
distance <<= numDirectBits;
|
||||
prob = probs + SpecPos;
|
||||
{
|
||||
UInt32 m = 1;
|
||||
uint32_t m = 1;
|
||||
distance++;
|
||||
do
|
||||
{
|
||||
@@ -476,9 +476,9 @@ int MY_FAST_CALL LZMA_DECODE_REAL(CLzmaDec *p, SizeT limit, const Byte *bufLimit
|
||||
range >>= 1;
|
||||
|
||||
{
|
||||
UInt32 t;
|
||||
uint32_t t;
|
||||
code -= range;
|
||||
t = (0 - ((UInt32)code >> 31)); /* (UInt32)((Int32)code >> 31) */
|
||||
t = (0 - ((uint32_t)code >> 31)); /* (uint32_t)((Int32)code >> 31) */
|
||||
distance = (distance << 1) + (t + 1);
|
||||
code += range & t;
|
||||
}
|
||||
@@ -502,7 +502,7 @@ int MY_FAST_CALL LZMA_DECODE_REAL(CLzmaDec *p, SizeT limit, const Byte *bufLimit
|
||||
REV_BIT_LAST (prob, i, 8);
|
||||
distance |= i;
|
||||
}
|
||||
if (distance == (UInt32)0xFFFFFFFF)
|
||||
if (distance == (uint32_t)0xFFFFFFFF)
|
||||
{
|
||||
len = kMatchSpecLenStart;
|
||||
state -= kNumStates;
|
||||
@@ -539,7 +539,7 @@ int MY_FAST_CALL LZMA_DECODE_REAL(CLzmaDec *p, SizeT limit, const Byte *bufLimit
|
||||
curLen = ((rem < len) ? (unsigned)rem : len);
|
||||
pos = dicPos - rep0 + (dicPos < rep0 ? dicBufSize : 0);
|
||||
|
||||
processedPos += (UInt32)curLen;
|
||||
processedPos += (uint32_t)curLen;
|
||||
|
||||
len -= curLen;
|
||||
if (curLen <= dicBufSize - pos)
|
||||
@@ -572,14 +572,14 @@ int MY_FAST_CALL LZMA_DECODE_REAL(CLzmaDec *p, SizeT limit, const Byte *bufLimit
|
||||
p->buf = buf;
|
||||
p->range = range;
|
||||
p->code = code;
|
||||
p->remainLen = (UInt32)len;
|
||||
p->remainLen = (uint32_t)len;
|
||||
p->dicPos = dicPos;
|
||||
p->processedPos = processedPos;
|
||||
p->reps[0] = rep0;
|
||||
p->reps[1] = rep1;
|
||||
p->reps[2] = rep2;
|
||||
p->reps[3] = rep3;
|
||||
p->state = (UInt32)state;
|
||||
p->state = (uint32_t)state;
|
||||
|
||||
return SZ_OK;
|
||||
}
|
||||
@@ -601,8 +601,8 @@ static void MY_FAST_CALL LzmaDec_WriteRem(CLzmaDec *p, SizeT limit)
|
||||
if (p->checkDicSize == 0 && p->prop.dicSize - p->processedPos <= len)
|
||||
p->checkDicSize = p->prop.dicSize;
|
||||
|
||||
p->processedPos += (UInt32)len;
|
||||
p->remainLen -= (UInt32)len;
|
||||
p->processedPos += (uint32_t)len;
|
||||
p->remainLen -= (uint32_t)len;
|
||||
while (len != 0)
|
||||
{
|
||||
len--;
|
||||
@@ -628,7 +628,7 @@ static int MY_FAST_CALL LzmaDec_DecodeReal2(CLzmaDec *p, SizeT limit, const Byte
|
||||
SizeT limit2 = limit;
|
||||
if (p->checkDicSize == 0)
|
||||
{
|
||||
UInt32 rem = p->prop.dicSize - p->processedPos;
|
||||
uint32_t rem = p->prop.dicSize - p->processedPos;
|
||||
if (limit - p->dicPos > rem)
|
||||
limit2 = p->dicPos + rem;
|
||||
|
||||
@@ -659,8 +659,8 @@ typedef enum
|
||||
|
||||
static ELzmaDummy LzmaDec_TryDummy(const CLzmaDec *p, const Byte *buf, SizeT inSize)
|
||||
{
|
||||
UInt32 range = p->range;
|
||||
UInt32 code = p->code;
|
||||
uint32_t range = p->range;
|
||||
uint32_t code = p->code;
|
||||
const Byte *bufLimit = buf + inSize;
|
||||
const CLzmaProb *probs = GET_PROBS;
|
||||
unsigned state = (unsigned)p->state;
|
||||
@@ -668,7 +668,7 @@ static ELzmaDummy LzmaDec_TryDummy(const CLzmaDec *p, const Byte *buf, SizeT inS
|
||||
|
||||
{
|
||||
const CLzmaProb *prob;
|
||||
UInt32 bound;
|
||||
uint32_t bound;
|
||||
unsigned ttt;
|
||||
unsigned posState = CALC_POS_STATE(p->processedPos, (1 << p->prop.pb) - 1);
|
||||
|
||||
@@ -681,7 +681,7 @@ static ELzmaDummy LzmaDec_TryDummy(const CLzmaDec *p, const Byte *buf, SizeT inS
|
||||
|
||||
prob = probs + Literal;
|
||||
if (p->checkDicSize != 0 || p->processedPos != 0)
|
||||
prob += ((UInt32)LZMA_LIT_SIZE *
|
||||
prob += ((uint32_t)LZMA_LIT_SIZE *
|
||||
((((p->processedPos) & ((1 << (p->prop.lp)) - 1)) << p->prop.lc) +
|
||||
(p->dic[(p->dicPos == 0 ? p->dicBufSize : p->dicPos) - 1] >> (8 - p->prop.lc))));
|
||||
|
||||
@@ -892,10 +892,10 @@ SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, const Byte *src, SizeT *sr
|
||||
return SZ_OK;
|
||||
}
|
||||
p->code =
|
||||
((UInt32)p->tempBuf[1] << 24)
|
||||
| ((UInt32)p->tempBuf[2] << 16)
|
||||
| ((UInt32)p->tempBuf[3] << 8)
|
||||
| ((UInt32)p->tempBuf[4]);
|
||||
((uint32_t)p->tempBuf[1] << 24)
|
||||
| ((uint32_t)p->tempBuf[2] << 16)
|
||||
| ((uint32_t)p->tempBuf[3] << 8)
|
||||
| ((uint32_t)p->tempBuf[4]);
|
||||
p->range = 0xFFFFFFFF;
|
||||
p->tempBufSize = 0;
|
||||
|
||||
@@ -1079,13 +1079,13 @@ void LzmaDec_Free(CLzmaDec *p, ISzAllocPtr alloc)
|
||||
|
||||
SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size)
|
||||
{
|
||||
UInt32 dicSize;
|
||||
uint32_t dicSize;
|
||||
Byte d;
|
||||
|
||||
if (size < LZMA_PROPS_SIZE)
|
||||
return SZ_ERROR_UNSUPPORTED;
|
||||
else
|
||||
dicSize = data[1] | ((UInt32)data[2] << 8) | ((UInt32)data[3] << 16) | ((UInt32)data[4] << 24);
|
||||
dicSize = data[1] | ((uint32_t)data[2] << 8) | ((uint32_t)data[3] << 16) | ((uint32_t)data[4] << 24);
|
||||
|
||||
if (dicSize < LZMA_DIC_MIN)
|
||||
dicSize = LZMA_DIC_MIN;
|
||||
@@ -1105,7 +1105,7 @@ SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size)
|
||||
|
||||
static SRes LzmaDec_AllocateProbs2(CLzmaDec *p, const CLzmaProps *propNew, ISzAllocPtr alloc)
|
||||
{
|
||||
UInt32 numProbs = LzmaProps_GetNumProbs(propNew);
|
||||
uint32_t numProbs = LzmaProps_GetNumProbs(propNew);
|
||||
if (!p->probs || numProbs != p->numProbs)
|
||||
{
|
||||
LzmaDec_FreeProbs(p, alloc);
|
||||
@@ -1135,10 +1135,10 @@ SRes LzmaDec_Allocate(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAll
|
||||
RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc));
|
||||
|
||||
{
|
||||
UInt32 dictSize = propNew.dicSize;
|
||||
SizeT mask = ((UInt32)1 << 12) - 1;
|
||||
if (dictSize >= ((UInt32)1 << 30)) mask = ((UInt32)1 << 22) - 1;
|
||||
else if (dictSize >= ((UInt32)1 << 22)) mask = ((UInt32)1 << 20) - 1;;
|
||||
uint32_t dictSize = propNew.dicSize;
|
||||
SizeT mask = ((uint32_t)1 << 12) - 1;
|
||||
if (dictSize >= ((uint32_t)1 << 30)) mask = ((uint32_t)1 << 22) - 1;
|
||||
else if (dictSize >= ((uint32_t)1 << 22)) mask = ((uint32_t)1 << 20) - 1;;
|
||||
dicBufSize = ((SizeT)dictSize + mask) & ~mask;
|
||||
if (dicBufSize < dictSize)
|
||||
dicBufSize = dictSize;
|
||||
|
||||
Vendored
+11
-11
@@ -14,9 +14,9 @@ EXTERN_C_BEGIN
|
||||
|
||||
typedef
|
||||
#ifdef _LZMA_PROB32
|
||||
UInt32
|
||||
uint32_t
|
||||
#else
|
||||
UInt16
|
||||
uint16_t
|
||||
#endif
|
||||
CLzmaProb;
|
||||
|
||||
@@ -31,7 +31,7 @@ typedef struct _CLzmaProps
|
||||
Byte lp;
|
||||
Byte pb;
|
||||
Byte _pad_;
|
||||
UInt32 dicSize;
|
||||
uint32_t dicSize;
|
||||
} CLzmaProps;
|
||||
|
||||
/* LzmaProps_Decode - decodes properties
|
||||
@@ -60,15 +60,15 @@ typedef struct
|
||||
SizeT dicBufSize;
|
||||
SizeT dicPos;
|
||||
const Byte *buf;
|
||||
UInt32 range;
|
||||
UInt32 code;
|
||||
UInt32 processedPos;
|
||||
UInt32 checkDicSize;
|
||||
UInt32 reps[4];
|
||||
UInt32 state;
|
||||
UInt32 remainLen;
|
||||
uint32_t range;
|
||||
uint32_t code;
|
||||
uint32_t processedPos;
|
||||
uint32_t checkDicSize;
|
||||
uint32_t reps[4];
|
||||
uint32_t state;
|
||||
uint32_t remainLen;
|
||||
|
||||
UInt32 numProbs;
|
||||
uint32_t numProbs;
|
||||
unsigned tempBufSize;
|
||||
Byte tempBuf[LZMA_REQUIRED_INPUT_MAX];
|
||||
} CLzmaDec;
|
||||
|
||||
Vendored
+188
-185
File diff suppressed because it is too large.
Load diff
Vendored
+5
-5
@@ -13,7 +13,7 @@ EXTERN_C_BEGIN
|
||||
typedef struct _CLzmaEncProps
|
||||
{
|
||||
int level; /* 0 <= level <= 9 */
|
||||
UInt32 dictSize; /* (1 << 12) <= dictSize <= (1 << 27) for 32-bit version
|
||||
uint32_t dictSize; /* (1 << 12) <= dictSize <= (1 << 27) for 32-bit version
|
||||
(1 << 12) <= dictSize <= (3 << 29) for 64-bit version
|
||||
default = (1 << 24) */
|
||||
int lc; /* 0 <= lc <= 8, default = 3 */
|
||||
@@ -23,17 +23,17 @@ typedef struct _CLzmaEncProps
|
||||
int fb; /* 5 <= fb <= 273, default = 32 */
|
||||
int btMode; /* 0 - hashChain Mode, 1 - binTree mode - normal, default = 1 */
|
||||
int numHashBytes; /* 2, 3 or 4, default = 4 */
|
||||
UInt32 mc; /* 1 <= mc <= (1 << 30), default = 32 */
|
||||
uint32_t mc; /* 1 <= mc <= (1 << 30), default = 32 */
|
||||
unsigned writeEndMark; /* 0 - do not write EOPM, 1 - write EOPM, default = 0 */
|
||||
int numThreads; /* 1 or 2, default = 2 */
|
||||
|
||||
UInt64 reduceSize; /* estimated size of data that will be compressed. default = (UInt64)(Int64)-1.
|
||||
uint64_t reduceSize; /* estimated size of data that will be compressed. default = (uint64_t)(int64_t)-1.
|
||||
Encoder uses this value to reduce dictionary size */
|
||||
} CLzmaEncProps;
|
||||
|
||||
void LzmaEncProps_Init(CLzmaEncProps *p);
|
||||
void LzmaEncProps_Normalize(CLzmaEncProps *p);
|
||||
UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2);
|
||||
uint32_t LzmaEncProps_GetDictSize(const CLzmaEncProps *props2);
|
||||
|
||||
|
||||
/* ---------- CLzmaEncHandle Interface ---------- */
|
||||
@@ -55,7 +55,7 @@ CLzmaEncHandle LzmaEnc_Create(ISzAllocPtr alloc);
|
||||
void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAllocPtr alloc, ISzAllocPtr allocBig);
|
||||
|
||||
SRes LzmaEnc_SetProps(CLzmaEncHandle p, const CLzmaEncProps *props);
|
||||
void LzmaEnc_SetDataSize(CLzmaEncHandle p, UInt64 expectedDataSiize);
|
||||
void LzmaEnc_SetDataSize(CLzmaEncHandle p, uint64_t expectedDataSiize);
|
||||
SRes LzmaEnc_WriteProperties(CLzmaEncHandle p, Byte *properties, SizeT *size);
|
||||
unsigned LzmaEnc_IsWriteEndMark(CLzmaEncHandle p);
|
||||
|
||||
|
||||
+2
-2
@@ -13,7 +13,7 @@ struct BaseConnectionUnix : public BaseConnection {
|
||||
int sock{-1};
|
||||
};
|
||||
|
||||
static BaseConnectionUnix Connection;
|
||||
static BaseConnectionUnix ConnectionUnix;
|
||||
static sockaddr_un PipeAddr{};
|
||||
#ifdef MSG_NOSIGNAL
|
||||
static int MsgFlags = MSG_NOSIGNAL;
|
||||
@@ -34,7 +34,7 @@ static const char* GetTempPath(void)
|
||||
/*static*/ BaseConnection* BaseConnection::Create()
|
||||
{
|
||||
PipeAddr.sun_family = AF_UNIX;
|
||||
return &Connection;
|
||||
return &ConnectionUnix;
|
||||
}
|
||||
|
||||
/*static*/ void BaseConnection::Destroy(BaseConnection*& c)
|
||||
|
||||
Vendored
+2
-2
@@ -63,8 +63,8 @@
|
||||
|
||||
/* Platform specific options */
|
||||
#if defined (__wiiu__)
|
||||
#define DEFAULT_CACHE_PAGES 4
|
||||
#define DEFAULT_SECTORS_PAGE 64
|
||||
#define DEFAULT_CACHE_PAGES 512
|
||||
#define DEFAULT_SECTORS_PAGE 128
|
||||
#if 0
|
||||
#define USE_LWP_LOCK
|
||||
#define USE_RTC_TIME
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
name: Publish Docker Image
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- name: Get release version
|
||||
id: get_release_tag
|
||||
run: |
|
||||
echo RELEASE_VERSION=$(echo $(date '+%Y%m%d')) >> $GITHUB_ENV
|
||||
echo REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}' | sed -e "s/:refs//" | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
|
||||
echo REPOSITORY_OWNER=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $1}' | sed 's/[^a-zA-Z0-9]//g' | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
|
||||
- name: Publish to Registry
|
||||
uses: elgohr/Publish-Docker-Github-Action@master
|
||||
with:
|
||||
name: ${{ env.REPOSITORY_OWNER }}/${{ env.REPOSITORY_NAME }}
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
snapshot: true
|
||||
cache: true
|
||||
tags: "latest, ${{ env.RELEASE_VERSION }}"
|
||||
@@ -0,0 +1,5 @@
|
||||
/*.a
|
||||
/build
|
||||
*.bz2
|
||||
release/
|
||||
lib/
|
||||
Vendored
+29
@@ -0,0 +1,29 @@
|
||||
language: cpp
|
||||
|
||||
os: linux
|
||||
sudo: false
|
||||
dist: trusty
|
||||
|
||||
env:
|
||||
global:
|
||||
- DEVKITPRO=/opt/devkitpro
|
||||
- DEVKITPPC=/opt/devkitpro/devkitPPC
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- "$HOME/.local"
|
||||
- "$DEVKITPRO"
|
||||
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- p7zip-full
|
||||
|
||||
before_install:
|
||||
- mkdir -p "${DEVKITPRO}"
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget https://github.com/devkitPro/pacman/releases/download/devkitpro-pacman-1.0.1/devkitpro-pacman.deb -O /tmp/devkitpro-pacman.deb; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo dpkg -i /tmp/devkitpro-pacman.deb; fi
|
||||
- yes | sudo dkp-pacman -Syu devkitPPC --needed
|
||||
|
||||
script:
|
||||
- make && make install
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
FROM wiiuenv/devkitppc:20210101
|
||||
|
||||
WORKDIR tmp_build
|
||||
COPY . .
|
||||
RUN make clean && make && mkdir -p /artifacts/wut/usr && cp -r lib /artifacts/wut/usr && cp -r include /artifacts/wut/usr
|
||||
WORKDIR /artifacts
|
||||
|
||||
FROM scratch
|
||||
COPY --from=0 /artifacts /artifacts
|
||||
Vendored
+157
@@ -0,0 +1,157 @@
|
||||
#-------------------------------------------------------------------------------
|
||||
.SUFFIXES:
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
ifeq ($(strip $(DEVKITPRO)),)
|
||||
$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>/devkitpro")
|
||||
endif
|
||||
|
||||
TOPDIR ?= $(CURDIR)
|
||||
|
||||
include $(DEVKITPRO)/wut/share/wut_rules
|
||||
|
||||
export VER_MAJOR := 1
|
||||
export VER_MINOR := 0
|
||||
export VER_PATCH := 0
|
||||
|
||||
VERSION := $(VER_MAJOR).$(VER_MINOR).$(VER_PATCH)
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# TARGET is the name of the output
|
||||
# BUILD is the directory where object files & intermediate files will be placed
|
||||
# SOURCES is a list of directories containing source code
|
||||
# DATA is a list of directories containing data files
|
||||
# INCLUDES is a list of directories containing header files
|
||||
#-------------------------------------------------------------------------------
|
||||
TARGET := $(notdir $(CURDIR))
|
||||
BUILD := build
|
||||
SOURCES := source
|
||||
DATA := data
|
||||
INCLUDES := source \
|
||||
include \
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# options for code generation
|
||||
#---------------------------------------------------------------------------------
|
||||
CFLAGS := -Wall -Werror -save-temps \
|
||||
-ffunction-sections -fdata-sections \
|
||||
$(MACHDEP) \
|
||||
$(BUILD_CFLAGS)
|
||||
|
||||
CFLAGS += $(INCLUDE) -D__WIIU__ -D__WUT__
|
||||
|
||||
CXXFLAGS := $(CFLAGS) -std=gnu++17
|
||||
|
||||
ASFLAGS := $(MACHDEP)
|
||||
|
||||
LDFLAGS = $(ARCH) -Wl,--gc-sections
|
||||
|
||||
|
||||
LIBS :=
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# list of directories containing libraries, this must be the top level containing
|
||||
# include and lib
|
||||
#---------------------------------------------------------------------------------
|
||||
LIBDIRS := $(PORTLIBS) $(WUT_ROOT)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# no real need to edit anything past this point unless you need to add additional
|
||||
# rules for different file extensions
|
||||
#---------------------------------------------------------------------------------
|
||||
ifneq ($(BUILD),$(notdir $(CURDIR)))
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
export TOPDIR := $(CURDIR)
|
||||
|
||||
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
|
||||
$(foreach dir,$(DATA),$(CURDIR)/$(dir))
|
||||
|
||||
CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
|
||||
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
|
||||
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
|
||||
DEFFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.def)))
|
||||
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# use CXX for linking C++ projects, CC for standard C
|
||||
#---------------------------------------------------------------------------------
|
||||
ifeq ($(strip $(CPPFILES)),)
|
||||
#---------------------------------------------------------------------------------
|
||||
export LD := $(CC)
|
||||
#---------------------------------------------------------------------------------
|
||||
else
|
||||
#---------------------------------------------------------------------------------
|
||||
export LD := $(CXX)
|
||||
#---------------------------------------------------------------------------------
|
||||
endif
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
export OFILES_BIN := $(addsuffix .o,$(BINFILES))
|
||||
export OFILES_SRC := $(DEFFILES:.def=.o) $(SFILES:.s=.o) $(CFILES:.c=.o) $(CPPFILES:.cpp=.o)
|
||||
export OFILES := $(OFILES_BIN) $(OFILES_SRC)
|
||||
export HFILES := $(addsuffix .h,$(subst .,_,$(BINFILES)))
|
||||
|
||||
export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
|
||||
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
|
||||
-I.
|
||||
|
||||
.PHONY: all dist-bin dist-src dist install clean
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
all: lib/libiosuhax.a
|
||||
|
||||
dist-bin: all
|
||||
@tar --exclude=*~ -cjf libiosuhax-$(VERSION).tar.bz2 include lib
|
||||
|
||||
dist-src:
|
||||
@tar --exclude=*~ -cjf libiosuhax-src-$(VERSION).tar.bz2 include source Makefile
|
||||
|
||||
dist: dist-src dist-bin
|
||||
|
||||
install: dist-bin
|
||||
mkdir -p $(DESTDIR)$(DEVKITPRO)/wut/usr
|
||||
bzip2 -cd libiosuhax-$(VERSION).tar.bz2 | tar -xf - -C $(DESTDIR)$(DEVKITPRO)/wut/usr
|
||||
|
||||
lib:
|
||||
@[ -d $@ ] || mkdir -p $@
|
||||
|
||||
release:
|
||||
@[ -d $@ ] || mkdir -p $@
|
||||
|
||||
lib/libiosuhax.a :$(SOURCES) $(INCLUDES) | lib release
|
||||
@$(MAKE) BUILD=release OUTPUT=$(CURDIR)/$@ \
|
||||
BUILD_CFLAGS="-DNDEBUG=1 -O2 -s" \
|
||||
DEPSDIR=$(CURDIR)/release \
|
||||
--no-print-directory -C release \
|
||||
-f $(CURDIR)/Makefile
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
clean:
|
||||
@echo clean ...
|
||||
@rm -rf release lib
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
else
|
||||
|
||||
DEPENDS := $(OFILES:.o=.d)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# main targets
|
||||
#---------------------------------------------------------------------------------
|
||||
$(OUTPUT) : $(OFILES)
|
||||
|
||||
$(OFILES_SRC) : $(HFILES)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
%_bin.h %.bin.o : %.bin
|
||||
#---------------------------------------------------------------------------------
|
||||
@echo $(notdir $<)
|
||||
@$(bin2o)
|
||||
|
||||
|
||||
-include $(DEPENDS)
|
||||
|
||||
#---------------------------------------------------------------------------------------
|
||||
endif
|
||||
#---------------------------------------------------------------------------------------
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
[](https://travis-ci.org/dimok789/libiosuhax)
|
||||
# libiosuhax
|
||||
A PPC library to access IOSUHAX from PPC and a devoptab for any device or path.
|
||||
It's only compatible to RPX-Files.
|
||||
|
||||
## Building
|
||||
Make you to have [wut](https://github.com/devkitPro/wut/) installed and use the following command for build:
|
||||
```
|
||||
make install
|
||||
```
|
||||
+112
-109
@@ -1,109 +1,112 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2016
|
||||
* by Dimok
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any
|
||||
* damages arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any
|
||||
* purpose, including commercial applications, and to alter it and
|
||||
* redistribute it freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you
|
||||
* must not claim that you wrote the original software. If you use
|
||||
* this software in a product, an acknowledgment in the product
|
||||
* documentation would be appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and
|
||||
* must not be misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
***************************************************************************/
|
||||
#ifndef _LIB_IOSUHAX_H_
|
||||
#define _LIB_IOSUHAX_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define IOS_ERROR_UNKNOWN_VALUE 0xFFFFFFD6
|
||||
#define IOS_ERROR_INVALID_ARG 0xFFFFFFE3
|
||||
#define IOS_ERROR_INVALID_SIZE 0xFFFFFFE9
|
||||
#define IOS_ERROR_UNKNOWN 0xFFFFFFF7
|
||||
#define IOS_ERROR_NOEXISTS 0xFFFFFFFA
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t flag;
|
||||
uint32_t permission;
|
||||
uint32_t owner_id;
|
||||
uint32_t group_id;
|
||||
uint32_t size; // size in bytes
|
||||
uint32_t physsize; // physical size on disk in bytes
|
||||
uint32_t unk[3];
|
||||
uint32_t id;
|
||||
uint32_t ctime;
|
||||
uint32_t mtime;
|
||||
uint32_t unk2[0x0D];
|
||||
}fileStat_s;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
fileStat_s stat;
|
||||
char name[0x100];
|
||||
}directoryEntry_s;
|
||||
|
||||
#define DIR_ENTRY_IS_DIRECTORY 0x80000000
|
||||
|
||||
#define FSA_MOUNTFLAGS_BINDMOUNT (1 << 0)
|
||||
#define FSA_MOUNTFLAGS_GLOBAL (1 << 1)
|
||||
|
||||
int IOSUHAX_Open(const char *dev); // if dev == NULL the default path /dev/iosuhax will be used
|
||||
int IOSUHAX_Close(void);
|
||||
|
||||
int IOSUHAX_memwrite(uint32_t address, const uint8_t * buffer, uint32_t size); // IOSU external input
|
||||
int IOSUHAX_memread(uint32_t address, uint8_t * out_buffer, uint32_t size); // IOSU external output
|
||||
int IOSUHAX_memcpy(uint32_t dst, uint32_t src, uint32_t size); // IOSU internal memcpy only
|
||||
|
||||
int IOSUHAX_SVC(uint32_t svc_id, uint32_t * args, uint32_t arg_cnt);
|
||||
|
||||
int IOSUHAX_FSA_Open();
|
||||
int IOSUHAX_FSA_Close(int fsaFd);
|
||||
|
||||
int IOSUHAX_FSA_Mount(int fsaFd, const char* device_path, const char* volume_path, uint32_t flags, const char* arg_string, int arg_string_len);
|
||||
int IOSUHAX_FSA_Unmount(int fsaFd, const char* path, uint32_t flags);
|
||||
int IOSUHAX_FSA_FlushVolume(int fsaFd, const char* volume_path);
|
||||
|
||||
int IOSUHAX_FSA_GetDeviceInfo(int fsaFd, const char* device_path, int type, uint32_t* out_data);
|
||||
|
||||
int IOSUHAX_FSA_MakeDir(int fsaFd, const char* path, uint32_t flags);
|
||||
int IOSUHAX_FSA_OpenDir(int fsaFd, const char* path, int* outHandle);
|
||||
int IOSUHAX_FSA_ReadDir(int fsaFd, int handle, directoryEntry_s* out_data);
|
||||
int IOSUHAX_FSA_RewindDir(int fsaFd, int dirHandle);
|
||||
int IOSUHAX_FSA_CloseDir(int fsaFd, int handle);
|
||||
int IOSUHAX_FSA_ChangeDir(int fsaFd, const char *path);
|
||||
|
||||
int IOSUHAX_FSA_OpenFile(int fsaFd, const char* path, const char* mode, int* outHandle);
|
||||
int IOSUHAX_FSA_ReadFile(int fsaFd, void* data, uint32_t size, uint32_t cnt, int fileHandle, uint32_t flags);
|
||||
int IOSUHAX_FSA_WriteFile(int fsaFd, const void* data, uint32_t size, uint32_t cnt, int fileHandle, uint32_t flags);
|
||||
int IOSUHAX_FSA_StatFile(int fsaFd, int fileHandle, fileStat_s* out_data);
|
||||
int IOSUHAX_FSA_CloseFile(int fsaFd, int fileHandle);
|
||||
int IOSUHAX_FSA_SetFilePos(int fsaFd, int fileHandle, uint32_t position);
|
||||
int IOSUHAX_FSA_GetStat(int fsaFd, const char *path, fileStat_s* out_data);
|
||||
int IOSUHAX_FSA_Remove(int fsaFd, const char *path);
|
||||
int IOSUHAX_FSA_ChangeMode(int fsaFd, const char* path, int mode);
|
||||
|
||||
int IOSUHAX_FSA_RawOpen(int fsaFd, const char* device_path, int* outHandle);
|
||||
int IOSUHAX_FSA_RawRead(int fsaFd, void* data, uint32_t block_size, uint32_t block_cnt, uint64_t sector_offset, int device_handle);
|
||||
int IOSUHAX_FSA_RawWrite(int fsaFd, const void* data, uint32_t block_size, uint32_t block_cnt, uint64_t sector_offset, int device_handle);
|
||||
int IOSUHAX_FSA_RawClose(int fsaFd, int device_handle);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2016
|
||||
* by Dimok
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any
|
||||
* damages arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any
|
||||
* purpose, including commercial applications, and to alter it and
|
||||
* redistribute it freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you
|
||||
* must not claim that you wrote the original software. If you use
|
||||
* this software in a product, an acknowledgment in the product
|
||||
* documentation would be appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and
|
||||
* must not be misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
***************************************************************************/
|
||||
#ifndef _LIB_IOSUHAX_H_
|
||||
#define _LIB_IOSUHAX_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define IOS_ERROR_UNKNOWN_VALUE 0xFFFFFFD6
|
||||
#define IOS_ERROR_INVALID_ARG 0xFFFFFFE3
|
||||
#define IOS_ERROR_INVALID_SIZE 0xFFFFFFE9
|
||||
#define IOS_ERROR_UNKNOWN 0xFFFFFFF7
|
||||
#define IOS_ERROR_NOEXISTS 0xFFFFFFFA
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t flag;
|
||||
uint32_t permission;
|
||||
uint32_t owner_id;
|
||||
uint32_t group_id;
|
||||
uint32_t size; // size in bytes
|
||||
uint32_t physsize; // physical size on disk in bytes
|
||||
uint32_t unk[3];
|
||||
uint32_t id;
|
||||
uint32_t ctime;
|
||||
uint32_t mtime;
|
||||
uint32_t unk2[0x0D];
|
||||
}fileStat_s;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
fileStat_s stat;
|
||||
char name[0x100];
|
||||
}directoryEntry_s;
|
||||
|
||||
#define DIR_ENTRY_IS_DIRECTORY 0x80000000
|
||||
|
||||
#define FSA_MOUNTFLAGS_BINDMOUNT (1 << 0)
|
||||
#define FSA_MOUNTFLAGS_GLOBAL (1 << 1)
|
||||
|
||||
int IOSUHAX_Open(const char *dev); // if dev == NULL the default path /dev/iosuhax will be used
|
||||
int IOSUHAX_Close(void);
|
||||
|
||||
int IOSUHAX_memwrite(uint32_t address, const uint8_t * buffer, uint32_t size); // IOSU external input
|
||||
int IOSUHAX_memread(uint32_t address, uint8_t * out_buffer, uint32_t size); // IOSU external output
|
||||
int IOSUHAX_memcpy(uint32_t dst, uint32_t src, uint32_t size); // IOSU internal memcpy only
|
||||
|
||||
int IOSUHAX_kern_write32(uint32_t address, uint32_t value);
|
||||
int IOSUHAX_kern_read32(uint32_t address, uint32_t* out_buffer, uint32_t count);
|
||||
|
||||
int IOSUHAX_SVC(uint32_t svc_id, uint32_t * args, uint32_t arg_cnt);
|
||||
|
||||
int IOSUHAX_FSA_Open();
|
||||
int IOSUHAX_FSA_Close(int fsaFd);
|
||||
|
||||
int IOSUHAX_FSA_Mount(int fsaFd, const char* device_path, const char* volume_path, uint32_t flags, const char* arg_string, int arg_string_len);
|
||||
int IOSUHAX_FSA_Unmount(int fsaFd, const char* path, uint32_t flags);
|
||||
int IOSUHAX_FSA_FlushVolume(int fsaFd, const char* volume_path);
|
||||
|
||||
int IOSUHAX_FSA_GetDeviceInfo(int fsaFd, const char* device_path, int type, uint32_t* out_data);
|
||||
|
||||
int IOSUHAX_FSA_MakeDir(int fsaFd, const char* path, uint32_t flags);
|
||||
int IOSUHAX_FSA_OpenDir(int fsaFd, const char* path, int* outHandle);
|
||||
int IOSUHAX_FSA_ReadDir(int fsaFd, int handle, directoryEntry_s* out_data);
|
||||
int IOSUHAX_FSA_RewindDir(int fsaFd, int dirHandle);
|
||||
int IOSUHAX_FSA_CloseDir(int fsaFd, int handle);
|
||||
int IOSUHAX_FSA_ChangeDir(int fsaFd, const char *path);
|
||||
|
||||
int IOSUHAX_FSA_OpenFile(int fsaFd, const char* path, const char* mode, int* outHandle);
|
||||
int IOSUHAX_FSA_ReadFile(int fsaFd, void* data, uint32_t size, uint32_t cnt, int fileHandle, uint32_t flags);
|
||||
int IOSUHAX_FSA_WriteFile(int fsaFd, const void* data, uint32_t size, uint32_t cnt, int fileHandle, uint32_t flags);
|
||||
int IOSUHAX_FSA_StatFile(int fsaFd, int fileHandle, fileStat_s* out_data);
|
||||
int IOSUHAX_FSA_CloseFile(int fsaFd, int fileHandle);
|
||||
int IOSUHAX_FSA_SetFilePos(int fsaFd, int fileHandle, uint32_t position);
|
||||
int IOSUHAX_FSA_GetStat(int fsaFd, const char *path, fileStat_s* out_data);
|
||||
int IOSUHAX_FSA_Remove(int fsaFd, const char *path);
|
||||
int IOSUHAX_FSA_ChangeMode(int fsaFd, const char* path, int mode);
|
||||
|
||||
int IOSUHAX_FSA_RawOpen(int fsaFd, const char* device_path, int* outHandle);
|
||||
int IOSUHAX_FSA_RawRead(int fsaFd, void* data, uint32_t block_size, uint32_t block_cnt, uint64_t sector_offset, int device_handle);
|
||||
int IOSUHAX_FSA_RawWrite(int fsaFd, const void* data, uint32_t block_size, uint32_t block_cnt, uint64_t sector_offset, int device_handle);
|
||||
int IOSUHAX_FSA_RawClose(int fsaFd, int device_handle);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+42
-42
@@ -1,42 +1,42 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2015
|
||||
* by Dimok
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any
|
||||
* damages arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any
|
||||
* purpose, including commercial applications, and to alter it and
|
||||
* redistribute it freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you
|
||||
* must not claim that you wrote the original software. If you use
|
||||
* this software in a product, an acknowledgment in the product
|
||||
* documentation would be appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and
|
||||
* must not be misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
***************************************************************************/
|
||||
#ifndef __IOSUHAX_DEVOPTAB_H_
|
||||
#define __IOSUHAX_DEVOPTAB_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
//! virtual name example: sd or odd (for sd:/ or odd:/ access)
|
||||
//! fsaFd: fd received by IOSUHAX_FSA_Open();
|
||||
//! dev_path: (optional) if a device should be mounted to the mount_path. If NULL no IOSUHAX_FSA_Mount is not executed.
|
||||
//! mount_path: path to map to virtual device name
|
||||
int mount_fs(const char *virt_name, int fsaFd, const char *dev_path, const char *mount_path);
|
||||
int unmount_fs(const char *virt_name);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __IOSUHAX_DEVOPTAB_H_
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2015
|
||||
* by Dimok
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any
|
||||
* damages arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any
|
||||
* purpose, including commercial applications, and to alter it and
|
||||
* redistribute it freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you
|
||||
* must not claim that you wrote the original software. If you use
|
||||
* this software in a product, an acknowledgment in the product
|
||||
* documentation would be appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and
|
||||
* must not be misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
***************************************************************************/
|
||||
#ifndef __IOSUHAX_DEVOPTAB_H_
|
||||
#define __IOSUHAX_DEVOPTAB_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
//! virtual name example: sd or odd (for sd:/ or odd:/ access)
|
||||
//! fsaFd: fd received by IOSUHAX_FSA_Open();
|
||||
//! dev_path: (optional) if a device should be mounted to the mount_path. If NULL no IOSUHAX_FSA_Mount is not executed.
|
||||
//! mount_path: path to map to virtual device name
|
||||
int mount_fs(const char *virt_name, int fsaFd, const char *dev_path, const char *mount_path);
|
||||
int unmount_fs(const char *virt_name);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __IOSUHAX_DEVOPTAB_H_
|
||||
Vendored
+73
-73
@@ -1,73 +1,73 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2016
|
||||
* by Dimok
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any
|
||||
* damages arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any
|
||||
* purpose, including commercial applications, and to alter it and
|
||||
* redistribute it freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you
|
||||
* must not claim that you wrote the original software. If you use
|
||||
* this software in a product, an acknowledgment in the product
|
||||
* documentation would be appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and
|
||||
* must not be misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
***************************************************************************/
|
||||
#ifndef _IOSUHAX_DISC_INTERFACE_H_
|
||||
#define _IOSUHAX_DISC_INTERFACE_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define DEVICE_TYPE_WII_U_SD (('W'<<24)|('U'<<16)|('S'<<8)|'D')
|
||||
#define DEVICE_TYPE_WII_U_USB (('W'<<24)|('U'<<16)|('S'<<8)|'B')
|
||||
#define FEATURE_WII_U_SD 0x00001000
|
||||
#define FEATURE_WII_U_USB 0x00002000
|
||||
|
||||
#ifndef OGC_DISC_IO_INCLUDE
|
||||
typedef uint32_t sec_t;
|
||||
|
||||
#define FEATURE_MEDIUM_CANREAD 0x00000001
|
||||
#define FEATURE_MEDIUM_CANWRITE 0x00000002
|
||||
|
||||
typedef bool (* FN_MEDIUM_STARTUP)(void) ;
|
||||
typedef bool (* FN_MEDIUM_ISINSERTED)(void) ;
|
||||
typedef bool (* FN_MEDIUM_READSECTORS)(uint32_t sector, uint32_t numSectors, void* buffer) ;
|
||||
typedef bool (* FN_MEDIUM_WRITESECTORS)(uint32_t sector, uint32_t numSectors, const void* buffer) ;
|
||||
typedef bool (* FN_MEDIUM_CLEARSTATUS)(void) ;
|
||||
typedef bool (* FN_MEDIUM_SHUTDOWN)(void) ;
|
||||
|
||||
struct DISC_INTERFACE_STRUCT {
|
||||
unsigned long ioType ;
|
||||
unsigned long features ;
|
||||
FN_MEDIUM_STARTUP startup ;
|
||||
FN_MEDIUM_ISINSERTED isInserted ;
|
||||
FN_MEDIUM_READSECTORS readSectors ;
|
||||
FN_MEDIUM_WRITESECTORS writeSectors ;
|
||||
FN_MEDIUM_CLEARSTATUS clearStatus ;
|
||||
FN_MEDIUM_SHUTDOWN shutdown ;
|
||||
} ;
|
||||
|
||||
typedef struct DISC_INTERFACE_STRUCT DISC_INTERFACE ;
|
||||
#endif
|
||||
|
||||
extern const DISC_INTERFACE IOSUHAX_sdio_disc_interface;
|
||||
extern const DISC_INTERFACE IOSUHAX_usb_disc_interface;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2016
|
||||
* by Dimok
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any
|
||||
* damages arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any
|
||||
* purpose, including commercial applications, and to alter it and
|
||||
* redistribute it freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you
|
||||
* must not claim that you wrote the original software. If you use
|
||||
* this software in a product, an acknowledgment in the product
|
||||
* documentation would be appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and
|
||||
* must not be misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
***************************************************************************/
|
||||
#ifndef _IOSUHAX_DISC_INTERFACE_H_
|
||||
#define _IOSUHAX_DISC_INTERFACE_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define DEVICE_TYPE_WII_U_SD (('W'<<24)|('U'<<16)|('S'<<8)|'D')
|
||||
#define DEVICE_TYPE_WII_U_USB (('W'<<24)|('U'<<16)|('S'<<8)|'B')
|
||||
#define FEATURE_WII_U_SD 0x00001000
|
||||
#define FEATURE_WII_U_USB 0x00002000
|
||||
|
||||
#ifndef OGC_DISC_IO_INCLUDE
|
||||
typedef uint32_t sec_t;
|
||||
|
||||
#define FEATURE_MEDIUM_CANREAD 0x00000001
|
||||
#define FEATURE_MEDIUM_CANWRITE 0x00000002
|
||||
|
||||
typedef bool (* FN_MEDIUM_STARTUP)(void) ;
|
||||
typedef bool (* FN_MEDIUM_ISINSERTED)(void) ;
|
||||
typedef bool (* FN_MEDIUM_READSECTORS)(uint32_t sector, uint32_t numSectors, void* buffer) ;
|
||||
typedef bool (* FN_MEDIUM_WRITESECTORS)(uint32_t sector, uint32_t numSectors, const void* buffer) ;
|
||||
typedef bool (* FN_MEDIUM_CLEARSTATUS)(void) ;
|
||||
typedef bool (* FN_MEDIUM_SHUTDOWN)(void) ;
|
||||
|
||||
struct DISC_INTERFACE_STRUCT {
|
||||
unsigned long ioType ;
|
||||
unsigned long features ;
|
||||
FN_MEDIUM_STARTUP startup ;
|
||||
FN_MEDIUM_ISINSERTED isInserted ;
|
||||
FN_MEDIUM_READSECTORS readSectors ;
|
||||
FN_MEDIUM_WRITESECTORS writeSectors ;
|
||||
FN_MEDIUM_CLEARSTATUS clearStatus ;
|
||||
FN_MEDIUM_SHUTDOWN shutdown ;
|
||||
} ;
|
||||
|
||||
typedef struct DISC_INTERFACE_STRUCT DISC_INTERFACE ;
|
||||
#endif
|
||||
|
||||
extern const DISC_INTERFACE IOSUHAX_sdio_disc_interface;
|
||||
extern const DISC_INTERFACE IOSUHAX_usb_disc_interface;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Vendored
-51
@@ -1,51 +0,0 @@
|
||||
#ifndef __OS_FUNCTIONS_H_
|
||||
#define __OS_FUNCTIONS_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define OS_MUTEX_SIZE 44
|
||||
|
||||
// RetroArch mod: use existing headers; prevents conflicts in griffin
|
||||
#include <wiiu/os.h>
|
||||
#include <wiiu/ios.h>
|
||||
#if 0
|
||||
|
||||
#ifndef __WUT__
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Mutex functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
extern void (* OSInitMutex)(void* mutex);
|
||||
extern void (* OSLockMutex)(void* mutex);
|
||||
extern void (* OSUnlockMutex)(void* mutex);
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! IOS function
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
extern int (*IOS_Ioctl)(int fd, unsigned int request, void *input_buffer,unsigned int input_buffer_len, void *output_buffer, unsigned int output_buffer_len);
|
||||
extern int (*IOS_Open)(char *path, unsigned int mode);
|
||||
extern int (*IOS_Close)(int fd);
|
||||
#else
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! Mutex functions
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
extern void OSInitMutex(void* mutex);
|
||||
extern void OSLockMutex(void* mutex);
|
||||
extern void OSUnlockMutex(void* mutex);
|
||||
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
//! IOS function
|
||||
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
extern int IOS_Ioctl(int fd, unsigned int request, void *input_buffer,unsigned int input_buffer_len, void *output_buffer, unsigned int output_buffer_len);
|
||||
extern int IOS_Open(char *path, unsigned int mode);
|
||||
extern int IOS_Close(int fd);
|
||||
#endif // __WUT__
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // 0
|
||||
|
||||
#endif // __OS_FUNCTIONS_H_
|
||||
+956
-1029
File diff suppressed because it is too large.
Load diff
+993
-1134
File diff suppressed because it is too large.
Load diff
+262
-262
@@ -1,262 +1,262 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2016
|
||||
* by Dimok
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any
|
||||
* damages arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any
|
||||
* purpose, including commercial applications, and to alter it and
|
||||
* redistribute it freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you
|
||||
* must not claim that you wrote the original software. If you use
|
||||
* this software in a product, an acknowledgment in the product
|
||||
* documentation would be appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and
|
||||
* must not be misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
***************************************************************************/
|
||||
#include <string.h>
|
||||
#include <malloc.h>
|
||||
#include "iosuhax.h"
|
||||
#include "iosuhax_disc_interface.h"
|
||||
|
||||
#define FSA_REF_SD 0x01
|
||||
#define FSA_REF_USB 0x02
|
||||
|
||||
static int initialized = 0;
|
||||
|
||||
static int fsaFdSd = 0;
|
||||
static int fsaFdUsb = 0;
|
||||
static int sdioFd = 0;
|
||||
static int usbFd = 0;
|
||||
|
||||
static void IOSUHAX_disc_io_initialize(void)
|
||||
{
|
||||
if(initialized == 0)
|
||||
{
|
||||
initialized = 1;
|
||||
fsaFdSd = -1;
|
||||
fsaFdUsb = -1;
|
||||
sdioFd = -1;
|
||||
usbFd = -1;
|
||||
}
|
||||
}
|
||||
|
||||
static bool IOSUHAX_disc_io_fsa_open(int fsaFd)
|
||||
{
|
||||
IOSUHAX_disc_io_initialize();
|
||||
|
||||
if(IOSUHAX_Open(NULL) < 0)
|
||||
return false;
|
||||
|
||||
if(fsaFd == FSA_REF_SD)
|
||||
{
|
||||
if(fsaFdSd < 0)
|
||||
{
|
||||
fsaFdSd = IOSUHAX_FSA_Open();
|
||||
}
|
||||
|
||||
if(fsaFdSd >= 0)
|
||||
return true;
|
||||
}
|
||||
else if(fsaFd == FSA_REF_USB)
|
||||
{
|
||||
if(fsaFdUsb < 0)
|
||||
{
|
||||
fsaFdUsb = IOSUHAX_FSA_Open();
|
||||
}
|
||||
|
||||
if(fsaFdUsb >= 0)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static void IOSUHAX_disc_io_fsa_close(int fsaFd)
|
||||
{
|
||||
if(fsaFd == FSA_REF_SD)
|
||||
{
|
||||
if(fsaFdSd >= 0)
|
||||
{
|
||||
IOSUHAX_FSA_Close(fsaFdSd);
|
||||
fsaFdSd = -1;
|
||||
}
|
||||
}
|
||||
else if(fsaFd == FSA_REF_USB)
|
||||
{
|
||||
if(fsaFdUsb >= 0)
|
||||
{
|
||||
IOSUHAX_FSA_Close(fsaFdUsb);
|
||||
fsaFdUsb = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static bool IOSUHAX_sdio_startup(void)
|
||||
{
|
||||
if(!IOSUHAX_disc_io_fsa_open(FSA_REF_SD))
|
||||
return false;
|
||||
|
||||
if(sdioFd < 0)
|
||||
{
|
||||
int res = IOSUHAX_FSA_RawOpen(fsaFdSd, "/dev/sdcard01", &sdioFd);
|
||||
if(res < 0)
|
||||
{
|
||||
IOSUHAX_disc_io_fsa_close(FSA_REF_SD);
|
||||
sdioFd = -1;
|
||||
}
|
||||
}
|
||||
|
||||
return (sdioFd >= 0);
|
||||
}
|
||||
|
||||
static bool IOSUHAX_sdio_isInserted(void)
|
||||
{
|
||||
//! TODO: check for SD card inserted with IOSUHAX_FSA_GetDeviceInfo()
|
||||
return initialized && (fsaFdSd >= 0) && (sdioFd >= 0);
|
||||
}
|
||||
|
||||
static bool IOSUHAX_sdio_clearStatus(void)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool IOSUHAX_sdio_shutdown(void)
|
||||
{
|
||||
if(!IOSUHAX_sdio_isInserted())
|
||||
return false;
|
||||
|
||||
IOSUHAX_FSA_RawClose(fsaFdSd, sdioFd);
|
||||
IOSUHAX_disc_io_fsa_close(FSA_REF_SD);
|
||||
sdioFd = -1;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool IOSUHAX_sdio_readSectors(uint32_t sector, uint32_t numSectors, void* buffer)
|
||||
{
|
||||
if(!IOSUHAX_sdio_isInserted() || !buffer)
|
||||
return false;
|
||||
|
||||
int res = IOSUHAX_FSA_RawRead(fsaFdSd, buffer, 512, numSectors, sector, sdioFd);
|
||||
if(res < 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool IOSUHAX_sdio_writeSectors(uint32_t sector, uint32_t numSectors, const void* buffer)
|
||||
{
|
||||
if(!IOSUHAX_sdio_isInserted() || !buffer)
|
||||
return false;
|
||||
|
||||
int res = IOSUHAX_FSA_RawWrite(fsaFdSd, buffer, 512, numSectors, sector, sdioFd);
|
||||
if(res < 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
const DISC_INTERFACE IOSUHAX_sdio_disc_interface =
|
||||
{
|
||||
DEVICE_TYPE_WII_U_SD,
|
||||
FEATURE_MEDIUM_CANREAD | FEATURE_MEDIUM_CANWRITE | FEATURE_WII_U_SD,
|
||||
IOSUHAX_sdio_startup,
|
||||
IOSUHAX_sdio_isInserted,
|
||||
IOSUHAX_sdio_readSectors,
|
||||
IOSUHAX_sdio_writeSectors,
|
||||
IOSUHAX_sdio_clearStatus,
|
||||
IOSUHAX_sdio_shutdown
|
||||
};
|
||||
|
||||
static bool IOSUHAX_usb_startup(void)
|
||||
{
|
||||
if(!IOSUHAX_disc_io_fsa_open(FSA_REF_USB))
|
||||
return false;
|
||||
|
||||
if(usbFd < 0)
|
||||
{
|
||||
int res = IOSUHAX_FSA_RawOpen(fsaFdUsb, "/dev/usb01", &usbFd);
|
||||
if(res < 0)
|
||||
{
|
||||
res = IOSUHAX_FSA_RawOpen(fsaFdUsb, "/dev/usb02", &usbFd);
|
||||
if(res < 0)
|
||||
{
|
||||
IOSUHAX_disc_io_fsa_close(FSA_REF_USB);
|
||||
usbFd = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return (usbFd >= 0);
|
||||
}
|
||||
|
||||
static bool IOSUHAX_usb_isInserted(void)
|
||||
{
|
||||
return initialized && (fsaFdUsb >= 0) && (usbFd >= 0);
|
||||
}
|
||||
|
||||
static bool IOSUHAX_usb_clearStatus(void)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool IOSUHAX_usb_shutdown(void)
|
||||
{
|
||||
if(!IOSUHAX_usb_isInserted())
|
||||
return false;
|
||||
|
||||
IOSUHAX_FSA_RawClose(fsaFdUsb, usbFd);
|
||||
IOSUHAX_disc_io_fsa_close(FSA_REF_USB);
|
||||
usbFd = -1;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool IOSUHAX_usb_readSectors(uint32_t sector, uint32_t numSectors, void* buffer)
|
||||
{
|
||||
if(!IOSUHAX_usb_isInserted() || !buffer)
|
||||
return false;
|
||||
|
||||
int res = IOSUHAX_FSA_RawRead(fsaFdUsb, buffer, 512, numSectors, sector, usbFd);
|
||||
if(res < 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool IOSUHAX_usb_writeSectors(uint32_t sector, uint32_t numSectors, const void* buffer)
|
||||
{
|
||||
if(!IOSUHAX_usb_isInserted() || !buffer)
|
||||
return false;
|
||||
|
||||
int res = IOSUHAX_FSA_RawWrite(fsaFdUsb, buffer, 512, numSectors, sector, usbFd);
|
||||
if(res < 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
const DISC_INTERFACE IOSUHAX_usb_disc_interface =
|
||||
{
|
||||
DEVICE_TYPE_WII_U_USB,
|
||||
FEATURE_MEDIUM_CANREAD | FEATURE_MEDIUM_CANWRITE | FEATURE_WII_U_USB,
|
||||
IOSUHAX_usb_startup,
|
||||
IOSUHAX_usb_isInserted,
|
||||
IOSUHAX_usb_readSectors,
|
||||
IOSUHAX_usb_writeSectors,
|
||||
IOSUHAX_usb_clearStatus,
|
||||
IOSUHAX_usb_shutdown
|
||||
};
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2016
|
||||
* by Dimok
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any
|
||||
* damages arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any
|
||||
* purpose, including commercial applications, and to alter it and
|
||||
* redistribute it freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you
|
||||
* must not claim that you wrote the original software. If you use
|
||||
* this software in a product, an acknowledgment in the product
|
||||
* documentation would be appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and
|
||||
* must not be misrepresented as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source
|
||||
* distribution.
|
||||
***************************************************************************/
|
||||
#include <string.h>
|
||||
#include <malloc.h>
|
||||
#include "iosuhax.h"
|
||||
#include "iosuhax_disc_interface.h"
|
||||
|
||||
#define FSA_REF_SD 0x01
|
||||
#define FSA_REF_USB 0x02
|
||||
|
||||
static int initialized = 0;
|
||||
|
||||
static int fsaFdSd = 0;
|
||||
static int fsaFdUsb = 0;
|
||||
static int sdioFd = 0;
|
||||
static int usbFd = 0;
|
||||
|
||||
static void IOSUHAX_disc_io_initialize(void)
|
||||
{
|
||||
if(initialized == 0)
|
||||
{
|
||||
initialized = 1;
|
||||
fsaFdSd = -1;
|
||||
fsaFdUsb = -1;
|
||||
sdioFd = -1;
|
||||
usbFd = -1;
|
||||
}
|
||||
}
|
||||
|
||||
static bool IOSUHAX_disc_io_fsa_open(int fsaFd)
|
||||
{
|
||||
IOSUHAX_disc_io_initialize();
|
||||
|
||||
if(IOSUHAX_Open(NULL) < 0)
|
||||
return false;
|
||||
|
||||
if(fsaFd == FSA_REF_SD)
|
||||
{
|
||||
if(fsaFdSd < 0)
|
||||
{
|
||||
fsaFdSd = IOSUHAX_FSA_Open();
|
||||
}
|
||||
|
||||
if(fsaFdSd >= 0)
|
||||
return true;
|
||||
}
|
||||
else if(fsaFd == FSA_REF_USB)
|
||||
{
|
||||
if(fsaFdUsb < 0)
|
||||
{
|
||||
fsaFdUsb = IOSUHAX_FSA_Open();
|
||||
}
|
||||
|
||||
if(fsaFdUsb >= 0)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static void IOSUHAX_disc_io_fsa_close(int fsaFd)
|
||||
{
|
||||
if(fsaFd == FSA_REF_SD)
|
||||
{
|
||||
if(fsaFdSd >= 0)
|
||||
{
|
||||
IOSUHAX_FSA_Close(fsaFdSd);
|
||||
fsaFdSd = -1;
|
||||
}
|
||||
}
|
||||
else if(fsaFd == FSA_REF_USB)
|
||||
{
|
||||
if(fsaFdUsb >= 0)
|
||||
{
|
||||
IOSUHAX_FSA_Close(fsaFdUsb);
|
||||
fsaFdUsb = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static bool IOSUHAX_sdio_startup(void)
|
||||
{
|
||||
if(!IOSUHAX_disc_io_fsa_open(FSA_REF_SD))
|
||||
return false;
|
||||
|
||||
if(sdioFd < 0)
|
||||
{
|
||||
int res = IOSUHAX_FSA_RawOpen(fsaFdSd, "/dev/sdcard01", &sdioFd);
|
||||
if(res < 0)
|
||||
{
|
||||
IOSUHAX_disc_io_fsa_close(FSA_REF_SD);
|
||||
sdioFd = -1;
|
||||
}
|
||||
}
|
||||
|
||||
return (sdioFd >= 0);
|
||||
}
|
||||
|
||||
static bool IOSUHAX_sdio_isInserted(void)
|
||||
{
|
||||
//! TODO: check for SD card inserted with IOSUHAX_FSA_GetDeviceInfo()
|
||||
return initialized && (fsaFdSd >= 0) && (sdioFd >= 0);
|
||||
}
|
||||
|
||||
static bool IOSUHAX_sdio_clearStatus(void)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool IOSUHAX_sdio_shutdown(void)
|
||||
{
|
||||
if(!IOSUHAX_sdio_isInserted())
|
||||
return false;
|
||||
|
||||
IOSUHAX_FSA_RawClose(fsaFdSd, sdioFd);
|
||||
IOSUHAX_disc_io_fsa_close(FSA_REF_SD);
|
||||
sdioFd = -1;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool IOSUHAX_sdio_readSectors(uint32_t sector, uint32_t numSectors, void* buffer)
|
||||
{
|
||||
if(!IOSUHAX_sdio_isInserted())
|
||||
return false;
|
||||
|
||||
int res = IOSUHAX_FSA_RawRead(fsaFdSd, buffer, 512, numSectors, sector, sdioFd);
|
||||
if(res < 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool IOSUHAX_sdio_writeSectors(uint32_t sector, uint32_t numSectors, const void* buffer)
|
||||
{
|
||||
if(!IOSUHAX_sdio_isInserted())
|
||||
return false;
|
||||
|
||||
int res = IOSUHAX_FSA_RawWrite(fsaFdSd, buffer, 512, numSectors, sector, sdioFd);
|
||||
if(res < 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
const DISC_INTERFACE IOSUHAX_sdio_disc_interface =
|
||||
{
|
||||
DEVICE_TYPE_WII_U_SD,
|
||||
FEATURE_MEDIUM_CANREAD | FEATURE_MEDIUM_CANWRITE | FEATURE_WII_U_SD,
|
||||
IOSUHAX_sdio_startup,
|
||||
IOSUHAX_sdio_isInserted,
|
||||
IOSUHAX_sdio_readSectors,
|
||||
IOSUHAX_sdio_writeSectors,
|
||||
IOSUHAX_sdio_clearStatus,
|
||||
IOSUHAX_sdio_shutdown
|
||||
};
|
||||
|
||||
static bool IOSUHAX_usb_startup(void)
|
||||
{
|
||||
if(!IOSUHAX_disc_io_fsa_open(FSA_REF_USB))
|
||||
return false;
|
||||
|
||||
if(usbFd < 0)
|
||||
{
|
||||
int res = IOSUHAX_FSA_RawOpen(fsaFdUsb, "/dev/usb01", &usbFd);
|
||||
if(res < 0)
|
||||
{
|
||||
res = IOSUHAX_FSA_RawOpen(fsaFdUsb, "/dev/usb02", &usbFd);
|
||||
if(res < 0)
|
||||
{
|
||||
IOSUHAX_disc_io_fsa_close(FSA_REF_USB);
|
||||
usbFd = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return (usbFd >= 0);
|
||||
}
|
||||
|
||||
static bool IOSUHAX_usb_isInserted(void)
|
||||
{
|
||||
return initialized && (fsaFdUsb >= 0) && (usbFd >= 0);
|
||||
}
|
||||
|
||||
static bool IOSUHAX_usb_clearStatus(void)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool IOSUHAX_usb_shutdown(void)
|
||||
{
|
||||
if(!IOSUHAX_usb_isInserted())
|
||||
return false;
|
||||
|
||||
IOSUHAX_FSA_RawClose(fsaFdUsb, usbFd);
|
||||
IOSUHAX_disc_io_fsa_close(FSA_REF_USB);
|
||||
usbFd = -1;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool IOSUHAX_usb_readSectors(uint32_t sector, uint32_t numSectors, void* buffer)
|
||||
{
|
||||
if(!IOSUHAX_usb_isInserted())
|
||||
return false;
|
||||
|
||||
int res = IOSUHAX_FSA_RawRead(fsaFdUsb, buffer, 512, numSectors, sector, usbFd);
|
||||
if(res < 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool IOSUHAX_usb_writeSectors(uint32_t sector, uint32_t numSectors, const void* buffer)
|
||||
{
|
||||
if(!IOSUHAX_usb_isInserted())
|
||||
return false;
|
||||
|
||||
int res = IOSUHAX_FSA_RawWrite(fsaFdUsb, buffer, 512, numSectors, sector, usbFd);
|
||||
if(res < 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
const DISC_INTERFACE IOSUHAX_usb_disc_interface =
|
||||
{
|
||||
DEVICE_TYPE_WII_U_USB,
|
||||
FEATURE_MEDIUM_CANREAD | FEATURE_MEDIUM_CANWRITE | FEATURE_WII_U_USB,
|
||||
IOSUHAX_usb_startup,
|
||||
IOSUHAX_usb_isInserted,
|
||||
IOSUHAX_usb_readSectors,
|
||||
IOSUHAX_usb_writeSectors,
|
||||
IOSUHAX_usb_clearStatus,
|
||||
IOSUHAX_usb_shutdown
|
||||
};
|
||||
Loaded 100 of 742 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user