mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-10 03:21:30 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9e25601a56 | ||
|
|
fca5af7ac3 | ||
|
|
1af0ede1a6 | ||
|
|
e7733abc40 | ||
|
|
4171c93bff | ||
|
|
dd2c9c911b | ||
|
|
de052537ec | ||
|
|
68bc6b37ae | ||
|
|
548d1bae9e | ||
|
|
c89e557158 | ||
|
|
62dda5fdbf | ||
|
|
22f24bd48f | ||
|
|
eeb0c65b6e | ||
|
|
b23fcf238b | ||
|
|
79698981ad | ||
|
|
ab4e3e8c75 | ||
|
|
4bee4429aa | ||
|
|
269ee7e672 | ||
|
|
8d6b70c22c | ||
|
|
e786059506 | ||
|
|
d48d4385d9 | ||
|
|
1521be8acb | ||
|
|
76c97bbfad | ||
|
|
1b931dd410 | ||
|
|
77baa1c930 | ||
|
|
d41b7770c4 | ||
|
|
4f145a4f4f | ||
|
|
fc7dc3cef7 | ||
|
|
0dbfd721b3 | ||
|
|
243505b7cb | ||
|
|
04af898fe5 | ||
|
|
9e1c5747f6 | ||
|
|
ab49806a5f | ||
|
|
e24934d5ea | ||
|
|
8ab162ffb1 | ||
|
|
614e5bc44f | ||
|
|
c1137ee3fa | ||
|
|
6cfe0ea77c | ||
|
|
d89b7f93b2 | ||
|
|
a6b114e423 | ||
|
|
90f2ebeac1 | ||
|
|
60cca4d9d2 | ||
|
|
9b2752ff07 | ||
|
|
16c4035e1c | ||
|
|
b5eba22aaf | ||
|
|
98b572d17a | ||
|
|
76c6e01534 | ||
|
|
15b1281075 | ||
|
|
e4ef930b47 | ||
|
|
19e86a2b19 | ||
|
|
46b62b4a63 | ||
|
|
7874d179da | ||
|
|
341a4d50ea | ||
|
|
b8328a9fdf | ||
|
|
5b8411fe77 | ||
|
|
682d8f23e9 | ||
|
|
34a9224334 | ||
|
|
88ee7cbfa8 | ||
|
|
70e472e9e2 | ||
|
|
e9adb44c4a | ||
|
|
81f8cae52a | ||
|
|
36e67108fb | ||
|
|
f0bad7b091 | ||
|
|
354c50039b | ||
|
|
b9c69e24a9 | ||
|
|
6319262b9c | ||
|
|
78e02bf3dd | ||
|
|
3492ba5fd6 | ||
|
|
f9ed6cbbfe | ||
|
|
98a573033d | ||
|
|
066089873b | ||
|
|
8032ff6e19 | ||
|
|
99d5dba6ae | ||
|
|
0b0455975b | ||
|
|
4b34894b59 | ||
|
|
311ee2db62 | ||
|
|
dfafcb0513 | ||
|
|
28520af599 | ||
|
|
207795abfd | ||
|
|
495ad41741 | ||
|
|
d591529e7a | ||
|
|
3a5dace583 | ||
|
|
e2952586d1 | ||
|
|
16f25c2e06 | ||
|
|
8fea733a1f | ||
|
|
bbb09f7557 | ||
|
|
1fc1acd3d0 | ||
|
|
0923985516 | ||
|
|
2b1d1bc8cb | ||
|
|
38e3cc2087 | ||
|
|
be3acb902b | ||
|
|
617940fb8d | ||
|
|
a96ae6e987 | ||
|
|
a65396ba56 | ||
|
|
61c4e3a5e4 | ||
|
|
df8f93e9d5 | ||
|
|
577e1bd693 | ||
|
|
1012d07e7f | ||
|
|
edec9448c4 | ||
|
|
19ea50843c | ||
|
|
e9db190baa | ||
|
|
fd5d9a0710 | ||
|
|
1f673be3c8 | ||
|
|
a82582e859 | ||
|
|
40ecfbcdfa | ||
|
|
1e54379141 | ||
|
|
291012d2a9 | ||
|
|
5296f4aebd | ||
|
|
c86de916cb | ||
|
|
c014fc20a1 | ||
|
|
39f089f374 | ||
|
|
1fe7898add | ||
|
|
3b2ec53100 | ||
|
|
3a8f12dff3 | ||
|
|
02d1eeb400 | ||
|
|
261f1b72d4 | ||
|
|
15f7ba4d99 | ||
|
|
ea49348db2 | ||
|
|
af6208be29 | ||
|
|
5f81200067 | ||
|
|
3901c2d63a | ||
|
|
b1ad6014f0 | ||
|
|
572611f1ca | ||
|
|
6d4b1b69e5 | ||
|
|
dcb6bae868 | ||
|
|
69208d0fca | ||
|
|
60c8edd39c | ||
|
|
d2e2c289a6 | ||
|
|
562bf11946 | ||
|
|
3d80838754 | ||
|
|
85f25574fb | ||
|
|
2986e9ff37 | ||
|
|
9b87456d3e | ||
|
|
8a64df5763 | ||
|
|
376547044c | ||
|
|
2b22eaa7e6 | ||
|
|
da4c95531e | ||
|
|
707aafa1e6 | ||
|
|
e5169eee71 | ||
|
|
665b98bd28 | ||
|
|
0817fb3d18 | ||
|
|
29e9546b7d | ||
|
|
2653a9bed3 | ||
|
|
72a44078ce | ||
|
|
501954c6f6 | ||
|
|
fa7859ad13 | ||
|
|
600776012d | ||
|
|
37044dd387 | ||
|
|
a11d955dd8 | ||
|
|
c0daf56963 | ||
|
|
bbdf586f18 | ||
|
|
4a93cb2007 | ||
|
|
203bea3fe6 | ||
|
|
641662d77c | ||
|
|
2ad394148a | ||
|
|
bbd1e6a6a5 | ||
|
|
bef72a19d0 | ||
|
|
3efa83a646 | ||
|
|
1d2150cb45 | ||
|
|
56236f7372 | ||
|
|
246863279a | ||
|
|
a986b71947 | ||
|
|
3eba8da4e9 | ||
|
|
94261da70a | ||
|
|
5dcdee5faa | ||
|
|
8386c06e07 | ||
|
|
85d11eac30 | ||
|
|
755cc94489 | ||
|
|
ef2ddf6912 | ||
|
|
f97e557194 | ||
|
|
0029598822 | ||
|
|
e23cd0e7e7 | ||
|
|
4c9ae245a4 | ||
|
|
4380b73ca6 | ||
|
|
fa2a748631 | ||
|
|
bdc866d6d5 | ||
|
|
554bbb5fd0 | ||
|
|
6e0971fc61 | ||
|
|
d5cdfbb7ba | ||
|
|
063986a4b3 | ||
|
|
fdb859276b | ||
|
|
9a14c28056 | ||
|
|
210833006f | ||
|
|
4ca5af4ac9 | ||
|
|
decd374c15 | ||
|
|
1216c3ef6d | ||
|
|
0f72a07b9e | ||
|
|
c4fafaebec | ||
|
|
c0160095fa | ||
|
|
f559e931cf | ||
|
|
f92a507a9b | ||
|
|
be7e074856 | ||
|
|
3e1f56d57f | ||
|
|
aae2e6fd7d | ||
|
|
91baea201a | ||
|
|
cf58c09d6e | ||
|
|
53dbd69751 | ||
|
|
3d950b2324 | ||
|
|
96395f7d39 | ||
|
|
e4eb5a9bb9 | ||
|
|
27c45b1b7a | ||
|
|
278dc75285 | ||
|
|
9c6c10da22 | ||
|
|
1d6f547e7f | ||
|
|
ee7051891b | ||
|
|
22b789cca6 | ||
|
|
40a6c978ce | ||
|
|
688629d108 | ||
|
|
65e8b28d02 | ||
|
|
1561ed8022 | ||
|
|
1630affbdd | ||
|
|
d88e37a2f1 | ||
|
|
fa00cdba20 | ||
|
|
6c97a7514c | ||
|
|
83057301c2 | ||
|
|
6e6fbc5ad3 | ||
|
|
d567b0ca25 | ||
|
|
3667690027 | ||
|
|
2936b1940a | ||
|
|
07700d77bd | ||
|
|
776568a429 | ||
|
|
8f39fb2adf | ||
|
|
91ee8c8ee6 | ||
|
|
a4e810795c | ||
|
|
0418e49757 | ||
|
|
0096b9e6f0 | ||
|
|
47e1f0f2b1 | ||
|
|
f2a64aa8e7 | ||
|
|
c25e3ab3f9 | ||
|
|
b6d01ce448 | ||
|
|
090919490a | ||
|
|
2ba1f3547c | ||
|
|
556fa9a499 | ||
|
|
ec3ab80da8 | ||
|
|
41e32ea949 | ||
|
|
42c3072ff9 | ||
|
|
0b0ac03bed | ||
|
|
ef8427cc23 | ||
|
|
c73daa6a1c | ||
|
|
6b6233944b | ||
|
|
a6245185b9 | ||
|
|
bfd283e2a6 | ||
|
|
54675938ce | ||
|
|
758a6c76ae | ||
|
|
05d71ebb67 | ||
|
|
19406af87f | ||
|
|
fa328c1590 | ||
|
|
c4e04a6d09 | ||
|
|
b1579dd8d9 | ||
|
|
6ca24c412d | ||
|
|
fc4a5ad691 | ||
|
|
4b183f84b2 | ||
|
|
bf01a2d6e5 | ||
|
|
4c38228359 | ||
|
|
ef9501a40d | ||
|
|
195c9f6ab6 | ||
|
|
cc0b7c42d1 | ||
|
|
4ec9fe5a57 | ||
|
|
643b3a73a4 | ||
|
|
dcd5dd6492 | ||
|
|
39db52b4f4 | ||
|
|
3955009b08 | ||
|
|
f1dc0b6d8e | ||
|
|
a30e53d911 | ||
|
|
568c55aca2 | ||
|
|
62af393cd8 | ||
|
|
7ed61ca766 | ||
|
|
f9580c245d | ||
|
|
88b28b6458 | ||
|
|
7c63889b26 | ||
|
|
55de2803a4 | ||
|
|
4de34a53e7 | ||
|
|
0e22651c48 | ||
|
|
fa6ce5bc68 | ||
|
|
db7431f3fa | ||
|
|
7747e3a6b4 | ||
|
|
0d2d8f4d41 | ||
|
|
f4f339c4d5 | ||
|
|
48fddcb7bd | ||
|
|
0a6f6cb281 | ||
|
|
eb51b0c383 | ||
|
|
5f1fcf51a6 | ||
|
|
569014c5d2 | ||
|
|
1d6ebacfaa | ||
|
|
80f494b961 | ||
|
|
f4d1732137 | ||
|
|
2fc3a6fc1a | ||
|
|
dc8f8cd401 | ||
|
|
88c331ea99 | ||
|
|
9d16264ba1 | ||
|
|
d809cc6a31 | ||
|
|
5c0cca9783 | ||
|
|
a0e7fe19af | ||
|
|
960ff23843 | ||
|
|
0996e13352 | ||
|
|
81972149fc | ||
|
|
48af253a06 | ||
|
|
1e45692f0b | ||
|
|
096a420e7b | ||
|
|
ecb3301b19 | ||
|
|
ad397671a7 | ||
|
|
8b5db9fdaf | ||
|
|
4137273002 | ||
|
|
f6db9ce04d | ||
|
|
106c912eb5 | ||
|
|
3fe8806018 | ||
|
|
f3742a101c | ||
|
|
b09a22360c | ||
|
|
f01afe72c6 | ||
|
|
a2fd581dad | ||
|
|
2169a25b0a | ||
|
|
fdd4915718 | ||
|
|
9e9fa1f7df | ||
|
|
5e8ab7b287 | ||
|
|
0e47f4efb8 | ||
|
|
080b3ea184 | ||
|
|
13d44720e0 | ||
|
|
57f5d04126 | ||
|
|
463d68163e | ||
|
|
7ad4becedb | ||
|
|
7fa6247770 | ||
|
|
17c827adfb | ||
|
|
a30a53f12a | ||
|
|
7e83f4a531 | ||
|
|
3c3e6978b8 | ||
|
|
19f53d96a2 | ||
|
|
98618c052b | ||
|
|
69e5e97bdf | ||
|
|
99850df96e | ||
|
|
dd658a05b4 | ||
|
|
3ce38ffe91 | ||
|
|
89b04d255e | ||
|
|
410e94aa89 | ||
|
|
7c8d831497 | ||
|
|
c84d02830c | ||
|
|
b3e8d6e9ca | ||
|
|
cf97f39cac | ||
|
|
96fd6f8617 | ||
|
|
cde4ecd08b | ||
|
|
a05ebd4bbc | ||
|
|
9e749ee63a | ||
|
|
e785bff78d | ||
|
|
3aedbe6989 | ||
|
|
b6a45645d8 | ||
|
|
3d3c848ba7 | ||
|
|
c98dc7ef34 | ||
|
|
586f54a0f7 | ||
|
|
75f3a79aa6 | ||
|
|
27c3c1f684 | ||
|
|
5ee803682f | ||
|
|
e52daa8602 | ||
|
|
65cddce865 | ||
|
|
973ae36fe5 | ||
|
|
7b1819e988 | ||
|
|
538f0c534f | ||
|
|
921e470b05 | ||
|
|
ea4e5ab9ef | ||
|
|
96d0de4e7c | ||
|
|
04bd684258 | ||
|
|
58852ec9bb | ||
|
|
e4fcce118c | ||
|
|
ef149605cd | ||
|
|
c240449b10 | ||
|
|
8d63faa74d | ||
|
|
226f2d52ff | ||
|
|
1165f8dfe9 | ||
|
|
4e34611d1d | ||
|
|
0df043aff1 | ||
|
|
9573b53390 | ||
|
|
ca0edad8c2 | ||
|
|
f47b07e35a | ||
|
|
45db2122c9 | ||
|
|
d33624c623 | ||
|
|
abb1b28e96 | ||
|
|
a19da4bf22 | ||
|
|
347cb15722 | ||
|
|
20f3b8d404 | ||
|
|
31a7f2b4d9 | ||
|
|
e5a6517897 | ||
|
|
80f3f99845 | ||
|
|
4322d0c3fe | ||
|
|
764f1d846e | ||
|
|
1d0be580c5 | ||
|
|
44f2986665 | ||
|
|
9d6490e38a | ||
|
|
7aa914fde7 | ||
|
|
0930cd29fb | ||
|
|
695749f155 | ||
|
|
3ca8623b29 | ||
|
|
c6309d963d | ||
|
|
305aee2c33 | ||
|
|
cbcdfa572a | ||
|
|
2512365012 | ||
|
|
9988bae6f4 | ||
|
|
18f2b9c63e | ||
|
|
b5cc71720c | ||
|
|
6eed40f80c | ||
|
|
e93d90bc45 | ||
|
|
d057d2a202 | ||
|
|
cb67ace703 | ||
|
|
759724facb | ||
|
|
3033491f3d | ||
|
|
751ff8f72c | ||
|
|
d6d76a53b9 | ||
|
|
3224eefdf1 | ||
|
|
776ae626a6 | ||
|
|
8ad44acc5d | ||
|
|
ecbbf1e3bb | ||
|
|
2d31377ba8 | ||
|
|
e55692d74f | ||
|
|
6164e33b07 | ||
|
|
4850cc0f97 | ||
|
|
5674c46f38 | ||
|
|
a33280b08e | ||
|
|
48799b73d5 | ||
|
|
7c028596fb | ||
|
|
d93200d2eb | ||
|
|
aafee65238 | ||
|
|
f5a7504c38 | ||
|
|
ef4d24600e | ||
|
|
28ec64e200 | ||
|
|
1fcded67ef | ||
|
|
3be60539ce | ||
|
|
779c0a01d3 | ||
|
|
e1a5b80ae1 | ||
|
|
021102c62d | ||
|
|
de1e66f7a9 | ||
|
|
13793885f3 | ||
|
|
cdeef9dc95 | ||
|
|
55400e9b42 | ||
|
|
110bc5abbe | ||
|
|
21ffbc0cca | ||
|
|
559c6df0c3 | ||
|
|
b7b0348c3c | ||
|
|
779b8b32cf | ||
|
|
a73555f672 | ||
|
|
03d0e0d799 | ||
|
|
64597e47c6 | ||
|
|
6713c6ebed | ||
|
|
051342cc8b | ||
|
|
94cf920751 | ||
|
|
dcac9de58b | ||
|
|
23ce202d38 | ||
|
|
362dd7241a | ||
|
|
94907678eb | ||
|
|
9cb94e00b0 | ||
|
|
3b4e55d0e5 | ||
|
|
8779151fef | ||
|
|
923c19356b | ||
|
|
3d95f3c7b1 | ||
|
|
6f6bd95a84 | ||
|
|
aa537310ad | ||
|
|
39ebd6e8d1 | ||
|
|
faf8c83f54 | ||
|
|
e8babede53 | ||
|
|
36af159991 | ||
|
|
7150d6ef59 | ||
|
|
2a500baaca | ||
|
|
cb85b3e8dd | ||
|
|
ea9d5e3a5e | ||
|
|
d96409ff37 | ||
|
|
95e11234a7 | ||
|
|
97329367e4 | ||
|
|
4217369709 | ||
|
|
09832d09fb | ||
|
|
168395af74 | ||
|
|
60b182b821 | ||
|
|
587a56026e | ||
|
|
3e8e6d35d6 | ||
|
|
9a7a8efb39 | ||
|
|
4db4d5e8bc | ||
|
|
d046594591 | ||
|
|
417d1b7de7 | ||
|
|
a88e6f4e1f | ||
|
|
96723c6f70 | ||
|
|
5062374c72 | ||
|
|
76bb0031cb | ||
|
|
8ba17dd985 | ||
|
|
4437cd1eac | ||
|
|
3cfed7ba01 | ||
|
|
e9a264217a | ||
|
|
15ffffa835 | ||
|
|
79ce997156 | ||
|
|
15838c2850 | ||
|
|
0545c42db9 | ||
|
|
f3001c9bba | ||
|
|
42aa83b2a5 | ||
|
|
15e8be4074 | ||
|
|
3c27300a4e | ||
|
|
65f406a39e | ||
|
|
0d06dfa948 | ||
|
|
b4be7b0c74 | ||
|
|
9ad874eef8 | ||
|
|
d52f3ba3e9 | ||
|
|
3d44faf6c3 | ||
|
|
8ad3cb14f8 | ||
|
|
0be7e96437 | ||
|
|
d1aa7dbedc | ||
|
|
eef7611cf1 | ||
|
|
758b3ad2cc | ||
|
|
b468aa8c01 | ||
|
|
31d86e6e78 | ||
|
|
1617cd7e2a | ||
|
|
ac318f2c8c | ||
|
|
42d02565af | ||
|
|
18d3eba614 | ||
|
|
3171c71639 | ||
|
|
32444f8188 | ||
|
|
73729e7a33 | ||
|
|
c6f55eeb94 | ||
|
|
5e156b9d73 | ||
|
|
004d100ed8 | ||
|
|
1f866dbad4 | ||
|
|
127e07c210 | ||
|
|
745fb4b40c | ||
|
|
a96ea2492d | ||
|
|
3b8e3c613f | ||
|
|
f7445bcc98 | ||
|
|
0fd2cfbab6 | ||
|
|
d5d643ca28 | ||
|
|
2dc9616509 | ||
|
|
739f7b47fe | ||
|
|
82df0c3aa3 | ||
|
|
3e22d7bbd5 | ||
|
|
b67894586f | ||
|
|
5e20d16ef8 | ||
|
|
83235dc484 | ||
|
|
bd0d8fd8ea | ||
|
|
ec7faddd26 | ||
|
|
6591844b3e | ||
|
|
14c5825769 | ||
|
|
dfda4f3519 | ||
|
|
7117cb8f8e | ||
|
|
00f755a822 | ||
|
|
328d5bf648 | ||
|
|
7f1c1db651 | ||
|
|
b90bd91731 | ||
|
|
5aa87c1734 | ||
|
|
1fd6d024eb | ||
|
|
c6b325e4d6 | ||
|
|
df588ca422 | ||
|
|
17a161afa2 | ||
|
|
5628d3ba91 | ||
|
|
94f82ece4e | ||
|
|
6b2ac3afcd | ||
|
|
1aaf933a1a | ||
|
|
3af86cab07 | ||
|
|
d0ed4e90b3 | ||
|
|
355aaac73a | ||
|
|
fbd973147b | ||
|
|
6d2b81c6b3 | ||
|
|
b01b4de91d | ||
|
|
36e7cc4bbd | ||
|
|
7429124cd4 | ||
|
|
e3658cbc7b | ||
|
|
3031556e73 | ||
|
|
105fadd668 | ||
|
|
a8a4e60171 | ||
|
|
bfe167fae8 | ||
|
|
7cbdd845ad | ||
|
|
de203390be | ||
|
|
55916a40ab | ||
|
|
002f2ab6e7 | ||
|
|
e61fc4e427 | ||
|
|
c198c0737a | ||
|
|
03b18dbfc4 | ||
|
|
c88f2b31ee | ||
|
|
a01e99aa63 | ||
|
|
1ea82b8b5d | ||
|
|
4b393eb22a | ||
|
|
bb6f13a725 | ||
|
|
7519d3562b | ||
|
|
0f924bd083 | ||
|
|
004d782323 | ||
|
|
1bd9d503f0 | ||
|
|
918b08e910 | ||
|
|
83cb526153 | ||
|
|
aa19d5180b | ||
|
|
d44d1537d9 | ||
|
|
1392143d14 | ||
|
|
ca03491e63 | ||
|
|
25fb69a7a5 | ||
|
|
c1717fc028 | ||
|
|
49fb0d7909 | ||
|
|
28e88c95ec | ||
|
|
4c198a7cb3 | ||
|
|
e1f8b66c05 | ||
|
|
f03f6d6a63 | ||
|
|
b06314cda3 | ||
|
|
fc6580200a | ||
|
|
ed20c14f23 | ||
|
|
cbe46dfd99 | ||
|
|
1223f74f5c | ||
|
|
8c2135f2bb | ||
|
|
d20dc01aff | ||
|
|
cd29485d6e | ||
|
|
a8430acd66 | ||
|
|
3a67e072bb | ||
|
|
535f2f23f3 | ||
|
|
a27ee73622 | ||
|
|
9b012e907a | ||
|
|
ebe9f1861e | ||
|
|
9462fd301a | ||
|
|
6992f580e8 | ||
|
|
6dd7f65322 | ||
|
|
72e6601702 | ||
|
|
cab8663713 | ||
|
|
8d9419128e | ||
|
|
e3bf70dc10 | ||
|
|
0647e0d2c2 | ||
|
|
2f43a1b5f4 | ||
|
|
831e33739e | ||
|
|
90008242eb | ||
|
|
43017cb65b | ||
|
|
2f17cbaef3 | ||
|
|
688acb1e41 | ||
|
|
7b2d7a9ec7 | ||
|
|
01e62efb72 | ||
|
|
82391b6ac1 | ||
|
|
2ad2983b25 | ||
|
|
5df0516318 | ||
|
|
56014a6bf7 | ||
|
|
dd923d55f2 | ||
|
|
3c2d30c510 | ||
|
|
a4982cd460 | ||
|
|
e6a3785b01 | ||
|
|
d09ae22147 | ||
|
|
d2e83df498 | ||
|
|
c490b06fe9 | ||
|
|
c9a97d255c | ||
|
|
f0a9f4e6a4 | ||
|
|
177ca956f1 | ||
|
|
e13febc82b | ||
|
|
04ee55f202 | ||
|
|
ee6c2393c1 | ||
|
|
52fe3d2c7d | ||
|
|
1dbc7cdc9a | ||
|
|
07f3abfda1 | ||
|
|
a2c7b17cd3 | ||
|
|
56393bd253 | ||
|
|
3d52d7a8f6 | ||
|
|
b5958359d2 | ||
|
|
e7257c1855 | ||
|
|
6329b28e4a | ||
|
|
c3743a74f6 | ||
|
|
e7d2e7ebcb | ||
|
|
71f4ff6b84 | ||
|
|
bfe00ac6f3 | ||
|
|
2b2d6742e0 | ||
|
|
aa9934a722 | ||
|
|
ec4ecb5d34 | ||
|
|
8551d175ab | ||
|
|
d0bce8bc9f | ||
|
|
12ae92ef66 | ||
|
|
c1a2dd81c7 | ||
|
|
a4d8ecf2b8 | ||
|
|
c80d18c446 | ||
|
|
2a41f1fb99 | ||
|
|
901932a8e1 | ||
|
|
e57e4dbf57 | ||
|
|
00ca7297f3 | ||
|
|
cfc2a15d41 | ||
|
|
e8f55e8b24 | ||
|
|
c09c4299ba | ||
|
|
dda12da672 | ||
|
|
96b6789855 | ||
|
|
17107a1563 | ||
|
|
c3c2f5bfb6 | ||
|
|
3953659901 | ||
|
|
c3f2469832 | ||
|
|
2e0c1daf1b | ||
|
|
93df88a5d6 | ||
|
|
3ed2cf7812 | ||
|
|
c0dfcd2adf | ||
|
|
f349784bd6 | ||
|
|
ba2c870d95 | ||
|
|
b382ea2a33 | ||
|
|
b6094d6f3b | ||
|
|
170397456c | ||
|
|
944485b9ae | ||
|
|
c8adaaaab2 | ||
|
|
d8ba2839c4 | ||
|
|
576213b048 | ||
|
|
1f97d31f2a | ||
|
|
1e6e7a698f | ||
|
|
9170bca9b3 | ||
|
|
388879da38 | ||
|
|
4476d3e971 | ||
|
|
4e4802e5c6 | ||
|
|
203a80aeaa | ||
|
|
50a50b8519 | ||
|
|
4203b4fb78 | ||
|
|
a990c0bca4 | ||
|
|
4eec21b4d1 | ||
|
|
6625eff3d8 | ||
|
|
677f13a2fe | ||
|
|
ba74747860 | ||
|
|
de3ac2c549 | ||
|
|
ccaba7d465 | ||
|
|
e553e19996 | ||
|
|
ce9ba045ff | ||
|
|
c69a11a219 | ||
|
|
4aa936ce33 | ||
|
|
f09561026a | ||
|
|
5cdef89b86 | ||
|
|
b1d5542d77 | ||
|
|
1671f16b0c | ||
|
|
5a5640155a | ||
|
|
822eb3bb86 | ||
|
|
3e55d598db | ||
|
|
def1e352d4 | ||
|
|
34b744aff6 | ||
|
|
bff8e8204d | ||
|
|
4cd3934610 | ||
|
|
33206b8847 | ||
|
|
b26fa714a8 | ||
|
|
9983976ddb | ||
|
|
d3ed02dd87 | ||
|
|
d392d90a6e | ||
|
|
c8067ba0c0 | ||
|
|
932071952d | ||
|
|
f081cfa314 | ||
|
|
861379d8e3 | ||
|
|
64b23937d3 | ||
|
|
11a4a4cffb | ||
|
|
8da54e2349 | ||
|
|
87cc90741d | ||
|
|
27da1c94f2 | ||
|
|
d2d240ecf5 | ||
|
|
540edd7b5d | ||
|
|
81c020d300 | ||
|
|
e3506ed06b | ||
|
|
387e18b528 | ||
|
|
bac58c99c4 | ||
|
|
964fcda79a | ||
|
|
b241b5769b | ||
|
|
376598a6e0 | ||
|
|
ed8e440b0d | ||
|
|
442608981d | ||
|
|
8191f2775f | ||
|
|
f142caea11 | ||
|
|
d2f381d121 | ||
|
|
90b56fb487 | ||
|
|
8533512a82 | ||
|
|
dbe4be7e7f | ||
|
|
912ab4ff00 | ||
|
|
460cfc9efd | ||
|
|
309045e0ac | ||
|
|
944e89bdc8 | ||
|
|
885eb4f15b | ||
|
|
27ecc119e0 | ||
|
|
ded406984f | ||
|
|
2a7b76249c | ||
|
|
e49d505254 | ||
|
|
79c336b6fd | ||
|
|
249c73d68c | ||
|
|
5d8c566dbc | ||
|
|
aa2348823c | ||
|
|
10a234908f | ||
|
|
6d5104f6d7 | ||
|
|
fbdc53f926 | ||
|
|
8e028f4db3 | ||
|
|
29ced2a72f | ||
|
|
77b05d6078 | ||
|
|
b351fac466 | ||
|
|
ffda27c8a7 | ||
|
|
72601103ba | ||
|
|
4736bef77b | ||
|
|
1581d23a6c | ||
|
|
15b6da2a17 | ||
|
|
f0784351c4 | ||
|
|
9df2a6fd99 | ||
|
|
8518b4f50b | ||
|
|
53b7fb2ba2 | ||
|
|
6a541125aa | ||
|
|
947e15f34f | ||
|
|
c7ce2c7053 | ||
|
|
d5a5380e6d | ||
|
|
496104005b | ||
|
|
33ab147514 | ||
|
|
c0bc8d2df2 | ||
|
|
d2a1d96f59 | ||
|
|
9d0356dd73 | ||
|
|
a46027bed7 | ||
|
|
a68e9b5014 | ||
|
|
88d4ae6790 | ||
|
|
48cca00d91 | ||
|
|
9555f70440 | ||
|
|
db9a067e64 | ||
|
|
0aa9bd9c22 | ||
|
|
aba96fbf03 | ||
|
|
2a72d90e8a | ||
|
|
479ba58042 | ||
|
|
9c0028c1d1 | ||
|
|
53d18cf95e | ||
|
|
63e437d58f | ||
|
|
ddd9fbf6ae | ||
|
|
68719ac8d4 | ||
|
|
934697b0da | ||
|
|
cbe68cbf88 | ||
|
|
9e547699c6 | ||
|
|
f9bc57bcf8 | ||
|
|
09b7202c54 | ||
|
|
8c799f978b | ||
|
|
34125a6d14 | ||
|
|
c252cbe9e0 | ||
|
|
8e6e30370d | ||
|
|
154c2d388d | ||
|
|
e8c027cbc3 | ||
|
|
e3a8e28edc | ||
|
|
1c9d0dbf48 | ||
|
|
939770929f | ||
|
|
756b4636f6 | ||
|
|
80e49531b1 | ||
|
|
b6aa9f2fd1 | ||
|
|
09a9b7d254 | ||
|
|
f804e0738f | ||
|
|
a28e57e42d | ||
|
|
7088281b52 | ||
|
|
ba183cf7a6 | ||
|
|
9df755bdb4 | ||
|
|
4eebfa237b | ||
|
|
cc99b9f949 | ||
|
|
6c47f02bdf | ||
|
|
30f36a30f2 | ||
|
|
b6dc887d52 | ||
|
|
9b192dc3c1 | ||
|
|
686a0ce199 | ||
|
|
27f88abb02 | ||
|
|
3b0cbc1e41 | ||
|
|
0d284c42bc | ||
|
|
11f054e646 | ||
|
|
6ec7eddfc9 | ||
|
|
7eefec6945 | ||
|
|
95dede9039 | ||
|
|
82898ea194 | ||
|
|
666ebb0ae1 | ||
|
|
8548771025 | ||
|
|
6adfff6995 | ||
|
|
724865a8fc | ||
|
|
eab80384ab | ||
|
|
cbf0bc9cfc | ||
|
|
474110b818 | ||
|
|
52b3a4fe17 | ||
|
|
2f7a6fa394 | ||
|
|
2a77dc5600 | ||
|
|
d84dfee044 | ||
|
|
616759ed8c | ||
|
|
637319c938 | ||
|
|
d7572399cc | ||
|
|
2678789bd8 | ||
|
|
96845f4a7e | ||
|
|
baaf27c268 | ||
|
|
3038e9e1ce | ||
|
|
a30f7dc79f | ||
|
|
2b20c8d350 | ||
|
|
3f88a49bdc | ||
|
|
bed9847b48 | ||
|
|
66bdf711f4 | ||
|
|
f3ca57e6f0 | ||
|
|
6b7673f806 | ||
|
|
312f143253 | ||
|
|
3a552e08ff | ||
|
|
1533d618e5 | ||
|
|
6394342b9c | ||
|
|
9c27f0e7c3 | ||
|
|
a0486c3cd7 | ||
|
|
4cca0c1eb7 | ||
|
|
a75491375c | ||
|
|
d31dcbed81 | ||
|
|
25a417cdd7 | ||
|
|
df6d65e061 | ||
|
|
95f68b0625 | ||
|
|
f9f7092370 | ||
|
|
9e2ac1100c | ||
|
|
8f492adac3 | ||
|
|
0a4795f6d5 | ||
|
|
8a26931622 | ||
|
|
52db3779c7 | ||
|
|
84de1ce2f2 | ||
|
|
6443169bac | ||
|
|
08ce33eed0 | ||
|
|
1fc1a48bfe | ||
|
|
e4bcfa6a2a | ||
|
|
cf586b7273 | ||
|
|
bc657778fe | ||
|
|
ad5874b94d | ||
|
|
0e6f33103a | ||
|
|
455982da91 | ||
|
|
0c83d2a7cf | ||
|
|
dbd1e70410 | ||
|
|
c62af7dc49 | ||
|
|
946713100a | ||
|
|
a3aef0f3f5 | ||
|
|
f3506054a1 | ||
|
|
a5f1e9f817 | ||
|
|
ff03272e07 | ||
|
|
bba454207e | ||
|
|
f2898f4404 | ||
|
|
a247ee14cd | ||
|
|
42a85938e7 | ||
|
|
4d6555d58b | ||
|
|
0493ecc7a6 | ||
|
|
44219c00aa | ||
|
|
545996f52e | ||
|
|
16e7fe41dc | ||
|
|
4a4b76111f | ||
|
|
38716b518c | ||
|
|
a28bbf5d14 | ||
|
|
6afd684ae5 | ||
|
|
ab56aca3ef | ||
|
|
7e6ce4e279 | ||
|
|
67e9fba9d7 | ||
|
|
d326828fd6 | ||
|
|
82b31c12c1 | ||
|
|
bfdc8e6a62 | ||
|
|
078961648f | ||
|
|
044851f608 | ||
|
|
dc696ab112 | ||
|
|
ec4f49d860 | ||
|
|
73e3620d20 | ||
|
|
112483e824 | ||
|
|
36f13e0520 | ||
|
|
f0aafce88b | ||
|
|
e9643d189b | ||
|
|
79b2b098b1 | ||
|
|
e60f72388e | ||
|
|
26f1e8be95 | ||
|
|
697d16dd01 | ||
|
|
841b3d620f | ||
|
|
b427f44908 | ||
|
|
98de418b7a | ||
|
|
8fc4a788e1 | ||
|
|
b590d0a219 | ||
|
|
eb2a881d55 | ||
|
|
b8d6e1d2c3 | ||
|
|
72d416d5f2 | ||
|
|
98b04b99dc | ||
|
|
14e159decf | ||
|
|
8809932b49 | ||
|
|
5a9f435863 | ||
|
|
72a087384b | ||
|
|
c356969c3a | ||
|
|
9ba48d8a4e | ||
|
|
01bf1c9710 | ||
|
|
370c28f0d4 | ||
|
|
c10175030f | ||
|
|
3a8e58ada4 | ||
|
|
d915787c9c | ||
|
|
7d5e24806c | ||
|
|
ee39d62031 | ||
|
|
064f821cf0 | ||
|
|
9a3512df31 | ||
|
|
fad8a0f29c | ||
|
|
7021a4909e | ||
|
|
d4b7be4ae4 | ||
|
|
eb77d84716 | ||
|
|
5639b3ebbd | ||
|
|
d215d3ff44 | ||
|
|
a488876a6a | ||
|
|
9c0f4c737e | ||
|
|
1f56d944ae | ||
|
|
7dbd46c978 | ||
|
|
b854201bc1 | ||
|
|
0719f9861c | ||
|
|
d15f8e0dc5 | ||
|
|
86a7e500e9 | ||
|
|
d641e67876 | ||
|
|
eb72061b27 | ||
|
|
b64289bd5f | ||
|
|
b3df81e791 | ||
|
|
eae8470dce | ||
|
|
6456b5dcb1 | ||
|
|
2ebf1a2c67 | ||
|
|
640a2b8991 | ||
|
|
6b4d76fc26 | ||
|
|
49b87724eb | ||
|
|
f7f0499601 | ||
|
|
0e79aa80d9 | ||
|
|
c9b8164b0c | ||
|
|
1436dcfb30 | ||
|
|
1ccd4d56fa | ||
|
|
a4f0176089 | ||
|
|
4a76399583 | ||
|
|
5e2f0428c7 | ||
|
|
8d4d69e218 | ||
|
|
14f8ee1e40 | ||
|
|
0615d655af | ||
|
|
45deb2c218 | ||
|
|
1194b29c12 | ||
|
|
b56551e978 | ||
|
|
32c2ae8278 | ||
|
|
0b92224c36 | ||
|
|
a723a833a8 | ||
|
|
c78a0da045 | ||
|
|
bf122a33e6 | ||
|
|
37ea3d0cee | ||
|
|
3734ccbcc0 | ||
|
|
362b76fd74 | ||
|
|
e968dd85e2 | ||
|
|
d51b32f662 | ||
|
|
4e78375340 | ||
|
|
1bab26dc3d | ||
|
|
f678a06b95 | ||
|
|
ef464d9785 | ||
|
|
682775ba83 | ||
|
|
24c798f550 | ||
|
|
73c853def4 | ||
|
|
38600f4cf3 | ||
|
|
e24ee95558 | ||
|
|
3cfde6cc45 | ||
|
|
1c8d147d7c | ||
|
|
37d12c3859 | ||
|
|
8283092367 | ||
|
|
ed7c3dcff4 | ||
|
|
836fb17d0d | ||
|
|
564eb6a4a0 | ||
|
|
969ed176d6 | ||
|
|
8e2be92c72 | ||
|
|
f9d9dc8adb | ||
|
|
a127d2bf48 | ||
|
|
5fca67974d | ||
|
|
02c35441d6 | ||
|
|
10d652a9f7 | ||
|
|
77069b7299 | ||
|
|
e34fdedfb4 | ||
|
|
dea603dcc1 | ||
|
|
011078f991 | ||
|
|
d0442f4468 | ||
|
|
615c581cd2 | ||
|
|
fd75ae487e | ||
|
|
c2c3ed6a76 | ||
|
|
4ac264b1d0 | ||
|
|
65935696c3 | ||
|
|
4d9fb951df | ||
|
|
836aa69f9c | ||
|
|
253f770259 | ||
|
|
50fbf04df5 | ||
|
|
55d123d95a | ||
|
|
7fee4ad11b | ||
|
|
14308e0b98 | ||
|
|
6b93b77d0d | ||
|
|
70fd455b13 | ||
|
|
839747f420 | ||
|
|
d1a74e1b96 | ||
|
|
89e9bdc413 | ||
|
|
87d0bce799 | ||
|
|
b29fbbb587 | ||
|
|
f983519589 | ||
|
|
4fbf823707 | ||
|
|
26b0bc771d | ||
|
|
0eff23eeed | ||
|
|
97f0357407 | ||
|
|
92272fe01e | ||
|
|
52c73e6382 | ||
|
|
b26a031ca8 | ||
|
|
5309036463 | ||
|
|
ca78e1c2bf | ||
|
|
5340387164 | ||
|
|
912fb252c6 | ||
|
|
1907deb8de | ||
|
|
042783af21 | ||
|
|
7bed40d17b | ||
|
|
ff726d212c | ||
|
|
d6d0bb5e4e | ||
|
|
2fe4cf6ca5 | ||
|
|
ef0eba5c5f | ||
|
|
77d185ba8b | ||
|
|
e47e055508 | ||
|
|
7afbd4632d | ||
|
|
cb576b1b95 | ||
|
|
778571e3d0 | ||
|
|
9144583fdb | ||
|
|
e394b439a8 | ||
|
|
b12d1d7d8a | ||
|
|
c41e2218f7 | ||
|
|
f7dba5d331 | ||
|
|
4dcd7a0247 | ||
|
|
956d08e9bc | ||
|
|
9fe72bfa7b | ||
|
|
b6eb048a12 | ||
|
|
875ff0e28c | ||
|
|
2b415292c6 | ||
|
|
0f55f8f12b | ||
|
|
41d3dfc591 | ||
|
|
a02245ade2 | ||
|
|
f0bfdbf209 | ||
|
|
2d769d4bfb | ||
|
|
64dc3dde40 | ||
|
|
385dfdd33d | ||
|
|
777b0a33c3 | ||
|
|
f8f29fbccf | ||
|
|
fb6a2ef746 | ||
|
|
7969221919 | ||
|
|
918b0619d0 | ||
|
|
0da68dacf5 | ||
|
|
4cf27651ba | ||
|
|
7e9e330e99 | ||
|
|
7175c3ec22 | ||
|
|
221df13250 | ||
|
|
7b4c4efd11 | ||
|
|
d18ae6dac6 | ||
|
|
b6e6b78843 | ||
|
|
eed65a64b2 | ||
|
|
453781af9c |
No files matched your search
+1
-1
@@ -1,6 +1,6 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||
github: [twinaphex]
|
||||
patreon: libretro
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
|
||||
+40
-3
@@ -1,3 +1,9 @@
|
||||
# This setting is to prevent travis to launch duplicate builds on PRs
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- /^v.*$/
|
||||
|
||||
# Use 'generic' to be able to override CC/CXX for clang
|
||||
language: generic
|
||||
|
||||
@@ -26,6 +32,8 @@ matrix:
|
||||
env: CXX_BUILD=1 CROSS_COMPILE=x86_64-w64-mingw32- CFLAGS="-D_WIN32_WINNT=0x0501"
|
||||
- compiler: gcc
|
||||
env: CC=gcc-8 CXX=g++-8
|
||||
- compiler: gcc
|
||||
env: CC="gcc-8 --sysroot=/" CXX="g++-8 --sysroot=/"
|
||||
- compiler: gcc
|
||||
env: C89_BUILD=1 CC=gcc-8 CXX=g++-8
|
||||
- compiler: gcc
|
||||
@@ -36,6 +44,10 @@ matrix:
|
||||
env: DISABLE_OVERLAY=1 CC=gcc-8 CXX=g++-8
|
||||
- compiler: gcc
|
||||
env: DISABLE_CDROM=1 CC=gcc-8 CXX=g++-8
|
||||
- compiler: gcc
|
||||
env: DISABLE_VIDEO_LAYOUT=1 CC=gcc-8 CXX=g++-8
|
||||
- compiler: gcc
|
||||
env: DISABLE_AUDIOMIXER=1 CC=gcc-8 CXX=g++-8
|
||||
- compiler: gcc
|
||||
env: ENABLE_GLES=1 CC=gcc-8 CXX=g++-8
|
||||
- compiler: gcc
|
||||
@@ -48,14 +60,28 @@ matrix:
|
||||
env: CXX_BUILD=1 CC=clang-6.0 CXX=clang++-6.0
|
||||
- os: osx
|
||||
env: CC=clang CXX=clang++
|
||||
- name: OSX OpenGL Make
|
||||
os: osx
|
||||
osx_image: xcode11.2
|
||||
script:
|
||||
- ./configure --enable-opengl --disable-metal
|
||||
- make
|
||||
- os: osx
|
||||
osx_image: xcode8
|
||||
script:
|
||||
- xcodebuild -target RetroArch -configuration Release -project pkg/apple/RetroArch.xcodeproj
|
||||
- os: osx
|
||||
osx_image: xcode10.1
|
||||
osx_image: xcode11.2
|
||||
script:
|
||||
- brew update-reset
|
||||
- brew install --force-bottle qt5
|
||||
- security create-keychain -p travis build.keychain
|
||||
- security default-keychain -s build.keychain
|
||||
- security unlock-keychain -p travis build.keychain
|
||||
- echo $OSX_CERT | base64 --decode > dev.p12
|
||||
- security import dev.p12 -k build.keychain -P $OSX_CERT_PASS -T /usr/bin/codesign
|
||||
- rm dev.p12
|
||||
- security set-key-partition-list -S "apple-tool:,apple:,codesign:" -s -k travis build.keychain
|
||||
- xcodebuild -target RetroArchQt -configuration Release -project pkg/apple/RetroArch_Metal.xcodeproj
|
||||
deploy:
|
||||
skip_cleanup: true
|
||||
@@ -81,7 +107,7 @@ matrix:
|
||||
|
||||
before_install:
|
||||
- |
|
||||
if [ "$CC" = gcc-8 ]; then
|
||||
if [[ "$CC" =~ ^gcc-8.* ]]; then
|
||||
# Install a more recent gcc than the default
|
||||
sudo apt-get install -y g++-8
|
||||
elif [ "$CC" = clang-6.0 ]; then
|
||||
@@ -93,7 +119,7 @@ before_install:
|
||||
sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
|
||||
fi
|
||||
|
||||
script:
|
||||
before_script:
|
||||
- |
|
||||
if [ -n "$CROSS_COMPILE" ]; then
|
||||
ARGS="$ARGS --disable-d3d8 --disable-d3d9 --disable-d3d10 --disable-d3d11 --disable-d3d12"
|
||||
@@ -110,6 +136,14 @@ script:
|
||||
if [ -n "$DISABLE_CDROM" ]; then
|
||||
ARGS="$ARGS --disable-cdrom"
|
||||
fi
|
||||
- |
|
||||
if [ -n "$DISABLE_VIDEO_LAYOUT" ]; then
|
||||
ARGS="$ARGS --disable-video_layout"
|
||||
fi
|
||||
- |
|
||||
if [ -n "$DISABLE_AUDIOMIXER" ]; then
|
||||
ARGS="$ARGS --disable-audiomixer"
|
||||
fi
|
||||
- |
|
||||
if [ -n "$ENABLE_GLES" ]; then
|
||||
ARGS="$ARGS --enable-opengles"
|
||||
@@ -118,6 +152,9 @@ script:
|
||||
if [ -n "$ENABLE_GLES3" ]; then
|
||||
ARGS="$ARGS --enable-opengles3"
|
||||
fi
|
||||
- echo "Configure arguments = $ARGS"
|
||||
|
||||
script:
|
||||
- ./configure $ARGS
|
||||
- |
|
||||
if [ -n "$C89_BUILD" ]; then
|
||||
|
||||
Vendored
+26
-1
@@ -40,6 +40,31 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
"name": "PSP-GDB Debugger",
|
||||
"type": "cppdbg",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/retroarchpsp.elf",
|
||||
"stopAtEntry": false,
|
||||
"cwd": "${workspaceFolder}",
|
||||
"environment": [],
|
||||
"setupCommands": [
|
||||
{
|
||||
"text": "symbol-file ${workspaceFolder}/retroarchpsp.elf",
|
||||
"description": "read symbols for elf file",
|
||||
"ignoreFailures": true
|
||||
},
|
||||
{
|
||||
"description": "Enable all-exceptions",
|
||||
"text": "-exec \"catch throw\"",
|
||||
"ignoreFailures": true
|
||||
}
|
||||
],
|
||||
"showDisplayString": true,
|
||||
"targetArchitecture": "mips",
|
||||
"MIMode": "gdb",
|
||||
"miDebuggerPath": "/usr/local/pspdev/bin/psp-gdb",
|
||||
"miDebuggerServerAddress": "127.0.0.1:10001",
|
||||
}
|
||||
]
|
||||
}
|
||||
+231
-2
@@ -1,4 +1,233 @@
|
||||
# Future (1.8.0)
|
||||
# Future
|
||||
|
||||
# 1.8.4
|
||||
- ANDROID/BUGFIX: Prevent crash when Android device is minimized and you go back to the app
|
||||
- CAMERA/BUGFIX: Fix crash when a core requires the camera driver and the platform only has a null driver. This would crash mgba on Wii for example
|
||||
- DISK CONTROL: Cycle Disk Tray now becomes Eject Disk or Insert Disk depending upon current drive state
|
||||
- DISK CONTROL: Current Disk Index is only shown when the current disk has been ejected
|
||||
- DISK CONTROL: The old Insert Disk entry has been changed to Load New Disk, and is only shown when a disk is currently inserted (this is because loading a new disk from the filesystem - i.e. bypassing the m3u playlist disk index interface - automatically ejects and inserts disks, and so cannot be done while the virtual drive is empty)
|
||||
- DISK CONTROL: The Current Disk Index may now be set more easily via a drop-down list.
|
||||
- DISK CONTROL: Selecting Eject Disk automatically moves the menu selection to the Current Disk Index entry
|
||||
- DISK CONTROL: Selecting an index via the Current Disk Index drop-down list automatically moves the menu selection back to Insert Disk
|
||||
- DISK CONTROL: The Disk Control entry sublabels have been changed for greater clarity
|
||||
- DISK CONTROL: All of the horrendous notification spam has been removed. Notifications are now only shown in the event of an error, or when the menu itself does not provide sufficient visual feedback (note that using hotkeys to swap disks still produces the old style notifications, since this is typically only done while content is running - i.e. no menu). The duration of disk-related info notifications has also been reduced to a more sane level.
|
||||
- DISK CONTROL: A new Resume content after changing disks option has been added under Settings > User Interface. When enabled (default setting), content is resumed automatically after selecting either Insert Disk or Load New Disk (when disabled, the menu remains open, obviously...)
|
||||
- DISK CONTROL/BUGFIX: The Disk Control menu now has the correct title
|
||||
- DISK CONTROL/BUGFIX: Selecting a disk via the Load New Disk file browser no longer flushes the user back to the top level menu (it now correctly returns to the Disk Control menu)
|
||||
- LIBNX/SWITCH: Updated libnx integration to v3.0.0. This also cherry-picks libnx commit 583d6bb92dcbb33b6bb4a0fa1a9df6e3725d6ef6, which should fix the requirement having to turn rumble off and on in the system settings once per reboot
|
||||
|
||||
# 1.8.3
|
||||
- ANDROID/BUGFIX: Fix 'Install or Restore Core' regression
|
||||
- BUGFIX: Ensure core info is always initialised when calling 'drivers_init()'. This bug could prevent cores from doing content runtime logging
|
||||
- BUGFIX/MENU: History size can only be set to 1 at a minimum
|
||||
- BUGFIX/MENU: (XMB/OZONE) Fix 'quick menu' detection. XMB would not display savestate thumbnails in the quick menu if it was accessed via the main menu
|
||||
- BUGFIX/CRASH/CORE UPDATER: Fix potential double free error
|
||||
- BUGFIX/CRASH/OPENGL/WINDOWS: Fix regression in 1.8.2 that would cause GL-based cores to fail because it would try to erroneously load libGLESv2.dll instead of OpenGL32.dll (cores affected: VitaQuake 2/3/Dhewm3, possibly more)
|
||||
- BUGFIX/MENU/DESKTOP UI: Show desktop menu on startup does not launch Qt UI on Linux
|
||||
- BUGFIX: Entries in the Playlist Thumbnails Updater list were displaying improper sublabels. I have no idea when this broke... The issue is now fixed
|
||||
- CHEEVOS: Don't disable achievement when AddAddress generates an out-of-range address
|
||||
- CHEEVOS: Don't reset triggers/leaderboards that failed to load
|
||||
- CHEEVOS: Don't count unsupported achievements as unlocked
|
||||
- CORE UPDATER: Display number of cores updated when updating installed cores
|
||||
- DINGUX: Initial port
|
||||
- D3D11: Block FL9_3 devices from D3D11 driver because they don't work anyway (current D3D11 driver uses SM4.0 which requires FL10_0 and up)
|
||||
- D3D11: Fallback to GL driver when D3D11 fails
|
||||
- EMSCRIPTEN: Fix assets
|
||||
- HISTORY/FAVORITES: Bump up default to 200 entries from 100
|
||||
- FFMPEG CORE: Implement packet buffer, fixes MP4 video playback for many files
|
||||
- LOCALIZATION: Update Italian translation
|
||||
- LOCALIZATION: Update Polish translation
|
||||
- LOCALIZATION: Update Russian translation
|
||||
- LOCALIZATION: Update Spanish translation
|
||||
- MENU: Added 'Hosting' menu under Netplay menu
|
||||
- MENU: Added 'Subsystems' menu
|
||||
- MENU/FILEBROWSER: Fix file selection issues when starting from (or navigating to) the top level directory
|
||||
- MENU/WIDGETS: Prevent looping of task title text
|
||||
- RASPBERRY PI: Fix BGRA8888 color inversion issues in the menu and elsewhere with VideoCore GL drivers
|
||||
- NETPLAY/RELAY: Add Sao Paulo (Brazil) relay server
|
||||
- NETPLAY/RELAY: Fix the “spectator” bug when using the relay server – When a player switches into the spectator mode (pressing “i”) while using the relay server, all players will disconnect.
|
||||
- NETPLAY/RELAY: Overall stability has improved. Fixed a memory leak that would cause the relay server to become unresponsive after some time.
|
||||
- NETPLAY/RELAY: Fixed critical bug that would cause all players to be disconnected from the relay server if one player was leaving the game. That bug had been open for one year and we were finally able to fix it.
|
||||
- SWITCH/LIBNX/BUGFIX: Fix onscreen keyboard input regression
|
||||
- THUMBNAIL UPDATER: When waiting for individual thumbnail file http transfers to complete, the task status checking is more accurate. This uses the same method as the new core updater - we now wait until the task is 'really' complete, instead of relying on the (slightly nebulous) 'task finished' state
|
||||
- UWP: Add ANGLE support
|
||||
- UWP: Wire up get_metrics to the fake context of D3D9/10/11/12 driver, enabling proper scaling and mouse/touch gestures
|
||||
- VITA: Re-add Online Updater
|
||||
- VULKAN: Fix font driver 'vulkan_get_message_width()' function
|
||||
- VIDEO FILTERS: Only use threads when the number exceeds 1. Fixes race conditions with some CPU filters on Vita
|
||||
- WINDOWS: Add ANGLE support for x64, separate binary (for now?)
|
||||
|
||||
# 1.8.2
|
||||
- BUG/CRASH/GLSLANG: Fix glslang crashing error - managed to reproduce an issue which has been plaguing
|
||||
users for a while, where glslang throws an assert after closing a game (and starting a new one). This would affect all video drivers that use Slang for shaders, such as D3D10/11/12/Vulkan/Metal
|
||||
- CHEEVOS: Display Unofficial and Unsupported achievement states
|
||||
- CHEEVOS: Pass RetroArch and core versions through User-Agent HTTP header
|
||||
- CHEEVOS: Use PSX.EXE if SYSTEM.CNF cannot be found
|
||||
- CHEEVOS: Prevent loading state while achievements are still being fetched from server
|
||||
- CHEEVOS: Pause hardcore if core doesn't support achievements
|
||||
- CHEEVOS/CRASH: Fix AddressSanitizer + CHD cause hard crash when Cheevos are enabled
|
||||
- CORE UPDATER: Only download when new core is available
|
||||
- CORE UPDATER: Add option to update all installed cores
|
||||
- DRM/KMS: Better detection for the current video mode
|
||||
- DYNAMIC RATE CONTROL: Support DRC even when using a vsync swap interval higher than 1
|
||||
- EMSCRIPTEN: Fix bug in Emscripten input code
|
||||
- EMSCRIPTEN: Changes to support upgraded emscripten SDK
|
||||
- FFMPEG CORE: Hardware accelerated video decoding
|
||||
- FFMPEG CORE: Implement send/receive encoding API, will allow for hardware accelerated AMD video encoding
|
||||
- FFMPEG CORE: The video FIFO can be removed, since we have a ring buffer in its place. This removes unneeded copy operations and as a positive side improves overall decoding speed. Makes 8k60p SW and 4k60p HW decoding feasible on many systems. For now the ring buffer is 32 images deep. This limitation will be removed, once audio and video decoder have their own packet handling.
|
||||
- INPUT: Fix 'Analog stick controls menu even if autoconfig disabled'
|
||||
- INPUT/TURBO: Added alternate Turbo-Mode 'Single Button' - For systems supporting only a single button, the turbo-button will toggle firing that button without the need to hold it. When holding the button turbo will be suspended and resumed when the button is released. Holding the button may have a different function to just tapping it.
|
||||
- IOS: Forcibly disable Threaded Video until UIWindow concurrency issues are fixed
|
||||
- INPUT/ANALOG: Fix radial analog deadzone scaling
|
||||
- INPUT/ANALOG: Implement proper analog button deadzone
|
||||
- INPUT/MENU: Analog stick controls menu even if autoconfig disabled
|
||||
- LOCALIZATION: Update Italian translation
|
||||
- LOCALIZATION: Update French translation
|
||||
- LOCALIZATION: Update Polish translation
|
||||
- LOCALIZATION: Update Portuguese Brazilian Translation
|
||||
- LOCALIZATION: Update Turkish translation
|
||||
- LINUX/LOCALIZATION: Correct Droid Sans Fallback font path in Linux. This should fix Chinese/Korean font display issues on Fedora/RHEL/CentOS/openSUSE/SLE
|
||||
- MENU/BUGFIX: When using a keyboard/gamepad/mouse wheel to navigate, the menu scroll position is always maintained and updated in a consistent (and expected) fashion
|
||||
- MENU/BUGFIX: When resizing the window, or changing the orientation of a mobile device, the current scroll position is correctly preserved
|
||||
- MENU/BUGFIX: All 'normal' pointer input is now inhibited when showing message boxes
|
||||
- MENU/BUGFIX: The pointer actions 'select' and 'cancel' both now properly close a message box if it is currently being shown
|
||||
- MENU/BUGFIX: Pointer 'select' and 'cancel' actions are now inhibited when an input bind dialog is active
|
||||
- MENU/INPUT: Change 'User' terminology to 'Port' for input binding
|
||||
- MENU/LINUX: Add proper drives to Load Content
|
||||
- MENU/MATERIALUI: Halt scrolling when pointer is pressed/stationary
|
||||
- MENU/MATERIALUI: Dual thumbnail view
|
||||
- MENU/MATERIALUI: Fullscreen thumbnail viewer for boxart
|
||||
- MENU/MATERIALUI: Scroll rapidly by press and holding the scrollbar
|
||||
- MENU/RGUI: New theme 'Flux'
|
||||
- MENU/OZONE: Thumbnails now have a fade-in animation
|
||||
- MENU/OZONE: Fullscreen thumbnail viewer for boxart and pictures
|
||||
- MENU/QT/WIMP: Fix dock titles getting cut off
|
||||
- MENU/XMB: Fullscreen thumbnail viewer for boxart and pictures
|
||||
- MENU/USABILITY: Selectively hide 'Disallow Non-Slave Mode Clients' if 'Allow Slave-Mode Clients' is disabled
|
||||
- MENU/USABILITY: Hide 'Show desktop menu on startup' if 'Desktop menu' setting itself is disabled
|
||||
- MENU/USABILITY: Reimplement Quick Menu - > Shaders -> Watch shader files for changes - can now be turned on/off through touch
|
||||
- MENU/USABILITY: Refactor Quick Menu - Controls - each port now has its own submenu
|
||||
- MENU/USABILITY: Quick Menu - Cheats - Delete All no longer requires five right button presses - this should fix this functionality for mobile touch users too
|
||||
- MENU/USABILITY: Hide Refresh Rate options when Threaded Video is enabled - these settings do nothing with Threaded Video
|
||||
- MENU/USABILITY: Hide Logging Verbosity levels behind Logging Verbosity
|
||||
- MENU/USABILITY: Get rid of 'Port Number' label for Port Binds screen
|
||||
- MENU/USABILITY/MOBILE: Should no longer crash when clicking on a cheat entry
|
||||
- MENU/USABILITY: Shader parameters now have a dropdown list
|
||||
- MENU/USABILITY: Shader passes now has a dropdown list
|
||||
- MENU/USABILITY: Video - Hide Windowed Mode settings selectively
|
||||
- MENU/USABILITY: Video - Hide Fullscreen Mode settings if windowed mode is not supported by context driver
|
||||
- MENU/USABILITY: Selectively hide Network Command Port
|
||||
- MENU/USABILITY: Selectively hide Relay Server Location
|
||||
- MENU/USABILITY: User Interface -> Appearance - Selectively hide XMB Horizontal Animation setting
|
||||
- MENU/USABILITY: Playlists - more selective hiding
|
||||
- MENU/USABILITY: Selectively hide Rewind Settings
|
||||
- MENU/USABILITY: Selectively hide Overlay Settings
|
||||
- MENU/USABILITY: Selectively hide FPS Update Interval based on Display Framerate being enabled
|
||||
- MENU/USABILITY: Selectively hide Onscreen Notifications BG Color Settings
|
||||
- MENU/USABILITY: Settings -> Logging - Hide 'Log To File Timestamp' if 'Log To File' is disabled
|
||||
- MENU/USABILITY: Video -> Scaling - Hide Custom Viewport X/Y when Integer Scale is enabled as description indicates
|
||||
- MENU/USABILITY: Achievement submenu - selectively hide
|
||||
- MENU/USABILITY: Settings -> Video -> Aspect ratio - selectively hide/show values based on whether you have Custom or Config selected
|
||||
- MENU/USABILITY: Settings -> Video -> Selectively hide Hard Sync
|
||||
- MENU/USABILITY: Settings -> Video -> Implement selective hiding for VSync and Hard Sync
|
||||
- MENU/USABILITY: Selective hiding of Runahead settings based on global setting
|
||||
- MENU/USABILITY: Add Input -> Haptic Feedback submenu
|
||||
- MENU/USABILITY: Add Input -> Menu Controls submenu
|
||||
- MENU/USABILITY: Settings -> Video -> Max Swapchain Images - Add OK action
|
||||
- MENU/USABILITY: Input - Implement OK action for Bind Hold, Turbo Period and Duty Cycle
|
||||
- MENU/USABILITY: Input - Hotkey Binds refactor
|
||||
- MENU/USABILITY: Move 'Press Quit Twice' and 'Menu Toggle Gamepad Combo' to Input -> Hotkey Binds
|
||||
- MENU/USABILITY: Video - Add sublabel for Video Output submenu
|
||||
- MENU/USABILITY: If 'Favorites Tab' is disabled, don't show 'Add To Favorites' option in Quick Menu/Playlist menu
|
||||
- MENU/USABILITY: If On-Demand Thumbnail Downloader is enabled, hide 'Download Thumbnails' from playlist menu screen
|
||||
- MENU/USABILITY: Add Audio Driver setting to Audio -> Output
|
||||
- MENU/USABILITY: Add Audio -> Resampler settings
|
||||
- MENU/USABILITY: Add Audio -> Output and Audio -> Synchronization
|
||||
- OPENGL: Shaders are now working properly (only in OpenGL) when rotating both from Core API rotation and from menu video rotation. The fix is clearly visible with crt-royale for example
|
||||
- OPENGL: 1:1 PAR is now correct when rotating (both from Core API rotation and from menu video rotation, as you said, in the latter case you currently have to change Aspect Ratio after menu video rotation for it to work)
|
||||
- OPENGL: When using Custom Aspect Ratio and rotation (both from Core API rotation and from menu video rotation), Integer Scaling is now working properly (correct multiples of internal resolution). Even when Integer Scaling is not activated, the Custom AR width / height are now correctly labeled using (1x), (2x), ... suffixes. You also have to activate Integer Scaling after menu video rotation for it to work
|
||||
- OPENGL: For all other Aspect Ratio options, Integer Scaling and rotation (both from Core API rotation and from menu video rotation) are now working properly together (correct multiples of internal resolution). You also have to activate Integer Scaling after menu video rotation for it to work
|
||||
- OPENBSD/POWERPC: Should build now on OpenBSD PowerPC
|
||||
- PLAYLISTS: Pressing 'Start' or long touching a playlist will bring you to a Playlist submenu where you can set a default core, setup thumbnail view, delete the playlist, etc
|
||||
- OSX: Forcibly disable Threaded Video until NSWindow concurrency issues are fixed
|
||||
- PSP: Solving issue exiting RetroArch by HOME button
|
||||
- SCANNER: Manual scanner, not dependent on database files
|
||||
- SCANNER/MANUAL: Add option to scan inside archives
|
||||
- SCANNER/MANUAL: Enable automatic naming of arcade content via DAT files. This is compatible with DAT files in either Logiqx XML or MAME List XML format.
|
||||
- VIDEO: Do not reinit video driver on SET_SYSTEM_AV_INFO unless needed
|
||||
- VIDEO: Support DRC even when using a vsync swap interval higher than 1
|
||||
- VIDEO LAYOUT: Fixed XML parsing of attributes with spaces, should fix issues with several video layouts
|
||||
- VITA: GL1 driver support
|
||||
- VITA/VITA2D: Several improvements to Vita 2D driver - menu widgets implemented
|
||||
- VITA/VITA2D: Fix clipping and reduce number of calls
|
||||
- VULKAN/ANDROID: Workaround weird WSI return codes in landscape mode - Android WSI wants you to use preTransform, and if it is not used correctly, Android 10 will return VK_SUBOPTIMAL_KHR, and we would create a new swapchain every frame. This workaround just ignores this error, since it's not really an error. A more "proper" fix is to use prerotate and modify the MVP matrices,
|
||||
which might help certain devices with crummy display processors
|
||||
- VULKAN/ANDROID: Recreate swapchain on orientation change. ANativeWindow getWidth/Height does not detect any changes when using
|
||||
Vulkan, so use the old onContentRectChanged callback to get notified when size changed. Use those values instead when figuring out how large swapchain to create
|
||||
- WINDOWS/XINPUT: Get rid of 128 byte device name limit for XInput device discover - when device name was too long, it would not be picked up by the XInput driver and would instead fallback to DirectInput
|
||||
- WINDOWS: ANGLE OpenGL ES 2 support
|
||||
- UWP: Fix crashes on startup / prompt for folder permissions when trying to load custom.ini
|
||||
- UWP: Fix - Mouse input is offset on high DPI monitors
|
||||
- UWP: Fix - Keyboard input hangs sometimes
|
||||
- UWP: Fix - Multi-touch support
|
||||
- UWP: Fix - Enable menu touch input by default
|
||||
- UWP: Fix - Get user language
|
||||
- UWP: Fix - Get CPU model name
|
||||
- UWP: Fix - Use GLUI instead of XMB on Windows Mobile 10
|
||||
- UWP: ANGLE OpenGL ES 2 support
|
||||
|
||||
# (1.8.1)
|
||||
- BUGFIX/MENU: Fix menu rendering with Mali GPUs after changing video dimensions
|
||||
- CDROM: Adds pregap support to cdfs helper methods
|
||||
- CHEEVOS: Provides the new PCEngine hashing algorithm for RetroAchievements
|
||||
- LOCALIZATION: Update French translation
|
||||
- LOCALIZATION: Update Polish translation
|
||||
- LOCALIZATION: Update Spanish translation
|
||||
- MENU/MATERIALUI: Initial thumbnail support
|
||||
- MENU/MATERIALUI: Cutie / Virtual Boy theme added
|
||||
- MENU/MATERIALUI: Bugfix - Under certain extreme circumstances, entries with very long sublabel strings could have their text prematurely 'clipped' as the entry is scrolled beyond the top of the screen
|
||||
- MENU/MATERIALUI: Bugfix - Certain setting value strings were unnecessarily truncated (with a ...) when using smooth ticker text
|
||||
- MENU/XMB: Sunbeam theme added
|
||||
- SWITCH: Accelerometer, gyroscope and illuminance sensor support
|
||||
- VITA: Accelerometer and gyroscope sensor support
|
||||
|
||||
# (1.8.0)
|
||||
- AI SERVICE: Added in fix for BMP returns to AI service. Added in label passing to AI service call
|
||||
- BSV: Fix BSV recording/playback
|
||||
- BUGFIX: Fix crash when setting Thumbnail Directory
|
||||
- BUGFIX/STABILITY: Set "Automatically Add Content to Playlist" to false by default, this was unstable on PS3 and Mac and other platforms potentially as well.
|
||||
- COMMON: Graceful driver switching for Windows and Linux
|
||||
- COMMON: Cache frame before converting 0RGB1555
|
||||
- LAKKA: Wi-Fi Access Point settings
|
||||
- MENU: Menu scaling improvements
|
||||
- MENU/MATERIALUI: There are no longer any animation glitches when 'wraparound' scrolling from the last entry in a list to the first, or when performing horizontal swipe navigation gestures on certain settings-type entries
|
||||
- MENU/MATERIALUI: List entries underneath the title and navigation bars are no longer highlighted when touching the title/navigation bars (this was only a cosmetic issue, but it was annoying...)
|
||||
- MENU/MATERIALUI: The current menu list is no longer reloaded when pressing the currently active tab on the navigation bar
|
||||
- MENU/MATERIALUI: The ticker text spacer has been set to a 'bullet' character (same as Ozone)
|
||||
- MENU/MATERIALUI: The default colour theme has been set to 'Ozone Dark'
|
||||
- MENU/MATERIALUI: Three new colour themes have been added.
|
||||
- MENU/MATERIALUI: A new Menu Transition Animation option has been added under User Interface > Appearance. When this is enabled, menu transition events are animated
|
||||
- MENU/MATERIALUI: The navigation bar is now shown at all times - i.e. it is an actual navigation tool, rather than a 'top-level-menu' curiosity
|
||||
- MENU/MATERIALUI: Two new context-sensitive buttons have been added to the navigation bar - back button and resume button
|
||||
- MENU/MATERIALUI: A new Auto-Rotate Navigation Bar option has been added under User Interface > Appearance. When enabled (this is the default setting), the navigation bar is moved to the right hand side of the screen when using landscape screen orientations.
|
||||
- MENU/MATERIALUI: The playlists tab is now correctly hidden when User Interface > Views > Show Playlist Tabs is disabled
|
||||
- MENU/MATERIALUI: Material UI now correctly readjusts its layout when screen orientation changes on mobile devices
|
||||
- MENU/MATERIALUI: Material UI now resizes in real-time when the user manually sets the Menu Scale Factor (this never worked properly with the old DPI override)
|
||||
- MENU/MATERIALUI: Material UI no longer leaks memory on 'context reset' (fonts were previously never free()'d)
|
||||
- MENU/MATERIALUI: A new Android-style 'system bar' has been added. This shows current core name, clock and battery level
|
||||
- MENU/MATERIALUI: A new search icon is shown on the title bar when viewing playlists and file browser lists. Pressing this launches the search interface
|
||||
- MENU/MATERIALUI: The title bar now uses a larger font, and the sublabel font has also been enlarged a little, to more closely align with Material UI standards
|
||||
- MENU/MATERIALUI: A number (quite a large number) of layout/spacing issues have been fixed
|
||||
- MENU/MATERIALUI: The existing colour theme handling code is not fit for purpose, so the whole lot got ripped out and reimplemented. In doing so, also adjusted all the theme colours to better match Material UI standards - with a few liberties taken for aesthetic purposes.
|
||||
- OSD: Fix fast forward indicator when not using menu widgets
|
||||
- PSP1: Remove duplicated FPS indicator on the screen
|
||||
- SWITCH: Make audren threaded audio driver the new default
|
||||
- VIDEO LAYOUT: Add video layout mame overlay compatibility. Enabled for Windows/Linux/OSX/iOS/Android/libnx. Only works with GL driver for now, no glcore yet
|
||||
|
||||
# (1.7.9) (v2)
|
||||
- 3DS: Fix 3DS screen flickering when OSD is enabled
|
||||
- IOS: Fix crash that could happen at startup
|
||||
- MENU/MATERIALUI: Change DPI scaling back to original - too many issues with current implementation, requires a redesign
|
||||
|
||||
# (1.7.9)
|
||||
- AI SERVICE: Image mode is now much faster, it now saves the image in-memory in PNG format then passes it along to the translation service
|
||||
@@ -31,7 +260,6 @@ operation had run
|
||||
- MOBILE (ANDROID/IOS): Add option to automatically rotate overlays when changing orientation
|
||||
- OSD: Memory details should now be available on every platform (get_mem_total and get_mem_free need to be implemented in the frontend driver for it to work)
|
||||
- OSD: Memory details can now be shown individually without FPS and frame count
|
||||
- OSX/METAL: CoreAudio V3 driver should now be the default audio driver on first startup
|
||||
- PS2: Fix memory leaks in font/video driver
|
||||
- SWITCH: Set default aspect ratio to core provided instead of 4:3
|
||||
- THREADED VIDEO: Fix FPS text in threaded video mode
|
||||
@@ -940,3 +1168,4 @@ Skipped this one
|
||||
|
||||
# 1.4.1
|
||||
|
||||
|
||||
+2
-2
@@ -38,7 +38,7 @@ 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".
|
||||
|
||||
## Non-obvious things:
|
||||
- Code should be both ISO C99 and ISO C++ compatible. This dual requirement is for XBox360 and MSVC in general. Think of it as a C++ compatible subset of C99.
|
||||
- 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.
|
||||
|
||||
@@ -55,4 +55,4 @@ We value discussing things in "real-time".
|
||||
|
||||
# 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.
|
||||
This typically happens when the "overhead" of looking through pull requests over time becomes a burden.
|
||||
@@ -14,7 +14,11 @@ include config.mk
|
||||
# (It'd be better to put this comment in that file, but .gitignore doesn't work on files that exist in the repo.)
|
||||
-include Makefile.local
|
||||
|
||||
ifeq ($(HAVE_ANGLE), 1)
|
||||
TARGET = retroarch_angle
|
||||
else
|
||||
TARGET = retroarch
|
||||
endif
|
||||
|
||||
OBJ :=
|
||||
LIBS :=
|
||||
@@ -102,10 +106,20 @@ ifneq ($(findstring Win32,$(OS)),)
|
||||
LDFLAGS += -mwindows
|
||||
endif
|
||||
|
||||
ifneq ($(CXX_BUILD), 1)
|
||||
ifneq ($(C89_BUILD),)
|
||||
CFLAGS += -std=c89 -ansi -pedantic -Werror=pedantic -Wno-long-long
|
||||
else ifeq ($(HAVE_C99), 1)
|
||||
CFLAGS += $(C99_CFLAGS)
|
||||
endif
|
||||
|
||||
CFLAGS += -D_GNU_SOURCE
|
||||
endif
|
||||
|
||||
DEF_FLAGS += -Wall $(INCLUDE_DIRS) -I. -Ideps -Ideps/stb
|
||||
|
||||
CFLAGS += $(DEF_FLAGS)
|
||||
CXXFLAGS += $(DEF_FLAGS) -std=c++11 -D__STDC_CONSTANT_MACROS
|
||||
CXXFLAGS += $(DEF_FLAGS) -D__STDC_CONSTANT_MACROS
|
||||
OBJCFLAGS := $(CFLAGS) -D__STDC_CONSTANT_MACROS
|
||||
|
||||
ifeq ($(HAVE_CXX), 1)
|
||||
@@ -123,20 +137,6 @@ else
|
||||
LINK = $(CC)
|
||||
endif
|
||||
|
||||
ifneq ($(CXX_BUILD), 1)
|
||||
ifneq ($(GNU90_BUILD), 1)
|
||||
ifneq ($(findstring icc,$(CC)),)
|
||||
CFLAGS += -std=c99 -D_GNU_SOURCE
|
||||
else
|
||||
CFLAGS += -std=gnu99 -D_GNU_SOURCE
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(C89_BUILD),)
|
||||
CFLAGS += -std=c89 -ansi -pedantic -Werror=pedantic -Wno-long-long
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(NOUNUSED), yes)
|
||||
CFLAGS += -Wno-unused-result
|
||||
CXXFLAGS += -Wno-unused-result
|
||||
@@ -203,7 +203,7 @@ endif
|
||||
|
||||
SYMBOL_MAP := -Wl,-Map=output.map
|
||||
|
||||
retroarch: $(RARCH_OBJ)
|
||||
$(TARGET): $(RARCH_OBJ)
|
||||
@$(if $(Q), $(shell echo echo LD $@),)
|
||||
$(Q)$(LINK) -o $@ $(RARCH_OBJ) $(LIBS) $(LDFLAGS) $(LIBRARY_DIRS)
|
||||
|
||||
@@ -280,7 +280,7 @@ install: $(TARGET)
|
||||
fi
|
||||
|
||||
uninstall:
|
||||
rm -f $(DESTDIR)$(BIN_DIR)/retroarch
|
||||
rm -f $(DESTDIR)$(BIN_DIR)/$(TARGET)
|
||||
rm -f $(DESTDIR)$(BIN_DIR)/retroarch-cg2glsl
|
||||
rm -f $(DESTDIR)$(GLOBAL_CONFIG_DIR)/retroarch.cfg
|
||||
rm -f $(DESTDIR)$(DATA_DIR)/applications/retroarch.desktop
|
||||
|
||||
+79
-34
@@ -7,6 +7,10 @@ ifeq ($(HAVE_STACK_USAGE), 1)
|
||||
DEF_FLAGS += -fstack-usage
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_CXX11), 1)
|
||||
CXXFLAGS += $(CXX11_CFLAGS)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_GL_CONTEXT),)
|
||||
HAVE_GL_CONTEXT = 0
|
||||
HAVE_GL_MODERN = 0
|
||||
@@ -153,9 +157,7 @@ ifeq ($(HAVE_DR_MP3), 1)
|
||||
endif
|
||||
|
||||
OBJ += frontend/frontend_driver.o \
|
||||
frontend/drivers/platform_null.o \
|
||||
retroarch.o \
|
||||
paths.o \
|
||||
msg_hash.o \
|
||||
intl/msg_hash_us.o \
|
||||
$(LIBRETRO_COMM_DIR)/queues/task_queue.o \
|
||||
@@ -164,6 +166,7 @@ OBJ += frontend/frontend_driver.o \
|
||||
tasks/task_file_transfer.o \
|
||||
tasks/task_image.o \
|
||||
tasks/task_playlist_manager.o \
|
||||
tasks/task_manual_content_scan.o \
|
||||
$(LIBRETRO_COMM_DIR)/encodings/encoding_utf.o \
|
||||
$(LIBRETRO_COMM_DIR)/encodings/encoding_crc32.o \
|
||||
$(LIBRETRO_COMM_DIR)/encodings/encoding_base64.o \
|
||||
@@ -181,7 +184,6 @@ OBJ += frontend/frontend_driver.o \
|
||||
$(LIBRETRO_COMM_DIR)/lists/string_list.o \
|
||||
$(LIBRETRO_COMM_DIR)/string/stdstring.o \
|
||||
$(LIBRETRO_COMM_DIR)/memmap/memalign.o \
|
||||
list_special.o \
|
||||
$(LIBRETRO_COMM_DIR)/file/nbio/nbio_stdio.o
|
||||
|
||||
ifneq ($(findstring Linux,$(OS)),)
|
||||
@@ -203,13 +205,13 @@ endif
|
||||
OBJ += \
|
||||
$(LIBRETRO_COMM_DIR)/file/nbio/nbio_intf.o \
|
||||
$(LIBRETRO_COMM_DIR)/file/file_path.o \
|
||||
$(LIBRETRO_COMM_DIR)/file/file_path_io.o \
|
||||
file_path_special.o \
|
||||
file_path_str.o \
|
||||
$(LIBRETRO_COMM_DIR)/hash/rhash.o \
|
||||
input/common/input_hid_common.o \
|
||||
input/input_mapper.o \
|
||||
led/led_driver.o \
|
||||
led/drivers/led_null.o \
|
||||
gfx/video_coord_array.o \
|
||||
gfx/video_display_server.o \
|
||||
gfx/video_crt_switch.o \
|
||||
@@ -243,25 +245,13 @@ OBJ += \
|
||||
$(LIBRETRO_COMM_DIR)/audio/dsp_filter.o \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/sinc_resampler.o \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/nearest_resampler.o \
|
||||
$(LIBRETRO_COMM_DIR)/audio/resampler/drivers/null_resampler.o \
|
||||
$(LIBRETRO_COMM_DIR)/utils/md5.o \
|
||||
location/drivers/nulllocation.o \
|
||||
camera/drivers/nullcamera.o \
|
||||
wifi/drivers/nullwifi.o \
|
||||
gfx/drivers/nullgfx.o \
|
||||
gfx/display_servers/dispserv_null.o \
|
||||
audio/drivers/nullaudio.o \
|
||||
input/drivers/nullinput.o \
|
||||
input/drivers_hid/null_hid.o \
|
||||
input/drivers_joypad/null_joypad.o \
|
||||
playlist.o \
|
||||
record/drivers/record_null.o \
|
||||
$(LIBRETRO_COMM_DIR)/features/features_cpu.o \
|
||||
performance_counters.o \
|
||||
verbosity.o \
|
||||
midi/drivers/null_midi.o \
|
||||
$(LIBRETRO_COMM_DIR)/playlists/label_sanitization.o
|
||||
|
||||
$(LIBRETRO_COMM_DIR)/playlists/label_sanitization.o \
|
||||
manual_content_scan.o
|
||||
|
||||
ifeq ($(HAVE_AUDIOMIXER), 1)
|
||||
DEFINES += -DHAVE_AUDIOMIXER
|
||||
@@ -827,9 +817,8 @@ ifeq ($(HAVE_MENU_COMMON), 1)
|
||||
menu/menu_displaylist.o \
|
||||
menu/menu_animation.o \
|
||||
menu/drivers/menu_generic.o \
|
||||
menu/drivers/null.o \
|
||||
menu/menu_thumbnail_path.o \
|
||||
menu/drivers_display/menu_display_null.o
|
||||
menu/menu_thumbnail.o
|
||||
|
||||
ifeq ($(HAVE_MENU_WIDGETS), 1)
|
||||
OBJ += menu/widgets/menu_widgets.o
|
||||
@@ -844,13 +833,14 @@ endif
|
||||
|
||||
ifeq ($(HAVE_VIDEO_LAYOUT), 1)
|
||||
DEFINES += -DHAVE_VIDEO_LAYOUT
|
||||
OBJ += gfx/video_layout.o \
|
||||
gfx/video_layout/view.o \
|
||||
gfx/video_layout/element.o \
|
||||
gfx/video_layout/component.o \
|
||||
gfx/video_layout/internal.o \
|
||||
gfx/video_layout/scope.o \
|
||||
gfx/video_layout/load.o
|
||||
OBJ += \
|
||||
gfx/video_layout.o \
|
||||
gfx/video_layout/view.o \
|
||||
gfx/video_layout/element.o \
|
||||
gfx/video_layout/component.o \
|
||||
gfx/video_layout/internal.o \
|
||||
gfx/video_layout/scope.o \
|
||||
gfx/video_layout/load.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_STB_FONT), 1)
|
||||
@@ -891,6 +881,7 @@ ifeq ($(HAVE_VITA2D), 1)
|
||||
$(DEPS_DIR)/libvita2d/shader/color_f_gxp.o \
|
||||
$(DEPS_DIR)/libvita2d/shader/texture_v_gxp.o \
|
||||
$(DEPS_DIR)/libvita2d/shader/texture_f_gxp.o \
|
||||
$(DEPS_DIR)/libvita2d/shader/texture_tint_v_gxp.o \
|
||||
$(DEPS_DIR)/libvita2d/shader/texture_tint_f_gxp.o
|
||||
|
||||
ifeq ($(HAVE_MENU_COMMON),1)
|
||||
@@ -985,6 +976,12 @@ ifeq ($(HAVE_WAYLAND), 1)
|
||||
|
||||
endif
|
||||
|
||||
# XML
|
||||
OBJ += \
|
||||
$(LIBRETRO_COMM_DIR)/formats/xml/rxml.o \
|
||||
$(LIBRETRO_COMM_DIR)/formats/logiqx_dat/logiqx_dat.o \
|
||||
deps/yxml/yxml.o
|
||||
|
||||
#Input
|
||||
|
||||
ifeq ($(HAVE_DINPUT), 1)
|
||||
@@ -1154,6 +1151,14 @@ ifeq ($(HAVE_PLAIN_DRM), 1)
|
||||
LIBS += -ldrm
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_VITAGL), 1)
|
||||
DEFINES += -DHAVE_OPENGL1
|
||||
OBJ += gfx/drivers/gl1.o \
|
||||
gfx/drivers_font/gl1_raster_font.o \
|
||||
gfx/drivers_context/vita_ctx.o \
|
||||
menu/drivers_display/menu_display_gl1.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_GL_CONTEXT), 1)
|
||||
ifeq ($(HAVE_GL_MODERN), 1)
|
||||
DEFINES += -DHAVE_OPENGL
|
||||
@@ -1268,8 +1273,14 @@ endif
|
||||
ifeq ($(HAVE_EGL), 1)
|
||||
DEFINES += -DHAVE_EGL
|
||||
DEF_FLAGS += $(EGL_CFLAGS)
|
||||
LIBS += $(EGL_LIBS)
|
||||
OBJ += gfx/common/egl_common.o
|
||||
|
||||
ifeq ($(HAVE_DYNAMIC_EGL), 1)
|
||||
DEFINES += -DHAVE_DYNAMIC_EGL
|
||||
else
|
||||
LIBS += $(EGL_LIBS)
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_SDL2), 1)
|
||||
@@ -1283,6 +1294,12 @@ else ifeq ($(HAVE_SDL), 1)
|
||||
OBJ += gfx/drivers/sdl_gfx.o
|
||||
DEF_FLAGS += $(SDL_CFLAGS)
|
||||
LIBS += $(SDL_LIBS)
|
||||
else ifeq ($(HAVE_SDL_DINGUX), 1)
|
||||
HAVE_SDL_COMMON = 1
|
||||
DEF_FLAGS += -DHAVE_SDL -DHAVE_SDL_DINGUX
|
||||
OBJ += gfx/drivers/sdl_dingux_gfx.o
|
||||
DEF_FLAGS += $(SDL_DINGUX_CFLAGS)
|
||||
LIBS += $(SDL_DINGUX_LIBS)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_SDL_COMMON), 1)
|
||||
@@ -1715,12 +1732,11 @@ endif
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/formats/bmp/rbmp_encode.o \
|
||||
$(LIBRETRO_COMM_DIR)/formats/json/jsonsax.o \
|
||||
$(LIBRETRO_COMM_DIR)/formats/json/jsonsax_full.o \
|
||||
$(LIBRETRO_COMM_DIR)/formats/xml/rxml.o \
|
||||
$(LIBRETRO_COMM_DIR)/formats/image_transfer.o
|
||||
|
||||
# Easter Egg
|
||||
ifeq ($(HAVE_EASTEREGG),1)
|
||||
DEFINES += -DHAVE_EASTEREGG
|
||||
# Gong embedded core
|
||||
ifeq ($(HAVE_GONG),1)
|
||||
DEFINES += -DHAVE_GONG
|
||||
OBJ += cores/libretro-gong/gong.o
|
||||
endif
|
||||
|
||||
@@ -1736,6 +1752,11 @@ ifeq ($(HAVE_V4L2),1)
|
||||
LIBS += $(V4L2_LIBS)
|
||||
endif
|
||||
|
||||
# Accessibility
|
||||
ifeq ($(HAVE_ACCESSIBILITY), 1)
|
||||
DEFINES += -DHAVE_ACCESSIBILITY
|
||||
endif
|
||||
|
||||
# Things that depend on network availability
|
||||
|
||||
ifeq ($(HAVE_NETWORKING), 1)
|
||||
@@ -1745,6 +1766,7 @@ ifeq ($(HAVE_NETWORKING), 1)
|
||||
$(LIBRETRO_COMM_DIR)/net/net_http_parse.o \
|
||||
$(LIBRETRO_COMM_DIR)/net/net_socket.o \
|
||||
$(LIBRETRO_COMM_DIR)/net/net_natt.o \
|
||||
core_updater_list.o \
|
||||
network/net_http_special.o \
|
||||
tasks/task_http.o \
|
||||
tasks/task_netplay_lan_scan.o \
|
||||
@@ -1754,7 +1776,8 @@ ifeq ($(HAVE_NETWORKING), 1)
|
||||
|
||||
ifeq ($(HAVE_MENU_COMMON), 1)
|
||||
OBJ += tasks/task_pl_thumbnail_download.o \
|
||||
menu/menu_networking.o
|
||||
tasks/task_core_updater.o \
|
||||
menu/menu_networking.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_SSL), 1)
|
||||
@@ -1939,11 +1962,19 @@ ifneq ($(findstring Win32,$(OS)),)
|
||||
LIBS += -lhid -lsetupapi
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_ANGLE), 1)
|
||||
OBJ += gfx/common/angle_common.o
|
||||
DEFINES += -DHAVE_ANGLE
|
||||
endif
|
||||
|
||||
# Record
|
||||
|
||||
ifeq ($(HAVE_FFMPEG), 1)
|
||||
OBJ += record/drivers/record_ffmpeg.o \
|
||||
cores/libretro-ffmpeg/ffmpeg_core.o
|
||||
cores/libretro-ffmpeg/ffmpeg_core.o \
|
||||
cores/libretro-ffmpeg/packet_buffer.o \
|
||||
cores/libretro-ffmpeg/video_buffer.o \
|
||||
$(LIBRETRO_COMM_DIR)/rthreads/tpool.o
|
||||
|
||||
LIBS += $(AVCODEC_LIBS) $(AVFORMAT_LIBS) $(AVUTIL_LIBS) $(SWSCALE_LIBS) $(SWRESAMPLE_LIBS) $(FFMPEG_LIBS)
|
||||
DEFINES += -DHAVE_FFMPEG
|
||||
@@ -2035,6 +2066,20 @@ ifeq ($(HAVE_RPILED), 1)
|
||||
OBJ += led/drivers/led_rpi.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_VITAGL), 1)
|
||||
DEFINES += -DHAVE_VITAGL -DTRANSPOSE_MATRICES
|
||||
INCLUDE_DIRS += -I$(DEPS_DIR)/vitaGL/source
|
||||
SOURCES := $(DEPS_DIR)/vitaGL/source $(DEPS_DIR)/vitaGL/source/utils
|
||||
OBJ += $(patsubst %.c,%.o,$(foreach dir,$(SOURCES), $(wildcard $(dir)/*.c)))
|
||||
endif
|
||||
|
||||
##################################
|
||||
### Classic Platform specifics ###
|
||||
###############WIP################
|
||||
|
||||
@@ -24,11 +24,11 @@ OBJ := ctr/ctr_system.o \
|
||||
frontend/frontend_salamander.o \
|
||||
frontend/frontend_driver.o \
|
||||
frontend/drivers/platform_ctr.o \
|
||||
frontend/drivers/platform_null.o \
|
||||
libretro-common/encodings/encoding_utf.o \
|
||||
libretro-common/compat/compat_strcasestr.o \
|
||||
libretro-common/compat/fopen_utf8.o \
|
||||
libretro-common/file/file_path.o \
|
||||
libretro-common/file/file_path_io.o \
|
||||
libretro-common/string/stdstring.o \
|
||||
libretro-common/lists/string_list.o \
|
||||
libretro-common/lists/dir_list.o \
|
||||
|
||||
+188
@@ -0,0 +1,188 @@
|
||||
CC = /opt/gcw0-toolchain/usr/bin/mipsel-gcw0-linux-uclibc-gcc
|
||||
CXX = /opt/gcw0-toolchain/usr/bin/mipsel-gcw0-linux-uclibc-g++
|
||||
PACKAGE_NAME = retroarch
|
||||
|
||||
DEBUG ?= 0
|
||||
|
||||
HAVE_7ZIP = 1
|
||||
HAVE_AL = 1
|
||||
# this freezes when switching back from menu
|
||||
HAVE_ALSA = 0
|
||||
HAVE_BUILTINMBEDTLS = 1
|
||||
HAVE_BUILTINZLIB = 1
|
||||
HAVE_C99 = 1
|
||||
HAVE_CC = 1
|
||||
HAVE_CC_RESAMPLER = 1
|
||||
HAVE_CHD = 1
|
||||
HAVE_CHEEVOS = 1
|
||||
HAVE_COMMAND = 1
|
||||
HAVE_CXX = 1
|
||||
HAVE_DR_MP3 = 1
|
||||
HAVE_DYNAMIC = 1
|
||||
HAVE_EGL = 1
|
||||
HAVE_FREETYPE = 1
|
||||
HAVE_GDI = 1
|
||||
HAVE_GETADDRINFO = 1
|
||||
HAVE_GETOPT_LONG = 1
|
||||
HAVE_GLSL = 1
|
||||
HAVE_HID = 1
|
||||
HAVE_IBXM = 1
|
||||
HAVE_IMAGEVIEWER = 1
|
||||
HAVE_LANGEXTRA = 1
|
||||
HAVE_LIBRETRODB = 1
|
||||
HAVE_MENU = 1
|
||||
HAVE_MENU_COMMON = 1
|
||||
HAVE_MENU_WIDGETS = 1
|
||||
HAVE_MMAP = 1
|
||||
HAVE_NETWORKING = 1
|
||||
HAVE_OPENDINGUX_FBDEV = 1
|
||||
HAVE_OPENGL = 1
|
||||
HAVE_OPENGL1 = 0
|
||||
HAVE_OPENGLES = 1
|
||||
HAVE_OPENGLES3 = 0
|
||||
HAVE_OPENGL_CORE = 0
|
||||
HAVE_OPENSSL = 1
|
||||
HAVE_OVERLAY = 1
|
||||
HAVE_RBMP = 1
|
||||
HAVE_RJPEG = 1
|
||||
HAVE_RPILED = 1
|
||||
HAVE_RPNG = 1
|
||||
HAVE_RUNAHEAD = 1
|
||||
HAVE_SDL_DINGUX = 1
|
||||
HAVE_SHADERPIPELINE = 1
|
||||
HAVE_STB_FONT = 1
|
||||
HAVE_STB_IMAGE = 1
|
||||
HAVE_STB_VORBIS = 1
|
||||
HAVE_STDIN_CMD = 1
|
||||
HAVE_STRCASESTR = 1
|
||||
HAVE_THREADS = 1
|
||||
HAVE_TRANSLATE = 1
|
||||
HAVE_UDEV = 1
|
||||
HAVE_VIDEO_LAYOUT = 1
|
||||
HAVE_XMB = 1
|
||||
HAVE_ZLIB = 1
|
||||
|
||||
OS = Linux
|
||||
TARGET = retroarch
|
||||
OPK_NAME = retroarch.opk
|
||||
|
||||
OBJ :=
|
||||
LINK := $(CXX)
|
||||
DEF_FLAGS := -march=mips32 -mtune=mips32r2 -mhard-float -ffast-math -fomit-frame-pointer -fdata-sections
|
||||
DEF_FLAGS += -I. -Ideps -Ideps/stb -DDINGUX=1 -MMD
|
||||
DEF_FLAGS += -Wall -Wno-unused-variable
|
||||
DEF_FLAGS += -std=gnu99 -D_GNU_SOURCE
|
||||
LIBS := -ldl -lz -lrt -lcrypto -lssl -ludev -pthread
|
||||
CFLAGS :=
|
||||
CXXFLAGS := -fno-exceptions -fno-rtti -std=c++11 -D__STDC_CONSTANT_MACROS
|
||||
ASFLAGS :=
|
||||
LDFLAGS := -flto
|
||||
INCLUDE_DIRS = -I/opt/gcw0-toolchain/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/include
|
||||
LIBRARY_DIRS = -L/opt/gcw0-toolchain/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/lib
|
||||
DEFINES := -DRARCH_INTERNAL -D_FILE_OFFSET_BITS=64 -UHAVE_STATIC_DUMMY
|
||||
DEFINES += -DHAVE_C99=1 -DHAVE_CXX=1 -DHAVE_OPENDINGUX_FBDEV=1
|
||||
DEFINES += -DHAVE_GETOPT_LONG=1 -DHAVE_STRCASESTR=1 -DHAVE_DYNAMIC=1
|
||||
DEFINES += -DHAVE_AL=1
|
||||
DEFINES += -DHAVE_ONLINE_UPDATER=1
|
||||
DEFINES += -DHAVE_UPDATE_ASSETS=1
|
||||
DEFINES += -DHAVE_UDEV=1
|
||||
|
||||
SDL_DINGUX_CFLAGS := $(shell /opt/gcw0-toolchain/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/bin/sdl-config --cflags)
|
||||
SDL_DINGUX_LIBS := $(shell /opt/gcw0-toolchain/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/bin/sdl-config --libs)
|
||||
FREETYPE_CFLAGS := $(shell /opt/gcw0-toolchain/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/bin/freetype-config --cflags)
|
||||
FREETYPE_LIBS := $(shell /opt/gcw0-toolchain/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/bin/freetype-config --libs)
|
||||
AL_LIBS := -lopenal
|
||||
OPENGLES_CFLAGS := -DMESA_EGL_NO_X11_HEADERS
|
||||
OPENGLES_LIBS := -lGLESv2 -lEGL
|
||||
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)
|
||||
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=Retroarch
|
||||
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 $@),)
|
||||
$(LINK) -o $@ $(RARCH_OBJ) $(LIBS) $(LDFLAGS) $(LIBRARY_DIRS)
|
||||
|
||||
$(OBJDIR)/%.o: %.c
|
||||
@mkdir -p $(dir $@)
|
||||
@$(if $(Q), $(shell echo echo CC $<),)
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(DEFINES) -c -o $@ $<
|
||||
|
||||
$(OBJDIR)/%.o: %.cpp
|
||||
@mkdir -p $(dir $@)
|
||||
@$(if $(Q), $(shell echo echo CXX $<),)
|
||||
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) -MMD -c -o $@ $<
|
||||
|
||||
$(OBJDIR)/%.o: %.m
|
||||
@mkdir -p $(dir $@)
|
||||
@$(if $(Q), $(shell echo echo OBJC $<),)
|
||||
$(CXX) $(OBJCFLAGS) $(DEFINES) -MMD -c -o $@ $<
|
||||
|
||||
.FORCE:
|
||||
|
||||
$(OBJDIR)/git_version.o: git_version.c .FORCE
|
||||
@mkdir -p $(dir $@)
|
||||
@$(if $(Q), $(shell echo echo CC $<),)
|
||||
$(CC) $(CFLAGS) $(DEFINES) -MMD -c -o $@ $<
|
||||
|
||||
$(OBJDIR)/%.o: %.S $(HEADERS)
|
||||
@mkdir -p $(dir $@)
|
||||
@$(if $(Q), $(shell echo echo AS $<),)
|
||||
$(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.gcw0.desktop
|
||||
rm -f $(OPK_NAME)
|
||||
cp media/ico_src/icon32.png retroarch.png
|
||||
mksquashfs retroarch default.gcw0.desktop retroarch.png $(OPK_NAME) -all-root -no-xattrs -noappend -no-exports
|
||||
rm -f default.gcw0.desktop retroarch.png
|
||||
|
||||
.PHONY: all clean opk
|
||||
|
||||
print-%:
|
||||
@echo '$*=$($*)'
|
||||
+6
-6
@@ -30,7 +30,7 @@ HAVE_STATIC_VIDEO_FILTERS = 1
|
||||
HAVE_STATIC_AUDIO_FILTERS = 1
|
||||
HAVE_STB_FONT = 1
|
||||
|
||||
MEMORY = 536870912
|
||||
MEMORY = 134217728
|
||||
|
||||
PRECISE_F32 = 1
|
||||
|
||||
@@ -39,8 +39,8 @@ OBJDIR := obj-emscripten
|
||||
#if you compile with SDL2 flag add this Emscripten flag "-s USE_SDL=2" to LDFLAGS:
|
||||
|
||||
LIBS := -s USE_ZLIB=1
|
||||
LDFLAGS := -L. --no-heap-copy -s USE_ZLIB=1 -s TOTAL_MEMORY=$(MEMORY) -s NO_EXIT_RUNTIME=0 -s FULL_ES2=1 \
|
||||
-s EXPORTED_FUNCTIONS="['_main', '_malloc', '_cmd_savefiles', '_cmd_save_state', '_cmd_load_state', '_cmd_take_screenshot']" \
|
||||
LDFLAGS := -L. --no-heap-copy -s $(LIBS) -s TOTAL_MEMORY=$(MEMORY) -s NO_EXIT_RUNTIME=0 -s FULL_ES2=1 -s "EXTRA_EXPORTED_RUNTIME_METHODS=['callMain']" \
|
||||
-s ALLOW_MEMORY_GROWTH=1 -s EXPORTED_FUNCTIONS="['_main', '_malloc', '_cmd_savefiles', '_cmd_save_state', '_cmd_load_state', '_cmd_take_screenshot']" \
|
||||
--js-library emscripten/library_rwebaudio.js \
|
||||
--js-library emscripten/library_rwebcam.js \
|
||||
--js-library emscripten/library_errno_codes.js
|
||||
@@ -70,16 +70,16 @@ ifeq ($(DEBUG), 1)
|
||||
LDFLAGS += -O0 -g
|
||||
CFLAGS += -O0 -g
|
||||
else
|
||||
LDFLAGS += -O2 -s WASM=1
|
||||
LDFLAGS += -O3 -s WASM=1
|
||||
# WARNING: some optimizations can break some cores (ex: LTO breaks tyrquake)
|
||||
LDFLAGS += -s PRECISE_F32=$(PRECISE_F32)
|
||||
ifeq ($(LTO), 1)
|
||||
LDFLAGS += --llvm-lto 3
|
||||
endif
|
||||
CFLAGS += -O2
|
||||
CFLAGS += -O3
|
||||
endif
|
||||
|
||||
CFLAGS += -DHAVE_RPNG -Wall -I. -Ilibretro-common/include -std=gnu99 -s USE_ZLIB=1 \
|
||||
CFLAGS += -Wall -I. -Ilibretro-common/include -std=gnu99 $(LIBS) \
|
||||
-s EXPORTED_FUNCTIONS="['_main', '_malloc', '_cmd_savefiles', '_cmd_save_state', '_cmd_take_screenshot']"
|
||||
|
||||
RARCH_OBJ := $(addprefix $(OBJDIR)/,$(OBJ))
|
||||
|
||||
+6
-6
@@ -439,7 +439,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 -DHAVE_EASTEREGG -D__MMX__ -D__SSE__ -DHAVE_OPENGL -DHAVE_OPENGL1 -DHAVE_GLSL -DHAVE_SHADERPIPELINE -DHAVE_OZONE
|
||||
PLATCFLAGS += -D_WIN32 -D_WIN32_WINNT=0x0410 -D__STDC_CONSTANT_MACROS -D_MBCS -D__MMX__ -D__SSE__ -DHAVE_OPENGL -DHAVE_OPENGL1 -DHAVE_GLSL -DHAVE_SHADERPIPELINE -DHAVE_OZONE
|
||||
LDFLAGS += shell32.lib user32.lib gdi32.lib comdlg32.lib winmm.lib ole32.lib msimg32.lib
|
||||
|
||||
PATH := $(shell IFS=$$'\n'; cygpath "$(VS80COMNTOOLS)../../VC/bin"):$(PATH)
|
||||
@@ -491,7 +491,7 @@ else ifneq (,$(findstring windows_msvc2010,$(platform)))
|
||||
LD = link.exe
|
||||
|
||||
PLATCFLAGS += -D_WIN32 -D__STDC_CONSTANT_MACROS -D_MBCS
|
||||
PLATCFLAGS += -D__i686__ -D__MMX__ -D__SSE__ -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINDOWS -DHAVE_CC_RESAMPLER -DHAVE_GL_SYNC -DHAVE_GLSL -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_OPENGL -DHAVE_SHADERPIPELINE -DHAVE_UPDATE_ASSETS -DWIN32 -DHAVE_EASTEREGG -DHAVE_CDROM
|
||||
PLATCFLAGS += -D__i686__ -D__MMX__ -D__SSE__ -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINDOWS -DHAVE_CC_RESAMPLER -DHAVE_GL_SYNC -DHAVE_GLSL -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_OPENGL -DHAVE_SHADERPIPELINE -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORES -DWIN32 -DHAVE_CDROM
|
||||
LDFLAGS += shell32.lib user32.lib gdi32.lib comdlg32.lib winmm.lib ole32.lib iphlpapi.lib msimg32.lib
|
||||
|
||||
PlatformSuffix = $(subst windows_msvc2010_,,$(platform))
|
||||
@@ -565,7 +565,7 @@ else ifneq (,$(findstring windows_msvc2012,$(platform)))
|
||||
LD = link.exe
|
||||
|
||||
PLATCFLAGS += -D_WIN32 -D__STDC_CONSTANT_MACROS -D_MBCS
|
||||
PLATCFLAGS += -D__i686__ -D__MMX__ -D__SSE__ -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINDOWS -DHAVE_CC_RESAMPLER -DHAVE_GL_SYNC -DHAVE_GLSL -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_OPENGL -DHAVE_SHADERPIPELINE -DHAVE_UPDATE_ASSETS -DWIN32 -DHAVE_EASTEREGG -DHAVE_CDROM
|
||||
PLATCFLAGS += -D__i686__ -D__MMX__ -D__SSE__ -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINDOWS -DHAVE_CC_RESAMPLER -DHAVE_GL_SYNC -DHAVE_GLSL -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_OPENGL -DHAVE_SHADERPIPELINE -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORES -DWIN32 -DHAVE_CDROM
|
||||
LDFLAGS += shell32.lib user32.lib gdi32.lib comdlg32.lib winmm.lib ole32.lib iphlpapi.lib
|
||||
|
||||
PlatformSuffix = $(subst windows_msvc2012_,,$(platform))
|
||||
@@ -643,7 +643,7 @@ else ifneq (,$(findstring windows_msvc2013,$(platform)))
|
||||
LD = link.exe
|
||||
|
||||
PLATCFLAGS += -D_WIN32 -D__STDC_CONSTANT_MACROS -D_MBCS
|
||||
PLATCFLAGS += -D__i686__ -D__MMX__ -D__SSE__ -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINDOWS -DHAVE_CC_RESAMPLER -DHAVE_GL_SYNC -DHAVE_GLSL -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_OPENGL -DHAVE_SHADERPIPELINE -DHAVE_UPDATE_ASSETS -DWIN32 -DHAVE_EASTEREGG -DHAVE_CDROM
|
||||
PLATCFLAGS += -D__i686__ -D__MMX__ -D__SSE__ -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINDOWS -DHAVE_CC_RESAMPLER -DHAVE_GL_SYNC -DHAVE_GLSL -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_OPENGL -DHAVE_SHADERPIPELINE -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORES -DWIN32 -DHAVE_CDROM
|
||||
LDFLAGS += shell32.lib user32.lib gdi32.lib comdlg32.lib winmm.lib ole32.lib iphlpapi.lib
|
||||
|
||||
PlatformSuffix = $(subst windows_msvc2013_,,$(platform))
|
||||
@@ -722,7 +722,7 @@ else ifneq (,$(findstring windows_msvc2015,$(platform)))
|
||||
|
||||
PLATCFLAGS += -utf-8
|
||||
PLATCFLAGS += -D_WIN32 -D__STDC_CONSTANT_MACROS -D_MBCS
|
||||
PLATCFLAGS += -D__i686__ -D__MMX__ -D__SSE__ -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINDOWS -DHAVE_CC_RESAMPLER -DHAVE_GL_SYNC -DHAVE_GLSL -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_OPENGL -DHAVE_SHADERPIPELINE -DHAVE_UPDATE_ASSETS -DWIN32 -DHAVE_EASTEREGG -DHAVE_CDROM
|
||||
PLATCFLAGS += -D__i686__ -D__MMX__ -D__SSE__ -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINDOWS -DHAVE_CC_RESAMPLER -DHAVE_GL_SYNC -DHAVE_GLSL -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_OPENGL -DHAVE_SHADERPIPELINE -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORES -DWIN32 -DHAVE_CDROM
|
||||
LDFLAGS += shell32.lib user32.lib gdi32.lib comdlg32.lib winmm.lib ole32.lib iphlpapi.lib
|
||||
|
||||
PlatformSuffix = $(subst windows_msvc2015_,,$(platform))
|
||||
@@ -806,7 +806,7 @@ else ifneq (,$(findstring unix,$(platform)))
|
||||
HAVE_GRIFFIN_CPP := 1
|
||||
WANT_GLSLANG := 1
|
||||
|
||||
PLATCFLAGS += -DHAVE_EASTEREGG -D__MMX__ -D__SSE__ -DHAVE_OPENGL -DHAVE_OPENGL1 -DHAVE_GLSL -DHAVE_SHADERPIPELINE -DHAVE_OZONE -DHAVE_CC_RESAMPLER -DHAVE_CHEEVOS -DRC_DISABLE_LUA -DHAVE_FBO -DHAVE_GL_SYNC -DHAVE_SLANG -DHAVE_GLSLANG -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_RUNAHEAD -DHAVE_MENU_WIDGETS -DHAVE_SPIRV_CROSS -DHAVE_STB_FONT -DHAVE_UPDATE_ASSETS -DHAVE_VULKAN -DHAVE_XMB -DRARCH_INTERNAL -DWANT_GLSLANG -DHAVE_X11 -DHAVE_XCB -DHAVE_UDEV -DHAVE_PULSE
|
||||
PLATCFLAGS += -D__MMX__ -D__SSE__ -DHAVE_OPENGL -DHAVE_OPENGL1 -DHAVE_GLSL -DHAVE_SHADERPIPELINE -DHAVE_OZONE -DHAVE_CC_RESAMPLER -DHAVE_CHEEVOS -DRC_DISABLE_LUA -DHAVE_FBO -DHAVE_GL_SYNC -DHAVE_SLANG -DHAVE_GLSLANG -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_RUNAHEAD -DHAVE_MENU_WIDGETS -DHAVE_SPIRV_CROSS -DHAVE_STB_FONT -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORES -DHAVE_VULKAN -DHAVE_XMB -DRARCH_INTERNAL -DWANT_GLSLANG -DHAVE_X11 -DHAVE_XCB -DHAVE_UDEV -DHAVE_PULSE
|
||||
EXT_TARGET := $(TARGET_NAME)
|
||||
EXT_INTER_TARGET := $(TARGET_NAME)
|
||||
INCLUDE += -Ilibretro-common/include -Igfx/include -Ideps -Ideps/stb -Ideps/rcheevos/include -Ideps/SPIRV-Cross -Ideps/glslang -I.
|
||||
|
||||
+3
-2
@@ -21,6 +21,7 @@ OBJ :=
|
||||
|
||||
DEFINES := -D__SWITCH__=1 -U__linux__ -U__linux -DGLM_FORCE_PURE=1 -DRARCH_CONSOLE -DRARCH_INTERNAL -DGLOBAL_CONFIG_DIR='"/switch"' -DHAVE_STB_VORBIS
|
||||
|
||||
HAVE_DR_MP3 = 1
|
||||
HAVE_TRANSLATE = 1
|
||||
HAVE_AUDIOMIXER = 1
|
||||
HAVE_CC_RESAMPLER = 1
|
||||
@@ -61,7 +62,7 @@ ifeq ($(HAVE_OPENGL), 1)
|
||||
HAVE_XMB = 1
|
||||
HAVE_OZONE = 1
|
||||
HAVE_OVERLAY = 1
|
||||
HAVE_VIDEO_LAYOUT = 0
|
||||
HAVE_VIDEO_LAYOUT = 1
|
||||
HAVE_GLSL = 1
|
||||
else
|
||||
HAVE_RGUI = 1
|
||||
@@ -117,7 +118,7 @@ ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE -mcpu=cortex-a57+crc+fp
|
||||
CFLAGS := -g -Wall -O3 -ffast-math -ffunction-sections \
|
||||
$(ARCH) $(DEFINES) $(INCLUDE_DIRS) -I$(LIBNX)/include -I$(PORTLIBS)/include/ -include $(LIBNX)/include/switch.h #$(shell $(PORTLIBS)/bin/freetype-config --cflags)
|
||||
|
||||
CFLAGS += $(INCLUDE) -DSWITCH=1 -DHAVE_LIBNX=1 -DNXLINK=1 -DHAVE_SHADERPIPELINE -DHAVE_UPDATE_ASSETS -DHAVE_STB_FONT #-DHAVE_FREETYPE
|
||||
CFLAGS += $(INCLUDE) -DSWITCH=1 -DHAVE_LIBNX=1 -DNXLINK=1 -DHAVE_SHADERPIPELINE -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORES -DHAVE_STB_FONT #-DHAVE_FREETYPE
|
||||
|
||||
ifeq ($(strip $(HAVE_STATIC_DUMMY)),1)
|
||||
CFLAGS += -DHAVE_STATIC_DUMMY=1
|
||||
|
||||
@@ -71,6 +71,7 @@ PPU_SRCS = griffin/griffin.c
|
||||
|
||||
#DEFINES += -DHAVE_VIDEO_LAYOUT
|
||||
DEFINES += -DHAVE_MENU -DHAVE_MENU_WIDGETS -DHAVE_RGUI -DHAVE_XMB -DHAVE_OZONE -DHAVE_LIBRETRODB -DHAVE_MATERIALUI -DHAVE_SHADERPIPELINE -DRARCH_INTERNAL -DMSB_FIRST -DHAVE_OVERLAY -DHAVE_CC_RESAMPLER -DHAVE_STB_VORBIS -DHAVE_STB_FONT -DHAVE_RUNAHEAD -DHAVE_DR_MP3 -DHAVE_DR_FLAC
|
||||
DEFINES += -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORES
|
||||
|
||||
ifeq ($(DEX_BUILD), 1)
|
||||
DEFINES += -DDEX_BUILD
|
||||
|
||||
@@ -45,8 +45,8 @@ PPU_CXXFLAGS := $(PPU_OPTIMIZE_LV) $(INCFLAGS) $(DEFINES)
|
||||
PPU_SRCS = frontend/frontend_salamander.c \
|
||||
frontend/frontend_driver.c \
|
||||
frontend/drivers/platform_ps3.c \
|
||||
frontend/drivers/platform_null.c \
|
||||
libretro-common/file/file_path.c \
|
||||
libretro-common/file/file_path_io.c \
|
||||
libretro-common/lists/dir_list.c \
|
||||
libretro-common/lists/string_list.c \
|
||||
libretro-common/file/retro_dirent.c \
|
||||
|
||||
@@ -58,3 +58,18 @@ OBJS = $(PSP_OBJECTS)
|
||||
|
||||
PSPSDK=$(shell psp-config --pspsdk-path)
|
||||
include $(PSPSDK)/lib/build.mak
|
||||
|
||||
pspsh-debug:
|
||||
pspsh -e reset
|
||||
read -p "Start debugger in VSCode and press any key to continue... \n" -n1 -s
|
||||
pspsh -e debug ./retroarchpsp.prx
|
||||
pspsh
|
||||
|
||||
pspsh-run:
|
||||
pspsh -e reset
|
||||
pspsh -e ./retroarchpsp.prx
|
||||
pspsh
|
||||
|
||||
debug: clean all pspsh-debug
|
||||
|
||||
run: clean all pspsh-run
|
||||
@@ -35,8 +35,8 @@ PSP_EBOOT_PIC1 = pkg/psp1/PIC1.PNG
|
||||
OBJS = frontend/frontend_salamander.o \
|
||||
frontend/frontend_driver.o \
|
||||
frontend/drivers/platform_psp.o \
|
||||
frontend/drivers/platform_null.o \
|
||||
libretro-common/file/file_path.o \
|
||||
libretro-common/file/file_path_io.o \
|
||||
libretro-common/string/stdstring.o \
|
||||
libretro-common/lists/string_list.o \
|
||||
libretro-common/lists/dir_list.o \
|
||||
|
||||
+8
-3
@@ -11,21 +11,24 @@ PC_DEVELOPMENT_UDP_PORT =
|
||||
|
||||
OBJ :=
|
||||
|
||||
DEFINES :=
|
||||
DEFINES := -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS
|
||||
INCDIRS :=
|
||||
|
||||
ifeq ($(GRIFFIN_BUILD), 1)
|
||||
OBJ += griffin/griffin.o
|
||||
DEFINES += -DHAVE_GRIFFIN=1
|
||||
DEFINES += -DHAVE_NEON -DHAVE_MENU -DHAVE_XMB -DHAVE_MATERIALUI -DHAVE_LIBRETRODB DEFINES -DHAVE_KEYMAPPER
|
||||
DEFINES += -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA -DHAVE_CC_RESAMPLER -DHAVE_UPDATE_ASSETS
|
||||
DEFINES += -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA -DHAVE_CC_RESAMPLER
|
||||
ifeq ($(DEBUG), 1)
|
||||
DEFINES += -DHAVE_NETLOGGER
|
||||
endif
|
||||
INCDIRS += -I. -Ideps/7zip -Ilibretro-common/include -Ilibretro-common/include/compat/zlib -Ideps/stb
|
||||
else
|
||||
|
||||
HAVE_UPDATE_ASSETS := 1
|
||||
HAVE_ONLINE_UPDATER := 1
|
||||
HAVE_NEON := 1
|
||||
HAVE_MATH_NEON := 1
|
||||
HAVE_FILTERS_BUILTIN := 1
|
||||
HAVE_LANGEXTRA := 1
|
||||
HAVE_RPNG := 1
|
||||
@@ -35,10 +38,12 @@ else
|
||||
HAVE_ZLIB := 1
|
||||
HAVE_7ZIP := 1
|
||||
HAVE_VITA2D := 1
|
||||
HAVE_VITAGL := 1
|
||||
HAVE_NETWORKING := 1
|
||||
HAVE_SOCKET_LEGACY := 1
|
||||
HAVE_MENU := 1
|
||||
HAVE_MENU_COMMON := 1
|
||||
HAVE_MENU_WIDGETS = 1
|
||||
HAVE_OVERLAY := 1
|
||||
HAVE_VIDEO_LAYOUT := 0
|
||||
HAVE_MATERIALUI := 1
|
||||
@@ -114,7 +119,7 @@ CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions
|
||||
|
||||
VITA_LIBS := -lSceDisplay_stub -lSceGxm_stub -lSceNet_stub -lSceNetCtl_stub -lSceAppUtil_stub \
|
||||
-lSceSysmodule_stub -lSceCtrl_stub -lSceHid_stub -lSceTouch_stub -lSceAudio_stub \
|
||||
-lScePower_stub -lSceRtc_stub -lSceCommonDialog_stub -lScePgf_stub \
|
||||
-lScePower_stub -lSceRtc_stub -lSceCommonDialog_stub -lScePgf_stub -lSceMotion_stub \
|
||||
-lSceFiber_stub -lSceMotion_stub -lSceAppMgr_stub -lpthread -lpng -lz
|
||||
|
||||
LIBS := $(WHOLE_START) -lretro_vita $(WHOLE_END) $(VITA_LIBS) -lm -lc
|
||||
|
||||
@@ -23,7 +23,7 @@ LIBDIR =
|
||||
LDFLAGS =
|
||||
LIBS = -lSceDisplay_stub -lSceGxm_stub -lSceNet_stub -lSceNetCtl_stub -lSceAppUtil_stub\
|
||||
-lSceSysmodule_stub -lSceCtrl_stub -lSceHid_stub -lSceAudio_stub -lSceFiber_stub\
|
||||
-lScePower_stub -lSceRtc_stub -lSceCommonDialog_stub -lScePgf_stub \
|
||||
-lScePower_stub -lSceRtc_stub -lSceCommonDialog_stub -lScePgf_stub -lSceMotion_stub \
|
||||
-lSceMotion_stub -lSceAppMgr_stub -lfreetype -lpng -lm -lc
|
||||
|
||||
ifeq ($(HAVE_FILE_LOGGER), 1)
|
||||
@@ -35,8 +35,8 @@ CFLAGS += $(RARCH_DEFINES)
|
||||
OBJS = frontend/frontend_salamander.o \
|
||||
frontend/frontend_driver.o \
|
||||
frontend/drivers/platform_psp.o \
|
||||
frontend/drivers/platform_null.o \
|
||||
libretro-common/file/file_path.o \
|
||||
libretro-common/file/file_path_io.o \
|
||||
libretro-common/string/stdstring.o \
|
||||
libretro-common/lists/string_list.o \
|
||||
libretro-common/lists/dir_list.o \
|
||||
|
||||
@@ -55,8 +55,8 @@ OBJ = frontend/frontend_salamander.o \
|
||||
frontend/frontend_driver.o \
|
||||
frontend/drivers/platform_gx.o \
|
||||
frontend/drivers/platform_wii.o \
|
||||
frontend/drivers/platform_null.o \
|
||||
libretro-common/file/file_path.o \
|
||||
libretro-common/file/file_path_io.o \
|
||||
libretro-common/hash/rhash.o \
|
||||
libretro-common/string/stdstring.o \
|
||||
libretro-common/lists/string_list.o \
|
||||
|
||||
+3
-1
@@ -53,11 +53,11 @@ ifeq ($(SALAMANDER_BUILD),1)
|
||||
OBJ += frontend/frontend_salamander.o
|
||||
OBJ += frontend/frontend_driver.o
|
||||
OBJ += frontend/drivers/platform_wiiu.o
|
||||
OBJ += frontend/drivers/platform_null.o
|
||||
OBJ += libretro-common/encodings/encoding_utf.o
|
||||
OBJ += libretro-common/compat/compat_strcasestr.o
|
||||
OBJ += libretro-common/compat/fopen_utf8.o
|
||||
OBJ += libretro-common/file/file_path.o
|
||||
OBJ += libretro-common/file/file_path_io.o
|
||||
OBJ += libretro-common/string/stdstring.o
|
||||
OBJ += libretro-common/lists/string_list.o
|
||||
OBJ += libretro-common/lists/dir_list.o
|
||||
@@ -74,7 +74,9 @@ ifeq ($(SALAMANDER_BUILD),1)
|
||||
else
|
||||
DEFINES += -DRARCH_INTERNAL
|
||||
DEFINES += -DHAVE_KEYMAPPER
|
||||
DEFINES += -DHAVE_ONLINE_UPDATER
|
||||
DEFINES += -DHAVE_UPDATE_ASSETS
|
||||
DEFINES += -DHAVE_UPDATE_CORES
|
||||
DEFINES += -DHAVE_FILTERS_BUILTIN
|
||||
DEFINES += -DHAVE_SLANG
|
||||
DEFINES += -DHAVE_SHADERPIPELINE
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
*
|
||||
* 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,16 +14,29 @@
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../led_driver.h"
|
||||
#include "../../verbosity.h"
|
||||
#ifndef __RETROARCH_ACCESSIBILITY_H
|
||||
#define __RETROARCH_ACCESSIBILITY_H
|
||||
|
||||
static void null_led_init(void) { }
|
||||
static void null_led_free(void) { }
|
||||
static void null_led_set(int led, int state) { }
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <sys/types.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
const led_driver_t null_led_driver = {
|
||||
null_led_init,
|
||||
null_led_free,
|
||||
null_led_set,
|
||||
"null"
|
||||
};
|
||||
#include <boolean.h>
|
||||
#include <retro_inline.h>
|
||||
#include <retro_common_api.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
bool is_accessibility_enabled(void);
|
||||
|
||||
bool accessibility_speak_priority(const char* speak_text, int priority);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
@@ -372,7 +372,7 @@ static void *alsa_device_list_new(void *data)
|
||||
|
||||
n = hints;
|
||||
|
||||
while (*n != NULL)
|
||||
while (*n)
|
||||
{
|
||||
char *name = snd_device_name_get_hint(*n, "NAME");
|
||||
char *io = snd_device_name_get_hint(*n, "IOID");
|
||||
|
||||
@@ -361,7 +361,7 @@ static void *alsa_thread_device_list_new(void *data)
|
||||
|
||||
n = hints;
|
||||
|
||||
while (*n != NULL)
|
||||
while (*n)
|
||||
{
|
||||
char *name = snd_device_name_get_hint(*n, "NAME");
|
||||
char *io = snd_device_name_get_hint(*n, "IOID");
|
||||
|
||||
@@ -52,7 +52,9 @@ typedef struct coreaudio
|
||||
size_t buffer_size;
|
||||
} coreaudio_t;
|
||||
|
||||
#if TARGET_OS_IOS
|
||||
static bool g_interrupted;
|
||||
#endif
|
||||
|
||||
static void coreaudio_free(void *data)
|
||||
{
|
||||
@@ -344,7 +346,11 @@ static ssize_t coreaudio_write(void *data, const void *buf_, size_t size)
|
||||
const uint8_t *buf = (const uint8_t*)buf_;
|
||||
size_t written = 0;
|
||||
|
||||
#if TARGET_OS_IOS
|
||||
while (!g_interrupted && size > 0)
|
||||
#else
|
||||
while (size > 0)
|
||||
#endif
|
||||
{
|
||||
size_t write_avail;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
typedef struct
|
||||
{
|
||||
bool nonblocking;
|
||||
bool nonblock;
|
||||
bool playing;
|
||||
int16_t* l;
|
||||
int16_t* r;
|
||||
@@ -180,7 +180,7 @@ static ssize_t ctr_csnd_audio_write(void *data, const void *buf, size_t size)
|
||||
(((ctr->pos - ctr->playpos ) & CTR_CSND_AUDIO_COUNT_MASK) < (CTR_CSND_AUDIO_COUNT >> 4)) ||
|
||||
(((ctr->playpos - ctr->pos) & CTR_CSND_AUDIO_COUNT_MASK) < (size >> 2)))
|
||||
{
|
||||
if (ctr->nonblocking)
|
||||
if (ctr->nonblock)
|
||||
ctr->pos = (ctr->playpos + (CTR_CSND_AUDIO_COUNT >> 1)) & CTR_CSND_AUDIO_COUNT_MASK;
|
||||
else
|
||||
{
|
||||
@@ -189,7 +189,7 @@ static ssize_t ctr_csnd_audio_write(void *data, const void *buf, size_t size)
|
||||
retro_sleep(1);
|
||||
ctr_csnd_audio_update_playpos(ctr);
|
||||
}while (((ctr->playpos - ctr->pos) & CTR_CSND_AUDIO_COUNT_MASK) < (CTR_CSND_AUDIO_COUNT >> 1)
|
||||
|| (((ctr->pos - ctr->playpos) & CTR_CSND_AUDIO_COUNT_MASK) < (CTR_CSND_AUDIO_COUNT >> 4)));
|
||||
|| (((ctr->pos - ctr->playpos) & CTR_CSND_AUDIO_COUNT_MASK) < (CTR_CSND_AUDIO_COUNT >> 4)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -265,7 +265,7 @@ static void ctr_csnd_audio_set_nonblock_state(void *data, bool state)
|
||||
{
|
||||
ctr_csnd_audio_t* ctr = (ctr_csnd_audio_t*)data;
|
||||
if (ctr)
|
||||
ctr->nonblocking = state;
|
||||
ctr->nonblock = state;
|
||||
}
|
||||
|
||||
static bool ctr_csnd_audio_use_float(void *data)
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
typedef struct
|
||||
{
|
||||
bool nonblocking;
|
||||
bool nonblock;
|
||||
bool playing;
|
||||
int channel;
|
||||
ndspWaveBuf dsp_buf;
|
||||
@@ -102,7 +102,7 @@ static ssize_t ctr_dsp_audio_write(void *data, const void *buf, size_t size)
|
||||
(((ctr->pos - sample_pos ) & CTR_DSP_AUDIO_COUNT_MASK) < (CTR_DSP_AUDIO_COUNT >> 4)) ||
|
||||
(((sample_pos - ctr->pos) & CTR_DSP_AUDIO_COUNT_MASK) < (size >> 2)))
|
||||
{
|
||||
if (ctr->nonblocking)
|
||||
if (ctr->nonblock)
|
||||
ctr->pos = (sample_pos + (CTR_DSP_AUDIO_COUNT >> 1)) & CTR_DSP_AUDIO_COUNT_MASK;
|
||||
else
|
||||
{
|
||||
@@ -173,7 +173,7 @@ static void ctr_dsp_audio_set_nonblock_state(void *data, bool state)
|
||||
{
|
||||
ctr_dsp_audio_t* ctr = (ctr_dsp_audio_t*)data;
|
||||
if (ctr)
|
||||
ctr->nonblocking = state;
|
||||
ctr->nonblock = state;
|
||||
}
|
||||
|
||||
static bool ctr_dsp_audio_use_float(void *data)
|
||||
|
||||
+66
-36
@@ -94,30 +94,25 @@ struct audio_lock
|
||||
DWORD size2;
|
||||
};
|
||||
|
||||
static INLINE bool grab_region(dsound_t *ds, uint32_t write_ptr,
|
||||
struct audio_lock *region)
|
||||
static bool grab_region(dsound_t *ds, uint32_t write_ptr,
|
||||
struct audio_lock *region, HRESULT res)
|
||||
{
|
||||
HRESULT res = IDirectSoundBuffer_Lock(ds->dsb, write_ptr, CHUNK_SIZE,
|
||||
®ion->chunk1, ®ion->size1, ®ion->chunk2, ®ion->size2, 0);
|
||||
|
||||
if (res == DSERR_BUFFERLOST)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
RARCH_WARN("[DirectSound error]: %s\n", "DSERR_BUFFERLOST");
|
||||
#endif
|
||||
if ((res = IDirectSoundBuffer_Restore(ds->dsb)) != DS_OK)
|
||||
return false;
|
||||
if ((res = IDirectSoundBuffer_Lock(ds->dsb, write_ptr, CHUNK_SIZE,
|
||||
®ion->chunk1, ®ion->size1, ®ion->chunk2, ®ion->size2, 0)) != DS_OK)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (res == DS_OK)
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
switch (res)
|
||||
{
|
||||
case DSERR_BUFFERLOST:
|
||||
RARCH_WARN("[DirectSound error]: %s\n", "DSERR_BUFFERLOST");
|
||||
break;
|
||||
case DSERR_INVALIDCALL:
|
||||
RARCH_WARN("[DirectSound error]: %s\n", "DSERR_INVALIDCALL");
|
||||
break;
|
||||
@@ -151,6 +146,7 @@ static DWORD CALLBACK dsound_thread(PVOID data)
|
||||
|
||||
while (ds->thread_alive)
|
||||
{
|
||||
HRESULT res;
|
||||
bool is_pull = false;
|
||||
struct audio_lock region;
|
||||
DWORD read_ptr, avail, fifo_avail;
|
||||
@@ -175,11 +171,15 @@ static DWORD CALLBACK dsound_thread(PVOID data)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!grab_region(ds, write_ptr, ®ion))
|
||||
if ((res = IDirectSoundBuffer_Lock(ds->dsb, write_ptr, CHUNK_SIZE,
|
||||
®ion.chunk1, ®ion.size1, ®ion.chunk2, ®ion.size2, 0)) != DS_OK)
|
||||
{
|
||||
ds->thread_alive = false;
|
||||
SetEvent(ds->event);
|
||||
break;
|
||||
if (!grab_region(ds, write_ptr, ®ion, res))
|
||||
{
|
||||
ds->thread_alive = false;
|
||||
SetEvent(ds->event);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (fifo_avail < CHUNK_SIZE)
|
||||
@@ -328,6 +328,19 @@ static BOOL CALLBACK enumerate_cb(LPGUID guid, LPCSTR desc, LPCSTR module, LPVOI
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void dsound_set_wavefmt(WAVEFORMATEX *wfx,
|
||||
unsigned channels, unsigned samplerate)
|
||||
{
|
||||
wfx->wFormatTag = WAVE_FORMAT_PCM;
|
||||
wfx->nBlockAlign = channels * sizeof(int16_t);
|
||||
wfx->wBitsPerSample = 16;
|
||||
|
||||
wfx->nChannels = channels;
|
||||
wfx->nSamplesPerSec = samplerate;
|
||||
wfx->nAvgBytesPerSec = wfx->nSamplesPerSec * wfx->nBlockAlign;
|
||||
wfx->cbSize = 0;
|
||||
}
|
||||
|
||||
static void *dsound_init(const char *dev, unsigned rate, unsigned latency,
|
||||
unsigned block_frames,
|
||||
unsigned *new_rate)
|
||||
@@ -390,12 +403,7 @@ static void *dsound_init(const char *dev, unsigned rate, unsigned latency,
|
||||
goto error;
|
||||
#endif
|
||||
|
||||
wfx.wFormatTag = WAVE_FORMAT_PCM;
|
||||
wfx.nChannels = 2;
|
||||
wfx.nSamplesPerSec = rate;
|
||||
wfx.wBitsPerSample = 16;
|
||||
wfx.nBlockAlign = 2 * sizeof(int16_t);
|
||||
wfx.nAvgBytesPerSec = rate * 2 * sizeof(int16_t);
|
||||
dsound_set_wavefmt(&wfx, 2, rate);
|
||||
|
||||
ds->buffer_size = (latency * wfx.nAvgBytesPerSec) / 1000;
|
||||
ds->buffer_size /= CHUNK_SIZE;
|
||||
@@ -496,27 +504,49 @@ static ssize_t dsound_write(void *data, const void *buf_, size_t size)
|
||||
if (!ds->thread_alive)
|
||||
return -1;
|
||||
|
||||
while (size > 0)
|
||||
if (ds->nonblock)
|
||||
{
|
||||
size_t avail;
|
||||
if (size > 0)
|
||||
{
|
||||
size_t avail;
|
||||
|
||||
EnterCriticalSection(&ds->crit);
|
||||
avail = fifo_write_avail(ds->buffer);
|
||||
if (avail > size)
|
||||
avail = size;
|
||||
EnterCriticalSection(&ds->crit);
|
||||
avail = fifo_write_avail(ds->buffer);
|
||||
if (avail > size)
|
||||
avail = size;
|
||||
|
||||
fifo_write(ds->buffer, buf, avail);
|
||||
LeaveCriticalSection(&ds->crit);
|
||||
fifo_write(ds->buffer, buf, avail);
|
||||
LeaveCriticalSection(&ds->crit);
|
||||
|
||||
buf += avail;
|
||||
size -= avail;
|
||||
written += avail;
|
||||
buf += avail;
|
||||
size -= avail;
|
||||
written += avail;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while (size > 0)
|
||||
{
|
||||
size_t avail;
|
||||
|
||||
if (ds->nonblock || !ds->thread_alive)
|
||||
break;
|
||||
EnterCriticalSection(&ds->crit);
|
||||
avail = fifo_write_avail(ds->buffer);
|
||||
if (avail > size)
|
||||
avail = size;
|
||||
|
||||
if (avail == 0)
|
||||
WaitForSingleObject(ds->event, INFINITE);
|
||||
fifo_write(ds->buffer, buf, avail);
|
||||
LeaveCriticalSection(&ds->crit);
|
||||
|
||||
buf += avail;
|
||||
size -= avail;
|
||||
written += avail;
|
||||
|
||||
if (!ds->thread_alive)
|
||||
break;
|
||||
|
||||
if (avail == 0)
|
||||
WaitForSingleObject(ds->event, INFINITE);
|
||||
}
|
||||
}
|
||||
|
||||
return written;
|
||||
|
||||
@@ -166,7 +166,7 @@ static void *ja_init(const char *device, unsigned rate, unsigned latency,
|
||||
#endif
|
||||
|
||||
jd->client = jack_client_open("RetroArch", JackNullOption, NULL);
|
||||
if (jd->client == NULL)
|
||||
if (!jd->client)
|
||||
goto error;
|
||||
|
||||
*new_rate = jack_get_sample_rate(jd->client);
|
||||
@@ -176,14 +176,14 @@ static void *ja_init(const char *device, unsigned rate, unsigned latency,
|
||||
|
||||
jd->ports[0] = jack_port_register(jd->client, "left", JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0);
|
||||
jd->ports[1] = jack_port_register(jd->client, "right", JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0);
|
||||
if (jd->ports[0] == NULL || jd->ports[1] == NULL)
|
||||
if (!jd->ports[0] || !jd->ports[1])
|
||||
{
|
||||
RARCH_ERR("[JACK]: Failed to register ports.\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
jports = jack_get_ports(jd->client, NULL, NULL, JackPortIsPhysical | JackPortIsInput);
|
||||
if (jports == NULL)
|
||||
if (!jports)
|
||||
{
|
||||
RARCH_ERR("[JACK]: Failed to get ports.\n");
|
||||
goto error;
|
||||
@@ -196,7 +196,7 @@ static void *ja_init(const char *device, unsigned rate, unsigned latency,
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
jd->buffer[i] = jack_ringbuffer_create(bufsize);
|
||||
if (jd->buffer[i] == NULL)
|
||||
if (!jd->buffer[i])
|
||||
{
|
||||
RARCH_ERR("[JACK]: Failed to create buffers.\n");
|
||||
goto error;
|
||||
@@ -229,7 +229,7 @@ static void *ja_init(const char *device, unsigned rate, unsigned latency,
|
||||
error:
|
||||
for (i = 0; i < parsed; i++)
|
||||
free(dest_ports[i]);
|
||||
if (jports != NULL)
|
||||
if (jports)
|
||||
jack_free(jports);
|
||||
free(jd);
|
||||
return NULL;
|
||||
@@ -334,14 +334,14 @@ static void ja_free(void *data)
|
||||
|
||||
jd->shutdown = true;
|
||||
|
||||
if (jd->client != NULL)
|
||||
if (jd->client)
|
||||
{
|
||||
jack_deactivate(jd->client);
|
||||
jack_client_close(jd->client);
|
||||
}
|
||||
|
||||
for (i = 0; i < 2; i++)
|
||||
if (jd->buffer[i] != NULL)
|
||||
if (jd->buffer[i])
|
||||
jack_ringbuffer_free(jd->buffer[i]);
|
||||
|
||||
#ifdef HAVE_THREADS
|
||||
|
||||
@@ -1,96 +0,0 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
*
|
||||
* 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 "../../retroarch.h"
|
||||
#include "../../verbosity.h"
|
||||
|
||||
static void *null_audio_init(const char *device, unsigned rate, unsigned latency,
|
||||
unsigned block_frames,
|
||||
unsigned *new_rate)
|
||||
{
|
||||
RARCH_ERR("Using the null audio driver. RetroArch will be silent.\n");
|
||||
|
||||
(void)device;
|
||||
(void)rate;
|
||||
(void)latency;
|
||||
(void)new_rate;
|
||||
return (void*)-1;
|
||||
}
|
||||
|
||||
static void null_audio_free(void *data)
|
||||
{
|
||||
(void)data;
|
||||
}
|
||||
|
||||
static ssize_t null_audio_write(void *data, const void *buf, size_t size)
|
||||
{
|
||||
(void)data;
|
||||
(void)buf;
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
static bool null_audio_stop(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool null_audio_alive(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool null_audio_start(void *data, bool is_shutdown)
|
||||
{
|
||||
(void)data;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void null_audio_set_nonblock_state(void *data, bool state)
|
||||
{
|
||||
(void)data;
|
||||
(void)state;
|
||||
}
|
||||
|
||||
static bool null_audio_use_float(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return true;
|
||||
}
|
||||
|
||||
static size_t null_audio_write_avail(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return 0;
|
||||
}
|
||||
|
||||
audio_driver_t audio_null = {
|
||||
null_audio_init,
|
||||
null_audio_write,
|
||||
null_audio_stop,
|
||||
null_audio_start,
|
||||
null_audio_alive,
|
||||
null_audio_set_nonblock_state,
|
||||
null_audio_free,
|
||||
null_audio_use_float,
|
||||
"null",
|
||||
NULL,
|
||||
NULL,
|
||||
null_audio_write_avail,
|
||||
NULL
|
||||
};
|
||||
@@ -115,7 +115,7 @@ static void *al_init(const char *device, unsigned rate, unsigned latency,
|
||||
|
||||
al->buffers = (ALuint*)calloc(al->num_buffers, sizeof(ALuint));
|
||||
al->res_buf = (ALuint*)calloc(al->num_buffers, sizeof(ALuint));
|
||||
if (al->buffers == NULL || al->res_buf == NULL)
|
||||
if (!al->buffers || !al->res_buf)
|
||||
goto error;
|
||||
|
||||
alGenSources(1, &al->source);
|
||||
|
||||
+56
-26
@@ -238,45 +238,75 @@ static ssize_t sl_write(void *data, const void *buf_, size_t size)
|
||||
size_t written = 0;
|
||||
const uint8_t *buf = (const uint8_t*)buf_;
|
||||
|
||||
while (size)
|
||||
if (sl->nonblock)
|
||||
{
|
||||
size_t avail_write;
|
||||
|
||||
if (sl->nonblock)
|
||||
while (size)
|
||||
{
|
||||
size_t avail_write;
|
||||
|
||||
if (sl->buffered_blocks == sl->buf_count)
|
||||
break;
|
||||
|
||||
avail_write = MIN(sl->buf_size - sl->buffer_ptr, size);
|
||||
|
||||
if (avail_write)
|
||||
{
|
||||
memcpy(sl->buffer[sl->buffer_index] + sl->buffer_ptr, buf, avail_write);
|
||||
sl->buffer_ptr += avail_write;
|
||||
buf += avail_write;
|
||||
size -= avail_write;
|
||||
written += avail_write;
|
||||
}
|
||||
|
||||
if (sl->buffer_ptr >= sl->buf_size)
|
||||
{
|
||||
SLresult res = (*sl->buffer_queue)->Enqueue(sl->buffer_queue, sl->buffer[sl->buffer_index], sl->buf_size);
|
||||
sl->buffer_index = (sl->buffer_index + 1) % sl->buf_count;
|
||||
__sync_fetch_and_add(&sl->buffered_blocks, 1);
|
||||
sl->buffer_ptr = 0;
|
||||
|
||||
if (res != SL_RESULT_SUCCESS)
|
||||
{
|
||||
RARCH_ERR("[OpenSL]: Failed to write! (Error: 0x%x)\n", (unsigned)res);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
while (size)
|
||||
{
|
||||
size_t avail_write;
|
||||
|
||||
slock_lock(sl->lock);
|
||||
while (sl->buffered_blocks == sl->buf_count)
|
||||
scond_wait(sl->cond, sl->lock);
|
||||
slock_unlock(sl->lock);
|
||||
}
|
||||
|
||||
avail_write = MIN(sl->buf_size - sl->buffer_ptr, size);
|
||||
avail_write = MIN(sl->buf_size - sl->buffer_ptr, size);
|
||||
|
||||
if (avail_write)
|
||||
{
|
||||
memcpy(sl->buffer[sl->buffer_index] + sl->buffer_ptr, buf, avail_write);
|
||||
sl->buffer_ptr += avail_write;
|
||||
buf += avail_write;
|
||||
size -= avail_write;
|
||||
written += avail_write;
|
||||
}
|
||||
|
||||
if (sl->buffer_ptr >= sl->buf_size)
|
||||
{
|
||||
SLresult res = (*sl->buffer_queue)->Enqueue(sl->buffer_queue, sl->buffer[sl->buffer_index], sl->buf_size);
|
||||
sl->buffer_index = (sl->buffer_index + 1) % sl->buf_count;
|
||||
__sync_fetch_and_add(&sl->buffered_blocks, 1);
|
||||
sl->buffer_ptr = 0;
|
||||
|
||||
if (res != SL_RESULT_SUCCESS)
|
||||
if (avail_write)
|
||||
{
|
||||
RARCH_ERR("[OpenSL]: Failed to write! (Error: 0x%x)\n", (unsigned)res);
|
||||
return -1;
|
||||
memcpy(sl->buffer[sl->buffer_index] + sl->buffer_ptr, buf, avail_write);
|
||||
sl->buffer_ptr += avail_write;
|
||||
buf += avail_write;
|
||||
size -= avail_write;
|
||||
written += avail_write;
|
||||
}
|
||||
|
||||
if (sl->buffer_ptr >= sl->buf_size)
|
||||
{
|
||||
SLresult res = (*sl->buffer_queue)->Enqueue(sl->buffer_queue, sl->buffer[sl->buffer_index], sl->buf_size);
|
||||
sl->buffer_index = (sl->buffer_index + 1) % sl->buf_count;
|
||||
__sync_fetch_and_add(&sl->buffered_blocks, 1);
|
||||
sl->buffer_ptr = 0;
|
||||
|
||||
if (res != SL_RESULT_SUCCESS)
|
||||
{
|
||||
RARCH_ERR("[OpenSL]: Failed to write! (Error: 0x%x)\n", (unsigned)res);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,8 @@
|
||||
|
||||
typedef struct ps2_audio
|
||||
{
|
||||
bool nonblocking;
|
||||
/* TODO/FIXME - nonblock is not implemented */
|
||||
bool nonblock;
|
||||
bool running;
|
||||
|
||||
} ps2_audio_t;
|
||||
@@ -39,11 +40,11 @@ static void audioConfigure(ps2_audio_t *ps2, unsigned rate)
|
||||
int err;
|
||||
struct audsrv_fmt_t format;
|
||||
|
||||
format.bits = AUDIO_BITS;
|
||||
format.freq = rate;
|
||||
format.bits = AUDIO_BITS;
|
||||
format.freq = rate;
|
||||
format.channels = AUDIO_CHANNELS;
|
||||
|
||||
err = audsrv_set_format(&format);
|
||||
err = audsrv_set_format(&format);
|
||||
|
||||
if (err)
|
||||
{
|
||||
@@ -82,15 +83,12 @@ static void ps2_audio_free(void *data)
|
||||
|
||||
static ssize_t ps2_audio_write(void *data, const void *buf, size_t size)
|
||||
{
|
||||
int bytes_sent;
|
||||
ps2_audio_t* ps2 = (ps2_audio_t*)data;
|
||||
|
||||
if (!ps2->running)
|
||||
return -1;
|
||||
|
||||
bytes_sent = audsrv_play_audio(buf, size);
|
||||
|
||||
return bytes_sent;
|
||||
return audsrv_play_audio(buf, size);
|
||||
}
|
||||
|
||||
static bool ps2_audio_alive(void *data)
|
||||
@@ -134,7 +132,7 @@ static void ps2_audio_set_nonblock_state(void *data, bool toggle)
|
||||
ps2_audio_t* ps2 = (ps2_audio_t*)data;
|
||||
|
||||
if (ps2)
|
||||
ps2->nonblocking = toggle;
|
||||
ps2->nonblock = toggle;
|
||||
}
|
||||
|
||||
static bool ps2_audio_use_float(void *data)
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
typedef struct
|
||||
{
|
||||
uint32_t audio_port;
|
||||
bool nonblocking;
|
||||
bool nonblock;
|
||||
bool started;
|
||||
volatile bool quit_thread;
|
||||
fifo_buffer_t *buffer;
|
||||
@@ -150,7 +150,7 @@ static ssize_t ps3_audio_write(void *data, const void *buf, size_t size)
|
||||
{
|
||||
ps3_audio_t *aud = data;
|
||||
|
||||
if (aud->nonblocking)
|
||||
if (aud->nonblock)
|
||||
{
|
||||
if (fifo_write_avail(aud->buffer) < size)
|
||||
return 0;
|
||||
@@ -200,7 +200,7 @@ static void ps3_audio_set_nonblock_state(void *data, bool toggle)
|
||||
{
|
||||
ps3_audio_t *aud = data;
|
||||
if (aud)
|
||||
aud->nonblocking = toggle;
|
||||
aud->nonblock = toggle;
|
||||
}
|
||||
|
||||
static void ps3_audio_free(void *data)
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
typedef struct psp_audio
|
||||
{
|
||||
bool nonblocking;
|
||||
bool nonblock;
|
||||
|
||||
uint32_t* buffer;
|
||||
uint32_t* zeroBuffer;
|
||||
@@ -167,7 +167,7 @@ static void *psp_audio_init(const char *device,
|
||||
psp->cond_lock = slock_new();
|
||||
psp->cond = scond_new();
|
||||
|
||||
psp->nonblocking = false;
|
||||
psp->nonblock = false;
|
||||
psp->running = true;
|
||||
psp->worker_thread = sthread_create(audioMainLoop, psp);
|
||||
|
||||
@@ -202,18 +202,18 @@ static void psp_audio_free(void *data)
|
||||
|
||||
static ssize_t psp_audio_write(void *data, const void *buf, size_t size)
|
||||
{
|
||||
psp_audio_t* psp = (psp_audio_t*)data;
|
||||
psp_audio_t* psp = (psp_audio_t*)data;
|
||||
uint16_t write_pos = psp->write_pos;
|
||||
uint16_t sampleCount = size / sizeof(uint32_t);
|
||||
|
||||
if (!psp->running)
|
||||
return -1;
|
||||
|
||||
if (psp->nonblocking)
|
||||
if (psp->nonblock)
|
||||
{
|
||||
if (AUDIO_BUFFER_SIZE - ((uint16_t)
|
||||
(psp->write_pos - psp->read_pos) & AUDIO_BUFFER_SIZE_MASK) < size)
|
||||
return 0;
|
||||
(psp->write_pos - psp->read_pos) & AUDIO_BUFFER_SIZE_MASK) < size)
|
||||
return 0;
|
||||
}
|
||||
|
||||
slock_lock(psp->cond_lock);
|
||||
@@ -287,7 +287,7 @@ static void psp_audio_set_nonblock_state(void *data, bool toggle)
|
||||
{
|
||||
psp_audio_t* psp = (psp_audio_t*)data;
|
||||
if (psp)
|
||||
psp->nonblocking = toggle;
|
||||
psp->nonblock = toggle;
|
||||
}
|
||||
|
||||
static bool psp_audio_use_float(void *data)
|
||||
|
||||
@@ -165,7 +165,7 @@ static bool rs_stop(void *data)
|
||||
|
||||
static void rs_set_nonblock_state(void *data, bool state)
|
||||
{
|
||||
rsd_t *rsd = (rsd_t*)data;
|
||||
rsd_t *rsd = (rsd_t*)data;
|
||||
rsd->nonblock = state;
|
||||
}
|
||||
|
||||
|
||||
@@ -92,27 +92,25 @@ static ssize_t switch_audio_write(void *data, const void *buf, size_t size)
|
||||
|
||||
if (!swa->current_buffer)
|
||||
{
|
||||
if (swa->blocking)
|
||||
/* no buffer, nonblocking... */
|
||||
if (!swa->blocking)
|
||||
return 0;
|
||||
|
||||
while (!swa->current_buffer)
|
||||
{
|
||||
while(swa->current_buffer == NULL)
|
||||
{
|
||||
uint32_t handle_idx = 0;
|
||||
num = 0;
|
||||
uint32_t handle_idx = 0;
|
||||
num = 0;
|
||||
|
||||
#ifdef HAVE_LIBNX
|
||||
if (audoutWaitPlayFinish(&swa->current_buffer, &num, U64_MAX) != 0) { }
|
||||
if (audoutWaitPlayFinish(&swa->current_buffer, &num, U64_MAX) != 0) { }
|
||||
#else
|
||||
svcWaitSynchronization(&handle_idx, &swa->event, 1, 33333333);
|
||||
svcResetSignal(swa->event);
|
||||
svcWaitSynchronization(&handle_idx, &swa->event, 1, 33333333);
|
||||
svcResetSignal(swa->event);
|
||||
|
||||
if (switch_audio_ipc_output_get_released_buffer(swa, num) != 0)
|
||||
return -1;
|
||||
if (switch_audio_ipc_output_get_released_buffer(swa, num) != 0)
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else
|
||||
/* no buffer, nonblocking... */
|
||||
return 0;
|
||||
}
|
||||
|
||||
swa->current_buffer->data_size = 0;
|
||||
@@ -297,7 +295,7 @@ static void *switch_audio_init(const char *device,
|
||||
swa->buffers[i].data_offset = 0;
|
||||
swa->buffers[i].buffer = memalign(0x1000, switch_audio_buffer_size(NULL));
|
||||
|
||||
if (swa->buffers[i].buffer == NULL)
|
||||
if (!swa->buffers[i].buffer)
|
||||
goto fail_audio_output;
|
||||
|
||||
memset(swa->buffers[i].buffer, 0, switch_audio_buffer_size(NULL));
|
||||
@@ -306,7 +304,7 @@ static void *switch_audio_init(const char *device,
|
||||
swa->buffers[i].unknown = 0;
|
||||
swa->buffers[i].sample_data = alloc_pages(sample_buffer_size, switch_audio_buffer_size(NULL), NULL);
|
||||
|
||||
if (swa->buffers[i].sample_data == NULL)
|
||||
if (!swa->buffers[i].sample_data)
|
||||
goto fail_audio_output;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ typedef Thread compat_thread;
|
||||
typedef CondVar compat_condvar;
|
||||
|
||||
#define compat_thread_create(thread, func, data, stack_size, prio, cpu) \
|
||||
threadCreate(thread, func, data, stack_size, prio, cpu)
|
||||
threadCreate(thread, func, data, NULL, stack_size, prio, cpu)
|
||||
#define compat_thread_start(thread) \
|
||||
threadStart(thread)
|
||||
#define compat_thread_join(thread) \
|
||||
|
||||
@@ -42,7 +42,8 @@ static const AudioRendererConfig audio_renderer_config =
|
||||
.num_mix_buffers = 2,
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
typedef struct
|
||||
{
|
||||
AudioDriver drv;
|
||||
void* mempool;
|
||||
AudioDriverWaveBuf wavebufs[BUFFER_COUNT];
|
||||
@@ -52,10 +53,11 @@ typedef struct {
|
||||
size_t buffer_size;
|
||||
size_t samples;
|
||||
Mutex update_lock;
|
||||
bool nonblocking;
|
||||
bool nonblock;
|
||||
} libnx_audren_t;
|
||||
|
||||
static void *libnx_audren_audio_init(const char *device, unsigned rate, unsigned latency,
|
||||
static void *libnx_audren_audio_init(
|
||||
const char *device, unsigned rate, unsigned latency,
|
||||
unsigned block_frames,
|
||||
unsigned *new_rate)
|
||||
{
|
||||
@@ -79,14 +81,14 @@ static void *libnx_audren_audio_init(const char *device, unsigned rate, unsigned
|
||||
real_latency = MAX(5, latency);
|
||||
RARCH_LOG("[Audio]: real_latency is %u\n", real_latency);
|
||||
|
||||
aud->nonblocking = !block_frames;
|
||||
aud->buffer_size = (real_latency * sample_rate / 1000);
|
||||
aud->samples = (aud->buffer_size / num_channels / sizeof(int16_t));
|
||||
aud->nonblock = !block_frames;
|
||||
aud->buffer_size = (real_latency * sample_rate / 1000);
|
||||
aud->samples = (aud->buffer_size / num_channels / sizeof(int16_t));
|
||||
aud->current_size = 0;
|
||||
*new_rate = sample_rate;
|
||||
*new_rate = sample_rate;
|
||||
|
||||
mempool_size = (aud->buffer_size * BUFFER_COUNT + (AUDREN_MEMPOOL_ALIGNMENT-1)) &~ (AUDREN_MEMPOOL_ALIGNMENT-1);
|
||||
aud->mempool = memalign(AUDREN_MEMPOOL_ALIGNMENT, mempool_size);
|
||||
mempool_size = (aud->buffer_size * BUFFER_COUNT + (AUDREN_MEMPOOL_ALIGNMENT-1)) &~ (AUDREN_MEMPOOL_ALIGNMENT-1);
|
||||
aud->mempool = memalign(AUDREN_MEMPOOL_ALIGNMENT, mempool_size);
|
||||
if (!aud->mempool)
|
||||
{
|
||||
RARCH_ERR("[Audio]: mempool alloc failed\n");
|
||||
@@ -94,14 +96,14 @@ static void *libnx_audren_audio_init(const char *device, unsigned rate, unsigned
|
||||
}
|
||||
|
||||
rc = audrenInitialize(&audio_renderer_config);
|
||||
if(R_FAILED(rc))
|
||||
if (R_FAILED(rc))
|
||||
{
|
||||
RARCH_ERR("[Audio]: audrenInitialize: %x\n", rc);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
rc = audrvCreate(&aud->drv, &audio_renderer_config, num_channels);
|
||||
if(R_FAILED(rc))
|
||||
if (R_FAILED(rc))
|
||||
{
|
||||
RARCH_ERR("[Audio]: audrvCreate: %x\n", rc);
|
||||
goto fail_init;
|
||||
@@ -123,7 +125,7 @@ static void *libnx_audren_audio_init(const char *device, unsigned rate, unsigned
|
||||
audrvDeviceSinkAdd(&aud->drv, AUDREN_DEFAULT_DEVICE_NAME, num_channels, sink_channels);
|
||||
|
||||
rc = audrenStartAudioRenderer();
|
||||
if(R_FAILED(rc))
|
||||
if (R_FAILED(rc))
|
||||
{
|
||||
RARCH_ERR("[Audio]: audrenStartAudioRenderer: %x\n", rc);
|
||||
}
|
||||
@@ -150,9 +152,7 @@ fail:
|
||||
if (aud)
|
||||
{
|
||||
if (aud->mempool)
|
||||
{
|
||||
free(aud->mempool);
|
||||
}
|
||||
|
||||
free(aud);
|
||||
}
|
||||
@@ -176,24 +176,25 @@ static ssize_t libnx_audren_audio_get_free_wavebuf_idx(libnx_audren_t* aud)
|
||||
|
||||
for (i = 0; i < BUFFER_COUNT; i++)
|
||||
{
|
||||
if (aud->wavebufs[i].state == AudioDriverWaveBufState_Free
|
||||
if (
|
||||
aud->wavebufs[i].state == AudioDriverWaveBufState_Free
|
||||
|| aud->wavebufs[i].state == AudioDriverWaveBufState_Done)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
static size_t libnx_audren_audio_append(libnx_audren_t* aud, const void *buf, size_t size)
|
||||
static size_t libnx_audren_audio_append(
|
||||
libnx_audren_t* aud, const void *buf, size_t size)
|
||||
{
|
||||
void *dstbuf = NULL;
|
||||
ssize_t free_idx = -1;
|
||||
|
||||
if(!aud->current_wavebuf)
|
||||
if (!aud->current_wavebuf)
|
||||
{
|
||||
free_idx = libnx_audren_audio_get_free_wavebuf_idx(aud);
|
||||
if(free_idx == -1)
|
||||
if (free_idx == -1)
|
||||
return 0;
|
||||
|
||||
aud->current_wavebuf = &aud->wavebufs[free_idx];
|
||||
@@ -201,18 +202,16 @@ static size_t libnx_audren_audio_append(libnx_audren_t* aud, const void *buf, si
|
||||
aud->current_size = 0;
|
||||
}
|
||||
|
||||
if(size > aud->buffer_size - aud->current_size)
|
||||
{
|
||||
if (size > aud->buffer_size - aud->current_size)
|
||||
size = aud->buffer_size - aud->current_size;
|
||||
}
|
||||
|
||||
void *dstbuf = aud->current_pool_ptr + aud->current_size;
|
||||
dstbuf = aud->current_pool_ptr + aud->current_size;
|
||||
memcpy(dstbuf, buf, size);
|
||||
armDCacheFlush(dstbuf, size);
|
||||
|
||||
aud->current_size += size;
|
||||
|
||||
if(aud->current_size == aud->buffer_size)
|
||||
if (aud->current_size == aud->buffer_size)
|
||||
{
|
||||
audrvVoiceAddWaveBuf(&aud->drv, 0, aud->current_wavebuf);
|
||||
|
||||
@@ -231,24 +230,32 @@ static size_t libnx_audren_audio_append(libnx_audren_t* aud, const void *buf, si
|
||||
return size;
|
||||
}
|
||||
|
||||
static ssize_t libnx_audren_audio_write(void *data, const void *buf, size_t size)
|
||||
static ssize_t libnx_audren_audio_write(void *data,
|
||||
const void *buf, size_t size)
|
||||
{
|
||||
libnx_audren_t *aud = (libnx_audren_t*)data;
|
||||
size_t written = 0;
|
||||
size_t written = 0;
|
||||
|
||||
if (!aud)
|
||||
return -1;
|
||||
|
||||
while(written < size)
|
||||
if (aud->nonblock)
|
||||
{
|
||||
written += libnx_audren_audio_append(aud, buf + written, size - written);
|
||||
if(written != size)
|
||||
while(written < size)
|
||||
{
|
||||
if(aud->nonblocking)
|
||||
{
|
||||
written += libnx_audren_audio_append(
|
||||
aud, buf + written, size - written);
|
||||
if (written != size)
|
||||
break;
|
||||
}
|
||||
else
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while(written < size)
|
||||
{
|
||||
written += libnx_audren_audio_append(
|
||||
aud, buf + written, size - written);
|
||||
if (written != size)
|
||||
{
|
||||
mutexLock(&aud->update_lock);
|
||||
audrvUpdate(&aud->drv);
|
||||
@@ -341,7 +348,7 @@ static void libnx_audren_audio_set_nonblock_state(void *data, bool state)
|
||||
if (!aud)
|
||||
return;
|
||||
|
||||
aud->nonblocking = state;
|
||||
aud->nonblock = state;
|
||||
}
|
||||
|
||||
audio_driver_t audio_switch_libnx_audren = {
|
||||
|
||||
@@ -43,13 +43,14 @@ static const AudioRendererConfig audio_renderer_config =
|
||||
.num_mix_buffers = 2,
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
typedef struct
|
||||
{
|
||||
AudioDriver drv;
|
||||
void* mempool;
|
||||
AudioDriverWaveBuf wavebufs[BUFFER_COUNT];
|
||||
size_t buffer_size;
|
||||
size_t samples;
|
||||
bool nonblocking;
|
||||
bool nonblock;
|
||||
|
||||
fifo_buffer_t* fifo;
|
||||
Mutex fifo_lock;
|
||||
@@ -63,21 +64,21 @@ typedef struct {
|
||||
|
||||
static void thread_job(void* data)
|
||||
{
|
||||
libnx_audren_thread_t *aud = (libnx_audren_thread_t*)data;
|
||||
size_t available = 0;
|
||||
size_t current_size = 0;
|
||||
size_t written_tmp = 0;
|
||||
AudioDriverWaveBuf* current_wavebuf = NULL;
|
||||
void* current_pool_ptr = NULL;
|
||||
void* dstbuf = NULL;
|
||||
unsigned i;
|
||||
libnx_audren_thread_t *aud = (libnx_audren_thread_t*)data;
|
||||
size_t available = 0;
|
||||
size_t current_size = 0;
|
||||
size_t written_tmp = 0;
|
||||
AudioDriverWaveBuf* current_wavebuf = NULL;
|
||||
void* current_pool_ptr = NULL;
|
||||
void* dstbuf = NULL;
|
||||
|
||||
if (!aud)
|
||||
return;
|
||||
|
||||
while(aud->running)
|
||||
while (aud->running)
|
||||
{
|
||||
if(!current_wavebuf)
|
||||
if (!current_wavebuf)
|
||||
{
|
||||
for (i = 0; i < BUFFER_COUNT; i++)
|
||||
{
|
||||
@@ -92,19 +93,17 @@ static void thread_job(void* data)
|
||||
}
|
||||
}
|
||||
|
||||
if(current_wavebuf)
|
||||
if (current_wavebuf)
|
||||
{
|
||||
mutexLock(&aud->fifo_lock);
|
||||
available = aud->paused ? 0 : fifo_read_avail(aud->fifo);
|
||||
written_tmp = MIN(available, aud->buffer_size - current_size);
|
||||
dstbuf = current_pool_ptr + current_size;
|
||||
if(written_tmp > 0)
|
||||
{
|
||||
if (written_tmp > 0)
|
||||
fifo_read(aud->fifo, dstbuf, written_tmp);
|
||||
}
|
||||
mutexUnlock(&aud->fifo_lock);
|
||||
|
||||
if(written_tmp > 0)
|
||||
if (written_tmp > 0)
|
||||
{
|
||||
condvarWakeAll(&aud->fifo_condvar);
|
||||
|
||||
@@ -112,7 +111,7 @@ static void thread_job(void* data)
|
||||
armDCacheFlush(dstbuf, written_tmp);
|
||||
}
|
||||
|
||||
if(current_size == aud->buffer_size)
|
||||
if (current_size == aud->buffer_size)
|
||||
{
|
||||
audrvVoiceAddWaveBuf(&aud->drv, 0, current_wavebuf);
|
||||
|
||||
@@ -157,17 +156,19 @@ static void *libnx_audren_thread_audio_init(const char *device, unsigned rate, u
|
||||
goto fail;
|
||||
}
|
||||
|
||||
real_latency = MAX(latency, 5);
|
||||
real_latency = MAX(latency, 5);
|
||||
RARCH_LOG("[Audio]: real_latency is %u\n", real_latency);
|
||||
|
||||
aud->running = true;
|
||||
aud->paused = false;
|
||||
aud->nonblocking = !block_frames;
|
||||
aud->running = true;
|
||||
aud->paused = false;
|
||||
aud->nonblock = !block_frames;
|
||||
aud->buffer_size = (real_latency * sample_rate / 1000);
|
||||
aud->samples = (aud->buffer_size / num_channels / sizeof(int16_t));
|
||||
aud->samples = (aud->buffer_size / num_channels / sizeof(int16_t));
|
||||
|
||||
mempool_size = (aud->buffer_size * BUFFER_COUNT +
|
||||
(AUDREN_MEMPOOL_ALIGNMENT-1)) &~ (AUDREN_MEMPOOL_ALIGNMENT-1);
|
||||
aud->mempool = memalign(AUDREN_MEMPOOL_ALIGNMENT, mempool_size);
|
||||
|
||||
mempool_size = (aud->buffer_size * BUFFER_COUNT + (AUDREN_MEMPOOL_ALIGNMENT-1)) &~ (AUDREN_MEMPOOL_ALIGNMENT-1);
|
||||
aud->mempool = memalign(AUDREN_MEMPOOL_ALIGNMENT, mempool_size);
|
||||
if (!aud->mempool)
|
||||
{
|
||||
RARCH_ERR("[Audio]: mempool alloc failed\n");
|
||||
@@ -175,43 +176,44 @@ static void *libnx_audren_thread_audio_init(const char *device, unsigned rate, u
|
||||
}
|
||||
|
||||
rc = audrenInitialize(&audio_renderer_config);
|
||||
if(R_FAILED(rc))
|
||||
if (R_FAILED(rc))
|
||||
{
|
||||
RARCH_ERR("[Audio]: audrenInitialize: %x\n", rc);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
rc = audrvCreate(&aud->drv, &audio_renderer_config, num_channels);
|
||||
if(R_FAILED(rc))
|
||||
if (R_FAILED(rc))
|
||||
{
|
||||
RARCH_ERR("[Audio]: audrvCreate: %x\n", rc);
|
||||
goto fail_init;
|
||||
}
|
||||
|
||||
for(i = 0; i < BUFFER_COUNT; i++)
|
||||
for (i = 0; i < BUFFER_COUNT; i++)
|
||||
{
|
||||
aud->wavebufs[i].data_raw = aud->mempool;
|
||||
aud->wavebufs[i].size = mempool_size;
|
||||
aud->wavebufs[i].data_raw = aud->mempool;
|
||||
aud->wavebufs[i].size = mempool_size;
|
||||
aud->wavebufs[i].start_sample_offset = i * aud->samples;
|
||||
aud->wavebufs[i].end_sample_offset = aud->wavebufs[i].start_sample_offset + aud->samples;
|
||||
aud->wavebufs[i].end_sample_offset = aud->wavebufs[i].start_sample_offset + aud->samples;
|
||||
}
|
||||
|
||||
mpid = audrvMemPoolAdd(&aud->drv, aud->mempool, mempool_size);
|
||||
audrvMemPoolAttach(&aud->drv, mpid);
|
||||
|
||||
audrvDeviceSinkAdd(&aud->drv, AUDREN_DEFAULT_DEVICE_NAME, num_channels, sink_channels);
|
||||
audrvDeviceSinkAdd(&aud->drv, AUDREN_DEFAULT_DEVICE_NAME,
|
||||
num_channels, sink_channels);
|
||||
|
||||
rc = audrenStartAudioRenderer();
|
||||
if(R_FAILED(rc))
|
||||
if (R_FAILED(rc))
|
||||
{
|
||||
RARCH_ERR("[Audio]: audrenStartAudioRenderer: %x\n", rc);
|
||||
}
|
||||
|
||||
audrvVoiceInit(&aud->drv, 0, num_channels, PcmFormat_Int16, sample_rate);
|
||||
audrvVoiceSetDestinationMix(&aud->drv, 0, AUDREN_FINAL_MIX_ID);
|
||||
for(i = 0; i < num_channels; i++)
|
||||
for (i = 0; i < num_channels; i++)
|
||||
{
|
||||
for(j = 0; j < num_channels; j++)
|
||||
for (j = 0; j < num_channels; j++)
|
||||
{
|
||||
audrvVoiceSetMixFactor(&aud->drv, 0, i == j ? 1.0f : 0.0f, i, j);
|
||||
}
|
||||
@@ -229,15 +231,17 @@ static void *libnx_audren_thread_audio_init(const char *device, unsigned rate, u
|
||||
mutexInit(&aud->fifo_condlock);
|
||||
|
||||
svcGetThreadPriority(&thread_priority, CUR_THREAD_HANDLE);
|
||||
rc = threadCreate(&aud->thread, &thread_job, (void*)aud, thread_stack_size, thread_priority - 1, thread_preferred_cpu);
|
||||
if(R_FAILED(rc))
|
||||
rc = threadCreate(&aud->thread, &thread_job,
|
||||
(void*)aud, NULL, thread_stack_size,
|
||||
thread_priority - 1, thread_preferred_cpu);
|
||||
if (R_FAILED(rc))
|
||||
{
|
||||
RARCH_ERR("[Audio]: threadCreate: %x\n", rc);
|
||||
goto fail_drv;
|
||||
}
|
||||
|
||||
rc = threadStart(&aud->thread);
|
||||
if(R_FAILED(rc))
|
||||
if (R_FAILED(rc))
|
||||
{
|
||||
RARCH_ERR("[Audio]: threadStart: %x\n", rc);
|
||||
threadClose(&aud->thread);
|
||||
@@ -258,9 +262,7 @@ fail:
|
||||
if (aud)
|
||||
{
|
||||
if (aud->mempool)
|
||||
{
|
||||
free(aud->mempool);
|
||||
}
|
||||
|
||||
free(aud);
|
||||
}
|
||||
@@ -278,7 +280,8 @@ static size_t libnx_audren_thread_audio_buffer_size(void *data)
|
||||
return aud->buffer_size;
|
||||
}
|
||||
|
||||
static ssize_t libnx_audren_thread_audio_write(void *data, const void *buf, size_t size)
|
||||
static ssize_t libnx_audren_thread_audio_write(void *data,
|
||||
const void *buf, size_t size)
|
||||
{
|
||||
libnx_audren_thread_t *aud = (libnx_audren_thread_t*)data;
|
||||
size_t available, written, written_tmp;
|
||||
@@ -286,18 +289,16 @@ static ssize_t libnx_audren_thread_audio_write(void *data, const void *buf, size
|
||||
if (!aud || !aud->running)
|
||||
return -1;
|
||||
|
||||
if(aud->paused)
|
||||
if (aud->paused)
|
||||
return 0;
|
||||
|
||||
if(aud->nonblocking)
|
||||
if (aud->nonblock)
|
||||
{
|
||||
mutexLock(&aud->fifo_lock);
|
||||
available = fifo_write_avail(aud->fifo);
|
||||
written = MIN(available, size);
|
||||
if(written > 0)
|
||||
{
|
||||
if (written > 0)
|
||||
fifo_write(aud->fifo, buf, written);
|
||||
}
|
||||
mutexUnlock(&aud->fifo_lock);
|
||||
}
|
||||
else
|
||||
@@ -307,7 +308,7 @@ static ssize_t libnx_audren_thread_audio_write(void *data, const void *buf, size
|
||||
{
|
||||
mutexLock(&aud->fifo_lock);
|
||||
available = fifo_write_avail(aud->fifo);
|
||||
if(available)
|
||||
if (available)
|
||||
{
|
||||
written_tmp = MIN(size - written, available);
|
||||
fifo_write(aud->fifo, (const char*)buf + written, written_tmp);
|
||||
@@ -419,7 +420,7 @@ static void libnx_audren_thread_audio_set_nonblock_state(void *data, bool state)
|
||||
if (!aud)
|
||||
return;
|
||||
|
||||
aud->nonblocking = state;
|
||||
aud->nonblock = state;
|
||||
}
|
||||
|
||||
audio_driver_t audio_switch_libnx_audren_thread = {
|
||||
|
||||
@@ -53,7 +53,7 @@ typedef struct
|
||||
size_t fifoSize;
|
||||
|
||||
volatile bool running;
|
||||
bool nonblocking;
|
||||
bool nonblock;
|
||||
bool is_paused;
|
||||
|
||||
compat_audio_out_buffer buffers[AUDIO_BUFFER_COUNT];
|
||||
@@ -152,7 +152,7 @@ static void *switch_thread_audio_init(const char *device, unsigned rate, unsigne
|
||||
return NULL;
|
||||
|
||||
swa->running = true;
|
||||
swa->nonblocking = true;
|
||||
swa->nonblock = true;
|
||||
swa->is_paused = true;
|
||||
swa->latency = MAX(latency, 8);
|
||||
|
||||
@@ -217,7 +217,7 @@ static void *switch_thread_audio_init(const char *device, unsigned rate, unsigne
|
||||
swa->buffers[i].data_size = swa->buffers[i].buffer_size;
|
||||
swa->buffers[i].buffer = memalign(0x1000, swa->buffers[i].buffer_size);
|
||||
|
||||
if (swa->buffers[i].buffer == NULL)
|
||||
if (!swa->buffers[i].buffer)
|
||||
goto fail;
|
||||
|
||||
memset(swa->buffers[i].buffer, 0, swa->buffers[i].buffer_size);
|
||||
@@ -228,7 +228,7 @@ static void *switch_thread_audio_init(const char *device, unsigned rate, unsigne
|
||||
swa->buffers[i].data_size = swa->buffers[i].buffer_size;
|
||||
swa->buffers[i].sample_data = alloc_pages(swa->buffers[i].buffer_size, swa->buffers[i].buffer_size, NULL);
|
||||
|
||||
if (swa->buffers[i].sample_data == NULL)
|
||||
if (!swa->buffers[i].sample_data)
|
||||
goto fail_audio_output;
|
||||
|
||||
memset(swa->buffers[i].sample_data, 0, swa->buffers[i].buffer_size);
|
||||
@@ -345,7 +345,7 @@ static ssize_t switch_thread_audio_write(void *data, const void *buf, size_t siz
|
||||
if (!swa || !swa->running)
|
||||
return 0;
|
||||
|
||||
if (swa->nonblocking)
|
||||
if (swa->nonblock)
|
||||
{
|
||||
compat_mutex_lock(&swa->fifoLock);
|
||||
avail = fifo_write_avail(swa->fifo);
|
||||
@@ -397,7 +397,7 @@ static void switch_thread_audio_set_nonblock_state(void *data, bool state)
|
||||
switch_thread_audio_t *swa = (switch_thread_audio_t *)data;
|
||||
|
||||
if (swa)
|
||||
swa->nonblocking = state;
|
||||
swa->nonblock = state;
|
||||
}
|
||||
|
||||
static bool switch_thread_audio_use_float(void *data)
|
||||
|
||||
@@ -808,7 +808,7 @@ static unsigned int pcm_get_channels(const struct pcm *pcm)
|
||||
* */
|
||||
static const struct pcm_config * pcm_get_config(const struct pcm *pcm)
|
||||
{
|
||||
if (pcm == NULL)
|
||||
if (!pcm)
|
||||
return NULL;
|
||||
return &pcm->config;
|
||||
}
|
||||
@@ -929,7 +929,7 @@ static int pcm_set_config(struct pcm *pcm, const struct pcm_config *config)
|
||||
struct snd_pcm_sw_params sparams;
|
||||
struct snd_pcm_hw_params params;
|
||||
|
||||
if (pcm == NULL)
|
||||
if (!pcm)
|
||||
return -EFAULT;
|
||||
|
||||
if (config)
|
||||
@@ -1293,7 +1293,7 @@ static int pcm_get_htimestamp(struct pcm *pcm, unsigned int *avail,
|
||||
*/
|
||||
static int pcm_is_ready(const struct pcm *pcm)
|
||||
{
|
||||
if (pcm != NULL)
|
||||
if (pcm)
|
||||
return pcm->fd >= 0;
|
||||
return 0;
|
||||
}
|
||||
@@ -1582,7 +1582,7 @@ static const struct pcm_mask *pcm_params_get_mask(const struct pcm_params *pcm_p
|
||||
{
|
||||
int p;
|
||||
struct snd_pcm_hw_params *params = (struct snd_pcm_hw_params *)pcm_params;
|
||||
if (params == NULL)
|
||||
if (!params)
|
||||
return NULL;
|
||||
|
||||
p = pcm_param_to_alsa(param);
|
||||
@@ -2185,7 +2185,7 @@ static void * tinyalsa_init(const char *devicestr, unsigned rate,
|
||||
RARCH_LOG("[TINYALSA]: Using card: %u, device: %u.\n", card, device);
|
||||
|
||||
tinyalsa->params = pcm_params_get(card, device, PCM_OUT);
|
||||
if (tinyalsa->params == NULL)
|
||||
if (!tinyalsa->params)
|
||||
{
|
||||
RARCH_ERR("[TINYALSA]: params: Cannot open audio device.\n");
|
||||
goto error;
|
||||
@@ -2224,7 +2224,7 @@ static void * tinyalsa_init(const char *devicestr, unsigned rate,
|
||||
|
||||
tinyalsa->pcm = pcm_open(card, device, PCM_OUT, &config);
|
||||
|
||||
if (tinyalsa->pcm == NULL)
|
||||
if (!tinyalsa->pcm)
|
||||
{
|
||||
RARCH_ERR("[TINYALSA]: Failed to allocate memory for pcm.\n");
|
||||
goto error;
|
||||
|
||||
+109
-64
@@ -29,7 +29,7 @@
|
||||
typedef struct
|
||||
{
|
||||
bool exclusive;
|
||||
bool blocking;
|
||||
bool nonblock;
|
||||
bool running;
|
||||
size_t frame_size; /* 4 or 8 only */
|
||||
size_t engine_buffer_size;
|
||||
@@ -575,7 +575,7 @@ static void *wasapi_init(const char *dev_id, unsigned rate, unsigned latency,
|
||||
if (FAILED(hr))
|
||||
goto error;
|
||||
w->running = true;
|
||||
w->blocking = settings->bools.audio_sync;
|
||||
w->nonblock = !settings->bools.audio_sync;
|
||||
|
||||
return w;
|
||||
|
||||
@@ -596,16 +596,15 @@ static bool wasapi_flush(wasapi_t * w, const void * data, size_t size)
|
||||
{
|
||||
BYTE *dest = NULL;
|
||||
UINT32 frame_count = size / w->frame_size;
|
||||
HRESULT hr = _IAudioRenderClient_GetBuffer(
|
||||
w->renderer, frame_count, &dest);
|
||||
if (FAILED(hr))
|
||||
|
||||
if (FAILED(_IAudioRenderClient_GetBuffer(
|
||||
w->renderer, frame_count, &dest)))
|
||||
return false;
|
||||
|
||||
memcpy(dest, data, size);
|
||||
hr = _IAudioRenderClient_ReleaseBuffer(
|
||||
w->renderer, frame_count,
|
||||
0);
|
||||
if (FAILED(hr))
|
||||
if (FAILED(_IAudioRenderClient_ReleaseBuffer(
|
||||
w->renderer, frame_count,
|
||||
0)))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -615,25 +614,76 @@ static bool wasapi_flush_buffer(wasapi_t * w, size_t size)
|
||||
{
|
||||
BYTE *dest = NULL;
|
||||
UINT32 frame_count = size / w->frame_size;
|
||||
HRESULT hr = _IAudioRenderClient_GetBuffer(
|
||||
w->renderer, frame_count, &dest);
|
||||
if (FAILED(hr))
|
||||
if (FAILED(_IAudioRenderClient_GetBuffer(
|
||||
w->renderer, frame_count, &dest)))
|
||||
return false;
|
||||
|
||||
fifo_read(w->buffer, dest, size);
|
||||
hr = _IAudioRenderClient_ReleaseBuffer(
|
||||
if (FAILED(_IAudioRenderClient_ReleaseBuffer(
|
||||
w->renderer, frame_count,
|
||||
0);
|
||||
if (FAILED(hr))
|
||||
0)))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static ssize_t wasapi_write_sh_buffer(wasapi_t *w, const void * data, size_t size)
|
||||
{
|
||||
ssize_t written = -1;
|
||||
UINT32 padding = 0;
|
||||
size_t write_avail = fifo_write_avail(w->buffer);
|
||||
|
||||
if (!write_avail)
|
||||
{
|
||||
size_t read_avail = 0;
|
||||
if (!(WaitForSingleObject(w->write_event, INFINITE) == WAIT_OBJECT_0))
|
||||
return -1;
|
||||
|
||||
if (FAILED(_IAudioClient_GetCurrentPadding(w->client, &padding)))
|
||||
return -1;
|
||||
|
||||
read_avail = fifo_read_avail(w->buffer);
|
||||
write_avail = w->engine_buffer_size - padding * w->frame_size;
|
||||
written = read_avail < write_avail ? read_avail : write_avail;
|
||||
if (written)
|
||||
if (!wasapi_flush_buffer(w, written))
|
||||
return -1;
|
||||
}
|
||||
|
||||
write_avail = fifo_write_avail(w->buffer);
|
||||
written = size < write_avail ? size : write_avail;
|
||||
if (written)
|
||||
fifo_write(w->buffer, data, written);
|
||||
|
||||
return written;
|
||||
}
|
||||
|
||||
static ssize_t wasapi_write_sh(wasapi_t *w, const void * data, size_t size)
|
||||
{
|
||||
DWORD ir;
|
||||
HRESULT hr;
|
||||
size_t write_avail = 0;
|
||||
ssize_t written = -1;
|
||||
UINT32 padding = 0;
|
||||
|
||||
if (!(WaitForSingleObject(w->write_event, INFINITE) == WAIT_OBJECT_0))
|
||||
return -1;
|
||||
|
||||
if (FAILED(_IAudioClient_GetCurrentPadding(w->client, &padding)))
|
||||
return -1;
|
||||
|
||||
write_avail = w->engine_buffer_size - padding * w->frame_size;
|
||||
if (!write_avail)
|
||||
return 0;
|
||||
|
||||
written = size < write_avail ? size : write_avail;
|
||||
if (written)
|
||||
if (!wasapi_flush(w, data, written))
|
||||
return -1;
|
||||
|
||||
return written;
|
||||
}
|
||||
|
||||
static ssize_t wasapi_write_sh_nonblock(wasapi_t *w, const void * data, size_t size)
|
||||
{
|
||||
size_t write_avail = 0;
|
||||
ssize_t written = -1;
|
||||
UINT32 padding = 0;
|
||||
@@ -644,16 +694,7 @@ static ssize_t wasapi_write_sh(wasapi_t *w, const void * data, size_t size)
|
||||
if (!write_avail)
|
||||
{
|
||||
size_t read_avail = 0;
|
||||
|
||||
if (w->blocking)
|
||||
{
|
||||
ir = WaitForSingleObject(w->write_event, INFINITE);
|
||||
if (!(ir == WAIT_OBJECT_0))
|
||||
return -1;
|
||||
}
|
||||
|
||||
hr = _IAudioClient_GetCurrentPadding(w->client, &padding);
|
||||
if (FAILED(hr))
|
||||
if (FAILED(_IAudioClient_GetCurrentPadding(w->client, &padding)))
|
||||
return -1;
|
||||
|
||||
read_avail = fifo_read_avail(w->buffer);
|
||||
@@ -671,19 +712,10 @@ static ssize_t wasapi_write_sh(wasapi_t *w, const void * data, size_t size)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (w->blocking)
|
||||
{
|
||||
ir = WaitForSingleObject(w->write_event, INFINITE);
|
||||
if (!(ir == WAIT_OBJECT_0))
|
||||
return -1;
|
||||
}
|
||||
|
||||
hr = _IAudioClient_GetCurrentPadding(w->client, &padding);
|
||||
if (FAILED(hr))
|
||||
if (FAILED(_IAudioClient_GetCurrentPadding(w->client, &padding)))
|
||||
return -1;
|
||||
|
||||
write_avail = w->engine_buffer_size - padding * w->frame_size;
|
||||
if (!write_avail)
|
||||
if (!(write_avail = w->engine_buffer_size - padding * w->frame_size))
|
||||
return 0;
|
||||
|
||||
written = size < write_avail ? size : write_avail;
|
||||
@@ -695,21 +727,15 @@ static ssize_t wasapi_write_sh(wasapi_t *w, const void * data, size_t size)
|
||||
return written;
|
||||
}
|
||||
|
||||
static ssize_t wasapi_write_ex(wasapi_t *w, const void * data, size_t size)
|
||||
static ssize_t wasapi_write_ex(wasapi_t *w, const void * data, size_t size, DWORD ms)
|
||||
{
|
||||
ssize_t written = 0;
|
||||
size_t write_avail = fifo_write_avail(w->buffer);
|
||||
|
||||
if (!write_avail)
|
||||
{
|
||||
DWORD ir = WaitForSingleObject(
|
||||
w->write_event, w->blocking ? INFINITE : 0);
|
||||
if (ir != WAIT_OBJECT_0)
|
||||
{
|
||||
if (w->blocking)
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
if (WaitForSingleObject(w->write_event, ms) != WAIT_OBJECT_0)
|
||||
return -1;
|
||||
|
||||
if (!wasapi_flush_buffer(w, w->engine_buffer_size))
|
||||
return -1;
|
||||
@@ -725,26 +751,48 @@ static ssize_t wasapi_write_ex(wasapi_t *w, const void * data, size_t size)
|
||||
|
||||
static ssize_t wasapi_write(void *wh, const void *data, size_t size)
|
||||
{
|
||||
size_t written;
|
||||
wasapi_t *w = (wasapi_t*)wh;
|
||||
size_t written = 0;
|
||||
wasapi_t *w = (wasapi_t*)wh;
|
||||
|
||||
if (w->blocking)
|
||||
if (w->nonblock)
|
||||
{
|
||||
if (w->exclusive)
|
||||
return wasapi_write_ex(w, data, size, 0);
|
||||
return wasapi_write_sh_nonblock(w, data, size);
|
||||
}
|
||||
|
||||
if (w->exclusive)
|
||||
{
|
||||
ssize_t ir;
|
||||
for (written = 0, ir = -1; written < size; written += ir)
|
||||
for (ir = -1; written < size; written += ir)
|
||||
{
|
||||
if (w->exclusive)
|
||||
ir = wasapi_write_ex(w, (char*)data + written, size - written);
|
||||
else
|
||||
ir = wasapi_write_sh(w, (char*)data + written, size - written);
|
||||
ir = wasapi_write_ex(w, (char*)data + written, size - written, INFINITE);
|
||||
if (ir == -1)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else if (w->exclusive)
|
||||
written = wasapi_write_ex(w, data, size);
|
||||
else
|
||||
written = wasapi_write_sh(w, data, size);
|
||||
{
|
||||
ssize_t ir;
|
||||
if (w->buffer)
|
||||
{
|
||||
for (ir = -1; written < size; written += ir)
|
||||
{
|
||||
ir = wasapi_write_sh_buffer(w, (char*)data + written, size - written);
|
||||
if (ir == -1)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (ir = -1; written < size; written += ir)
|
||||
{
|
||||
ir = wasapi_write_sh(w, (char*)data + written, size - written);
|
||||
if (ir == -1)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return written;
|
||||
}
|
||||
@@ -752,8 +800,7 @@ static ssize_t wasapi_write(void *wh, const void *data, size_t size)
|
||||
static bool wasapi_stop(void *wh)
|
||||
{
|
||||
wasapi_t *w = (wasapi_t*)wh;
|
||||
HRESULT hr = _IAudioClient_Stop(w->client);
|
||||
if (FAILED(hr))
|
||||
if (FAILED(_IAudioClient_Stop(w->client)))
|
||||
return !w->running;
|
||||
|
||||
w->running = false;
|
||||
@@ -790,7 +837,7 @@ static void wasapi_set_nonblock_state(void *wh, bool nonblock)
|
||||
|
||||
RARCH_LOG("[WASAPI]: Sync %s.\n", nonblock ? "off" : "on");
|
||||
|
||||
w->blocking = !nonblock;
|
||||
w->nonblock = nonblock;
|
||||
}
|
||||
|
||||
static void wasapi_free(void *wh)
|
||||
@@ -838,15 +885,13 @@ static void wasapi_device_list_free(void *u, void *slp)
|
||||
|
||||
static size_t wasapi_write_avail(void *wh)
|
||||
{
|
||||
HRESULT hr;
|
||||
wasapi_t *w = (wasapi_t*)wh;
|
||||
UINT32 padding = 0;
|
||||
|
||||
if (w->buffer)
|
||||
return fifo_write_avail(w->buffer);
|
||||
|
||||
hr = _IAudioClient_GetCurrentPadding(w->client, &padding);
|
||||
if (FAILED(hr))
|
||||
if (FAILED(_IAudioClient_GetCurrentPadding(w->client, &padding)))
|
||||
return 0;
|
||||
|
||||
return w->engine_buffer_size - padding * w->frame_size;
|
||||
|
||||
+43
-39
@@ -31,7 +31,7 @@ typedef struct
|
||||
AXMVoice* mvoice;
|
||||
uint16_t* buffer_l;
|
||||
uint16_t* buffer_r;
|
||||
bool nonblocking;
|
||||
bool nonblock;
|
||||
|
||||
uint32_t pos;
|
||||
uint32_t written;
|
||||
@@ -56,17 +56,19 @@ typedef struct
|
||||
static volatile ax_audio_t *wiiu_cb_ax = NULL;
|
||||
void wiiu_ax_callback(void)
|
||||
{
|
||||
ax_audio_t *ax = NULL;
|
||||
/*possibly called before unregister */
|
||||
if(wiiu_cb_ax == NULL)
|
||||
if (!wiiu_cb_ax)
|
||||
return;
|
||||
|
||||
ax_audio_t *ax = (ax_audio_t*)wiiu_cb_ax;
|
||||
if(AXIsMultiVoiceRunning(ax->mvoice))
|
||||
ax = (ax_audio_t*)wiiu_cb_ax;
|
||||
|
||||
if (AXIsMultiVoiceRunning(ax->mvoice))
|
||||
{
|
||||
if(OSUninterruptibleSpinLock_Acquire(&ax->spinlock))
|
||||
if (OSUninterruptibleSpinLock_Acquire(&ax->spinlock))
|
||||
{
|
||||
/* Buffer underrun, stop playback to let it fill up */
|
||||
if(ax->written < AX_AUDIO_SAMPLE_MIN)
|
||||
if (ax->written < AX_AUDIO_SAMPLE_MIN)
|
||||
AXSetMultiVoiceState(ax->mvoice, AX_VOICE_STATE_STOPPED);
|
||||
ax->written -= AX_AUDIO_SAMPLE_COUNT;
|
||||
OSUninterruptibleSpinLock_Release(&ax->spinlock);
|
||||
@@ -100,7 +102,7 @@ static void* ax_audio_init(const char* device, unsigned rate, unsigned latency,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ax->buffer_l = MEM1_alloc(AX_AUDIO_SIZE, 0x100);
|
||||
ax->buffer_l = MEM1_alloc(AX_AUDIO_SIZE, 0x100);
|
||||
ax->buffer_r = MEM1_alloc(AX_AUDIO_SIZE, 0x100);
|
||||
memset(ax->buffer_l,0,AX_AUDIO_SIZE);
|
||||
memset(ax->buffer_r,0,AX_AUDIO_SIZE);
|
||||
@@ -166,9 +168,9 @@ static bool ax_audio_stop(void* data)
|
||||
|
||||
static int ax_audio_limit(int in)
|
||||
{
|
||||
if(in < 0)
|
||||
if (in < 0)
|
||||
in += AX_AUDIO_COUNT;
|
||||
else if(in >= AX_AUDIO_COUNT)
|
||||
else if (in >= AX_AUDIO_COUNT)
|
||||
in -= AX_AUDIO_COUNT;
|
||||
return in;
|
||||
}
|
||||
@@ -183,57 +185,58 @@ static bool ax_audio_start(void* data, bool is_shutdown)
|
||||
return true;
|
||||
|
||||
/* Set back to playing on enough buffered data */
|
||||
if(ax->written > AX_AUDIO_SAMPLE_LOAD)
|
||||
if (ax->written > AX_AUDIO_SAMPLE_LOAD)
|
||||
{
|
||||
AXSetMultiVoiceCurrentOffset(ax->mvoice, ax_audio_limit(ax->pos - ax->written));
|
||||
AXSetMultiVoiceState(ax->mvoice, AX_VOICE_STATE_PLAYING);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static ssize_t ax_audio_write(void* data, const void* buf, size_t size)
|
||||
{
|
||||
uint32_t i;
|
||||
size_t countAvail = 0;
|
||||
size_t count_avail = 0;
|
||||
ax_audio_t* ax = (ax_audio_t*)data;
|
||||
const uint16_t* src = buf;
|
||||
size_t count = size >> 2;
|
||||
|
||||
if(!size || (size & 0x3))
|
||||
if (!size || (size & 0x3))
|
||||
return 0;
|
||||
|
||||
if(count > AX_AUDIO_MAX_FREE)
|
||||
if (count > AX_AUDIO_MAX_FREE)
|
||||
count = AX_AUDIO_MAX_FREE;
|
||||
|
||||
countAvail = ((ax->written > AX_AUDIO_MAX_FREE) ? 0 : (AX_AUDIO_MAX_FREE - ax->written));
|
||||
count_avail = ((ax->written > AX_AUDIO_MAX_FREE) ? 0 : (AX_AUDIO_MAX_FREE - ax->written));
|
||||
|
||||
if (ax->nonblocking)
|
||||
if (ax->nonblock)
|
||||
{
|
||||
/* Not enough available for 3ms of data */
|
||||
if(countAvail < AX_AUDIO_SAMPLE_COUNT)
|
||||
if (count_avail < AX_AUDIO_SAMPLE_COUNT)
|
||||
count = 0;
|
||||
}
|
||||
else if(countAvail < count)
|
||||
else if (count_avail < count)
|
||||
{
|
||||
/* Sync, wait for free memory */
|
||||
while(AXIsMultiVoiceRunning(ax->mvoice) && (countAvail < count))
|
||||
while(AXIsMultiVoiceRunning(ax->mvoice) && (count_avail < count))
|
||||
{
|
||||
OSYieldThread(); /* Gives threads with same priority time to run */
|
||||
countAvail = (ax->written > AX_AUDIO_MAX_FREE ? 0 : (AX_AUDIO_MAX_FREE - ax->written));
|
||||
count_avail = (ax->written > AX_AUDIO_MAX_FREE ? 0 : (AX_AUDIO_MAX_FREE - ax->written));
|
||||
}
|
||||
}
|
||||
|
||||
/* Over available space, do as much as possible */
|
||||
if(count > countAvail)
|
||||
count = countAvail;
|
||||
if (count > count_avail)
|
||||
count = count_avail;
|
||||
|
||||
/* make sure we have input size */
|
||||
if(count > 0)
|
||||
if (count > 0)
|
||||
{
|
||||
/* write in new data */
|
||||
size_t startPos = ax->pos;
|
||||
int flushP2needed = 0;
|
||||
int flushP2 = 0;
|
||||
size_t start_pos = ax->pos;
|
||||
int flush_p2_needed = 0;
|
||||
int flush_p2 = 0;
|
||||
|
||||
for (i = 0; i < (count << 1); i += 2)
|
||||
{
|
||||
@@ -242,30 +245,31 @@ static ssize_t ax_audio_write(void* data, const void* buf, size_t size)
|
||||
ax->pos = ax_audio_limit(ax->pos + 1);
|
||||
|
||||
/* wrapped around, make sure to store cache */
|
||||
if(ax->pos == 0)
|
||||
if (ax->pos == 0)
|
||||
{
|
||||
flushP2needed = 1;
|
||||
flushP2 = ((count << 1) - i);
|
||||
DCStoreRangeNoSync(ax->buffer_l+startPos, (AX_AUDIO_COUNT-startPos) << 1);
|
||||
DCStoreRangeNoSync(ax->buffer_r+startPos, (AX_AUDIO_COUNT-startPos) << 1);
|
||||
flush_p2_needed = 1;
|
||||
flush_p2 = ((count << 1) - i);
|
||||
DCStoreRangeNoSync(ax->buffer_l + start_pos,
|
||||
(AX_AUDIO_COUNT - start_pos) << 1);
|
||||
DCStoreRangeNoSync(ax->buffer_r + start_pos, (AX_AUDIO_COUNT - start_pos) << 1);
|
||||
}
|
||||
}
|
||||
|
||||
/* standard cache store case */
|
||||
if(!flushP2needed)
|
||||
if (!flush_p2_needed)
|
||||
{
|
||||
DCStoreRangeNoSync(ax->buffer_l+startPos, count << 1);
|
||||
DCStoreRange(ax->buffer_r+startPos, count << 1);
|
||||
DCStoreRangeNoSync(ax->buffer_l + start_pos, count << 1);
|
||||
DCStoreRange(ax->buffer_r + start_pos, count << 1);
|
||||
}
|
||||
/* store the rest after wrap */
|
||||
else if(flushP2 > 0)
|
||||
else if (flush_p2 > 0)
|
||||
{
|
||||
DCStoreRangeNoSync(ax->buffer_l, flushP2);
|
||||
DCStoreRange(ax->buffer_r, flushP2);
|
||||
DCStoreRangeNoSync(ax->buffer_l, flush_p2);
|
||||
DCStoreRange(ax->buffer_r, flush_p2);
|
||||
}
|
||||
|
||||
/* add in new audio data */
|
||||
if(OSUninterruptibleSpinLock_Acquire(&ax->spinlock))
|
||||
if (OSUninterruptibleSpinLock_Acquire(&ax->spinlock))
|
||||
{
|
||||
ax->written += count;
|
||||
OSUninterruptibleSpinLock_Release(&ax->spinlock);
|
||||
@@ -276,7 +280,7 @@ static ssize_t ax_audio_write(void* data, const void* buf, size_t size)
|
||||
*
|
||||
* checks if it can be started
|
||||
*/
|
||||
if(!AXIsMultiVoiceRunning(ax->mvoice))
|
||||
if (!AXIsMultiVoiceRunning(ax->mvoice))
|
||||
ax_audio_start(ax, false);
|
||||
|
||||
/* return what was actually copied */
|
||||
@@ -294,7 +298,7 @@ static void ax_audio_set_nonblock_state(void* data, bool state)
|
||||
ax_audio_t* ax = (ax_audio_t*)data;
|
||||
|
||||
if (ax)
|
||||
ax->nonblocking = state;
|
||||
ax->nonblock = state;
|
||||
}
|
||||
|
||||
static bool ax_audio_use_float(void* data)
|
||||
|
||||
@@ -869,26 +869,27 @@ static INLINE HRESULT XAudio2Create(_Outptr_ IXAudio2** ppXAudio2,
|
||||
typedef HRESULT(__stdcall *XAudio2CreateWithVersionInfoFunc)(_Outptr_ IXAudio2**, UINT32, XAUDIO2_PROCESSOR, DWORD);
|
||||
typedef HRESULT(__stdcall *XAudio2CreateInfoFunc)(_Outptr_ IXAudio2**, UINT32, XAUDIO2_PROCESSOR);
|
||||
|
||||
static HMODULE s_dllInstance = NULL;
|
||||
static XAudio2CreateWithVersionInfoFunc s_pfnAudio2CreateWithVersion = NULL;
|
||||
static XAudio2CreateWithVersionInfoFunc
|
||||
s_pfnAudio2CreateWithVersion = NULL;
|
||||
static XAudio2CreateInfoFunc s_pfnAudio2Create = NULL;
|
||||
static HMODULE s_dllInstance = NULL;
|
||||
|
||||
if (s_dllInstance == NULL)
|
||||
if (!s_dllInstance)
|
||||
{
|
||||
s_dllInstance = LoadLibraryEx(XAUDIO2_DLL, NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);
|
||||
if (s_dllInstance == NULL)
|
||||
if (!s_dllInstance)
|
||||
return HRESULT_FROM_WIN32(GetLastError());
|
||||
|
||||
s_pfnAudio2CreateWithVersion = (XAudio2CreateWithVersionInfoFunc)(void*)GetProcAddress(s_dllInstance, "XAudio2CreateWithVersionInfo");
|
||||
if (s_pfnAudio2CreateWithVersion == NULL)
|
||||
if (!s_pfnAudio2CreateWithVersion)
|
||||
{
|
||||
s_pfnAudio2Create = (XAudio2CreateInfoFunc)(void*)GetProcAddress(s_dllInstance, "XAudio2Create");
|
||||
if (s_pfnAudio2Create == NULL)
|
||||
if (!s_pfnAudio2Create)
|
||||
return HRESULT_FROM_WIN32(GetLastError());
|
||||
}
|
||||
}
|
||||
|
||||
if (s_pfnAudio2CreateWithVersion != NULL)
|
||||
if (s_pfnAudio2CreateWithVersion)
|
||||
return (*s_pfnAudio2CreateWithVersion)(ppXAudio2, Flags, XAudio2Processor, NTDDI_VERSION);
|
||||
return (*s_pfnAudio2Create)(ppXAudio2, Flags, XAudio2Processor);
|
||||
}
|
||||
|
||||
@@ -66,7 +66,15 @@ static ssize_t xenon360_audio_write(void *data, const void *buf, size_t size)
|
||||
for (i = 0; i < (size >> 2); i++)
|
||||
xa->buffer[i] = bswap_32(in_buf[i]);
|
||||
|
||||
if (!xa->nonblock)
|
||||
if (xa->nonblock)
|
||||
{
|
||||
if (xenon_sound_get_unplayed() < MAX_BUFFER)
|
||||
{
|
||||
xenon_sound_submit(xa->buffer, size);
|
||||
written = size;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while (xenon_sound_get_unplayed() >= MAX_BUFFER)
|
||||
{
|
||||
@@ -78,14 +86,6 @@ static ssize_t xenon360_audio_write(void *data, const void *buf, size_t size)
|
||||
xenon_sound_submit(xa->buffer, size);
|
||||
written = size;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (xenon_sound_get_unplayed() < MAX_BUFFER)
|
||||
{
|
||||
xenon_sound_submit(xa->buffer, size);
|
||||
written = size;
|
||||
}
|
||||
}
|
||||
|
||||
return written;
|
||||
}
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
#include <psp2/kernel/sysmem.h>
|
||||
#include <psp2/kernel/threadmgr.h>
|
||||
|
||||
#define RAM_THRESHOLD 0xA00000 // Memory left to the system for threads and other internal stuffs
|
||||
#define RAM_THRESHOLD 0x1000000 // Memory left to the system for threads and other internal stuffs
|
||||
|
||||
static int _newlib_heap_memblock;
|
||||
static unsigned _newlib_heap_size;
|
||||
int _newlib_heap_memblock;
|
||||
unsigned _newlib_heap_size;
|
||||
char *_newlib_heap_base, *_newlib_heap_end, *_newlib_heap_cur;
|
||||
static char _newlib_sbrk_mutex[32] __attribute__ ((aligned (8)));
|
||||
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2012-2015 - Michael Lelli
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
*
|
||||
* 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 "../../retroarch.h"
|
||||
|
||||
static void *nullcamera_init(const char *device, uint64_t caps,
|
||||
unsigned width, unsigned height)
|
||||
{
|
||||
(void)device;
|
||||
return (void*)-1;
|
||||
}
|
||||
|
||||
static void nullcamera_free(void *data)
|
||||
{
|
||||
(void)data;
|
||||
}
|
||||
|
||||
static bool nullcamera_start(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void nullcamera_stop(void *data)
|
||||
{
|
||||
(void)data;
|
||||
}
|
||||
|
||||
static bool nullcamera_poll(void *data,
|
||||
retro_camera_frame_raw_framebuffer_t frame_raw_cb,
|
||||
retro_camera_frame_opengl_texture_t frame_gl_cb)
|
||||
{
|
||||
(void)data;
|
||||
(void)frame_raw_cb;
|
||||
(void)frame_gl_cb;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
camera_driver_t camera_null = {
|
||||
nullcamera_init,
|
||||
nullcamera_free,
|
||||
nullcamera_start,
|
||||
nullcamera_stop,
|
||||
nullcamera_poll,
|
||||
"null",
|
||||
};
|
||||
+730
-336
File diff suppressed because it is too large.
Load diff
+30
-6
@@ -168,9 +168,30 @@ const uint8_t* rcheevos_patch_address(unsigned address, int console)
|
||||
}
|
||||
else if (console == RC_CONSOLE_PC_ENGINE)
|
||||
{
|
||||
/* RAM. */
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "PCE memory address %X adjusted to %X\n", address, address + 0x1f0000);
|
||||
address += 0x1f0000;
|
||||
if (address < 0x002000)
|
||||
{
|
||||
/* RAM. */
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "PCE memory address %X adjusted to %X\n", address, address + 0x1f0000);
|
||||
address += 0x1f0000;
|
||||
}
|
||||
else if (address < 0x012000)
|
||||
{
|
||||
/* CD-ROM RAM. */
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "PCE memory address %X adjusted to %X\n", address, address + 0x100000 - 0x002000);
|
||||
address += 0x100000 - 0x002000;
|
||||
}
|
||||
else if (address < 0x042000)
|
||||
{
|
||||
/* Super System Card RAM. */
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "PCE memory address %X adjusted to %X\n", address, address + 0x0d0000 - 0x012000);
|
||||
address += 0x0d0000 - 0x012000;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* CD-ROM battery backed RAM. */
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "PCE memory address %X adjusted to %X\n", address, address + 0x1ee000 - 0x042000);
|
||||
address += 0x1ee000 - 0x042000;
|
||||
}
|
||||
}
|
||||
else if (console == RC_CONSOLE_SUPER_NINTENDO)
|
||||
{
|
||||
@@ -215,6 +236,7 @@ const uint8_t* rcheevos_patch_address(unsigned address, int console)
|
||||
else
|
||||
{
|
||||
unsigned i;
|
||||
unsigned addr = address;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
@@ -238,9 +260,10 @@ const uint8_t* rcheevos_patch_address(unsigned address, int console)
|
||||
|
||||
core_get_memory(&meminfo);
|
||||
|
||||
if (address < meminfo.size)
|
||||
if (addr < meminfo.size)
|
||||
{
|
||||
pointer = meminfo.data;
|
||||
address = addr;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -249,14 +272,15 @@ const uint8_t* rcheevos_patch_address(unsigned address, int console)
|
||||
* it's size is not always set correctly in the core.
|
||||
*/
|
||||
if (i == 0 && console == RC_CONSOLE_NINTENDO)
|
||||
address -= 0x6000;
|
||||
addr -= 0x6000;
|
||||
else
|
||||
address -= meminfo.size;
|
||||
addr -= meminfo.size;
|
||||
}
|
||||
}
|
||||
|
||||
if (pointer == NULL)
|
||||
{
|
||||
CHEEVOS_LOG(RCHEEVOS_TAG "address %X not supported\n", address);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -180,6 +180,8 @@ enum event_command
|
||||
CMD_EVENT_DISK_NEXT,
|
||||
/* Cycle to previous disk. */
|
||||
CMD_EVENT_DISK_PREV,
|
||||
/* Switch to specified disk index */
|
||||
CMD_EVENT_DISK_INDEX,
|
||||
/* Appends disk image to disk image list. */
|
||||
CMD_EVENT_DISK_APPEND_IMAGE,
|
||||
/* Stops rumbling. */
|
||||
|
||||
+88
-19
@@ -89,6 +89,8 @@
|
||||
#define DEFAULT_MAX_PADS 4
|
||||
#elif defined(HAVE_XINPUT) && !defined(HAVE_DINPUT)
|
||||
#define DEFAULT_MAX_PADS 4
|
||||
#elif defined(DINGUX)
|
||||
#define DEFAULT_MAX_PADS 2
|
||||
#else
|
||||
#define DEFAULT_MAX_PADS 16
|
||||
#endif
|
||||
@@ -97,7 +99,7 @@
|
||||
#define DEFAULT_MOUSE_SCALE 1
|
||||
#endif
|
||||
|
||||
#if defined(RARCH_MOBILE) || defined(HAVE_LIBNX)
|
||||
#if defined(RARCH_MOBILE) || defined(HAVE_LIBNX) || defined(__WINRT__)
|
||||
#define DEFAULT_POINTER_ENABLE true
|
||||
#else
|
||||
#define DEFAULT_POINTER_ENABLE false
|
||||
@@ -114,9 +116,54 @@
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MATERIALUI
|
||||
/* Show icons to the left of each menu entry */
|
||||
#define DEFAULT_MATERIALUI_ICONS_ENABLE true
|
||||
#endif
|
||||
|
||||
/* Material UI colour theme */
|
||||
#define DEFAULT_MATERIALUI_THEME MATERIALUI_THEME_OZONE_DARK
|
||||
|
||||
/* Type of animation to use when performing menu transitions
|
||||
* > 'Auto' follows Material UI standards:
|
||||
* - Slide when switching between parent menus (tabs)
|
||||
* - Fade when changing levels in a menu
|
||||
* Note: Not wrapping this with a HAVE_MATERIALUI ifdef
|
||||
* because there's too much baggage involved... */
|
||||
#define DEFAULT_MATERIALUI_TRANSITION_ANIM MATERIALUI_TRANSITION_ANIM_AUTO
|
||||
|
||||
/* Adjust menu padding etc. to better fit the
|
||||
* screen when using landscape layouts */
|
||||
#if defined(RARCH_MOBILE)
|
||||
#define DEFAULT_MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION_DISABLED
|
||||
#else
|
||||
#define DEFAULT_MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION_ALWAYS
|
||||
#endif
|
||||
|
||||
/* Reposition navigation bar to make better use
|
||||
* of screen space when using landscape layouts */
|
||||
#define DEFAULT_MATERIALUI_AUTO_ROTATE_NAV_BAR true
|
||||
|
||||
/* Default portrait/landscape playlist view modes
|
||||
* (when thumbnails are enabled) */
|
||||
#define DEFAULT_MATERIALUI_THUMBNAIL_VIEW_PORTRAIT MATERIALUI_THUMBNAIL_VIEW_PORTRAIT_LIST_SMALL
|
||||
#define DEFAULT_MATERIALUI_THUMBNAIL_VIEW_LANDSCAPE MATERIALUI_THUMBNAIL_VIEW_LANDSCAPE_LIST_MEDIUM
|
||||
|
||||
/* Enable second thumbnail when using 'list view'
|
||||
* thumbnail views
|
||||
* Note: Second thumbnail will only be drawn if
|
||||
* display has sufficient horizontal real estate */
|
||||
#if defined(RARCH_MOBILE)
|
||||
#define DEFAULT_MATERIALUI_DUAL_THUMBNAIL_LIST_VIEW_ENABLE false
|
||||
#else
|
||||
#define DEFAULT_MATERIALUI_DUAL_THUMBNAIL_LIST_VIEW_ENABLE true
|
||||
#endif
|
||||
|
||||
/* Draw solid colour 4:3 background when rendering
|
||||
* thumbnails
|
||||
* > Helps to unify menu appearance when viewing
|
||||
* thumbnails of different sizes */
|
||||
#define DEFAULT_MATERIALUI_THUMBNAIL_BACKGROUND_ENABLE true
|
||||
|
||||
#define DEFAULT_CRT_SWITCH_RESOLUTION CRT_SWITCH_NONE
|
||||
|
||||
#define DEFAULT_CRT_SWITCH_RESOLUTION_SUPER 2560
|
||||
@@ -127,6 +174,12 @@
|
||||
|
||||
#define DEFAULT_PLAYLIST_ENTRY_RENAME true
|
||||
|
||||
#define DEFAULT_ACCESSIBILITY_ENABLE false
|
||||
|
||||
#define DEFAULT_ACCESSIBILITY_NARRATOR_SPEECH_SPEED 5
|
||||
|
||||
#define DEFAULT_DRIVER_SWITCH_ENABLE true
|
||||
|
||||
#define DEFAULT_USER_LANGUAGE 0
|
||||
|
||||
#if (defined(_WIN32) && !defined(_XBOX)) || (defined(__linux) && !defined(ANDROID) && !defined(HAVE_LAKKA)) || (defined(__MACH__) && !defined(IOS)) || defined(EMSCRIPTEN)
|
||||
@@ -156,7 +209,13 @@
|
||||
/* Fullscreen */
|
||||
|
||||
/* To start in Fullscreen, or not. */
|
||||
|
||||
#ifdef HAVE_STEAM
|
||||
/* Start in fullscreen mode for Steam build */
|
||||
#define DEFAULT_FULLSCREEN true
|
||||
#else
|
||||
#define DEFAULT_FULLSCREEN false
|
||||
#endif
|
||||
|
||||
/* To use windowed mode or not when going fullscreen. */
|
||||
#define DEFAULT_WINDOWED_FULLSCREEN true
|
||||
@@ -409,11 +468,14 @@ static bool quick_menu_show_save_core_overrides = true;
|
||||
static bool quick_menu_show_save_game_overrides = true;
|
||||
static bool quick_menu_show_save_content_dir_overrides = true;
|
||||
|
||||
#ifdef HAVE_NETWORKING
|
||||
static bool quick_menu_show_download_thumbnails = true;
|
||||
#endif
|
||||
|
||||
static bool kiosk_mode_enable = false;
|
||||
|
||||
static bool menu_horizontal_animation = true;
|
||||
#define DEFAULT_MENU_HORIZONTAL_ANIMATION true
|
||||
|
||||
static bool menu_show_online_updater = true;
|
||||
static bool menu_show_load_core = true;
|
||||
static bool menu_show_load_content = true;
|
||||
@@ -447,6 +509,8 @@ static bool menu_savestate_resume = true;
|
||||
static bool menu_savestate_resume = false;
|
||||
#endif
|
||||
|
||||
#define DEFAULT_MENU_INSERT_DISK_RESUME true
|
||||
|
||||
static bool content_show_settings = true;
|
||||
static bool content_show_favorites = true;
|
||||
#ifdef HAVE_IMAGEVIEWER
|
||||
@@ -460,13 +524,10 @@ static bool content_show_video = true;
|
||||
static bool content_show_netplay = true;
|
||||
#endif
|
||||
static bool content_show_history = true;
|
||||
#ifdef HAVE_LIBRETRODB
|
||||
static bool content_show_add = true;
|
||||
#endif
|
||||
static bool content_show_playlists = true;
|
||||
|
||||
#ifdef HAVE_XMB
|
||||
static unsigned xmb_scale_factor = 100;
|
||||
static unsigned xmb_alpha_factor = 75;
|
||||
static unsigned menu_font_color_red = 255;
|
||||
static unsigned menu_font_color_green = 255;
|
||||
@@ -520,7 +581,8 @@ static bool rgui_extended_ascii = false;
|
||||
#define DEFAULT_BLOCK_CONFIG_READ false
|
||||
#endif
|
||||
|
||||
#define DEFAULT_AUTOMATICALLY_ADD_CONTENT_TO_PLAYLIST true
|
||||
/* TODO/FIXME - this setting is thread-unsafe right now and can corrupt the stack - default to off */
|
||||
#define DEFAULT_AUTOMATICALLY_ADD_CONTENT_TO_PLAYLIST false
|
||||
|
||||
static bool default_game_specific_options = true;
|
||||
static bool default_auto_overrides_enable = true;
|
||||
@@ -536,7 +598,7 @@ static bool default_savefiles_in_content_dir = false;
|
||||
static bool default_systemfiles_in_content_dir = false;
|
||||
static bool default_screenshots_in_content_dir = false;
|
||||
|
||||
#if defined(__CELLOS_LV2__) || defined(_XBOX1) || defined(_XBOX360)
|
||||
#if defined(__CELLOS_LV2__) || defined(_XBOX1) || defined(_XBOX360) || defined(DINGUX)
|
||||
static unsigned menu_toggle_gamepad_combo = INPUT_TOGGLE_L3_R3;
|
||||
#elif defined(PS2) || defined(PSP)
|
||||
static unsigned menu_toggle_gamepad_combo = INPUT_TOGGLE_HOLD_START;
|
||||
@@ -575,7 +637,12 @@ static unsigned input_backtouch_toggle = false;
|
||||
#define DEFAULT_CROP_OVERSCAN true
|
||||
|
||||
/* Font size for on-screen messages. */
|
||||
#if defined(DINGUX)
|
||||
#define DEFAULT_FONT_SIZE 12
|
||||
#else
|
||||
#define DEFAULT_FONT_SIZE 32
|
||||
#endif
|
||||
|
||||
|
||||
/* Offset for where messages will be placed on-screen.
|
||||
* Values are in range [0.0, 1.0]. */
|
||||
@@ -845,14 +912,18 @@ static const bool stdin_cmd_enable = false;
|
||||
|
||||
static const uint16_t network_remote_base_port = 55400;
|
||||
|
||||
#if defined(ANDROID) || defined(IOS)
|
||||
static const bool network_on_demand_thumbnails = true;
|
||||
#else
|
||||
static const bool network_on_demand_thumbnails = false;
|
||||
#endif
|
||||
|
||||
/* Number of entries that will be kept in content history playlist file. */
|
||||
static const unsigned default_content_history_size = 100;
|
||||
static const unsigned default_content_history_size = 200;
|
||||
|
||||
/* Number of entries that will be kept in content favorites playlist file.
|
||||
* -1 == 'unlimited' (99999) */
|
||||
static const int default_content_favorites_size = 100;
|
||||
static const int default_content_favorites_size = 200;
|
||||
|
||||
/* Sort all playlists (apart from histories) alphabetically */
|
||||
static const bool playlist_sort_alphabetical = true;
|
||||
@@ -888,15 +959,9 @@ static const bool playlist_fuzzy_archive_match = false;
|
||||
/* Show Menu start-up screen on boot. */
|
||||
static const bool default_menu_show_start_screen = true;
|
||||
|
||||
#define DEFAULT_MENU_DPI_OVERRIDE_ENABLE false
|
||||
|
||||
#ifdef RARCH_MOBILE
|
||||
#define DEFAULT_MENU_DPI_OVERRIDE_VALUE 72
|
||||
#elif defined(__CELLOS_LV2__)
|
||||
#define DEFAULT_MENU_DPI_OVERRIDE_VALUE 360
|
||||
#else
|
||||
#define DEFAULT_MENU_DPI_OVERRIDE_VALUE 200
|
||||
#endif
|
||||
/* Default scale factor for non-frambuffer-based menu
|
||||
* drivers and menu widgets */
|
||||
#define DEFAULT_MENU_SCALE_FACTOR 1.0f
|
||||
|
||||
/* Log level for the frontend */
|
||||
#define DEFAULT_FRONTEND_LOG_LEVEL 1
|
||||
@@ -925,6 +990,8 @@ static const float analog_sensitivity = 1.0f;
|
||||
/* Describes speed of which turbo-enabled buttons toggle. */
|
||||
static const unsigned turbo_period = 6;
|
||||
static const unsigned turbo_duty_cycle = 3;
|
||||
static const unsigned turbo_mode = 0;
|
||||
static const unsigned turbo_default_btn = RETRO_DEVICE_ID_JOYPAD_B;
|
||||
|
||||
/* Enable input auto-detection. Will attempt to autoconfigure
|
||||
* gamepads, plug-and-play style. */
|
||||
@@ -989,7 +1056,7 @@ static const bool content_runtime_log_aggregate = false;
|
||||
|
||||
#if defined(__QNX__) || defined(_XBOX1) || defined(_XBOX360) || defined(__CELLOS_LV2__) || (defined(__MACH__) && defined(IOS)) || defined(ANDROID) || defined(WIIU) || defined(HAVE_NEON) || defined(GEKKO) || defined(__ARM_NEON__)
|
||||
static enum resampler_quality audio_resampler_quality_level = RESAMPLER_QUALITY_LOWER;
|
||||
#elif defined(PSP) || defined(_3DS) || defined(VITA) || defined(PS2)
|
||||
#elif defined(PSP) || defined(_3DS) || defined(VITA) || defined(PS2) || defined(DINGUX)
|
||||
static enum resampler_quality audio_resampler_quality_level = RESAMPLER_QUALITY_LOWEST;
|
||||
#else
|
||||
static enum resampler_quality audio_resampler_quality_level = RESAMPLER_QUALITY_NORMAL;
|
||||
@@ -1124,6 +1191,8 @@ static char default_discord_app_id[] = "475456035851599874";
|
||||
|
||||
#define DEFAULT_AI_SERVICE_ENABLE true
|
||||
|
||||
#define DEFAULT_AI_SERVICE_PAUSE false
|
||||
|
||||
#define DEFAULT_AI_SERVICE_MODE 1
|
||||
|
||||
#define DEFAULT_AI_SERVICE_URL "http://localhost:4404/"
|
||||
|
||||
@@ -105,6 +105,88 @@ static const struct retro_keybind retro_keybinds_1[] = {
|
||||
{ true, RARCH_RECORDING_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_RECORDING_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_STREAMING_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_STREAMING_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_AI_SERVICE, MENU_ENUM_LABEL_VALUE_INPUT_META_AI_SERVICE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
#elif defined(DINGUX)
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_B, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_B, RETROK_LALT, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_Y, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_Y, RETROK_LSHIFT, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_SELECT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_SELECT, RETROK_ESCAPE, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_START, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_START, RETROK_RETURN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_UP, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_UP, RETROK_UP, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_DOWN, RETROK_DOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_LEFT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_LEFT, RETROK_LEFT, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_RIGHT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_RIGHT, RETROK_RIGHT, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_A, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_A, RETROK_LCTRL, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_X, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_X, RETROK_SPACE, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_L, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L, RETROK_TAB, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_R, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R, RETROK_BACKSPACE, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_L2, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L2, RETROK_PAGEUP, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_R2, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R2, RETROK_PAGEDOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_L3, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L3, RETROK_KP_DIVIDE, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_R3, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R3, RETROK_KP_PERIOD, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
|
||||
{ true, RARCH_ANALOG_LEFT_X_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_X_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_ANALOG_LEFT_X_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_X_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_ANALOG_LEFT_Y_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_Y_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_ANALOG_LEFT_Y_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_Y_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_ANALOG_RIGHT_X_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_X_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_ANALOG_RIGHT_X_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_X_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_ANALOG_RIGHT_Y_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_Y_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_ANALOG_RIGHT_Y_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_Y_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
|
||||
{ true, RARCH_LIGHTGUN_TRIGGER, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_TRIGGER, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_LIGHTGUN_RELOAD, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_RELOAD, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_LIGHTGUN_AUX_A, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_A, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_LIGHTGUN_AUX_B, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_B, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_LIGHTGUN_AUX_C, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_C, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_LIGHTGUN_START, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_START, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_LIGHTGUN_SELECT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_SELECT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_LIGHTGUN_DPAD_UP, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_UP, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_LIGHTGUN_DPAD_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_DOWN, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_LIGHTGUN_DPAD_LEFT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_LEFT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_LIGHTGUN_DPAD_RIGHT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_RIGHT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
|
||||
{ true, RARCH_TURBO_ENABLE, MENU_ENUM_LABEL_VALUE_INPUT_TURBO_ENABLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
|
||||
{ true, RARCH_FAST_FORWARD_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FAST_FORWARD_KEY, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_FAST_FORWARD_HOLD_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FAST_FORWARD_HOLD_KEY, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_SLOWMOTION_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_SLOWMOTION_KEY, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_SLOWMOTION_HOLD_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_SLOWMOTION_KEY, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_LOAD_STATE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_LOAD_STATE_KEY, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_SAVE_STATE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_SAVE_STATE_KEY, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_FULLSCREEN_TOGGLE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FULLSCREEN_TOGGLE_KEY, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_QUIT_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_QUIT_KEY, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_STATE_SLOT_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_META_STATE_SLOT_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_STATE_SLOT_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_META_STATE_SLOT_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_REWIND, MENU_ENUM_LABEL_VALUE_INPUT_META_REWIND, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_BSV_RECORD_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_BSV_RECORD_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_PAUSE_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_PAUSE_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_FRAMEADVANCE, MENU_ENUM_LABEL_VALUE_INPUT_META_FRAMEADVANCE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_RESET, MENU_ENUM_LABEL_VALUE_INPUT_META_RESET, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_SHADER_NEXT, MENU_ENUM_LABEL_VALUE_INPUT_META_SHADER_NEXT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_SHADER_PREV, MENU_ENUM_LABEL_VALUE_INPUT_META_SHADER_PREV, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_CHEAT_INDEX_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_META_CHEAT_INDEX_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_CHEAT_INDEX_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_META_CHEAT_INDEX_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_CHEAT_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_CHEAT_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_SCREENSHOT, MENU_ENUM_LABEL_VALUE_INPUT_META_SCREENSHOT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_MUTE, MENU_ENUM_LABEL_VALUE_INPUT_META_MUTE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_OSK, MENU_ENUM_LABEL_VALUE_INPUT_META_OSK, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_FPS_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_FPS_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_SEND_DEBUG_INFO, MENU_ENUM_LABEL_VALUE_INPUT_META_SEND_DEBUG_INFO, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_NETPLAY_HOST_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_HOST_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_NETPLAY_GAME_WATCH, MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_GAME_WATCH, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_ENABLE_HOTKEY, MENU_ENUM_LABEL_VALUE_INPUT_META_ENABLE_HOTKEY, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_VOLUME_UP, MENU_ENUM_LABEL_VALUE_INPUT_META_VOLUME_UP, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_VOLUME_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_META_VOLUME_DOWN, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_OVERLAY_NEXT, MENU_ENUM_LABEL_VALUE_INPUT_META_OVERLAY_NEXT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_DISK_EJECT_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_EJECT_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_DISK_NEXT, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_NEXT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_DISK_PREV, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_PREV, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_GRAB_MOUSE_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_GRAB_MOUSE_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_GAME_FOCUS_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_GAME_FOCUS_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_UI_COMPANION_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_UI_COMPANION_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_MENU_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_MENU_TOGGLE, RETROK_HOME, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_RECORDING_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_RECORDING_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_STREAMING_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_STREAMING_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RARCH_AI_SERVICE, MENU_ENUM_LABEL_VALUE_INPUT_META_AI_SERVICE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
#else
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_B, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_B, RETROK_z, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_Y, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_Y, RETROK_a, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@
|
||||
#define SUPPORTS_LIBUSB false
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SDL
|
||||
#if defined(HAVE_SDL)
|
||||
#define SUPPORTS_SDL true
|
||||
#else
|
||||
#define SUPPORTS_SDL false
|
||||
|
||||
+48
-33
@@ -144,6 +144,7 @@ enum video_driver_enum
|
||||
VIDEO_XVIDEO,
|
||||
VIDEO_SDL,
|
||||
VIDEO_SDL2,
|
||||
VIDEO_SDL_DINGUX,
|
||||
VIDEO_EXT,
|
||||
VIDEO_WII,
|
||||
VIDEO_WIIU,
|
||||
@@ -319,7 +320,9 @@ enum midi_driver_enum
|
||||
|
||||
#if defined(HAVE_METAL)
|
||||
static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_METAL;
|
||||
#elif defined(HAVE_OPENGL) || defined(HAVE_OPENGLES) || defined(__CELLOS_LV2__)
|
||||
#elif defined(HAVE_VITA2D)
|
||||
static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_VITA2D;
|
||||
#elif (defined(HAVE_OPENGL) || defined(HAVE_OPENGLES) || defined(__CELLOS_LV2__)) && !defined(__WINRT__)
|
||||
static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_GL;
|
||||
#elif defined(HAVE_OPENGL_CORE)
|
||||
static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_GL_CORE;
|
||||
@@ -345,8 +348,6 @@ static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_D3D9;
|
||||
static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_D3D8;
|
||||
#elif defined(HAVE_VG)
|
||||
static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_VG;
|
||||
#elif defined(HAVE_VITA2D)
|
||||
static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_VITA2D;
|
||||
#elif defined(PSP)
|
||||
static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_PSP1;
|
||||
#elif defined(PS2)
|
||||
@@ -357,10 +358,12 @@ static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_CTR;
|
||||
static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_SWITCH;
|
||||
#elif defined(HAVE_XVIDEO)
|
||||
static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_XVIDEO;
|
||||
#elif defined(HAVE_SDL)
|
||||
#elif defined(HAVE_SDL) && !defined(HAVE_SDL_DINGUX)
|
||||
static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_SDL;
|
||||
#elif defined(HAVE_SDL2)
|
||||
static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_SDL2;
|
||||
#elif defined(HAVE_SDL_DINGUX)
|
||||
static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_SDL_DINGUX;
|
||||
#elif defined(_WIN32) && !defined(_XBOX)
|
||||
static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_GDI;
|
||||
#elif defined(DJGPP)
|
||||
@@ -699,7 +702,7 @@ const char *config_get_default_audio(void)
|
||||
return "dsp";
|
||||
case AUDIO_SWITCH:
|
||||
#if defined(HAVE_LIBNX)
|
||||
return "switch_thread";
|
||||
return "switch_audren_thread";
|
||||
#else
|
||||
return "switch";
|
||||
#endif
|
||||
@@ -808,6 +811,8 @@ const char *config_get_default_video(void)
|
||||
return "switch";
|
||||
case VIDEO_XVIDEO:
|
||||
return "xvideo";
|
||||
case VIDEO_SDL_DINGUX:
|
||||
return "sdl_dingux";
|
||||
case VIDEO_SDL:
|
||||
return "sdl";
|
||||
case VIDEO_SDL2:
|
||||
@@ -1330,6 +1335,8 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
|
||||
struct config_bool_setting *tmp = (struct config_bool_setting*)calloc(1, (*size + 1) * sizeof(struct config_bool_setting));
|
||||
unsigned count = 0;
|
||||
|
||||
SETTING_BOOL("accessibility_enable", &settings->bools.accessibility_enable, true, DEFAULT_ACCESSIBILITY_ENABLE, false);
|
||||
SETTING_BOOL("driver_switch_enable", &settings->bools.driver_switch_enable, true, DEFAULT_DRIVER_SWITCH_ENABLE, false);
|
||||
SETTING_BOOL("frame_time_counter_reset_after_fastforwarding", &settings->bools.frame_time_counter_reset_after_fastforwarding, true, false, false);
|
||||
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);
|
||||
@@ -1450,10 +1457,10 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
|
||||
SETTING_BOOL("menu_unified_controls", &settings->bools.menu_unified_controls, true, false, false);
|
||||
SETTING_BOOL("menu_throttle_framerate", &settings->bools.menu_throttle_framerate, true, true, false);
|
||||
SETTING_BOOL("menu_linear_filter", &settings->bools.menu_linear_filter, true, true, false);
|
||||
SETTING_BOOL("menu_horizontal_animation", &settings->bools.menu_horizontal_animation, true, true, false);
|
||||
SETTING_BOOL("dpi_override_enable", &settings->bools.menu_dpi_override_enable, true, DEFAULT_MENU_DPI_OVERRIDE_ENABLE, false);
|
||||
SETTING_BOOL("menu_horizontal_animation", &settings->bools.menu_horizontal_animation, true, DEFAULT_MENU_HORIZONTAL_ANIMATION, false);
|
||||
SETTING_BOOL("menu_pause_libretro", &settings->bools.menu_pause_libretro, true, true, false);
|
||||
SETTING_BOOL("menu_savestate_resume", &settings->bools.menu_savestate_resume, true, menu_savestate_resume, false);
|
||||
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);
|
||||
@@ -1522,9 +1529,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
|
||||
SETTING_BOOL("content_show_netplay", &settings->bools.menu_content_show_netplay, true, content_show_netplay, false);
|
||||
#endif
|
||||
SETTING_BOOL("content_show_history", &settings->bools.menu_content_show_history, true, content_show_history, false);
|
||||
#ifdef HAVE_LIBRETRODB
|
||||
SETTING_BOOL("content_show_add", &settings->bools.menu_content_show_add, true, content_show_add, false);
|
||||
#endif
|
||||
SETTING_BOOL("content_show_playlists", &settings->bools.menu_content_show_playlists, true, content_show_playlists, false);
|
||||
SETTING_BOOL("menu_show_load_core", &settings->bools.menu_show_load_core, true, menu_show_load_core, false);
|
||||
SETTING_BOOL("menu_show_load_content", &settings->bools.menu_show_load_content, true, menu_show_load_content, false);
|
||||
@@ -1556,6 +1561,9 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
|
||||
SETTING_BOOL("menu_show_advanced_settings", &settings->bools.menu_show_advanced_settings, true, DEFAULT_SHOW_ADVANCED_SETTINGS, false);
|
||||
#ifdef HAVE_MATERIALUI
|
||||
SETTING_BOOL("materialui_icons_enable", &settings->bools.menu_materialui_icons_enable, true, DEFAULT_MATERIALUI_ICONS_ENABLE, false);
|
||||
SETTING_BOOL("materialui_auto_rotate_nav_bar", &settings->bools.menu_materialui_auto_rotate_nav_bar, true, DEFAULT_MATERIALUI_AUTO_ROTATE_NAV_BAR, false);
|
||||
SETTING_BOOL("materialui_dual_thumbnail_list_view_enable", &settings->bools.menu_materialui_dual_thumbnail_list_view_enable, true, DEFAULT_MATERIALUI_DUAL_THUMBNAIL_LIST_VIEW_ENABLE, false);
|
||||
SETTING_BOOL("materialui_thumbnail_background_enable", &settings->bools.menu_materialui_thumbnail_background_enable, true, DEFAULT_MATERIALUI_THUMBNAIL_BACKGROUND_ENABLE, false);
|
||||
#endif
|
||||
#ifdef HAVE_RGUI
|
||||
SETTING_BOOL("rgui_background_filler_thickness_enable", &settings->bools.menu_rgui_background_filler_thickness_enable, true, true, false);
|
||||
@@ -1663,6 +1671,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
|
||||
SETTING_OVERRIDE(RARCH_OVERRIDE_SETTING_LOG_TO_FILE);
|
||||
SETTING_BOOL("log_to_file_timestamp", &settings->bools.log_to_file_timestamp, true, DEFAULT_LOG_TO_FILE_TIMESTAMP, false);
|
||||
SETTING_BOOL("ai_service_enable", &settings->bools.ai_service_enable, DEFAULT_AI_SERVICE_ENABLE, false, false);
|
||||
SETTING_BOOL("ai_service_pause", &settings->bools.ai_service_pause, true, DEFAULT_AI_SERVICE_PAUSE, false);
|
||||
|
||||
*size = count;
|
||||
|
||||
@@ -1692,6 +1701,7 @@ static struct config_float_setting *populate_settings_float(settings_t *settings
|
||||
SETTING_FLOAT("input_overlay_scale", &settings->floats.input_overlay_scale, true, 1.0f, false);
|
||||
#endif
|
||||
#ifdef HAVE_MENU
|
||||
SETTING_FLOAT("menu_scale_factor", &settings->floats.menu_scale_factor, true, DEFAULT_MENU_SCALE_FACTOR, false);
|
||||
SETTING_FLOAT("menu_wallpaper_opacity", &settings->floats.menu_wallpaper_opacity, true, menu_wallpaper_opacity, false);
|
||||
SETTING_FLOAT("menu_framebuffer_opacity", &settings->floats.menu_framebuffer_opacity, true, menu_framebuffer_opacity, false);
|
||||
SETTING_FLOAT("menu_footer_opacity", &settings->floats.menu_footer_opacity, true, menu_footer_opacity, false);
|
||||
@@ -1722,6 +1732,7 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings,
|
||||
if (!tmp)
|
||||
return NULL;
|
||||
|
||||
SETTING_UINT("accessibility_narrator_speech_speed", &settings->uints.accessibility_narrator_speech_speed, true, DEFAULT_ACCESSIBILITY_NARRATOR_SPEECH_SPEED, false);
|
||||
#ifdef HAVE_NETWORKING
|
||||
SETTING_UINT("streaming_mode", &settings->uints.streaming_mode, true, STREAMING_MODE_TWITCH, false);
|
||||
#endif
|
||||
@@ -1730,6 +1741,8 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings,
|
||||
SETTING_UINT("input_bind_hold", &settings->uints.input_bind_hold, true, input_bind_hold, false);
|
||||
SETTING_UINT("input_turbo_period", &settings->uints.input_turbo_period, true, turbo_period, false);
|
||||
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("fps_update_interval", &settings->uints.fps_update_interval, true, DEFAULT_FPS_UPDATE_INTERVAL, false);
|
||||
SETTING_UINT("input_menu_toggle_gamepad_combo", &settings->uints.input_menu_toggle_gamepad_combo, true, menu_toggle_gamepad_combo, false);
|
||||
@@ -1769,7 +1782,6 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings,
|
||||
SETTING_UINT("video_overscan_correction_bottom", &settings->uints.video_overscan_correction_bottom, true, DEFAULT_VIDEO_OVERSCAN_CORRECTION_BOTTOM, false);
|
||||
#endif
|
||||
#ifdef HAVE_MENU
|
||||
SETTING_UINT("dpi_override_value", &settings->uints.menu_dpi_override_value, true, DEFAULT_MENU_DPI_OVERRIDE_VALUE, false);
|
||||
SETTING_UINT("menu_thumbnails", &settings->uints.menu_thumbnails, true, menu_thumbnails_default, false);
|
||||
SETTING_UINT("menu_left_thumbnails", &settings->uints.menu_left_thumbnails, true, menu_left_thumbnails_default, false);
|
||||
SETTING_UINT("menu_thumbnail_upscale_threshold", &settings->uints.menu_thumbnail_upscale_threshold, true, menu_thumbnail_upscale_threshold, false);
|
||||
@@ -1799,7 +1811,6 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings,
|
||||
SETTING_UINT("menu_xmb_animation_horizontal_highlight", &settings->uints.menu_xmb_animation_horizontal_highlight, true, 0 /* TODO/FIXME - implement */, false);
|
||||
SETTING_UINT("menu_xmb_animation_move_up_down", &settings->uints.menu_xmb_animation_move_up_down, true, 0 /* TODO/FIXME - implement */, false);
|
||||
SETTING_UINT("xmb_alpha_factor", &settings->uints.menu_xmb_alpha_factor, true, xmb_alpha_factor, false);
|
||||
SETTING_UINT("xmb_scale_factor", &settings->uints.menu_xmb_scale_factor, true, xmb_scale_factor, false);
|
||||
SETTING_UINT("xmb_layout", &settings->uints.menu_xmb_layout, true, xmb_menu_layout, false);
|
||||
SETTING_UINT("xmb_theme", &settings->uints.menu_xmb_theme, true, xmb_icon_theme, false);
|
||||
SETTING_UINT("xmb_menu_color_theme", &settings->uints.menu_xmb_color_theme, true, xmb_theme, false);
|
||||
@@ -1808,7 +1819,11 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings,
|
||||
SETTING_UINT("menu_font_color_blue", &settings->uints.menu_font_color_blue, true, menu_font_color_blue, false);
|
||||
SETTING_UINT("menu_xmb_thumbnail_scale_factor", &settings->uints.menu_xmb_thumbnail_scale_factor, true, xmb_thumbnail_scale_factor, false);
|
||||
#endif
|
||||
SETTING_UINT("materialui_menu_color_theme", &settings->uints.menu_materialui_color_theme, true, MATERIALUI_THEME_BLUE, false);
|
||||
SETTING_UINT("materialui_menu_color_theme", &settings->uints.menu_materialui_color_theme, true, DEFAULT_MATERIALUI_THEME, false);
|
||||
SETTING_UINT("materialui_menu_transition_animation", &settings->uints.menu_materialui_transition_animation, true, DEFAULT_MATERIALUI_TRANSITION_ANIM, false);
|
||||
SETTING_UINT("materialui_thumbnail_view_portrait", &settings->uints.menu_materialui_thumbnail_view_portrait, true, DEFAULT_MATERIALUI_THUMBNAIL_VIEW_PORTRAIT, false);
|
||||
SETTING_UINT("materialui_thumbnail_view_landscape", &settings->uints.menu_materialui_thumbnail_view_landscape, true, DEFAULT_MATERIALUI_THUMBNAIL_VIEW_LANDSCAPE, false);
|
||||
SETTING_UINT("materialui_landscape_layout_optimization", &settings->uints.menu_materialui_landscape_layout_optimization, true, DEFAULT_MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION, false);
|
||||
SETTING_UINT("menu_shader_pipeline", &settings->uints.menu_xmb_shader_pipeline, true, DEFAULT_MENU_SHADER_PIPELINE, false);
|
||||
#ifdef HAVE_OZONE
|
||||
SETTING_UINT("ozone_menu_color_theme", &settings->uints.menu_ozone_color_theme, true, 1, false);
|
||||
@@ -1945,12 +1960,13 @@ static struct config_int_setting *populate_settings_int(settings_t *settings, in
|
||||
*
|
||||
* Set 'default' configuration values.
|
||||
**/
|
||||
void config_set_defaults(void)
|
||||
void config_set_defaults(void *data)
|
||||
{
|
||||
unsigned i, j;
|
||||
#ifdef HAVE_MENU
|
||||
static bool first_initialized = true;
|
||||
#endif
|
||||
global_t *global = (global_t*)data;
|
||||
settings_t *settings = config_get_ptr();
|
||||
int bool_settings_size = sizeof(settings->bools) / sizeof(settings->bools.placeholder);
|
||||
int float_settings_size = sizeof(settings->floats) / sizeof(settings->floats.placeholder);
|
||||
@@ -2125,6 +2141,7 @@ void config_set_defaults(void)
|
||||
settings->bools.ssh_enable = filestream_exists(LAKKA_SSH_PATH);
|
||||
settings->bools.samba_enable = filestream_exists(LAKKA_SAMBA_PATH);
|
||||
settings->bools.bluetooth_enable = filestream_exists(LAKKA_BLUETOOTH_PATH);
|
||||
settings->bools.localap_enable = false;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
@@ -2208,14 +2225,10 @@ void config_set_defaults(void)
|
||||
rarch_ctl(RARCH_CTL_UNSET_BPS_PREF, NULL);
|
||||
rarch_ctl(RARCH_CTL_UNSET_IPS_PREF, NULL);
|
||||
|
||||
if (global)
|
||||
{
|
||||
global_t *global = global_get_ptr();
|
||||
|
||||
if (global)
|
||||
{
|
||||
*global->record.output_dir = '\0';
|
||||
*global->record.config_dir = '\0';
|
||||
}
|
||||
*global->record.output_dir = '\0';
|
||||
*global->record.config_dir = '\0';
|
||||
}
|
||||
|
||||
*settings->paths.path_core_options = '\0';
|
||||
@@ -2681,7 +2694,8 @@ static bool check_menu_driver_compatibility(void)
|
||||
* Loads a config file and reads all the values into memory.
|
||||
*
|
||||
*/
|
||||
static bool config_load_file(const char *path, settings_t *settings)
|
||||
static bool config_load_file(global_t *global,
|
||||
const char *path, settings_t *settings)
|
||||
{
|
||||
unsigned i;
|
||||
size_t path_size = PATH_MAX_LENGTH * sizeof(char);
|
||||
@@ -3107,8 +3121,6 @@ static bool config_load_file(const char *path, settings_t *settings)
|
||||
|
||||
else if (path_is_directory(tmp_str))
|
||||
{
|
||||
global_t *global = global_get_ptr();
|
||||
|
||||
dir_set(RARCH_DIR_SAVEFILE, tmp_str);
|
||||
|
||||
if (global)
|
||||
@@ -3132,8 +3144,6 @@ static bool config_load_file(const char *path, settings_t *settings)
|
||||
dir_set(RARCH_DIR_SAVESTATE, g_defaults.dirs[DEFAULT_DIR_SAVESTATE]);
|
||||
else if (path_is_directory(tmp_str))
|
||||
{
|
||||
global_t *global = global_get_ptr();
|
||||
|
||||
dir_set(RARCH_DIR_SAVESTATE, tmp_str);
|
||||
|
||||
if (global)
|
||||
@@ -3376,7 +3386,8 @@ bool config_load_override(void)
|
||||
retroarch_override_setting_unset(RARCH_OVERRIDE_SETTING_STATE_PATH, NULL);
|
||||
retroarch_override_setting_unset(RARCH_OVERRIDE_SETTING_SAVE_PATH, NULL);
|
||||
|
||||
if (!config_load_file(path_get(RARCH_PATH_CONFIG), config_get_ptr()))
|
||||
if (!config_load_file(global_get_ptr(),
|
||||
path_get(RARCH_PATH_CONFIG), config_get_ptr()))
|
||||
goto error;
|
||||
|
||||
/* Restore the libretro_path we're using
|
||||
@@ -3422,7 +3433,8 @@ bool config_unload_override(void)
|
||||
retroarch_override_setting_unset(RARCH_OVERRIDE_SETTING_STATE_PATH, NULL);
|
||||
retroarch_override_setting_unset(RARCH_OVERRIDE_SETTING_SAVE_PATH, NULL);
|
||||
|
||||
if (!config_load_file(path_get(RARCH_PATH_CONFIG), config_get_ptr()))
|
||||
if (!config_load_file(global_get_ptr(),
|
||||
path_get(RARCH_PATH_CONFIG), config_get_ptr()))
|
||||
return false;
|
||||
|
||||
RARCH_LOG("[Overrides] configuration overrides unloaded, original configuration restored.\n");
|
||||
@@ -3569,8 +3581,9 @@ success:
|
||||
* Loads a config file and reads all the values into memory.
|
||||
*
|
||||
*/
|
||||
void config_parse_file(void)
|
||||
void config_parse_file(void *data)
|
||||
{
|
||||
global_t *global = (global_t*)data;
|
||||
if (path_is_empty(RARCH_PATH_CONFIG))
|
||||
{
|
||||
RARCH_LOG("[config] Loading default config.\n");
|
||||
@@ -3580,7 +3593,7 @@ void config_parse_file(void)
|
||||
const char *config_path = path_get(RARCH_PATH_CONFIG);
|
||||
RARCH_LOG("[config] loading config from: %s.\n", config_path);
|
||||
|
||||
if (!config_load_file(config_path, config_get_ptr()))
|
||||
if (!config_load_file(global, config_path, config_get_ptr()))
|
||||
{
|
||||
RARCH_ERR("[config] couldn't find config at path: \"%s\"\n",
|
||||
config_path);
|
||||
@@ -3594,10 +3607,11 @@ void config_parse_file(void)
|
||||
* Loads a config file and reads all the values into memory.
|
||||
*
|
||||
*/
|
||||
void config_load(void)
|
||||
void config_load(void *data)
|
||||
{
|
||||
config_set_defaults();
|
||||
config_parse_file();
|
||||
global_t *global = (global_t*)data;
|
||||
config_set_defaults(global);
|
||||
config_parse_file(global);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4028,7 +4042,8 @@ bool config_save_overrides(int override_type)
|
||||
conf = config_file_new_alloc();
|
||||
|
||||
/* Load the original config file in memory */
|
||||
config_load_file(path_get(RARCH_PATH_CONFIG), settings);
|
||||
config_load_file(global_get_ptr(),
|
||||
path_get(RARCH_PATH_CONFIG), settings);
|
||||
|
||||
bool_settings = populate_settings_bool(settings, &bool_settings_size);
|
||||
tmp_i = sizeof(settings->bools) / sizeof(settings->bools.placeholder);
|
||||
|
||||
+24
-5
@@ -110,6 +110,9 @@ typedef struct settings
|
||||
bool video_layout_enable;
|
||||
#endif
|
||||
|
||||
/* Accessibility */
|
||||
bool accessibility_enable;
|
||||
|
||||
/* Audio */
|
||||
bool audio_enable;
|
||||
bool audio_enable_menu;
|
||||
@@ -151,6 +154,7 @@ typedef struct settings
|
||||
bool menu_show_start_screen;
|
||||
bool menu_pause_libretro;
|
||||
bool menu_savestate_resume;
|
||||
bool menu_insert_disk_resume;
|
||||
bool menu_timedate_enable;
|
||||
bool menu_battery_level_enable;
|
||||
bool menu_core_enable;
|
||||
@@ -161,7 +165,6 @@ typedef struct settings
|
||||
bool menu_pointer_enable;
|
||||
bool menu_navigation_wraparound_enable;
|
||||
bool menu_navigation_browser_filter_supported_extensions_enable;
|
||||
bool menu_dpi_override_enable;
|
||||
bool menu_show_advanced_settings;
|
||||
bool menu_throttle_framerate;
|
||||
bool menu_linear_filter;
|
||||
@@ -187,6 +190,9 @@ typedef struct settings
|
||||
bool menu_show_video_layout;
|
||||
#endif
|
||||
bool menu_materialui_icons_enable;
|
||||
bool menu_materialui_auto_rotate_nav_bar;
|
||||
bool menu_materialui_dual_thumbnail_list_view_enable;
|
||||
bool menu_materialui_thumbnail_background_enable;
|
||||
bool menu_rgui_background_filler_thickness_enable;
|
||||
bool menu_rgui_border_filler_thickness_enable;
|
||||
bool menu_rgui_border_filler_enable;
|
||||
@@ -304,6 +310,9 @@ typedef struct settings
|
||||
bool bundle_finished;
|
||||
bool bundle_assets_extract_enable;
|
||||
|
||||
/* Driver */
|
||||
bool driver_switch_enable;
|
||||
|
||||
/* Misc. */
|
||||
bool discord_enable;
|
||||
bool threaded_data_runloop_enable;
|
||||
@@ -350,6 +359,7 @@ typedef struct settings
|
||||
bool ssh_enable;
|
||||
bool samba_enable;
|
||||
bool bluetooth_enable;
|
||||
bool localap_enable;
|
||||
|
||||
bool automatically_add_content_to_playlist;
|
||||
bool video_window_show_decorations;
|
||||
@@ -377,6 +387,7 @@ typedef struct settings
|
||||
bool scan_without_core_match;
|
||||
|
||||
bool ai_service_enable;
|
||||
bool ai_service_pause;
|
||||
} bools;
|
||||
|
||||
struct
|
||||
@@ -394,6 +405,7 @@ typedef struct settings
|
||||
float video_msg_color_b;
|
||||
float video_msg_bgcolor_opacity;
|
||||
|
||||
float menu_scale_factor;
|
||||
float menu_wallpaper_opacity;
|
||||
float menu_framebuffer_opacity;
|
||||
float menu_footer_opacity;
|
||||
@@ -453,6 +465,8 @@ typedef struct settings
|
||||
|
||||
unsigned input_turbo_period;
|
||||
unsigned input_turbo_duty_cycle;
|
||||
unsigned input_turbo_mode;
|
||||
unsigned input_turbo_default_button;
|
||||
|
||||
unsigned input_bind_timeout;
|
||||
unsigned input_bind_hold;
|
||||
@@ -510,25 +524,30 @@ typedef struct settings
|
||||
#endif
|
||||
unsigned video_shader_delay;
|
||||
|
||||
/* Accessibility */
|
||||
unsigned accessibility_narrator_speech_speed;
|
||||
|
||||
unsigned menu_timedate_style;
|
||||
unsigned menu_thumbnails;
|
||||
unsigned menu_left_thumbnails;
|
||||
unsigned menu_thumbnail_upscale_threshold;
|
||||
unsigned menu_rgui_thumbnail_downscaler;
|
||||
unsigned menu_rgui_thumbnail_delay;
|
||||
unsigned menu_dpi_override_value;
|
||||
unsigned menu_rgui_color_theme;
|
||||
unsigned menu_xmb_animation_opening_main_menu;
|
||||
unsigned menu_xmb_animation_horizontal_highlight;
|
||||
unsigned menu_xmb_animation_move_up_down;
|
||||
unsigned menu_xmb_layout;
|
||||
unsigned menu_xmb_shader_pipeline;
|
||||
unsigned menu_xmb_scale_factor;
|
||||
unsigned menu_xmb_alpha_factor;
|
||||
unsigned menu_xmb_theme;
|
||||
unsigned menu_xmb_color_theme;
|
||||
unsigned menu_xmb_thumbnail_scale_factor;
|
||||
unsigned menu_materialui_color_theme;
|
||||
unsigned menu_materialui_transition_animation;
|
||||
unsigned menu_materialui_thumbnail_view_portrait;
|
||||
unsigned menu_materialui_thumbnail_view_landscape;
|
||||
unsigned menu_materialui_landscape_layout_optimization;
|
||||
unsigned menu_ozone_color_theme;
|
||||
unsigned menu_font_color_red;
|
||||
unsigned menu_font_color_green;
|
||||
@@ -797,7 +816,7 @@ const char *config_get_default_record(void);
|
||||
* Loads a config file and reads all the values into memory.
|
||||
*
|
||||
*/
|
||||
void config_parse_file(void);
|
||||
void config_parse_file(void *data);
|
||||
|
||||
/**
|
||||
* config_load_override:
|
||||
@@ -866,7 +885,7 @@ bool config_replace(bool config_save_on_exit, char *path);
|
||||
|
||||
bool config_overlay_enable_default(void);
|
||||
|
||||
void config_set_defaults(void);
|
||||
void config_set_defaults(void *data);
|
||||
|
||||
settings_t *config_get_ptr(void);
|
||||
|
||||
|
||||
@@ -0,0 +1,797 @@
|
||||
/* Copyright (C) 2010-2019 The RetroArch team
|
||||
*
|
||||
* ---------------------------------------------------------------------------------------
|
||||
* The following license statement only applies to this file (core_updater_list.c).
|
||||
* ---------------------------------------------------------------------------------------
|
||||
*
|
||||
* Permission is hereby granted, free of charge,
|
||||
* to any person obtaining a copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation the rights to
|
||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <file/file_path.h>
|
||||
#include <string/stdstring.h>
|
||||
#include <lists/string_list.h>
|
||||
#include <net/net_http.h>
|
||||
#include <retro_miscellaneous.h>
|
||||
|
||||
#include "file_path_special.h"
|
||||
#include "core_info.h"
|
||||
|
||||
#include "core_updater_list.h"
|
||||
|
||||
/* Holds all entries in a core updater list */
|
||||
struct core_updater_list
|
||||
{
|
||||
size_t size;
|
||||
size_t capacity;
|
||||
core_updater_list_entry_t *entries;
|
||||
};
|
||||
|
||||
/* Cached ('global') core updater list */
|
||||
static core_updater_list_t *core_list_cached = NULL;
|
||||
|
||||
/**************************************/
|
||||
/* Initialisation / De-Initialisation */
|
||||
/**************************************/
|
||||
|
||||
/* Frees contents of specified core updater
|
||||
* list entry */
|
||||
static void core_updater_list_free_entry(core_updater_list_entry_t *entry)
|
||||
{
|
||||
if (!entry)
|
||||
return;
|
||||
|
||||
if (entry->remote_filename)
|
||||
{
|
||||
free(entry->remote_filename);
|
||||
entry->remote_filename = NULL;
|
||||
}
|
||||
|
||||
if (entry->remote_core_path)
|
||||
{
|
||||
free(entry->remote_core_path);
|
||||
entry->remote_core_path = NULL;
|
||||
}
|
||||
|
||||
if (entry->local_core_path)
|
||||
{
|
||||
free(entry->local_core_path);
|
||||
entry->local_core_path = NULL;
|
||||
}
|
||||
|
||||
if (entry->local_info_path)
|
||||
{
|
||||
free(entry->local_info_path);
|
||||
entry->local_info_path = NULL;
|
||||
}
|
||||
|
||||
if (entry->display_name)
|
||||
{
|
||||
free(entry->display_name);
|
||||
entry->display_name = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* Creates a new, empty core updater list.
|
||||
* Returns a handle to a new core_updater_list_t object
|
||||
* on success, otherwise returns NULL. */
|
||||
core_updater_list_t *core_updater_list_init(size_t max_size)
|
||||
{
|
||||
core_updater_list_t *core_list = NULL;
|
||||
core_updater_list_entry_t *entries = NULL;
|
||||
|
||||
/* Sanity check */
|
||||
if (max_size < 1)
|
||||
return NULL;
|
||||
|
||||
/* Create core updater list */
|
||||
core_list = (core_updater_list_t*)calloc(1, sizeof(*core_list));
|
||||
|
||||
if (!core_list)
|
||||
return NULL;
|
||||
|
||||
/* Create entries array */
|
||||
entries = (core_updater_list_entry_t*)calloc(max_size, sizeof(*entries));
|
||||
|
||||
if (!entries)
|
||||
{
|
||||
free(core_list);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Initial configuration */
|
||||
core_list->size = 0;
|
||||
core_list->capacity = max_size;
|
||||
core_list->entries = entries;
|
||||
|
||||
return core_list;
|
||||
}
|
||||
|
||||
/* Resets (removes all entries of) specified core
|
||||
* updater list */
|
||||
void core_updater_list_reset(core_updater_list_t *core_list)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
if (!core_list)
|
||||
return;
|
||||
|
||||
for (i = 0; i < core_list->size; i++)
|
||||
{
|
||||
core_updater_list_entry_t *entry = &core_list->entries[i];
|
||||
|
||||
if (entry)
|
||||
core_updater_list_free_entry(entry);
|
||||
}
|
||||
|
||||
core_list->size = 0;
|
||||
}
|
||||
|
||||
/* Frees specified core updater list */
|
||||
void core_updater_list_free(core_updater_list_t *core_list)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
if (!core_list)
|
||||
return;
|
||||
|
||||
for (i = 0; i < core_list->size; i++)
|
||||
{
|
||||
core_updater_list_entry_t *entry = &core_list->entries[i];
|
||||
|
||||
if (entry)
|
||||
core_updater_list_free_entry(entry);
|
||||
}
|
||||
|
||||
free(core_list->entries);
|
||||
core_list->entries = NULL;
|
||||
|
||||
free(core_list);
|
||||
}
|
||||
|
||||
/***************/
|
||||
/* Cached List */
|
||||
/***************/
|
||||
|
||||
/* Creates a new, empty cached core updater list
|
||||
* (i.e. 'global' list).
|
||||
* Returns false in the event of an error. */
|
||||
bool core_updater_list_init_cached(size_t max_size)
|
||||
{
|
||||
/* Free any existing cached core updater list */
|
||||
if (core_list_cached)
|
||||
{
|
||||
core_updater_list_free(core_list_cached);
|
||||
core_list_cached = NULL;
|
||||
}
|
||||
|
||||
core_list_cached = core_updater_list_init(max_size);
|
||||
|
||||
if (!core_list_cached)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Fetches cached core updater list */
|
||||
core_updater_list_t *core_updater_list_get_cached(void)
|
||||
{
|
||||
if (core_list_cached)
|
||||
return core_list_cached;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Frees cached core updater list */
|
||||
void core_updater_list_free_cached(void)
|
||||
{
|
||||
core_updater_list_free(core_list_cached);
|
||||
core_list_cached = NULL;
|
||||
}
|
||||
|
||||
/***********/
|
||||
/* Getters */
|
||||
/***********/
|
||||
|
||||
/* Returns number of entries in core updater list */
|
||||
size_t core_updater_list_size(core_updater_list_t *core_list)
|
||||
{
|
||||
if (!core_list)
|
||||
return 0;
|
||||
|
||||
return core_list->size;
|
||||
}
|
||||
|
||||
/* Returns maximum allowed number of entries in core
|
||||
* updater list */
|
||||
size_t core_updater_list_capacity(core_updater_list_t *core_list)
|
||||
{
|
||||
if (!core_list)
|
||||
return 0;
|
||||
|
||||
return core_list->capacity;
|
||||
}
|
||||
|
||||
/* Fetches core updater list entry corresponding
|
||||
* to the specified entry index.
|
||||
* Returns false if index is invalid. */
|
||||
bool core_updater_list_get_index(
|
||||
core_updater_list_t *core_list,
|
||||
size_t idx,
|
||||
const core_updater_list_entry_t **entry)
|
||||
{
|
||||
if (!core_list || !entry)
|
||||
return false;
|
||||
|
||||
if (idx >= core_list->size)
|
||||
return false;
|
||||
|
||||
if (entry)
|
||||
*entry = &core_list->entries[idx];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Fetches core updater list entry corresponding
|
||||
* to the specified remote core filename.
|
||||
* Returns false if core is not found. */
|
||||
bool core_updater_list_get_filename(
|
||||
core_updater_list_t *core_list,
|
||||
const char *remote_filename,
|
||||
const core_updater_list_entry_t **entry)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
if (!core_list || string_is_empty(remote_filename))
|
||||
return false;
|
||||
|
||||
if (core_list->size < 1)
|
||||
return false;
|
||||
|
||||
/* Search for specified filename */
|
||||
for (i = 0; i < core_list->size; i++)
|
||||
{
|
||||
core_updater_list_entry_t *current_entry = &core_list->entries[i];
|
||||
|
||||
if (string_is_empty(current_entry->remote_filename))
|
||||
continue;
|
||||
|
||||
if (string_is_equal(remote_filename, current_entry->remote_filename))
|
||||
{
|
||||
if (entry)
|
||||
*entry = current_entry;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Fetches core updater list entry corresponding
|
||||
* to the specified core.
|
||||
* Returns false if core is not found. */
|
||||
bool core_updater_list_get_core(
|
||||
core_updater_list_t *core_list,
|
||||
const char *local_core_path,
|
||||
const core_updater_list_entry_t **entry)
|
||||
{
|
||||
size_t i;
|
||||
char real_core_path[PATH_MAX_LENGTH];
|
||||
|
||||
real_core_path[0] = '\0';
|
||||
|
||||
if (!core_list || !entry || string_is_empty(local_core_path))
|
||||
return false;
|
||||
|
||||
if (core_list->size < 1)
|
||||
return false;
|
||||
|
||||
/* Resolve absolute pathname of local_core_path */
|
||||
strlcpy(real_core_path, local_core_path, sizeof(real_core_path));
|
||||
path_resolve_realpath(real_core_path, sizeof(real_core_path), true);
|
||||
|
||||
if (string_is_empty(real_core_path))
|
||||
return false;
|
||||
|
||||
/* Search for specified core */
|
||||
for (i = 0; i < core_list->size; i++)
|
||||
{
|
||||
core_updater_list_entry_t *current_entry = &core_list->entries[i];
|
||||
|
||||
if (string_is_empty(current_entry->local_core_path))
|
||||
continue;
|
||||
|
||||
#ifdef _WIN32
|
||||
/* Handle case-insensitive operating systems*/
|
||||
if (string_is_equal_noncase(real_core_path, current_entry->local_core_path))
|
||||
{
|
||||
#else
|
||||
if (string_is_equal(real_core_path, current_entry->local_core_path))
|
||||
{
|
||||
#endif
|
||||
if (entry)
|
||||
*entry = current_entry;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/***********/
|
||||
/* Setters */
|
||||
/***********/
|
||||
|
||||
/* Parses date string and adds contents to
|
||||
* specified core updater list entry */
|
||||
static bool core_updater_list_set_date(
|
||||
core_updater_list_entry_t *entry, const char *date_str)
|
||||
{
|
||||
struct string_list *date_list = NULL;
|
||||
|
||||
if (!entry || string_is_empty(date_str))
|
||||
goto error;
|
||||
|
||||
/* Split date string into component values */
|
||||
date_list = string_split(date_str, "-");
|
||||
|
||||
if (!date_list)
|
||||
goto error;
|
||||
|
||||
/* Date string must have 3 values:
|
||||
* [year] [month] [day] */
|
||||
if (date_list->size < 3)
|
||||
goto error;
|
||||
|
||||
/* Convert date string values */
|
||||
entry->date.year = string_to_unsigned(date_list->elems[0].data);
|
||||
entry->date.month = string_to_unsigned(date_list->elems[1].data);
|
||||
entry->date.day = string_to_unsigned(date_list->elems[2].data);
|
||||
|
||||
/* Clean up */
|
||||
string_list_free(date_list);
|
||||
|
||||
return true;
|
||||
|
||||
error:
|
||||
|
||||
if (date_list)
|
||||
string_list_free(date_list);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Parses crc string and adds value to
|
||||
* specified core updater list entry */
|
||||
static bool core_updater_list_set_crc(
|
||||
core_updater_list_entry_t *entry, const char *crc_str)
|
||||
{
|
||||
uint32_t crc;
|
||||
|
||||
if (!entry || string_is_empty(crc_str))
|
||||
return false;
|
||||
|
||||
crc = (uint32_t)string_hex_to_unsigned(crc_str);
|
||||
|
||||
if (crc == 0)
|
||||
return false;
|
||||
|
||||
entry->crc = crc;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Parses core filename string and adds all
|
||||
* associated paths to the specified core
|
||||
* updater list entry */
|
||||
static bool core_updater_list_set_paths(
|
||||
core_updater_list_entry_t *entry,
|
||||
const char *path_dir_libretro,
|
||||
const char *path_libretro_info,
|
||||
const char *network_buildbot_url,
|
||||
const char *filename_str)
|
||||
{
|
||||
char *last_underscore = NULL;
|
||||
char *tmp_url = NULL;
|
||||
char remote_core_path[PATH_MAX_LENGTH];
|
||||
char local_core_path[PATH_MAX_LENGTH];
|
||||
char local_info_path[PATH_MAX_LENGTH];
|
||||
char display_name[255];
|
||||
bool is_archive;
|
||||
|
||||
remote_core_path[0] = '\0';
|
||||
local_core_path[0] = '\0';
|
||||
local_info_path[0] = '\0';
|
||||
display_name[0] = '\0';
|
||||
|
||||
if (!entry || string_is_empty(filename_str))
|
||||
return false;
|
||||
|
||||
if (string_is_empty(path_dir_libretro) ||
|
||||
string_is_empty(path_libretro_info) ||
|
||||
string_is_empty(network_buildbot_url))
|
||||
return false;
|
||||
|
||||
/* Check whether remote file is an archive */
|
||||
is_archive = path_is_compressed_file(filename_str);
|
||||
|
||||
/* remote_filename */
|
||||
if (entry->remote_filename)
|
||||
{
|
||||
free(entry->remote_filename);
|
||||
entry->remote_filename = NULL;
|
||||
}
|
||||
|
||||
entry->remote_filename = strdup(filename_str);
|
||||
|
||||
/* remote_core_path */
|
||||
fill_pathname_join(
|
||||
remote_core_path,
|
||||
network_buildbot_url,
|
||||
filename_str,
|
||||
sizeof(remote_core_path));
|
||||
|
||||
/* > Apply proper URL encoding (messy...) */
|
||||
tmp_url = strdup(remote_core_path);
|
||||
remote_core_path[0] = '\0';
|
||||
net_http_urlencode_full(
|
||||
remote_core_path, tmp_url, sizeof(remote_core_path));
|
||||
if (tmp_url)
|
||||
free(tmp_url);
|
||||
|
||||
if (entry->remote_core_path)
|
||||
{
|
||||
free(entry->remote_core_path);
|
||||
entry->remote_core_path = NULL;
|
||||
}
|
||||
|
||||
entry->remote_core_path = strdup(remote_core_path);
|
||||
|
||||
/* local_core_path */
|
||||
fill_pathname_join(
|
||||
local_core_path,
|
||||
path_dir_libretro,
|
||||
filename_str,
|
||||
sizeof(local_core_path));
|
||||
|
||||
if (is_archive)
|
||||
path_remove_extension(local_core_path);
|
||||
|
||||
path_resolve_realpath(local_core_path, sizeof(local_core_path), true);
|
||||
|
||||
if (entry->local_core_path)
|
||||
{
|
||||
free(entry->local_core_path);
|
||||
entry->local_core_path = NULL;
|
||||
}
|
||||
|
||||
entry->local_core_path = strdup(local_core_path);
|
||||
|
||||
/* local_info_path */
|
||||
fill_pathname_join_noext(
|
||||
local_info_path,
|
||||
path_libretro_info,
|
||||
filename_str,
|
||||
sizeof(local_info_path));
|
||||
|
||||
if (is_archive)
|
||||
path_remove_extension(local_info_path);
|
||||
|
||||
/* > Remove any non-standard core filename
|
||||
* additions (i.e. info files end with
|
||||
* '_libretro' but core files may have
|
||||
* a platform specific addendum,
|
||||
* e.g. '_android')*/
|
||||
last_underscore = (char*)strrchr(local_info_path, '_');
|
||||
|
||||
if (!string_is_empty(last_underscore))
|
||||
{
|
||||
if (string_is_not_equal_fast(last_underscore, "_libretro", 9))
|
||||
*last_underscore = '\0';
|
||||
}
|
||||
|
||||
/* > Add proper file extension */
|
||||
strlcat(
|
||||
local_info_path,
|
||||
file_path_str(FILE_PATH_CORE_INFO_EXTENSION),
|
||||
sizeof(local_info_path));
|
||||
|
||||
if (entry->local_info_path)
|
||||
{
|
||||
free(entry->local_info_path);
|
||||
entry->local_info_path = NULL;
|
||||
}
|
||||
|
||||
entry->local_info_path = strdup(local_info_path);
|
||||
|
||||
/* display_name
|
||||
* > Note: It's a bit rubbish that we have to
|
||||
* read the actual core info files here...
|
||||
* Would be better to cache this globally
|
||||
* (at present, we only cache info for
|
||||
* *installed* cores...) */
|
||||
if (path_is_valid(local_info_path))
|
||||
if (!core_info_get_display_name(
|
||||
local_info_path, display_name, sizeof(display_name)))
|
||||
display_name[0] = '\0';
|
||||
|
||||
/* > If info file does not exist, just use
|
||||
* core filename */
|
||||
if (string_is_empty(display_name))
|
||||
strlcpy(display_name, filename_str, sizeof(display_name));
|
||||
|
||||
if (entry->display_name)
|
||||
{
|
||||
free(entry->display_name);
|
||||
entry->display_name = NULL;
|
||||
}
|
||||
|
||||
entry->display_name = strdup(display_name);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Adds entry to the end of the specified core
|
||||
* updater list
|
||||
* NOTE: Entry string values are passed by
|
||||
* reference - *do not free the entry passed
|
||||
* to this function* */
|
||||
static bool core_updater_list_push_entry(
|
||||
core_updater_list_t *core_list, core_updater_list_entry_t *entry)
|
||||
{
|
||||
core_updater_list_entry_t *list_entry = NULL;
|
||||
|
||||
if (!core_list || !entry)
|
||||
return false;
|
||||
|
||||
/* Ensure there is enough space for the new entry */
|
||||
if (core_list->capacity <= core_list->size)
|
||||
return false;
|
||||
|
||||
/* Get handle of new entry inside list */
|
||||
list_entry = &core_list->entries[core_list->size];
|
||||
|
||||
if (!list_entry)
|
||||
return false;
|
||||
|
||||
/* Ensure list entry is empty */
|
||||
core_updater_list_free_entry(list_entry);
|
||||
|
||||
/* Assign paths */
|
||||
list_entry->remote_filename = entry->remote_filename;
|
||||
list_entry->remote_core_path = entry->remote_core_path;
|
||||
list_entry->local_core_path = entry->local_core_path;
|
||||
list_entry->local_info_path = entry->local_info_path;
|
||||
list_entry->display_name = entry->display_name;
|
||||
|
||||
/* Copy crc */
|
||||
list_entry->crc = entry->crc;
|
||||
|
||||
/* Copy date */
|
||||
memcpy(&list_entry->date, &entry->date, sizeof(core_updater_list_date_t));
|
||||
|
||||
/* Increment list size */
|
||||
core_list->size++;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Parses the contents of a single buildbot
|
||||
* core listing and adds it to the specified
|
||||
* core updater list */
|
||||
static void core_updater_list_add_entry(
|
||||
core_updater_list_t *core_list,
|
||||
const char *path_dir_libretro,
|
||||
const char *path_libretro_info,
|
||||
const char *network_buildbot_url,
|
||||
struct string_list *network_core_entry_list)
|
||||
{
|
||||
const char *date_str = NULL;
|
||||
const char *crc_str = NULL;
|
||||
const char *filename_str = NULL;
|
||||
core_updater_list_entry_t entry = {0};
|
||||
|
||||
if (!core_list || !network_core_entry_list)
|
||||
goto error;
|
||||
|
||||
/* > Listings must have 3 entries:
|
||||
* [date] [crc] [filename] */
|
||||
if (network_core_entry_list->size < 3)
|
||||
goto error;
|
||||
|
||||
/* Get handles of the individual listing strings */
|
||||
date_str = network_core_entry_list->elems[0].data;
|
||||
crc_str = network_core_entry_list->elems[1].data;
|
||||
filename_str = network_core_entry_list->elems[2].data;
|
||||
|
||||
if (string_is_empty(date_str) ||
|
||||
string_is_empty(crc_str) ||
|
||||
string_is_empty(filename_str))
|
||||
goto error;
|
||||
|
||||
/* Check whether core file is already included
|
||||
* in the list (this is *not* an error condition,
|
||||
* it just means we can skip the current listing) */
|
||||
if (core_updater_list_get_filename(core_list, filename_str, NULL))
|
||||
goto error;
|
||||
|
||||
/* Parse individual listing strings */
|
||||
if (!core_updater_list_set_date(&entry, date_str))
|
||||
goto error;
|
||||
|
||||
if (!core_updater_list_set_crc(&entry, crc_str))
|
||||
goto error;
|
||||
|
||||
if (!core_updater_list_set_paths(
|
||||
&entry,
|
||||
path_dir_libretro,
|
||||
path_libretro_info,
|
||||
network_buildbot_url,
|
||||
filename_str))
|
||||
goto error;
|
||||
|
||||
/* Add entry to list */
|
||||
if (!core_updater_list_push_entry(core_list, &entry))
|
||||
goto error;
|
||||
|
||||
return;
|
||||
|
||||
error:
|
||||
/* This is not a *fatal* error - it just
|
||||
* means one of the following:
|
||||
* - The current line of entry text received
|
||||
* from the buildbot is broken somehow
|
||||
* (could be the case that the network buffer
|
||||
* wasn't large enough to cache the entire
|
||||
* string, so the last line was truncated)
|
||||
* - The core updater list struct is at capacity
|
||||
* In either case, the current entry is discarded
|
||||
* and we move on to the next one
|
||||
* (network transfers are fishy business, so we
|
||||
* choose to ignore this sort of error - don't
|
||||
* want the whole fetch to fail because of a
|
||||
* trivial glitch...) */
|
||||
core_updater_list_free_entry(&entry);
|
||||
}
|
||||
|
||||
/* Core updater list qsort helper function */
|
||||
static int core_updater_list_qsort_func(
|
||||
const core_updater_list_entry_t *a, const core_updater_list_entry_t *b)
|
||||
{
|
||||
if (!a || !b)
|
||||
return 0;
|
||||
|
||||
if (string_is_empty(a->display_name) || string_is_empty(b->display_name))
|
||||
return 0;
|
||||
|
||||
return strcasecmp(a->display_name, b->display_name);
|
||||
}
|
||||
|
||||
/* Sorts core updater list into alphabetical order */
|
||||
static void core_updater_list_qsort(core_updater_list_t *core_list)
|
||||
{
|
||||
if (!core_list)
|
||||
return;
|
||||
|
||||
if (core_list->size < 2)
|
||||
return;
|
||||
|
||||
qsort(
|
||||
core_list->entries,
|
||||
core_list->size,
|
||||
sizeof(core_updater_list_entry_t),
|
||||
(int (*)(const void *, const void *))
|
||||
core_updater_list_qsort_func);
|
||||
}
|
||||
|
||||
/* Reads the contents of a buildbot core list
|
||||
* network request into the specified
|
||||
* core_updater_list_t object.
|
||||
* Returns false in the event of an error. */
|
||||
bool core_updater_list_parse_network_data(
|
||||
core_updater_list_t *core_list,
|
||||
const char *path_dir_libretro,
|
||||
const char *path_libretro_info,
|
||||
const char *network_buildbot_url,
|
||||
const char *data, size_t len)
|
||||
{
|
||||
struct string_list *network_core_list = NULL;
|
||||
struct string_list *network_core_entry_list = NULL;
|
||||
char *data_buf = NULL;
|
||||
size_t i;
|
||||
|
||||
/* Sanity check */
|
||||
if (!core_list || string_is_empty(data) || (len < 1))
|
||||
goto error;
|
||||
|
||||
/* We're populating a list 'from scratch' - remove
|
||||
* any existing entries */
|
||||
core_updater_list_reset(core_list);
|
||||
|
||||
/* Input data string is not terminated - have
|
||||
* to copy it to a temporary buffer... */
|
||||
data_buf = (char*)malloc((len + 1) * sizeof(char));
|
||||
|
||||
if (!data_buf)
|
||||
goto error;
|
||||
|
||||
memcpy(data_buf, data, len * sizeof(char));
|
||||
data_buf[len] = '\0';
|
||||
|
||||
/* Split network listing request into lines */
|
||||
network_core_list = string_split(data_buf, "\n");
|
||||
|
||||
if (!network_core_list)
|
||||
goto error;
|
||||
|
||||
if (network_core_list->size < 1)
|
||||
goto error;
|
||||
|
||||
/* Temporary data buffer is no longer required */
|
||||
free(data_buf);
|
||||
data_buf = NULL;
|
||||
|
||||
/* Loop over lines */
|
||||
for (i = 0; i < network_core_list->size; i++)
|
||||
{
|
||||
const char *line = network_core_list->elems[i].data;
|
||||
|
||||
if (string_is_empty(line))
|
||||
continue;
|
||||
|
||||
/* Split line into listings info components */
|
||||
network_core_entry_list = string_split(line, " ");
|
||||
|
||||
/* Parse listings info and add to core updater
|
||||
* list */
|
||||
core_updater_list_add_entry(
|
||||
core_list,
|
||||
path_dir_libretro,
|
||||
path_libretro_info,
|
||||
network_buildbot_url,
|
||||
network_core_entry_list);
|
||||
|
||||
/* Clean up */
|
||||
string_list_free(network_core_entry_list);
|
||||
network_core_entry_list = NULL;
|
||||
}
|
||||
|
||||
/* Sanity check */
|
||||
if (core_list->size < 1)
|
||||
goto error;
|
||||
|
||||
/* Clean up */
|
||||
string_list_free(network_core_list);
|
||||
|
||||
/* Sort completed list */
|
||||
core_updater_list_qsort(core_list);
|
||||
|
||||
return true;
|
||||
|
||||
error:
|
||||
|
||||
if (network_core_list)
|
||||
string_list_free(network_core_list);
|
||||
|
||||
if (network_core_entry_list)
|
||||
string_list_free(network_core_entry_list);
|
||||
|
||||
if (data_buf)
|
||||
free(data_buf);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -0,0 +1,147 @@
|
||||
/* Copyright (C) 2010-2019 The RetroArch team
|
||||
*
|
||||
* ---------------------------------------------------------------------------------------
|
||||
* The following license statement only applies to this file (core_updater_list.h).
|
||||
* ---------------------------------------------------------------------------------------
|
||||
*
|
||||
* Permission is hereby granted, free of charge,
|
||||
* to any person obtaining a copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation the rights to
|
||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef __CORE_UPDATER_LIST_H
|
||||
#define __CORE_UPDATER_LIST_H
|
||||
|
||||
#include <retro_common_api.h>
|
||||
#include <libretro.h>
|
||||
|
||||
#include <boolean.h>
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
/* Default maximum number of entries in
|
||||
* a core updater list */
|
||||
#define CORE_UPDATER_LIST_SIZE 9999
|
||||
|
||||
/* Holds all date info for a core file
|
||||
* on the buildbot */
|
||||
typedef struct
|
||||
{
|
||||
unsigned year;
|
||||
unsigned month;
|
||||
unsigned day;
|
||||
} core_updater_list_date_t;
|
||||
|
||||
/* Holds all info related to a core
|
||||
* file on the buildbot */
|
||||
typedef struct
|
||||
{
|
||||
char *remote_filename;
|
||||
char *remote_core_path;
|
||||
char *local_core_path;
|
||||
char *local_info_path;
|
||||
char *display_name;
|
||||
uint32_t crc;
|
||||
core_updater_list_date_t date;
|
||||
} core_updater_list_entry_t;
|
||||
|
||||
/* Prevent direct access to core_updater_list_t
|
||||
* members */
|
||||
typedef struct core_updater_list core_updater_list_t;
|
||||
|
||||
/**************************************/
|
||||
/* Initialisation / De-Initialisation */
|
||||
/**************************************/
|
||||
|
||||
/* Creates a new, empty core updater list with a
|
||||
* maximum number of 'max_size' entries.
|
||||
* Returns a handle to a new core_updater_list_t object
|
||||
* on success, otherwise returns NULL. */
|
||||
core_updater_list_t *core_updater_list_init(size_t max_size);
|
||||
|
||||
/* Resets (removes all entries of) specified core
|
||||
* updater list */
|
||||
void core_updater_list_reset(core_updater_list_t *core_list);
|
||||
|
||||
/* Frees specified core updater list */
|
||||
void core_updater_list_free(core_updater_list_t *core_list);
|
||||
|
||||
/***************/
|
||||
/* Cached List */
|
||||
/***************/
|
||||
|
||||
/* Creates a new, empty cached core updater list
|
||||
* (i.e. 'global' list).
|
||||
* Returns false in the event of an error. */
|
||||
bool core_updater_list_init_cached(size_t max_size);
|
||||
|
||||
/* Fetches cached core updater list */
|
||||
core_updater_list_t *core_updater_list_get_cached(void);
|
||||
|
||||
/* Frees cached core updater list */
|
||||
void core_updater_list_free_cached(void);
|
||||
|
||||
/***********/
|
||||
/* Getters */
|
||||
/***********/
|
||||
|
||||
/* Returns number of entries in core updater list */
|
||||
size_t core_updater_list_size(core_updater_list_t *core_list);
|
||||
|
||||
/* Returns maximum allowed number of entries in core
|
||||
* updater list */
|
||||
size_t core_updater_list_capacity(core_updater_list_t *core_list);
|
||||
|
||||
/* Fetches core updater list entry corresponding
|
||||
* to the specified entry index.
|
||||
* Returns false if index is invalid. */
|
||||
bool core_updater_list_get_index(
|
||||
core_updater_list_t *core_list,
|
||||
size_t idx,
|
||||
const core_updater_list_entry_t **entry);
|
||||
|
||||
/* Fetches core updater list entry corresponding
|
||||
* to the specified remote core filename.
|
||||
* Returns false if core is not found. */
|
||||
bool core_updater_list_get_filename(
|
||||
core_updater_list_t *core_list,
|
||||
const char *remote_filename,
|
||||
const core_updater_list_entry_t **entry);
|
||||
|
||||
/* Fetches core updater list entry corresponding
|
||||
* to the specified core.
|
||||
* Returns false if core is not found. */
|
||||
bool core_updater_list_get_core(
|
||||
core_updater_list_t *core_list,
|
||||
const char *local_core_path,
|
||||
const core_updater_list_entry_t **entry);
|
||||
|
||||
/***********/
|
||||
/* Setters */
|
||||
/***********/
|
||||
|
||||
/* Reads the contents of a buildbot core list
|
||||
* network request into the specified
|
||||
* core_updater_list_t object.
|
||||
* Returns false in the event of an error. */
|
||||
bool core_updater_list_parse_network_data(
|
||||
core_updater_list_t *core_list,
|
||||
const char *path_dir_libretro,
|
||||
const char *path_libretro_info,
|
||||
const char *network_buildbot_url,
|
||||
const char *data, size_t len);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
@@ -360,7 +360,7 @@ size_t libretro_videoprocessor_retro_get_memory_size(unsigned id);
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_EASTEREGG
|
||||
#ifdef HAVE_GONG
|
||||
/* Internal gong core. */
|
||||
|
||||
void libretro_gong_retro_init(void);
|
||||
|
||||
@@ -75,6 +75,11 @@ endif
|
||||
|
||||
TARGET_NAME := ffmpeg
|
||||
|
||||
GIT_VERSION ?= " $(shell git rev-parse --short HEAD || echo unknown)"
|
||||
ifneq ($(GIT_VERSION)," unknown")
|
||||
CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
|
||||
endif
|
||||
|
||||
ifneq (,$(findstring unix,$(platform)))
|
||||
ARCH_X86 = 1
|
||||
TARGET := $(TARGET_NAME)_libretro.so
|
||||
@@ -123,7 +128,7 @@ else ifneq (,$(findstring ios,$(platform)))
|
||||
TARGET := $(TARGET_NAME)_libretro_ios.dylib
|
||||
fpic := -fPIC
|
||||
SHARED := -dynamiclib
|
||||
CFLAGS += -I. -I.. -DHAVE_FMINF -DIOS
|
||||
CFLAGS += -I. -I.. -DHAVE_FMINF -DIOS -DHAVE_UNISTD_H
|
||||
ifeq ($(OPENGL),1)
|
||||
HAVE_OPENGL = 1
|
||||
GLES = 1
|
||||
@@ -140,11 +145,16 @@ ifeq ($(IOSSDK),)
|
||||
IOSSDK := $(shell xcodebuild -version -sdk iphoneos Path)
|
||||
endif
|
||||
|
||||
ifeq ($(platform),ios-arm64)
|
||||
CC = cc -arch arm64 -isysroot $(IOSSDK)
|
||||
CXX = c++ -arch arm64 -isysroot $(IOSSDK)
|
||||
else
|
||||
CC = cc -arch armv7 -isysroot $(IOSSDK)
|
||||
CXX = c++ -arch armv7 -isysroot $(IOSSDK)
|
||||
LD = armv7-apple-darwin11-ld
|
||||
endif
|
||||
|
||||
ifeq ($(platform),ios9)
|
||||
ifeq ($(platform),$(filter $(platform),ios9 ios-arm64))
|
||||
CC += -miphoneos-version-min=8.0
|
||||
CFLAGS += -miphoneos-version-min=8.0
|
||||
else
|
||||
@@ -177,20 +187,23 @@ else ifeq ($(platform), emscripten)
|
||||
else
|
||||
|
||||
ARCH_X86 = 1
|
||||
CC = gcc
|
||||
CXX = g++
|
||||
TARGET := $(TARGET_NAME)_libretro.dll
|
||||
SHARED := -shared -static-libgcc -static-libstdc++ -s -Wl,--version-script=link.T -Wl,--no-undefined
|
||||
CFLAGS += -Iffmpeg
|
||||
ifeq ($(OPENGL),1)
|
||||
GL_LIB := -lopengl32
|
||||
CFLAGS += -DHAVE_OPENGL
|
||||
HAVE_OPENGL = 1
|
||||
HAVE_GL_FFT := 1
|
||||
WIN32_PLATFORM := 1
|
||||
endif
|
||||
LIBS += -L.
|
||||
endif
|
||||
|
||||
ifeq ($(LIBRETRO_SWITCH), 1)
|
||||
CFLAGS += -DUPSTREAM_VERSION=\"$(shell cat ../RELEASE)\"
|
||||
endif
|
||||
|
||||
CFLAGS += -D__LIBRETRO__
|
||||
|
||||
include Makefile.common
|
||||
|
||||
@@ -19,10 +19,13 @@ SWRESAMPLE_DIR := $(BASE_DIR)/libswresample
|
||||
INCFLAGS += -I$(BASE_DIR) -I$(CORE_DIR) -I$(LIBRETRO_COMM_DIR)/include -I$(LIBRETRO_COMM_DIR)/include/compat
|
||||
|
||||
LIBRETRO_SOURCE += $(CORE_DIR)/ffmpeg_core.c \
|
||||
$(CORE_DIR)/packet_buffer.c \
|
||||
$(CORE_DIR)/video_buffer.c \
|
||||
$(LIBRETRO_COMM_DIR)/rthreads/tpool.c \
|
||||
$(LIBRETRO_COMM_DIR)/queues/fifo_queue.c \
|
||||
$(LIBRETRO_COMM_DIR)/rthreads/rthreads.c
|
||||
|
||||
ifeq ($(LIBRETRO_SWITCH),1)
|
||||
ifeq ($(LIBRETRO_SWITCH), 1)
|
||||
DEFINES += -DLIBRETRO_SWITCH=1
|
||||
INTERNAL_LIBAVCODEC = 1
|
||||
INTERNAL_LIBAVFORMAT = 1
|
||||
|
||||
@@ -5,6 +5,7 @@ ifeq ($(INTERNAL_ZLIB),0)
|
||||
HAVE_ZLIB = 1
|
||||
else
|
||||
HAVE_ZLIB = 1
|
||||
DEFINES += -DWANT_ZLIB
|
||||
INCFLAGS += -I$(DEPS_DIR)/libz
|
||||
DEPS_SOURCE += $(wildcard $(DEPS_DIR)/libz/*.c)
|
||||
endif
|
||||
|
||||
+737
-307
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,135 @@
|
||||
#include "packet_buffer.h"
|
||||
|
||||
struct AVPacketNode {
|
||||
AVPacket *data;
|
||||
struct AVPacketNode *next;
|
||||
struct AVPacketNode *previous;
|
||||
};
|
||||
typedef struct AVPacketNode AVPacketNode_t;
|
||||
|
||||
struct packet_buffer
|
||||
{
|
||||
AVPacketNode_t *head;
|
||||
AVPacketNode_t *tail;
|
||||
size_t size;
|
||||
};
|
||||
|
||||
packet_buffer_t *packet_buffer_create()
|
||||
{
|
||||
packet_buffer_t *b = malloc(sizeof(packet_buffer_t));
|
||||
if (!b)
|
||||
return NULL;
|
||||
|
||||
memset(b, 0, sizeof(packet_buffer_t));
|
||||
|
||||
return b;
|
||||
}
|
||||
|
||||
void packet_buffer_destroy(packet_buffer_t *packet_buffer)
|
||||
{
|
||||
AVPacketNode_t *node;
|
||||
|
||||
if (!packet_buffer)
|
||||
return;
|
||||
|
||||
if (packet_buffer->head)
|
||||
{
|
||||
node = packet_buffer->head;
|
||||
while (node)
|
||||
{
|
||||
AVPacketNode_t *next = node->next;
|
||||
av_packet_free(&node->data);
|
||||
free(node);
|
||||
node = next;
|
||||
}
|
||||
}
|
||||
|
||||
free(packet_buffer);
|
||||
}
|
||||
|
||||
void packet_buffer_clear(packet_buffer_t **packet_buffer)
|
||||
{
|
||||
if (!packet_buffer)
|
||||
return;
|
||||
|
||||
packet_buffer_destroy(*packet_buffer);
|
||||
*packet_buffer = packet_buffer_create();
|
||||
}
|
||||
|
||||
bool packet_buffer_empty(packet_buffer_t *packet_buffer)
|
||||
{
|
||||
if (!packet_buffer)
|
||||
return true;
|
||||
|
||||
return packet_buffer->size == 0;
|
||||
}
|
||||
|
||||
size_t packet_buffer_size(packet_buffer_t *packet_buffer)
|
||||
{
|
||||
if (!packet_buffer)
|
||||
return 0;
|
||||
|
||||
return packet_buffer->size;
|
||||
}
|
||||
|
||||
void packet_buffer_add_packet(packet_buffer_t *packet_buffer, AVPacket *pkt)
|
||||
{
|
||||
AVPacketNode_t *new_head = (AVPacketNode_t *) malloc(sizeof(AVPacketNode_t));
|
||||
new_head->data = av_packet_alloc();
|
||||
|
||||
av_packet_move_ref(new_head->data, pkt);
|
||||
|
||||
if (packet_buffer->head)
|
||||
{
|
||||
new_head->next = packet_buffer->head;
|
||||
packet_buffer->head->previous = new_head;
|
||||
}
|
||||
else
|
||||
{
|
||||
new_head->next = NULL;
|
||||
packet_buffer->tail = new_head;
|
||||
}
|
||||
|
||||
packet_buffer->head = new_head;
|
||||
packet_buffer->head->previous = NULL;
|
||||
packet_buffer->size++;
|
||||
}
|
||||
|
||||
void packet_buffer_get_packet(packet_buffer_t *packet_buffer, AVPacket *pkt)
|
||||
{
|
||||
AVPacketNode_t *new_tail = NULL;
|
||||
|
||||
if (packet_buffer->tail == NULL)
|
||||
return;
|
||||
|
||||
av_packet_move_ref(pkt, packet_buffer->tail->data);
|
||||
if (packet_buffer->tail->previous)
|
||||
{
|
||||
new_tail = packet_buffer->tail->previous;
|
||||
new_tail->next = NULL;
|
||||
}
|
||||
else
|
||||
packet_buffer->head = NULL;
|
||||
|
||||
av_packet_free(&packet_buffer->tail->data);
|
||||
free(packet_buffer->tail);
|
||||
|
||||
packet_buffer->tail = new_tail;
|
||||
packet_buffer->size--;
|
||||
}
|
||||
|
||||
int64_t packet_buffer_peek_start_pts(packet_buffer_t *packet_buffer)
|
||||
{
|
||||
if (!packet_buffer->tail)
|
||||
return 0;
|
||||
|
||||
return packet_buffer->tail->data->pts;
|
||||
}
|
||||
|
||||
int64_t packet_buffer_peek_end_pts(packet_buffer_t *packet_buffer)
|
||||
{
|
||||
if (!packet_buffer->tail)
|
||||
return 0;
|
||||
|
||||
return packet_buffer->tail->data->pts + packet_buffer->tail->data->duration;
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
#ifndef __LIBRETRO_SDK_PACKETBUFFER_H__
|
||||
#define __LIBRETRO_SDK_PACKETBUFFER_H__
|
||||
|
||||
#include <retro_common_api.h>
|
||||
|
||||
#include <boolean.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <libavcodec/avcodec.h>
|
||||
|
||||
#include <retro_miscellaneous.h>
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
/**
|
||||
* packet_buffer
|
||||
*
|
||||
* Just a simple double linked list for AVPackets.
|
||||
*
|
||||
*/
|
||||
struct packet_buffer;
|
||||
typedef struct packet_buffer packet_buffer_t;
|
||||
|
||||
/**
|
||||
* packet_buffer_create:
|
||||
*
|
||||
* Create a packet_buffer.
|
||||
*
|
||||
* Returns: A packet buffer.
|
||||
*/
|
||||
packet_buffer_t *packet_buffer_create();
|
||||
|
||||
/**
|
||||
* packet_buffer_destroy:
|
||||
* @packet_buffer : packet buffer
|
||||
*
|
||||
* Destroys a packet buffer.
|
||||
*
|
||||
**/
|
||||
void packet_buffer_destroy(packet_buffer_t *packet_buffer);
|
||||
|
||||
/**
|
||||
* packet_buffer_clear:
|
||||
* @packet_buffer : packet buffer
|
||||
*
|
||||
* Clears a packet buffer by re-creating it.
|
||||
*
|
||||
**/
|
||||
void packet_buffer_clear(packet_buffer_t **packet_buffer);
|
||||
|
||||
/**
|
||||
* packet_buffer_empty:
|
||||
* @packet_buffer : packet buffer
|
||||
*
|
||||
* Return true if the buffer is empty;
|
||||
*
|
||||
**/
|
||||
bool packet_buffer_empty(packet_buffer_t *packet_buffer);
|
||||
|
||||
/**
|
||||
* packet_buffer_size:
|
||||
* @packet_buffer : packet buffer
|
||||
*
|
||||
* Returns the number of AVPackets the buffer currently
|
||||
* holds.
|
||||
*
|
||||
**/
|
||||
size_t packet_buffer_size(packet_buffer_t *packet_buffer);
|
||||
|
||||
/**
|
||||
* packet_buffer_add_packet:
|
||||
* @packet_buffer : packet buffer
|
||||
* @pkt : packet
|
||||
*
|
||||
* Copies the given packet into the selected buffer.
|
||||
*
|
||||
**/
|
||||
void packet_buffer_add_packet(packet_buffer_t *packet_buffer, AVPacket *pkt);
|
||||
|
||||
/**
|
||||
* packet_buffer_get_packet:
|
||||
* @packet_buffer : packet buffer
|
||||
* @pkt : packet
|
||||
*
|
||||
* Get the next packet. User needs to unref the packet with av_packet_unref().
|
||||
*
|
||||
**/
|
||||
void packet_buffer_get_packet(packet_buffer_t *packet_buffer, AVPacket *pkt);
|
||||
|
||||
/**
|
||||
* packet_buffer_peek_start_pts:
|
||||
* @packet_buffer : packet buffer
|
||||
*
|
||||
* Returns the start pts of the next packet in the buffer.
|
||||
*
|
||||
**/
|
||||
int64_t packet_buffer_peek_start_pts(packet_buffer_t *packet_buffer);
|
||||
|
||||
/**
|
||||
* packet_buffer_peek_end_pts:
|
||||
* @packet_buffer : packet buffer
|
||||
*
|
||||
* Returns the end pts of the next packet in the buffer.
|
||||
*
|
||||
**/
|
||||
int64_t packet_buffer_peek_end_pts(packet_buffer_t *packet_buffer);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,241 @@
|
||||
#include <libavformat/avformat.h>
|
||||
|
||||
#include <rthreads/rthreads.h>
|
||||
|
||||
#include "video_buffer.h"
|
||||
|
||||
enum kbStatus
|
||||
{
|
||||
KB_OPEN,
|
||||
KB_IN_PROGRESS,
|
||||
KB_FINISHED
|
||||
};
|
||||
|
||||
struct video_buffer
|
||||
{
|
||||
video_decoder_context_t *buffer;
|
||||
enum kbStatus *status;
|
||||
size_t capacity;
|
||||
slock_t *lock;
|
||||
scond_t *open_cond;
|
||||
scond_t *finished_cond;
|
||||
int64_t head;
|
||||
int64_t tail;
|
||||
};
|
||||
|
||||
video_buffer_t *video_buffer_create(size_t capacity, int frame_size, int width, int height)
|
||||
{
|
||||
video_buffer_t *b = malloc(sizeof(video_buffer_t));
|
||||
if (!b)
|
||||
return NULL;
|
||||
|
||||
memset(b, 0, sizeof(video_buffer_t));
|
||||
b->capacity = capacity;
|
||||
|
||||
b->status = malloc(sizeof(enum kbStatus) * capacity);
|
||||
if (!b->status)
|
||||
goto fail;
|
||||
for (int i = 0; i < capacity; i++)
|
||||
b->status[i] = KB_OPEN;
|
||||
|
||||
b->lock = slock_new();
|
||||
b->open_cond = scond_new();
|
||||
b->finished_cond = scond_new();
|
||||
if (!b->lock || !b->open_cond || !b->finished_cond)
|
||||
goto fail;
|
||||
|
||||
b->buffer = malloc(sizeof(video_decoder_context_t) * capacity);
|
||||
if (!b->buffer)
|
||||
goto fail;
|
||||
|
||||
for (int i = 0; i < capacity; i++)
|
||||
{
|
||||
b->buffer[i].index = i;
|
||||
b->buffer[i].pts = 0;
|
||||
b->buffer[i].sws = sws_alloc_context();
|
||||
b->buffer[i].source = av_frame_alloc();
|
||||
#if LIBAVUTIL_VERSION_MAJOR > 55
|
||||
b->buffer[i].hw_source = av_frame_alloc();
|
||||
#endif
|
||||
b->buffer[i].target = av_frame_alloc();
|
||||
b->buffer[i].frame_buf = av_malloc(frame_size);
|
||||
|
||||
avpicture_fill((AVPicture*)b->buffer[i].target, (const uint8_t*)b->buffer[i].frame_buf,
|
||||
PIX_FMT_RGB32, width, height);
|
||||
|
||||
if (!b->buffer[i].sws ||
|
||||
!b->buffer[i].source ||
|
||||
#if LIBAVUTIL_VERSION_MAJOR > 55
|
||||
!b->buffer[i].hw_source ||
|
||||
#endif
|
||||
!b->buffer[i].target ||
|
||||
!b->buffer[i].frame_buf)
|
||||
goto fail;
|
||||
}
|
||||
return b;
|
||||
|
||||
fail:
|
||||
video_buffer_destroy(b);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void video_buffer_destroy(video_buffer_t *video_buffer)
|
||||
{
|
||||
if (!video_buffer)
|
||||
return;
|
||||
|
||||
slock_free(video_buffer->lock);
|
||||
scond_free(video_buffer->open_cond);
|
||||
scond_free(video_buffer->finished_cond);
|
||||
free(video_buffer->status);
|
||||
if (video_buffer->buffer)
|
||||
for (int i = 0; i < video_buffer->capacity; i++)
|
||||
{
|
||||
#if LIBAVUTIL_VERSION_MAJOR > 55
|
||||
av_frame_free(&video_buffer->buffer[i].hw_source);
|
||||
#endif
|
||||
av_frame_free(&video_buffer->buffer[i].source);
|
||||
av_frame_free(&video_buffer->buffer[i].target);
|
||||
av_freep(&video_buffer->buffer[i].frame_buf);
|
||||
sws_freeContext(video_buffer->buffer[i].sws);
|
||||
}
|
||||
free(video_buffer->buffer);
|
||||
free(video_buffer);
|
||||
}
|
||||
|
||||
void video_buffer_clear(video_buffer_t *video_buffer)
|
||||
{
|
||||
if (!video_buffer)
|
||||
return;
|
||||
|
||||
slock_lock(video_buffer->lock);
|
||||
|
||||
scond_signal(video_buffer->open_cond);
|
||||
scond_signal(video_buffer->finished_cond);
|
||||
|
||||
video_buffer->head = 0;
|
||||
video_buffer->tail = 0;
|
||||
for (int i = 0; i < video_buffer->capacity; i++)
|
||||
video_buffer->status[i] = KB_OPEN;
|
||||
|
||||
slock_unlock(video_buffer->lock);
|
||||
}
|
||||
|
||||
void video_buffer_get_open_slot(video_buffer_t *video_buffer, video_decoder_context_t **context)
|
||||
{
|
||||
slock_lock(video_buffer->lock);
|
||||
|
||||
if (video_buffer->status[video_buffer->head] == KB_OPEN)
|
||||
{
|
||||
*context = &video_buffer->buffer[video_buffer->head];
|
||||
video_buffer->status[video_buffer->head] = KB_IN_PROGRESS;
|
||||
video_buffer->head++;
|
||||
video_buffer->head %= video_buffer->capacity;
|
||||
}
|
||||
|
||||
slock_unlock(video_buffer->lock);
|
||||
}
|
||||
|
||||
void video_buffer_return_open_slot(video_buffer_t *video_buffer, video_decoder_context_t *context)
|
||||
{
|
||||
slock_lock(video_buffer->lock);
|
||||
|
||||
if (video_buffer->status[context->index] == KB_IN_PROGRESS)
|
||||
{
|
||||
video_buffer->status[context->index] = KB_OPEN;
|
||||
video_buffer->head--;
|
||||
video_buffer->head %= video_buffer->capacity;
|
||||
}
|
||||
|
||||
slock_unlock(video_buffer->lock);
|
||||
}
|
||||
|
||||
void video_buffer_open_slot(video_buffer_t *video_buffer, video_decoder_context_t *context)
|
||||
{
|
||||
slock_lock(video_buffer->lock);
|
||||
|
||||
if (video_buffer->status[context->index] == KB_FINISHED)
|
||||
{
|
||||
video_buffer->status[context->index] = KB_OPEN;
|
||||
video_buffer->tail++;
|
||||
video_buffer->tail %= (video_buffer->capacity);
|
||||
scond_signal(video_buffer->open_cond);
|
||||
}
|
||||
|
||||
slock_unlock(video_buffer->lock);
|
||||
}
|
||||
|
||||
void video_buffer_get_finished_slot(video_buffer_t *video_buffer, video_decoder_context_t **context)
|
||||
{
|
||||
slock_lock(video_buffer->lock);
|
||||
|
||||
if (video_buffer->status[video_buffer->tail] == KB_FINISHED)
|
||||
*context = &video_buffer->buffer[video_buffer->tail];
|
||||
|
||||
slock_unlock(video_buffer->lock);
|
||||
}
|
||||
|
||||
void video_buffer_finish_slot(video_buffer_t *video_buffer, video_decoder_context_t *context)
|
||||
{
|
||||
slock_lock(video_buffer->lock);
|
||||
|
||||
if (video_buffer->status[context->index] == KB_IN_PROGRESS)
|
||||
{
|
||||
video_buffer->status[context->index] = KB_FINISHED;
|
||||
scond_signal(video_buffer->finished_cond);
|
||||
}
|
||||
|
||||
slock_unlock(video_buffer->lock);
|
||||
}
|
||||
|
||||
bool video_buffer_wait_for_open_slot(video_buffer_t *video_buffer)
|
||||
{
|
||||
slock_lock(video_buffer->lock);
|
||||
|
||||
while (video_buffer->status[video_buffer->head] != KB_OPEN)
|
||||
scond_wait(video_buffer->open_cond, video_buffer->lock);
|
||||
|
||||
slock_unlock(video_buffer->lock);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool video_buffer_wait_for_finished_slot(video_buffer_t *video_buffer)
|
||||
{
|
||||
slock_lock(video_buffer->lock);
|
||||
|
||||
while (video_buffer->status[video_buffer->tail] != KB_FINISHED)
|
||||
scond_wait(video_buffer->finished_cond, video_buffer->lock);
|
||||
|
||||
slock_unlock(video_buffer->lock);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool video_buffer_has_open_slot(video_buffer_t *video_buffer)
|
||||
{
|
||||
bool ret = false;
|
||||
|
||||
slock_lock(video_buffer->lock);
|
||||
|
||||
if (video_buffer->status[video_buffer->head] == KB_OPEN)
|
||||
ret = true;
|
||||
|
||||
slock_unlock(video_buffer->lock);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool video_buffer_has_finished_slot(video_buffer_t *video_buffer)
|
||||
{
|
||||
bool ret = false;
|
||||
|
||||
slock_lock(video_buffer->lock);
|
||||
|
||||
if (video_buffer->status[video_buffer->tail] == KB_FINISHED)
|
||||
ret = true;
|
||||
|
||||
slock_unlock(video_buffer->lock);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -0,0 +1,195 @@
|
||||
#ifndef __LIBRETRO_SDK_VIDEOBUFFER_H__
|
||||
#define __LIBRETRO_SDK_VIDEOBUFFER_H__
|
||||
|
||||
#include <retro_common_api.h>
|
||||
|
||||
#include <boolean.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef HAVE_SSA
|
||||
#include <ass/ass.h>
|
||||
#endif
|
||||
|
||||
#include <libavutil/frame.h>
|
||||
#include <libswscale/swscale.h>
|
||||
|
||||
#include <retro_miscellaneous.h>
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
#ifndef PIX_FMT_RGB32
|
||||
#define PIX_FMT_RGB32 AV_PIX_FMT_RGB32
|
||||
#endif
|
||||
|
||||
/**
|
||||
* video_decoder_context
|
||||
*
|
||||
* Context object for the sws worker threads.
|
||||
*
|
||||
*/
|
||||
struct video_decoder_context
|
||||
{
|
||||
int index;
|
||||
int64_t pts;
|
||||
struct SwsContext *sws;
|
||||
AVFrame *source;
|
||||
#if LIBAVUTIL_VERSION_MAJOR > 55
|
||||
AVFrame *hw_source;
|
||||
#endif
|
||||
AVFrame *target;
|
||||
#ifdef HAVE_SSA
|
||||
ASS_Track *ass_track_active;
|
||||
#endif
|
||||
uint8_t *frame_buf;
|
||||
};
|
||||
typedef struct video_decoder_context video_decoder_context_t;
|
||||
|
||||
/**
|
||||
* video_buffer
|
||||
*
|
||||
* The video buffer is a ring buffer, that can be used as a
|
||||
* buffer for many workers while keeping the order.
|
||||
*
|
||||
* It is thread safe in a sensem that it is designed to work
|
||||
* with one work coordinator, that allocates work slots for
|
||||
* workers threads to work on and later collect the work
|
||||
* product in the same order, as the slots were allocated.
|
||||
*
|
||||
*/
|
||||
struct video_buffer;
|
||||
typedef struct video_buffer video_buffer_t;
|
||||
|
||||
/**
|
||||
* video_buffer_create:
|
||||
* @capacity : Size of the buffer.
|
||||
* @frame_size : Size of the target frame.
|
||||
* @width : Width of the target frame.
|
||||
* @height : Height of the target frame.
|
||||
*
|
||||
* Create a video buffer.
|
||||
*
|
||||
* Returns: A video buffer.
|
||||
*/
|
||||
video_buffer_t *video_buffer_create(size_t capacity, int frame_size, int width, int height);
|
||||
|
||||
/**
|
||||
* video_buffer_destroy:
|
||||
* @video_buffer : video buffer.
|
||||
*
|
||||
* Destroys a video buffer.
|
||||
*
|
||||
* Does also free the buffer allocated with video_buffer_create().
|
||||
* User has to shut down any external worker threads that may have
|
||||
* a reference to this video buffer.
|
||||
*
|
||||
**/
|
||||
void video_buffer_destroy(video_buffer_t *video_buffer);
|
||||
|
||||
/**
|
||||
* video_buffer_clear:
|
||||
* @video_buffer : video buffer.
|
||||
*
|
||||
* Clears a video buffer.
|
||||
*
|
||||
**/
|
||||
void video_buffer_clear(video_buffer_t *video_buffer);
|
||||
|
||||
/**
|
||||
* video_buffer_get_open_slot:
|
||||
* @video_buffer : video buffer.
|
||||
* @context : sws context.
|
||||
*
|
||||
* Returns the next open context inside the ring buffer
|
||||
* and it's index. The status of the slot will be marked as
|
||||
* 'in progress' until slot is marked as finished with
|
||||
* video_buffer_finish_slot();
|
||||
*
|
||||
**/
|
||||
void video_buffer_get_open_slot(video_buffer_t *video_buffer, video_decoder_context_t **context);
|
||||
|
||||
/**
|
||||
* video_buffer_return_open_slot:
|
||||
* @video_buffer : video buffer.
|
||||
* @context : sws context.
|
||||
*
|
||||
* Marks the given sws context that is "in progress" as "open" again.
|
||||
*
|
||||
**/
|
||||
void video_buffer_return_open_slot(video_buffer_t *video_buffer, video_decoder_context_t *context);
|
||||
|
||||
/**
|
||||
* video_buffer_open_slot:
|
||||
* @video_buffer : video buffer.
|
||||
* @context : sws context.
|
||||
*
|
||||
* Sets the status of the given context from "finished" to "open".
|
||||
* The slot is then available for producers to claim again with video_buffer_get_open_slot().
|
||||
**/
|
||||
void video_buffer_open_slot(video_buffer_t *video_buffer, video_decoder_context_t *context);
|
||||
|
||||
/**
|
||||
* video_buffer_get_finished_slot:
|
||||
* @video_buffer : video buffer.
|
||||
* @context : sws context.
|
||||
*
|
||||
* Returns a reference for the next context inside
|
||||
* the ring buffer. User needs to use video_buffer_open_slot()
|
||||
* to open the slot in the ringbuffer for the next
|
||||
* work assignment. User is free to re-allocate or
|
||||
* re-use the context.
|
||||
*/
|
||||
void video_buffer_get_finished_slot(video_buffer_t *video_buffer, video_decoder_context_t **context);
|
||||
|
||||
/**
|
||||
* video_buffer_finish_slot:
|
||||
* @video_buffer : video buffer.
|
||||
* @context : sws context.
|
||||
*
|
||||
* Sets the status of the given context from "in progress" to "finished".
|
||||
* This is normally done by a producer. User can then retrieve the finished work
|
||||
* context by calling video_buffer_get_finished_slot().
|
||||
*/
|
||||
void video_buffer_finish_slot(video_buffer_t *video_buffer, video_decoder_context_t *context);
|
||||
|
||||
/**
|
||||
* video_buffer_wait_for_open_slot:
|
||||
* @video_buffer : video buffer.
|
||||
*
|
||||
* Blocks until open slot is available.
|
||||
*
|
||||
* Returns true if the buffer has a open slot available.
|
||||
*/
|
||||
bool video_buffer_wait_for_open_slot(video_buffer_t *video_buffer);
|
||||
|
||||
/**
|
||||
* video_buffer_wait_for_finished_slot:
|
||||
* @video_buffer : video buffer.
|
||||
*
|
||||
* Blocks until finished slot is available.
|
||||
*
|
||||
* Returns true if the buffers next slot is finished and a
|
||||
* context available.
|
||||
*/
|
||||
bool video_buffer_wait_for_finished_slot(video_buffer_t *video_buffer);
|
||||
|
||||
/**
|
||||
* bool video_buffer_has_open_slot(video_buffer_t *video_buffer)
|
||||
:
|
||||
* @video_buffer : video buffer.
|
||||
*
|
||||
* Returns true if the buffer has a open slot available.
|
||||
*/
|
||||
bool video_buffer_has_open_slot(video_buffer_t *video_buffer);
|
||||
|
||||
/**
|
||||
* video_buffer_has_finished_slot:
|
||||
* @video_buffer : video buffer.
|
||||
*
|
||||
* Returns true if the buffers next slot is finished and a
|
||||
* context available.
|
||||
*/
|
||||
bool video_buffer_has_finished_slot(video_buffer_t *video_buffer);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
@@ -8,6 +8,7 @@ image_core.so: image_core.c
|
||||
../../libretro-common/compat/compat_strcasestr.c \
|
||||
../../libretro-common/compat/compat_strl.c \
|
||||
../../libretro-common/file/file_path.c \
|
||||
../../libretro-common/file/file_path_io.c \
|
||||
../../libretro-common/file/retro_dirent.c \
|
||||
../../libretro-common/lists/dir_list.c \
|
||||
../../libretro-common/lists/string_list.c \
|
||||
|
||||
Vendored
+21
-4
@@ -21,6 +21,7 @@
|
||||
#include <iostream>
|
||||
#include <cstring>
|
||||
#include <cstdlib>
|
||||
#include <mutex>
|
||||
|
||||
#include "../../verbosity.h"
|
||||
|
||||
@@ -31,18 +32,33 @@ struct SlangProcess
|
||||
{
|
||||
public:
|
||||
SlangProcess();
|
||||
|
||||
TBuiltInResource& GetResources() { return Resources; }
|
||||
~SlangProcess() { FinalizeProcess(); }
|
||||
|
||||
private:
|
||||
TBuiltInResource Resources;
|
||||
};
|
||||
|
||||
// We don't use glslang from multiple threads, but to be sure.
|
||||
// Initializing TLS and freeing it for glslang works around a really bizarre issue
|
||||
// where the TLS key is suddenly corrupted *somehow*.
|
||||
static std::mutex glslang_global_lock;
|
||||
struct SlangProcessHolder
|
||||
{
|
||||
SlangProcessHolder()
|
||||
{
|
||||
glslang_global_lock.lock();
|
||||
InitializeProcess();
|
||||
}
|
||||
|
||||
~SlangProcessHolder()
|
||||
{
|
||||
FinalizeProcess();
|
||||
glslang_global_lock.unlock();
|
||||
}
|
||||
};
|
||||
|
||||
SlangProcess::SlangProcess()
|
||||
{
|
||||
InitializeProcess();
|
||||
|
||||
char DefaultConfig[] =
|
||||
"MaxLights 32\n"
|
||||
"MaxClipPlanes 6\n"
|
||||
@@ -337,6 +353,7 @@ SlangProcess::SlangProcess()
|
||||
bool glslang::compile_spirv(const string &source, Stage stage, std::vector<uint32_t> *spirv)
|
||||
{
|
||||
static SlangProcess process;
|
||||
SlangProcessHolder process_holder;
|
||||
|
||||
TProgram program;
|
||||
EShLanguage language;
|
||||
|
||||
@@ -158,6 +158,7 @@ bool DetachProcess()
|
||||
|
||||
OS_FreeTLSIndex(ThreadInitializeIndex);
|
||||
ThreadInitializeIndex = OS_INVALID_TLS_INDEX;
|
||||
DeinitializePoolIndex();
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
namespace glslang {
|
||||
|
||||
bool InitializePoolIndex();
|
||||
bool DeinitializePoolIndex();
|
||||
|
||||
} // end namespace glslang
|
||||
|
||||
|
||||
@@ -65,6 +65,15 @@ bool InitializePoolIndex()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DeinitializePoolIndex()
|
||||
{
|
||||
if (PoolIndex == OS_INVALID_TLS_INDEX)
|
||||
return false;
|
||||
OS_FreeTLSIndex(PoolIndex);
|
||||
PoolIndex = OS_INVALID_TLS_INDEX;
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
// Implement the functionality of the TPoolAllocator class, which
|
||||
// is documented in PoolAlloc.h.
|
||||
|
||||
@@ -1312,6 +1312,7 @@ int __fastcall ShFinalize()
|
||||
glslang::HlslScanContext::deleteKeywordMap();
|
||||
#endif
|
||||
|
||||
DetachProcess();
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Vendored
+2
-1
@@ -8,10 +8,11 @@ extern SceGxmVertexProgram *_vita2d_colorVertexProgram;
|
||||
extern SceGxmFragmentProgram *_vita2d_colorFragmentProgram;
|
||||
extern SceGxmVertexProgram *_vita2d_textureVertexProgram;
|
||||
extern SceGxmFragmentProgram *_vita2d_textureFragmentProgram;
|
||||
extern SceGxmVertexProgram *_vita2d_textureTintVertexProgram;
|
||||
extern SceGxmFragmentProgram *_vita2d_textureTintFragmentProgram;
|
||||
extern const SceGxmProgramParameter *_vita2d_colorWvpParam;
|
||||
extern const SceGxmProgramParameter *_vita2d_textureWvpParam;
|
||||
extern const SceGxmProgramParameter *_vita2d_textureTintColorParam;
|
||||
extern const SceGxmProgramParameter *_vita2d_textureTintWvpParam;
|
||||
|
||||
|
||||
#endif
|
||||
Vendored
+15
-1
@@ -31,6 +31,18 @@ typedef struct vita2d_texture_vertex {
|
||||
float v;
|
||||
} vita2d_texture_vertex;
|
||||
|
||||
typedef struct vita2d_texture_tint_vertex {
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
float u;
|
||||
float v;
|
||||
float r;
|
||||
float g;
|
||||
float b;
|
||||
float a;
|
||||
} vita2d_texture_tint_vertex;
|
||||
|
||||
typedef struct vita2d_texture {
|
||||
SceGxmTexture gxm_tex;
|
||||
SceUID data_UID;
|
||||
@@ -77,6 +89,7 @@ int vita2d_get_clipping_enabled();
|
||||
void vita2d_set_clip_rectangle(int x_min, int y_min, int x_max, int y_max);
|
||||
void vita2d_get_clip_rectangle(int *x_min, int *y_min, int *x_max, int *y_max);
|
||||
void vita2d_set_blend_mode_add(int enable);
|
||||
void vita2d_set_viewport(int x, int y, int width, int height);
|
||||
|
||||
void *vita2d_pool_malloc(unsigned int size);
|
||||
void *vita2d_pool_memalign(unsigned int size, unsigned int alignment);
|
||||
@@ -120,13 +133,14 @@ void vita2d_draw_texture_part_scale_rotate(const vita2d_texture *texture, float
|
||||
void vita2d_draw_texture_tint(const vita2d_texture *texture, float x, float y, unsigned int color);
|
||||
void vita2d_draw_texture_tint_rotate(const vita2d_texture *texture, float x, float y, float rad, unsigned int color);
|
||||
void vita2d_draw_texture_tint_rotate_hotspot(const vita2d_texture *texture, float x, float y, float rad, float center_x, float center_y, unsigned int color);
|
||||
void vita2d_draw_texture_tint_scale(const vita2d_texture *texture, float x, float y, float x_scale, float y_scale, unsigned int color);
|
||||
void vita2d_draw_texture_tint_scale(const vita2d_texture *texture, float x, float y, float x_scale, float y_scale, const float *color);
|
||||
void vita2d_draw_texture_tint_part(const vita2d_texture *texture, float x, float y, float tex_x, float tex_y, float tex_w, float tex_h, unsigned int color);
|
||||
void vita2d_draw_texture_tint_part_scale(const vita2d_texture *texture, float x, float y, float tex_x, float tex_y, float tex_w, float tex_h, float x_scale, float y_scale, unsigned int color);
|
||||
void vita2d_draw_texture_tint_scale_rotate_hotspot(const vita2d_texture *texture, float x, float y, float x_scale, float y_scale, float rad, float center_x, float center_y, unsigned int color);
|
||||
void vita2d_draw_texture_tint_scale_rotate(const vita2d_texture *texture, float x, float y, float x_scale, float y_scale, float rad, unsigned int color);
|
||||
void vita2d_draw_texture_part_tint_scale_rotate(const vita2d_texture *texture, float x, float y, float tex_x, float tex_y, float tex_w, float tex_h, float x_scale, float y_scale, float rad, unsigned int color);
|
||||
void vita2d_draw_array_textured(const vita2d_texture *texture, SceGxmPrimitiveType mode, const vita2d_texture_vertex *vertices, size_t count, unsigned int color);
|
||||
void vita2d_draw_array_textured_mat(const vita2d_texture *texture, const vita2d_texture_tint_vertex *vertices, size_t count, float *mat);
|
||||
|
||||
/** ADVANCED **/
|
||||
void vita2d_texture_set_wvp(float x, float y, float width, float height);
|
||||
|
||||
+20
-22
@@ -1,24 +1,22 @@
|
||||
/* Generated by bin2c, do not edit manually */
|
||||
|
||||
/* Contents of file texture_tint_f.gxp */
|
||||
const long int texture_tint_f_gxp_size = 288;
|
||||
// Imported from file 'shader_f.gxp'
|
||||
const unsigned char texture_tint_f_gxp[288] = {
|
||||
0x47, 0x58, 0x50, 0x00, 0x01, 0x04, 0x00, 0x00, 0x1F, 0x01, 0x00, 0x00, 0xEA, 0xFC, 0xA0, 0xCB,
|
||||
0x79, 0x0C, 0xE6, 0xA5, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xC8, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00,
|
||||
0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x00, 0x00, 0x00,
|
||||
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5C, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x01, 0x04, 0x01, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0xF9, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x44, 0xFA, 0x00, 0x00, 0x00, 0x00, 0x40, 0x09, 0x00, 0xF8,
|
||||
0x02, 0x80, 0x99, 0xAF, 0xBC, 0x0D, 0xC0, 0x40, 0x3C, 0x00, 0x04, 0xCF, 0x84, 0x47, 0xA4, 0x08,
|
||||
0x00, 0xBC, 0x19, 0x20, 0x7E, 0x0D, 0x81, 0x40, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00,
|
||||
0x20, 0x00, 0x00, 0x00, 0x01, 0xE4, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x1B, 0x00, 0x00, 0x00, 0x02, 0x04, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x75, 0x54, 0x69, 0x6E, 0x74, 0x43, 0x6F, 0x6C, 0x6F, 0x72, 0x00, 0x74, 0x65, 0x78, 0x00, 0x00
|
||||
0x47,0x58,0x50,0x00,0x01,0x05,0x10,0x03,0x20,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x05,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0xc4,0x00,0x00,0x00,0x70,0x00,0x00,0x00,
|
||||
0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x05,0x00,0x00,0x00,
|
||||
0x84,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x74,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x84,0x00,0x00,0x00,0xc0,0x3c,0x03,0x00,
|
||||
0x00,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x68,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x58,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x04,0x01,0x00,0x01,0x00,0x04,0x00,0x00,0x00,
|
||||
0x00,0xa9,0xd0,0x0e,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x44,0xfa,0x00,0x00,0x00,0x00,
|
||||
0x40,0x09,0x00,0xf8,0x02,0x80,0x99,0xaf,0xbc,0x0d,0xc0,0x40,0x06,0x82,0xb9,0xaf,
|
||||
0xbc,0x0d,0x80,0x40,0x7c,0x0f,0x04,0x00,0x86,0x47,0xa4,0x10,0x30,0x00,0x00,0x00,
|
||||
0x02,0x04,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x74,0x65,0x78,0x00
|
||||
};
|
||||
const unsigned int texture_tint_f_gxp_size = 288;
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
// Imported from file 'shader_v.gxp'
|
||||
const unsigned char texture_tint_v_gxp[384] = {
|
||||
0x47,0x58,0x50,0x00,0x01,0x05,0x10,0x03,0x7f,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x19,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0xf8,0x00,0x00,0x00,0x70,0x00,0x00,0x00,
|
||||
0x0c,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x0b,0x00,0x00,0x00,
|
||||
0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x74,0x00,0x00,0x00,0x70,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0xb0,0x00,0x00,0x00,0xc0,0x3c,0x03,0x00,
|
||||
0x00,0x00,0x00,0x00,0xa4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xa4,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x94,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x8c,0x00,0x00,0x00,
|
||||
0x01,0x00,0x00,0x00,0x84,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x37,0x0f,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x0a,
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x07,0x44,0xfa,0x01,0x0e,0x01,0x01,0x02,0x00,0x10,0xfa,
|
||||
0x80,0x00,0x08,0x83,0x21,0x25,0x80,0x38,0x01,0x01,0x01,0x01,0x00,0x00,0x14,0xfa,
|
||||
0x02,0x80,0x81,0xaf,0x9c,0x0d,0xc0,0x40,0x0e,0x86,0xb9,0xff,0xbc,0x0d,0xc0,0x40,
|
||||
0x04,0x11,0x49,0xcf,0x80,0x8f,0xb1,0x18,0x02,0x11,0x45,0xcf,0x80,0x8f,0xb1,0x18,
|
||||
0x00,0x11,0x01,0xc0,0x81,0x81,0xb1,0x18,0x01,0xd1,0x42,0xc0,0x81,0x81,0xb1,0x18,
|
||||
0x00,0x00,0x20,0xa0,0x00,0x50,0x27,0xfb,0x0e,0x00,0x00,0x00,0x00,0x00,0x10,0x00,
|
||||
0x40,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x3a,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x01,0x00,0x00,0x00,0x04,0x00,0x00,0x00,
|
||||
0x34,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x01,0x00,0x00,0x00,0x08,0x00,0x00,0x00,
|
||||
0x2b,0x00,0x00,0x00,0x01,0xe4,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x61,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x00,0x61,0x54,0x65,0x78,0x63,0x6f,
|
||||
0x6f,0x72,0x64,0x00,0x61,0x43,0x6f,0x6c,0x6f,0x72,0x00,0x77,0x76,0x70,0x00,0x00
|
||||
};
|
||||
const unsigned int texture_tint_v_gxp_size = 384;
|
||||
Vendored
+78
-5
@@ -39,6 +39,7 @@ extern const SceGxmProgram color_v_gxp;
|
||||
extern const SceGxmProgram color_f_gxp;
|
||||
extern const SceGxmProgram texture_v_gxp;
|
||||
extern const SceGxmProgram texture_f_gxp;
|
||||
extern const SceGxmProgram texture_tint_v_gxp;
|
||||
extern const SceGxmProgram texture_tint_f_gxp;
|
||||
|
||||
/* Static variables */
|
||||
@@ -51,6 +52,7 @@ static const SceGxmProgram *const colorVertexProgramGxp = &color_v_gxp;
|
||||
static const SceGxmProgram *const colorFragmentProgramGxp = &color_f_gxp;
|
||||
static const SceGxmProgram *const textureVertexProgramGxp = &texture_v_gxp;
|
||||
static const SceGxmProgram *const textureFragmentProgramGxp = &texture_f_gxp;
|
||||
static const SceGxmProgram *const textureTintVertexProgramGxp = &texture_tint_v_gxp;
|
||||
static const SceGxmProgram *const textureTintFragmentProgramGxp = &texture_tint_f_gxp;
|
||||
|
||||
static int vita2d_initialized = 0;
|
||||
@@ -95,6 +97,7 @@ static SceGxmShaderPatcherId colorVertexProgramId;
|
||||
static SceGxmShaderPatcherId colorFragmentProgramId;
|
||||
static SceGxmShaderPatcherId textureVertexProgramId;
|
||||
static SceGxmShaderPatcherId textureFragmentProgramId;
|
||||
static SceGxmShaderPatcherId textureTintVertexProgramId;
|
||||
static SceGxmShaderPatcherId textureTintFragmentProgramId;
|
||||
|
||||
static SceUID patcherBufferUid;
|
||||
@@ -113,11 +116,12 @@ SceGxmVertexProgram *_vita2d_colorVertexProgram = NULL;
|
||||
SceGxmFragmentProgram *_vita2d_colorFragmentProgram = NULL;
|
||||
SceGxmVertexProgram *_vita2d_textureVertexProgram = NULL;
|
||||
SceGxmFragmentProgram *_vita2d_textureFragmentProgram = NULL;
|
||||
SceGxmVertexProgram *_vita2d_textureTintVertexProgram = NULL;
|
||||
SceGxmFragmentProgram *_vita2d_textureTintFragmentProgram = NULL;
|
||||
const SceGxmProgramParameter *_vita2d_clearClearColorParam = NULL;
|
||||
const SceGxmProgramParameter *_vita2d_colorWvpParam = NULL;
|
||||
const SceGxmProgramParameter *_vita2d_textureWvpParam = NULL;
|
||||
const SceGxmProgramParameter *_vita2d_textureTintColorParam = NULL;
|
||||
const SceGxmProgramParameter *_vita2d_textureTintWvpParam = NULL;
|
||||
|
||||
typedef struct vita2d_fragment_programs {
|
||||
SceGxmFragmentProgram *color;
|
||||
@@ -208,7 +212,7 @@ static void _vita2d_make_fragment_programs(vita2d_fragment_programs *out,
|
||||
SCE_GXM_OUTPUT_REGISTER_FORMAT_UCHAR4,
|
||||
msaa,
|
||||
blend_info,
|
||||
textureVertexProgramGxp,
|
||||
textureTintVertexProgramGxp,
|
||||
&out->textureTint);
|
||||
|
||||
VITA2D_DEBUG("texture_tint sceGxmShaderPatcherCreateFragmentProgram(): 0x%08X\n", err);
|
||||
@@ -442,6 +446,8 @@ static int vita2d_init_internal(unsigned int temp_pool_size, SceGxmMultisampleMo
|
||||
VITA2D_DEBUG("texture_v sceGxmProgramCheck(): 0x%08X\n", err);
|
||||
err = sceGxmProgramCheck(textureFragmentProgramGxp);
|
||||
VITA2D_DEBUG("texture_f sceGxmProgramCheck(): 0x%08X\n", err);
|
||||
err = sceGxmProgramCheck(textureTintVertexProgramGxp);
|
||||
VITA2D_DEBUG("texture_v sceGxmProgramCheck(): 0x%08X\n", err);
|
||||
err = sceGxmProgramCheck(textureTintFragmentProgramGxp);
|
||||
VITA2D_DEBUG("texture_tint_f sceGxmProgramCheck(): 0x%08X\n", err);
|
||||
|
||||
@@ -464,6 +470,9 @@ static int vita2d_init_internal(unsigned int temp_pool_size, SceGxmMultisampleMo
|
||||
err = sceGxmShaderPatcherRegisterProgram(shaderPatcher, textureFragmentProgramGxp, &textureFragmentProgramId);
|
||||
VITA2D_DEBUG("texture_f sceGxmShaderPatcherRegisterProgram(): 0x%08X\n", err);
|
||||
|
||||
err = sceGxmShaderPatcherRegisterProgram(shaderPatcher, textureTintVertexProgramGxp, &textureTintVertexProgramId);
|
||||
VITA2D_DEBUG("texture_v sceGxmShaderPatcherRegisterProgram(): 0x%08X\n", err);
|
||||
|
||||
err = sceGxmShaderPatcherRegisterProgram(shaderPatcher, textureTintFragmentProgramGxp, &textureTintFragmentProgramId);
|
||||
VITA2D_DEBUG("texture_tint_f sceGxmShaderPatcherRegisterProgram(): 0x%08X\n", err);
|
||||
|
||||
@@ -630,6 +639,52 @@ static int vita2d_init_internal(unsigned int temp_pool_size, SceGxmMultisampleMo
|
||||
|
||||
VITA2D_DEBUG("texture sceGxmShaderPatcherCreateVertexProgram(): 0x%08X\n", err);
|
||||
|
||||
const SceGxmProgramParameter *paramTextureTintPositionAttribute = sceGxmProgramFindParameterByName(textureTintVertexProgramGxp, "aPosition");
|
||||
VITA2D_DEBUG("aPosition sceGxmProgramFindParameterByName(): %p\n", paramTextureTintPositionAttribute);
|
||||
|
||||
const SceGxmProgramParameter *paramTextureTintTexcoordAttribute = sceGxmProgramFindParameterByName(textureTintVertexProgramGxp, "aTexcoord");
|
||||
VITA2D_DEBUG("aTexcoord sceGxmProgramFindParameterByName(): %p\n", paramTextureTintTexcoordAttribute);
|
||||
|
||||
const SceGxmProgramParameter *paramTextureTintColorAttribute = sceGxmProgramFindParameterByName(textureTintVertexProgramGxp, "aColor");
|
||||
VITA2D_DEBUG("aColor sceGxmProgramFindParameterByName(): %p\n", paramTextureTintColorAttribute);
|
||||
|
||||
// create texture vertex format
|
||||
SceGxmVertexAttribute textureTintVertexAttributes[3];
|
||||
SceGxmVertexStream textureTintVertexStreams[1];
|
||||
/* x,y,z: 3 float 32 bits */
|
||||
textureTintVertexAttributes[0].streamIndex = 0;
|
||||
textureTintVertexAttributes[0].offset = 0;
|
||||
textureTintVertexAttributes[0].format = SCE_GXM_ATTRIBUTE_FORMAT_F32;
|
||||
textureTintVertexAttributes[0].componentCount = 3; // (x, y, z)
|
||||
textureTintVertexAttributes[0].regIndex = sceGxmProgramParameterGetResourceIndex(paramTextureTintPositionAttribute);
|
||||
/* u,v: 2 floats 32 bits */
|
||||
textureTintVertexAttributes[1].streamIndex = 0;
|
||||
textureTintVertexAttributes[1].offset = 12; // (x, y, z) * 4 = 12 bytes
|
||||
textureTintVertexAttributes[1].format = SCE_GXM_ATTRIBUTE_FORMAT_F32;
|
||||
textureTintVertexAttributes[1].componentCount = 2; // (u, v)
|
||||
textureTintVertexAttributes[1].regIndex = sceGxmProgramParameterGetResourceIndex(paramTextureTintTexcoordAttribute);
|
||||
/* r,g,b,a: 4 floats 32 bits */
|
||||
textureTintVertexAttributes[2].streamIndex = 0;
|
||||
textureTintVertexAttributes[2].offset = 20; // (u, v) * 4 = 8 bytes
|
||||
textureTintVertexAttributes[2].format = SCE_GXM_ATTRIBUTE_FORMAT_F32;
|
||||
textureTintVertexAttributes[2].componentCount = 4; // (r, g, b, a)
|
||||
textureTintVertexAttributes[2].regIndex = sceGxmProgramParameterGetResourceIndex(paramTextureTintColorAttribute);
|
||||
// 16 bit (short) indices
|
||||
textureTintVertexStreams[0].stride = sizeof(vita2d_texture_tint_vertex);
|
||||
textureTintVertexStreams[0].indexSource = SCE_GXM_INDEX_SOURCE_INDEX_16BIT;
|
||||
|
||||
// create texture shaders
|
||||
err = sceGxmShaderPatcherCreateVertexProgram(
|
||||
shaderPatcher,
|
||||
textureTintVertexProgramId,
|
||||
textureTintVertexAttributes,
|
||||
3,
|
||||
textureTintVertexStreams,
|
||||
1,
|
||||
&_vita2d_textureTintVertexProgram);
|
||||
|
||||
VITA2D_DEBUG("texture sceGxmShaderPatcherCreateVertexProgram(): 0x%08X\n", err);
|
||||
|
||||
// Create variations of the fragment program based on blending mode
|
||||
_vita2d_make_fragment_programs(&_vita2d_fragmentPrograms.blend_mode_normal, &blend_info, msaa);
|
||||
_vita2d_make_fragment_programs(&_vita2d_fragmentPrograms.blend_mode_add, &blend_info_add, msaa);
|
||||
@@ -647,8 +702,8 @@ static int vita2d_init_internal(unsigned int temp_pool_size, SceGxmMultisampleMo
|
||||
_vita2d_textureWvpParam = sceGxmProgramFindParameterByName(textureVertexProgramGxp, "wvp");
|
||||
VITA2D_DEBUG("texture wvp sceGxmProgramFindParameterByName(): %p\n", _vita2d_textureWvpParam);
|
||||
|
||||
_vita2d_textureTintColorParam = sceGxmProgramFindParameterByName(textureTintFragmentProgramGxp, "uTintColor");
|
||||
VITA2D_DEBUG("texture wvp sceGxmProgramFindParameterByName(): %p\n", _vita2d_textureWvpParam);
|
||||
_vita2d_textureTintWvpParam = sceGxmProgramFindParameterByName(textureTintVertexProgramGxp, "wvp");
|
||||
VITA2D_DEBUG("texture tint wvp sceGxmProgramFindParameterByName(): %p\n", _vita2d_textureTintWvpParam);
|
||||
|
||||
// Allocate memory for the memory pool
|
||||
pool_size = temp_pool_size;
|
||||
@@ -743,7 +798,8 @@ int vita2d_fini()
|
||||
sceGxmShaderPatcherUnregisterProgram(shaderPatcher, colorVertexProgramId);
|
||||
sceGxmShaderPatcherUnregisterProgram(shaderPatcher, textureFragmentProgramId);
|
||||
sceGxmShaderPatcherUnregisterProgram(shaderPatcher, textureTintFragmentProgramId);
|
||||
sceGxmShaderPatcherUnregisterProgram(shaderPatcher, textureVertexProgramId);
|
||||
sceGxmShaderPatcherUnregisterProgram(shaderPatcher, textureTintVertexProgramId);
|
||||
sceGxmShaderPatcherUnregisterProgram(shaderPatcher, textureVertexProgramId);
|
||||
|
||||
sceGxmShaderPatcherDestroy(shaderPatcher);
|
||||
fragment_usse_free(patcherFragmentUsseUid);
|
||||
@@ -877,12 +933,16 @@ int vita2d_get_clipping_enabled()
|
||||
|
||||
void vita2d_set_clip_rectangle(int x_min, int y_min, int x_max, int y_max)
|
||||
{
|
||||
vita2d_set_viewport(0,0,DISPLAY_WIDTH,DISPLAY_HEIGHT);
|
||||
clipping_enabled = 1;
|
||||
clip_rect_x_min = x_min;
|
||||
clip_rect_y_min = y_min;
|
||||
clip_rect_x_max = x_max;
|
||||
clip_rect_y_max = y_max;
|
||||
// we can only draw during a scene, but we can cache the values since they're not going to have any visible effect till the scene starts anyways
|
||||
if(drawing) {
|
||||
sceGxmSetFrontDepthWriteEnable(_vita2d_context,
|
||||
SCE_GXM_DEPTH_WRITE_DISABLED);
|
||||
// clear the stencil buffer to 0
|
||||
sceGxmSetFrontStencilFunc(
|
||||
_vita2d_context,
|
||||
@@ -903,6 +963,8 @@ void vita2d_set_clip_rectangle(int x_min, int y_min, int x_max, int y_max)
|
||||
0xFF,
|
||||
0xFF);
|
||||
vita2d_draw_rectangle(x_min, y_min, x_max - x_min, y_max - y_min, 0);
|
||||
sceGxmSetFrontDepthWriteEnable(_vita2d_context,
|
||||
SCE_GXM_DEPTH_WRITE_ENABLED);
|
||||
if(clipping_enabled) {
|
||||
// set the stencil function to only accept pixels where the stencil is 1
|
||||
sceGxmSetFrontStencilFunc(
|
||||
@@ -1035,4 +1097,15 @@ void vita2d_set_blend_mode_add(int enable)
|
||||
_vita2d_colorFragmentProgram = in->color;
|
||||
_vita2d_textureFragmentProgram = in->texture;
|
||||
_vita2d_textureTintFragmentProgram = in->textureTint;
|
||||
}
|
||||
|
||||
void vita2d_set_viewport(int x, int y, int width, int height){
|
||||
static float vh = DISPLAY_HEIGHT;
|
||||
float sw = width / 2.;
|
||||
float sh = height / 2.;
|
||||
float x_scale = sw;
|
||||
float x_port = x + sw;
|
||||
float y_scale = -(sh);
|
||||
float y_port = vh - y - sh;
|
||||
sceGxmSetViewport(_vita2d_context, x_port, x_scale, y_port, y_scale, -0.5f, 0.5f);
|
||||
}
|
||||
+127
-27
@@ -271,7 +271,7 @@ static inline void set_texture_program()
|
||||
|
||||
static inline void set_texture_tint_program()
|
||||
{
|
||||
sceGxmSetVertexProgram(_vita2d_context, _vita2d_textureVertexProgram);
|
||||
sceGxmSetVertexProgram(_vita2d_context, _vita2d_textureTintVertexProgram);
|
||||
sceGxmSetFragmentProgram(_vita2d_context, _vita2d_textureTintFragmentProgram);
|
||||
}
|
||||
|
||||
@@ -282,21 +282,11 @@ static inline void set_texture_wvp_uniform()
|
||||
sceGxmSetUniformDataF(vertex_wvp_buffer, _vita2d_textureWvpParam, 0, 16, _vita2d_ortho_matrix);
|
||||
}
|
||||
|
||||
static inline void set_texture_tint_color_uniform(unsigned int color)
|
||||
static inline void set_texture_tint_wvp_uniform()
|
||||
{
|
||||
void *texture_tint_color_buffer;
|
||||
sceGxmReserveFragmentDefaultUniformBuffer(_vita2d_context, &texture_tint_color_buffer);
|
||||
|
||||
float *tint_color = vita2d_pool_memalign(
|
||||
4 * sizeof(float), // RGBA
|
||||
sizeof(float));
|
||||
|
||||
tint_color[0] = ((color >> 8*0) & 0xFF)/255.0f;
|
||||
tint_color[1] = ((color >> 8*1) & 0xFF)/255.0f;
|
||||
tint_color[2] = ((color >> 8*2) & 0xFF)/255.0f;
|
||||
tint_color[3] = ((color >> 8*3) & 0xFF)/255.0f;
|
||||
|
||||
sceGxmSetUniformDataF(texture_tint_color_buffer, _vita2d_textureTintColorParam, 0, 4, tint_color);
|
||||
void *vertex_wvp_buffer;
|
||||
sceGxmReserveVertexDefaultUniformBuffer(_vita2d_context, &vertex_wvp_buffer);
|
||||
sceGxmSetUniformDataF(vertex_wvp_buffer, _vita2d_textureTintWvpParam, 0, 16, _vita2d_ortho_matrix);
|
||||
}
|
||||
|
||||
static inline void draw_texture_generic(const vita2d_texture *texture, float x, float y)
|
||||
@@ -350,7 +340,6 @@ void vita2d_draw_texture_tint(const vita2d_texture *texture, float x, float y, u
|
||||
{
|
||||
set_texture_tint_program();
|
||||
set_texture_wvp_uniform();
|
||||
set_texture_tint_color_uniform(color);
|
||||
draw_texture_generic(texture, x, y);
|
||||
}
|
||||
|
||||
@@ -430,7 +419,6 @@ void vita2d_draw_texture_tint_rotate_hotspot(const vita2d_texture *texture, floa
|
||||
{
|
||||
set_texture_tint_program();
|
||||
set_texture_wvp_uniform();
|
||||
set_texture_tint_color_uniform(color);
|
||||
draw_texture_rotate_hotspot_generic(texture, x, y, rad, center_x, center_y);
|
||||
}
|
||||
|
||||
@@ -474,6 +462,54 @@ static inline void draw_texture_scale_generic(const vita2d_texture *texture, flo
|
||||
sceGxmDraw(_vita2d_context, SCE_GXM_PRIMITIVE_TRIANGLE_STRIP, SCE_GXM_INDEX_FORMAT_U16, vita2d_get_linear_indices(), 4);
|
||||
}
|
||||
|
||||
static inline void draw_texture_tint_scale_generic(const vita2d_texture *texture, float x, float y, float x_scale, float y_scale, const float *color)
|
||||
{
|
||||
vita2d_texture_tint_vertex *vertices = (vita2d_texture_tint_vertex *)vita2d_pool_memalign(
|
||||
4 * sizeof(vita2d_texture_tint_vertex), // 4 vertices
|
||||
sizeof(vita2d_texture_tint_vertex));
|
||||
|
||||
const float w = x_scale * vita2d_texture_get_width(texture);
|
||||
const float h = y_scale * vita2d_texture_get_height(texture);
|
||||
|
||||
vertices[0].x = x;
|
||||
vertices[0].y = y;
|
||||
vertices[0].z = +0.5f;
|
||||
vertices[0].u = 0.0f;
|
||||
vertices[0].v = 0.0f;
|
||||
|
||||
vertices[1].x = x + w;
|
||||
vertices[1].y = y;
|
||||
vertices[1].z = +0.5f;
|
||||
vertices[1].u = 1.0f;
|
||||
vertices[1].v = 0.0f;
|
||||
|
||||
vertices[2].x = x;
|
||||
vertices[2].y = y + h;
|
||||
vertices[2].z = +0.5f;
|
||||
vertices[2].u = 0.0f;
|
||||
vertices[2].v = 1.0f;
|
||||
|
||||
vertices[3].x = x + w;
|
||||
vertices[3].y = y + h;
|
||||
vertices[3].z = +0.5f;
|
||||
vertices[3].u = 1.0f;
|
||||
vertices[3].v = 1.0f;
|
||||
|
||||
for(int n = 0; n < 4; n++){
|
||||
int k = (n + 2) % 4 ;
|
||||
vertices[n].r = color[4*k+0];
|
||||
vertices[n].g = color[4*k+1];
|
||||
vertices[n].b = color[4*k+2];
|
||||
vertices[n].a = color[4*k+3];
|
||||
}
|
||||
|
||||
// Set the texture to the TEXUNIT0
|
||||
sceGxmSetFragmentTexture(_vita2d_context, 0, &texture->gxm_tex);
|
||||
|
||||
sceGxmSetVertexStream(_vita2d_context, 0, vertices);
|
||||
sceGxmDraw(_vita2d_context, SCE_GXM_PRIMITIVE_TRIANGLE_STRIP, SCE_GXM_INDEX_FORMAT_U16, vita2d_get_linear_indices(), 4);
|
||||
}
|
||||
|
||||
void vita2d_draw_texture_scale(const vita2d_texture *texture, float x, float y, float x_scale, float y_scale)
|
||||
{
|
||||
set_texture_program();
|
||||
@@ -481,12 +517,11 @@ void vita2d_draw_texture_scale(const vita2d_texture *texture, float x, float y,
|
||||
draw_texture_scale_generic(texture, x, y, x_scale, y_scale);
|
||||
}
|
||||
|
||||
void vita2d_draw_texture_tint_scale(const vita2d_texture *texture, float x, float y, float x_scale, float y_scale, unsigned int color)
|
||||
void vita2d_draw_texture_tint_scale(const vita2d_texture *texture, float x, float y, float x_scale, float y_scale, const float *color)
|
||||
{
|
||||
set_texture_tint_program();
|
||||
set_texture_wvp_uniform();
|
||||
set_texture_tint_color_uniform(color);
|
||||
draw_texture_scale_generic(texture, x, y, x_scale, y_scale);
|
||||
set_texture_tint_wvp_uniform();
|
||||
draw_texture_tint_scale_generic(texture, x, y, x_scale, y_scale, color);
|
||||
}
|
||||
|
||||
|
||||
@@ -546,7 +581,6 @@ void vita2d_draw_texture_tint_part(const vita2d_texture *texture, float x, float
|
||||
{
|
||||
set_texture_tint_program();
|
||||
set_texture_wvp_uniform();
|
||||
set_texture_tint_color_uniform(color);
|
||||
draw_texture_part_generic(texture, x, y, tex_x, tex_y, tex_w, tex_h);
|
||||
}
|
||||
|
||||
@@ -598,6 +632,61 @@ static inline void draw_texture_part_scale_generic(const vita2d_texture *texture
|
||||
sceGxmDraw(_vita2d_context, SCE_GXM_PRIMITIVE_TRIANGLE_STRIP, SCE_GXM_INDEX_FORMAT_U16, vita2d_get_linear_indices(), 4);
|
||||
}
|
||||
|
||||
static inline void draw_texture_tint_part_scale_generic(const vita2d_texture *texture, float x, float y, float tex_x, float tex_y, float tex_w, float tex_h, float x_scale, float y_scale, unsigned int color)
|
||||
{
|
||||
vita2d_texture_tint_vertex *vertices = (vita2d_texture_tint_vertex *)vita2d_pool_memalign(
|
||||
4 * sizeof(vita2d_texture_tint_vertex), // 4 vertices
|
||||
sizeof(vita2d_texture_tint_vertex));
|
||||
|
||||
const float w = vita2d_texture_get_width(texture);
|
||||
const float h = vita2d_texture_get_height(texture);
|
||||
|
||||
const float u0 = tex_x/w;
|
||||
const float v0 = tex_y/h;
|
||||
const float u1 = (tex_x+tex_w)/w;
|
||||
const float v1 = (tex_y+tex_h)/h;
|
||||
|
||||
tex_w *= x_scale;
|
||||
tex_h *= y_scale;
|
||||
|
||||
vertices[0].x = x;
|
||||
vertices[0].y = y;
|
||||
vertices[0].z = +0.5f;
|
||||
vertices[0].u = u0;
|
||||
vertices[0].v = v0;
|
||||
|
||||
vertices[1].x = x + tex_w;
|
||||
vertices[1].y = y;
|
||||
vertices[1].z = +0.5f;
|
||||
vertices[1].u = u1;
|
||||
vertices[1].v = v0;
|
||||
|
||||
vertices[2].x = x;
|
||||
vertices[2].y = y + tex_h;
|
||||
vertices[2].z = +0.5f;
|
||||
vertices[2].u = u0;
|
||||
vertices[2].v = v1;
|
||||
|
||||
vertices[3].x = x + tex_w;
|
||||
vertices[3].y = y + tex_h;
|
||||
vertices[3].z = +0.5f;
|
||||
vertices[3].u = u1;
|
||||
vertices[3].v = v1;
|
||||
|
||||
for(int n = 0; n < 4; n++){
|
||||
vertices[n].r = ((color >> 8*0) & 0xFF)/255.0f;
|
||||
vertices[n].g = ((color >> 8*1) & 0xFF)/255.0f;
|
||||
vertices[n].b = ((color >> 8*2) & 0xFF)/255.0f;
|
||||
vertices[n].a = ((color >> 8*3) & 0xFF)/255.0f;
|
||||
}
|
||||
|
||||
// Set the texture to the TEXUNIT0
|
||||
sceGxmSetFragmentTexture(_vita2d_context, 0, &texture->gxm_tex);
|
||||
|
||||
sceGxmSetVertexStream(_vita2d_context, 0, vertices);
|
||||
sceGxmDraw(_vita2d_context, SCE_GXM_PRIMITIVE_TRIANGLE_STRIP, SCE_GXM_INDEX_FORMAT_U16, vita2d_get_linear_indices(), 4);
|
||||
}
|
||||
|
||||
void vita2d_draw_texture_part_scale(const vita2d_texture *texture, float x, float y, float tex_x, float tex_y, float tex_w, float tex_h, float x_scale, float y_scale)
|
||||
{
|
||||
set_texture_program();
|
||||
@@ -609,8 +698,7 @@ void vita2d_draw_texture_tint_part_scale(const vita2d_texture *texture, float x,
|
||||
{
|
||||
set_texture_tint_program();
|
||||
set_texture_wvp_uniform();
|
||||
set_texture_tint_color_uniform(color);
|
||||
draw_texture_part_scale_generic(texture, x, y, tex_x, tex_y, tex_w, tex_h, x_scale, y_scale);
|
||||
draw_texture_tint_part_scale_generic(texture, x, y, tex_x, tex_y, tex_w, tex_h, x_scale, y_scale, color);
|
||||
}
|
||||
|
||||
static inline void draw_texture_scale_rotate_hotspot_generic(const vita2d_texture *texture, float x, float y, float x_scale, float y_scale, float rad, float center_x, float center_y)
|
||||
@@ -684,7 +772,6 @@ void vita2d_draw_texture_tint_scale_rotate_hotspot(const vita2d_texture *texture
|
||||
{
|
||||
set_texture_tint_program();
|
||||
set_texture_wvp_uniform();
|
||||
set_texture_tint_color_uniform(color);
|
||||
draw_texture_scale_rotate_hotspot_generic(texture, x, y, x_scale, y_scale,
|
||||
rad, center_x, center_y);
|
||||
}
|
||||
@@ -769,7 +856,6 @@ void vita2d_draw_texture_part_tint_scale_rotate(const vita2d_texture *texture, f
|
||||
{
|
||||
set_texture_tint_program();
|
||||
set_texture_wvp_uniform();
|
||||
set_texture_tint_color_uniform(color);
|
||||
draw_texture_part_scale_rotate_generic(texture, x, y,
|
||||
tex_x, tex_y, tex_w, tex_h, x_scale, y_scale, rad);
|
||||
}
|
||||
@@ -778,7 +864,6 @@ void vita2d_draw_array_textured(const vita2d_texture *texture, SceGxmPrimitiveTy
|
||||
{
|
||||
set_texture_tint_program();
|
||||
set_texture_wvp_uniform();
|
||||
set_texture_tint_color_uniform(color);
|
||||
|
||||
sceGxmSetBackPolygonMode(_vita2d_context, SCE_GXM_POLYGON_MODE_TRIANGLE_FILL);
|
||||
|
||||
@@ -788,3 +873,18 @@ void vita2d_draw_array_textured(const vita2d_texture *texture, SceGxmPrimitiveTy
|
||||
sceGxmSetVertexStream(_vita2d_context, 0, vertices);
|
||||
sceGxmDraw(_vita2d_context, mode, SCE_GXM_INDEX_FORMAT_U16, vita2d_get_linear_indices(), count);
|
||||
}
|
||||
|
||||
void vita2d_draw_array_textured_mat(const vita2d_texture *texture, const vita2d_texture_tint_vertex *vertices, size_t count, float *mat)
|
||||
{
|
||||
set_texture_tint_program();
|
||||
|
||||
void *vertex_wvp_buffer;
|
||||
sceGxmReserveVertexDefaultUniformBuffer(_vita2d_context, &vertex_wvp_buffer);
|
||||
sceGxmSetUniformDataF(vertex_wvp_buffer, _vita2d_textureWvpParam, 0, 16, mat);
|
||||
|
||||
// Set the texture to the TEXUNIT0
|
||||
sceGxmSetFragmentTexture(_vita2d_context, 0, &texture->gxm_tex);
|
||||
|
||||
sceGxmSetVertexStream(_vita2d_context, 0, vertices);
|
||||
sceGxmDraw(_vita2d_context, SCE_GXM_PRIMITIVE_TRIANGLE_STRIP, SCE_GXM_INDEX_FORMAT_U16, vita2d_get_linear_indices(), count);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
# Auto detect text files and perform LF normalization
|
||||
* text=auto
|
||||
|
||||
# Custom for Visual Studio
|
||||
*.cs diff=csharp
|
||||
|
||||
# Standard to msysgit
|
||||
*.doc diff=astextplain
|
||||
*.DOC diff=astextplain
|
||||
*.docx diff=astextplain
|
||||
*.DOCX diff=astextplain
|
||||
*.dot diff=astextplain
|
||||
*.DOT diff=astextplain
|
||||
*.pdf diff=astextplain
|
||||
*.PDF diff=astextplain
|
||||
*.rtf diff=astextplain
|
||||
*.RTF diff=astextplain
|
||||
@@ -0,0 +1,26 @@
|
||||
*.o
|
||||
*.a
|
||||
|
||||
# Windows thumbnail cache files
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
ehthumbs_vista.db
|
||||
|
||||
# Folder config file
|
||||
Desktop.ini
|
||||
|
||||
# Recycle Bin used on file shares
|
||||
$RECYCLE.BIN/
|
||||
|
||||
# Windows Installer files
|
||||
*.cab
|
||||
*.msi
|
||||
*.msm
|
||||
*.msp
|
||||
|
||||
# Windows shortcuts
|
||||
*.lnk
|
||||
|
||||
# =========================
|
||||
# Operating System Files
|
||||
# =========================
|
||||
Vendored
+29
@@ -0,0 +1,29 @@
|
||||
TARGET := libmathneon
|
||||
SOURCES := source
|
||||
|
||||
LIBS = -lc -lm -lSceGxm_stub -lSceDisplay_stub
|
||||
|
||||
CFILES := $(foreach dir,$(SOURCES), $(wildcard $(dir)/*.c))
|
||||
CGFILES := $(foreach dir,$(SHADERS), $(wildcard $(dir)/*.cg))
|
||||
HEADERS := $(CGFILES:.cg=.h)
|
||||
OBJS := $(CFILES:.c=.o)
|
||||
|
||||
PREFIX = arm-vita-eabi
|
||||
CC = $(PREFIX)-gcc
|
||||
AR = $(PREFIX)-gcc-ar
|
||||
CFLAGS = -g -Wl,-q -O2 -ffast-math -mtune=cortex-a9 -mfpu=neon -flto -ftree-vectorize
|
||||
ASFLAGS = $(CFLAGS)
|
||||
|
||||
all: $(TARGET).a
|
||||
|
||||
$(TARGET).a: $(OBJS)
|
||||
$(AR) -rc $@ $^
|
||||
|
||||
clean:
|
||||
@rm -rf $(TARGET).a $(TARGET).elf $(OBJS)
|
||||
|
||||
install: $(TARGET).a
|
||||
@mkdir -p $(VITASDK)/$(PREFIX)/lib/
|
||||
cp $(TARGET).a $(VITASDK)/$(PREFIX)/lib/
|
||||
@mkdir -p $(VITASDK)/$(PREFIX)/include/
|
||||
cp source/math_neon.h $(VITASDK)/$(PREFIX)/include/
|
||||
Vendored
+169
@@ -0,0 +1,169 @@
|
||||
|
||||
Library: MATH-NEON
|
||||
By: Lachlan Tychsen-Smith
|
||||
Licence: MIT (expat)
|
||||
=======================================================================================
|
||||
This project implements the cmath functions and some optimised matrix functions
|
||||
with the aim of increasing the floating point performance of ARM Cortex A-8
|
||||
based platforms. As well as implementing the functions in ARM NEON assembly,
|
||||
they sacrifice error checking and some accuracy to achieve better performance.
|
||||
|
||||
Function Errors:
|
||||
=======================================================================================
|
||||
The measurement and characterisations of the inaccuracies present within these
|
||||
functions is really a field within itself. For the benchmark i provide the
|
||||
maximum absolute, maximum relative and root mean squared error compared to the
|
||||
cmath implementations over the specified range. However these values can be
|
||||
misleading, especially for functions which quickly go to infinity. So its always a
|
||||
good idea to test it within your actual program. In general, this library will not
|
||||
be as accurate as cmath, however for many functions it is close enough to be
|
||||
negilible.
|
||||
|
||||
Notes:
|
||||
=======================================================================================
|
||||
- The *_c functions are c implementations of the *_neon code.
|
||||
- Like cmath, The errors present in the functions are very dependent on the
|
||||
range which your operating in. So you should test them first.
|
||||
- Look in the "math_neon.h" file for discriptions of the functions. In some
|
||||
function files there are also notes on the specific implementation.
|
||||
- The *_neon functions make certain assumptions about the location of arguments
|
||||
that is incompatible with inlining.
|
||||
|
||||
Contact:
|
||||
=======================================================================================
|
||||
Name: Lachlan Tychsen-Smith
|
||||
Email: [email protected]
|
||||
|
||||
PSVITA performances test results:
|
||||
|
||||
RUNFAST: Enabled
|
||||
------------------------------------------------------------------------------------------------------
|
||||
MATRIX FUNCTION TESTS
|
||||
------------------------------------------------------------------------------------------------------
|
||||
matmul2_c =
|
||||
|-7.16, 9.42|
|
||||
|17.86, -10.70|
|
||||
matmul2_neon =
|
||||
|-7.16, 9.42|
|
||||
|17.86, -10.70|
|
||||
matmul2: c=183985 neon=87480 rate=2.10
|
||||
matvec2_c = |-7.16, 17.86|
|
||||
matvec2_neon = |-7.16, 17.86|
|
||||
matvec2: c=98178 neon=66040 rate=1.49
|
||||
matmul3_c =
|
||||
|11.14, -0.78, -3.98|
|
||||
|16.56, 17.96, 23.58|
|
||||
|8.73, -0.18, 1.57|
|
||||
matmul3_neon =
|
||||
|11.14, -0.78, -3.98|
|
||||
|16.56, 17.96, 23.58|
|
||||
|8.73, -0.18, 1.57|
|
||||
matmul3: c=551838 neon=340292 rate=1.62
|
||||
matvec3_c = |11.14, 16.56, 8.73|
|
||||
matvec3_neon = |11.14, 16.56, 8.73|
|
||||
matvec3: c=98178 neon=66040 rate=1.49
|
||||
matmul4_c =
|
||||
|17.91, -23.96, 1.86, 16.53|
|
||||
|4.10, -18.16, 4.17, 29.06|
|
||||
|6.92, -1.60, 3.12, 27.81|
|
||||
|-15.13, -7.46, -17.91, 22.49|
|
||||
matmul4_neon =
|
||||
|17.91, -23.96, 1.86, 16.53|
|
||||
|4.10, -18.16, 4.17, 29.06|
|
||||
|6.92, -1.60, 3.12, 27.81|
|
||||
|-15.13, -7.46, -17.91, 22.49|
|
||||
matmul4: c=1316131 neon=315444 rate=4.17
|
||||
matvec4_c = |17.91, 4.10, 6.92, -15.126419|
|
||||
matvec4_neon = |17.91, 4.10, 6.92, -15.126419|
|
||||
matvec4: c=98178 neon=66040 rate=1.49
|
||||
|
||||
dot2_c = 5.804099
|
||||
dot2_neon = 5.804099
|
||||
dot2: c=291526 neon=307025 rate=0.95
|
||||
normalize2_c = [0.97, 0.24]
|
||||
normalize2_neon = [0.97, 0.24]
|
||||
normalize2: c=1058588 neon=965696 rate=1.10
|
||||
|
||||
dot3_c = -0.817487
|
||||
dot3_neon = -0.817487
|
||||
dot3: c=322094 neon=444834 rate=0.72
|
||||
normalize3_c = [0.50, 0.12, -0.86]
|
||||
normalize3_neon = [0.50, 0.12, -0.86]
|
||||
normalize3: c=1257201 neon=1134375 rate=1.11
|
||||
cross3_c = [-13.16, -17.29, -10.19]
|
||||
cross3_neon = [-13.16, -17.29, -10.19]
|
||||
cross3: c=705298 neon=766477 rate=0.92
|
||||
|
||||
dot4_c = -7.880241
|
||||
dot4_neon = -7.880241
|
||||
dot4: c=414431 neon=506460 rate=0.82
|
||||
normalize4_c = [0.45, 0.11, -0.77, -0.44]
|
||||
normalize4_neon = [0.45, 0.11, -0.77, -0.44]
|
||||
normalize4: c=1410727 neon=1102802 rate=1.28
|
||||
|
||||
------------------------------------------------------------------------------------------------------
|
||||
CMATH FUNCTION TESTS
|
||||
------------------------------------------------------------------------------------------------------
|
||||
Function Range Number ABS Max Error REL Max Error RMS Error Time Rate
|
||||
------------------------------------------------------------------------------------------------------
|
||||
sinf [-3.14, 3.14] 500000 0.00e+00 0.00e+00% 0.00e+00 647042739 x1.00
|
||||
sinf_c [-3.14, 3.14] 500000 7.75e-07 1.00e+02% 4.09e-07 646276691 x1.00
|
||||
sinf_neon [-3.14, 3.14] 500000 1.00e+00 1.00e+02% 7.07e-01 645546381 x1.00
|
||||
cosf [-3.14, 3.14] 500000 0.00e+00 0.00e+00% 0.00e+00 644742077 x1.00
|
||||
cosf_c [-3.14, 3.14] 500000 7.75e-07 6.74e-01% 4.15e-07 643957358 x1.00
|
||||
cosf_neon [-3.14, 3.14] 500000 1.00e+00 1.00e+02% 7.06e-01 643211256 x1.00
|
||||
tanf [-0.79, 0.79] 500000 0.00e+00 0.00e+00% 0.00e+00 642444112 x1.00
|
||||
tanf_c [-0.79, 0.79] 500000 2.98e-06 7.94e-04% 1.31e-06 641628507 x1.00
|
||||
tanf_neon [-0.79, 0.79] 500000 1.00e+00 1.00e+02% nan 640740514 x1.00
|
||||
asinf [-1.00, 1.00] 500000 0.00e+00 0.00e+00% 0.00e+00 639560380 x1.00
|
||||
asinf_c [-1.00, 1.00] 500000 5.54e-05 1.06e-02% nan 638453383 x1.00
|
||||
asinf_neon [-1.00, 1.00] 500000 1.57e+00 1.00e+02% 6.84e-01 637349653 x1.00
|
||||
acosf [-1.00, 1.00] 500000 0.00e+00 0.00e+00% 0.00e+00 636078992 x1.00
|
||||
acosf_c [-1.00, 1.00] 500000 5.56e-05 6.46e-03% nan 634934201 x1.00
|
||||
acosf_neon [-1.00, 1.00] 500000 1.57e+00 1.02e+05% 6.84e-01 633793585 x1.00
|
||||
atanf [-1.00, 1.00] 500000 0.00e+00 0.00e+00% 0.00e+00 632835241 x1.00
|
||||
atanf_c [-1.00, 1.00] 500000 1.67e-04 2.12e-02% 7.40e-05 632142823 x1.00
|
||||
atanf_neon [-1.00, 1.00] 500000 7.85e-01 0.00e+00% nan 631387330 x1.00
|
||||
sinhf [-3.14, 3.14] 500000 0.00e+00 0.00e+00% 0.00e+00 630142014 x1.00
|
||||
sinhf_c [-3.14, 3.14] 500000 1.91e-06 1.52e-01% 1.85e-07 628992714 x1.00
|
||||
sinhf_neon [-3.14, 3.14] 500000 1.15e+01 1.00e+02% 4.55e+00 627998454 x1.00
|
||||
coshf [-3.14, 3.14] 500000 0.00e+00 0.00e+00% 0.00e+00 626869866 x1.00
|
||||
coshf_c [-3.14, 3.14] 500000 9.54e-07 2.38e-05% 1.64e-07 625829657 x1.00
|
||||
coshf_neon [-3.14, 3.14] 500000 1.06e+01 9.14e+01% 3.92e+00 624873969 x1.00
|
||||
tanhf [-3.14, 3.14] 500000 0.00e+00 0.00e+00% 0.00e+00 623689093 x1.00
|
||||
tanhf_c [-3.14, 3.14] 500000 1.20e-05 2.48e-01% 5.48e-06 622547097 x1.00
|
||||
tanhf_neon [-3.14, 3.14] 500000 9.96e-01 1.00e+02% 8.26e-01 621506812 x1.00
|
||||
expf [0.00, 10.00] 500000 0.00e+00 0.00e+00% 0.00e+00 620497304 x1.00
|
||||
expf_c [0.00, 10.00] 500000 9.77e-03 6.15e-05% 1.64e-03 619569554 x1.00
|
||||
expf_neon [0.00, 10.00] 500000 2.20e+04 1.00e+02% 4.92e+03 618761400 x1.00
|
||||
logf [1.00, 1000.00] 500000 0.00e+00 0.00e+00% 0.00e+00 617882765 x1.00
|
||||
logf_c [1.00, 1000.00] 500000 6.20e-06 1.62e-02% 9.83e-07 617087810 x1.00
|
||||
logf_neon [1.00, 1000.00] 500000 9.49e+01 inf% 9.39e+01 616388420 x1.00
|
||||
log10f [1.00, 1000.00] 500000 0.00e+00 0.00e+00% 0.00e+00 615405364 x1.00
|
||||
log10f_c [1.00, 1000.00] 500000 2.86e-06 6.68e-03% 4.79e-07 614442585 x1.00
|
||||
log10f_neon [1.00, 1000.00] 500000 4.12e+01 inf% 4.07e+01 613671782 x1.00
|
||||
floorf [1.00, 1000.00] 5000000 0.00e+00 0.00e+00% 0.00e+00 611113689 x1.00
|
||||
floorf_c [1.00, 1000.00] 5000000 0.00e+00 0.00e+00% 0.00e+00 608159325 x1.00
|
||||
floorf_neon [1.00, 1000.00] 5000000 2.00e+00 2.00e+02% 1.42e-02 604769008 x1.01
|
||||
ceilf [1.00, 1000.00] 5000000 0.00e+00 0.00e+00% 0.00e+00 601342443 x1.00
|
||||
ceilf_c [1.00, 1000.00] 5000000 0.00e+00 0.00e+00% 0.00e+00 598387998 x1.00
|
||||
ceilf_neon [1.00, 1000.00] 5000000 2.00e+00 1.00e+02% 1.02e+00 594959710 x1.01
|
||||
fabsf [1.00, 1000.00] 5000000 0.00e+00 0.00e+00% 0.00e+00 592068236 x1.00
|
||||
fabsf_c [1.00, 1000.00] 5000000 0.00e+00 0.00e+00% 0.00e+00 589808748 x1.00
|
||||
fabsf_neon [1.00, 1000.00] 5000000 0.00e+00 0.00e+00% 0.00e+00 587712180 x1.01
|
||||
sqrtf [1.00, 1000.00] 500000 0.00e+00 0.00e+00% 0.00e+00 586496654 x1.00
|
||||
sqrtf_c [1.00, 1000.00] 500000 2.33e-04 1.06e-03% 8.69e-05 585470866 x1.00
|
||||
sqrtf_neon [1.00, 1000.00] 500000 0.00e+00 0.00e+00% nan 584594551 x1.00
|
||||
invsqrtf [1.00, 1000.00] 500000 0.00e+00 0.00e+00% 0.00e+00 583492213 x1.00
|
||||
invsqrtf_c [1.00, 1000.00] 500000 4.35e-06 4.78e-04% 2.00e-07 582448164 x1.00
|
||||
invsqrtf_neon [1.00, 1000.00] 500000 0.00e+00 0.00e+00% nan 581642365 x1.00
|
||||
atan2f [0.10, 10.00] 10000 0.00e+00 0.00e+00% 0.00e+00 83594269 x1.00
|
||||
atan2f_c [0.10, 10.00] 10000 1.73e-04 2.23e-02% 0.00e+00 85383651 x0.98
|
||||
atan2f_neon [0.10, 10.00] 10000 0.00e+00 0.00e+00% 0.00e+00 87387055 x0.96
|
||||
powf [1.00, 10.00] 10000 0.00e+00 0.00e+00% 0.00e+00 93430489 x1.00
|
||||
powf_c [1.00, 10.00] 10000 1.08e+05 4.37e-03% 0.00e+00 96726976 x0.97
|
||||
powf_neon [1.00, 10.00] 10000 9.97e+09 1.00e+02% 0.00e+00 100185753 x0.93
|
||||
fmodf [1.00, 10.00] 10000 0.00e+00 0.00e+00% 0.00e+00 101653673 x1.00
|
||||
fmodf_c [1.00, 10.00] 10000 9.90e+00 8.06e-02% 0.00e+00 103177551 x0.99
|
||||
fmodf_neon [1.00, 10.00] 10000 9.99e+00 1.00e+02% 0.00e+00 104771240 x0.97
|
||||
|
||||
Vendored
+67
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Lachlan Tychsen-Smith (lachlan.ts@gmail.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "math.h"
|
||||
#include "math_neon.h"
|
||||
|
||||
/*
|
||||
Test func : acosf(x)
|
||||
Test Range: -1.0 < x < 1.0
|
||||
Peak Error: ~0.005%
|
||||
RMS Error: ~0.001%
|
||||
*/
|
||||
|
||||
const float __acosf_pi_2 = M_PI_2;
|
||||
|
||||
float acosf_c(float x)
|
||||
{
|
||||
return __acosf_pi_2 - asinf_c(x);
|
||||
}
|
||||
|
||||
|
||||
float acosf_neon_hfp(float x)
|
||||
{
|
||||
#ifdef __MATH_NEON
|
||||
asinf_neon_hfp(x);
|
||||
asm volatile (
|
||||
"vdup.f32 d1, %0 \n\t" //d1 = {pi/2, pi/2};
|
||||
"vsub.f32 d0, d1, d0 \n\t" //d0 = d1 - d0;
|
||||
::"r"(__acosf_pi_2):
|
||||
);
|
||||
#endif
|
||||
}
|
||||
|
||||
float acosf_neon_sfp(float x)
|
||||
{
|
||||
#ifdef __MATH_NEON
|
||||
asm volatile ("vmov.f32 s0, r0 \n\t");
|
||||
acosf_neon_hfp(x);
|
||||
asm volatile ("vmov.f32 r0, s0 \n\t");
|
||||
#else
|
||||
return acosf_c(x);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
Vendored
+183
@@ -0,0 +1,183 @@
|
||||
/*
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Lachlan Tychsen-Smith (lachlan.ts@gmail.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "math.h"
|
||||
#include "math_neon.h"
|
||||
|
||||
/*
|
||||
Test func : asinf(x)
|
||||
Test Range: -1.0 < x < 1.0
|
||||
Peak Error: ~0.005%
|
||||
RMS Error: ~0.001%
|
||||
*/
|
||||
|
||||
|
||||
const float __asinf_lut[4] = {
|
||||
0.105312459675071, //p7
|
||||
0.169303418571894, //p3
|
||||
0.051599985887214, //p5
|
||||
0.999954835104825 //p1
|
||||
};
|
||||
|
||||
const float __asinf_pi_2 = M_PI_2;
|
||||
|
||||
float asinf_c(float x)
|
||||
{
|
||||
|
||||
float a, b, c, d, r, ax;
|
||||
int m;
|
||||
|
||||
union {
|
||||
float f;
|
||||
int i;
|
||||
} xx;
|
||||
|
||||
ax = fabs(x);
|
||||
d = 0.5;
|
||||
d = d - ax*0.5;
|
||||
|
||||
//fast invsqrt approx
|
||||
xx.f = d;
|
||||
xx.i = 0x5F3759DF - (xx.i >> 1); //VRSQRTE
|
||||
c = d * xx.f;
|
||||
b = (3.0f - c * xx.f) * 0.5; //VRSQRTS
|
||||
xx.f = xx.f * b;
|
||||
c = d * xx.f;
|
||||
b = (3.0f - c * xx.f) * 0.5;
|
||||
xx.f = xx.f * b;
|
||||
|
||||
//fast inverse approx
|
||||
d = xx.f;
|
||||
m = 0x3F800000 - (xx.i & 0x7F800000);
|
||||
xx.i = xx.i + m;
|
||||
xx.f = 1.41176471f - 0.47058824f * xx.f;
|
||||
xx.i = xx.i + m;
|
||||
b = 2.0 - xx.f * d;
|
||||
xx.f = xx.f * b;
|
||||
b = 2.0 - xx.f * d;
|
||||
xx.f = xx.f * b;
|
||||
|
||||
//if |x|>0.5 -> x = sqrt((1-x)/2)
|
||||
xx.f = xx.f - ax;
|
||||
a = (ax > 0.5f);
|
||||
d = __asinf_pi_2 * a;
|
||||
c = 1.0f - 3.0f * a;
|
||||
ax = ax + xx.f * a;
|
||||
|
||||
//polynomial evaluation
|
||||
xx.f = ax * ax;
|
||||
a = (__asinf_lut[0] * ax) * xx.f + (__asinf_lut[2] * ax);
|
||||
b = (__asinf_lut[1] * ax) * xx.f + (__asinf_lut[3] * ax);
|
||||
xx.f = xx.f * xx.f;
|
||||
r = b + a * xx.f;
|
||||
r = d + c * r;
|
||||
|
||||
a = r + r;
|
||||
b = (x < 0.0f);
|
||||
r = r - a * b;
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
float asinf_neon_hfp(float x)
|
||||
{
|
||||
#ifdef __MATH_NEON
|
||||
asm volatile (
|
||||
|
||||
"vdup.f32 d0, d0[0] \n\t" //d0 = {x, x};
|
||||
"vdup.f32 d4, %1 \n\t" //d4 = {pi/2, pi/2};
|
||||
"vmov.f32 d6, d0 \n\t" //d6 = d0;
|
||||
"vabs.f32 d0, d0 \n\t" //d0 = fabs(d0) ;
|
||||
|
||||
"vmov.f32 d5, #0.5 \n\t" //d5 = 0.5;
|
||||
"vmls.f32 d5, d0, d5 \n\t" //d5 = d5 - d0*d5;
|
||||
|
||||
//fast invsqrt approx
|
||||
"vmov.f32 d1, d5 \n\t" //d1 = d5
|
||||
"vrsqrte.f32 d5, d5 \n\t" //d5 = ~ 1.0 / sqrt(d5)
|
||||
"vmul.f32 d2, d5, d1 \n\t" //d2 = d5 * d1
|
||||
"vrsqrts.f32 d3, d2, d5 \n\t" //d3 = (3 - d5 * d2) / 2
|
||||
"vmul.f32 d5, d5, d3 \n\t" //d5 = d5 * d3
|
||||
"vmul.f32 d2, d5, d1 \n\t" //d2 = d5 * d1
|
||||
"vrsqrts.f32 d3, d2, d5 \n\t" //d3 = (3 - d5 * d3) / 2
|
||||
"vmul.f32 d5, d5, d3 \n\t" //d5 = d5 * d3
|
||||
|
||||
//fast reciporical approximation
|
||||
"vrecpe.f32 d1, d5 \n\t" //d1 = ~ 1 / d5;
|
||||
"vrecps.f32 d2, d1, d5 \n\t" //d2 = 2.0 - d1 * d5;
|
||||
"vmul.f32 d1, d1, d2 \n\t" //d1 = d1 * d2;
|
||||
"vrecps.f32 d2, d1, d5 \n\t" //d2 = 2.0 - d1 * d5;
|
||||
"vmul.f32 d5, d1, d2 \n\t" //d5 = d1 * d2;
|
||||
|
||||
//if |x| > 0.5 -> ax = sqrt((1-ax)/2), r = pi/2
|
||||
"vsub.f32 d5, d0, d5 \n\t" //d5 = d0 - d5;
|
||||
"vmov.f32 d2, #0.5 \n\t" //d2 = 0.5;
|
||||
"vcgt.f32 d3, d0, d2 \n\t" //d3 = (d0 > d2);
|
||||
"vmov.f32 d1, #3.0 \n\t" //d5 = 3.0;
|
||||
"vshr.u32 d3, #31 \n\t" //d3 = d3 >> 31;
|
||||
"vmov.f32 d16, #1.0 \n\t" //d16 = 1.0;
|
||||
"vcvt.f32.u32 d3, d3 \n\t" //d3 = (float) d3;
|
||||
"vmls.f32 d0, d5, d3[0] \n\t" //d0 = d0 - d5 * d3[0];
|
||||
"vmul.f32 d7, d4, d3[0] \n\t" //d7 = d5 * d4;
|
||||
"vmls.f32 d16, d1, d3[0] \n\t" //d16 = d16 - d1 * d3;
|
||||
|
||||
//polynomial:
|
||||
"vmul.f32 d2, d0, d0 \n\t" //d2 = d0*d0 = {ax^2, ax^2}
|
||||
"vld1.32 {d4, d5}, [%0] \n\t" //d4 = {p7, p3}, d5 = {p5, p1}
|
||||
"vmul.f32 d3, d2, d2 \n\t" //d3 = d2*d2 = {x^4, x^4}
|
||||
"vmul.f32 q0, q2, d0[0] \n\t" //q0 = q2 * d0[0] = {p7x, p3x, p5x, p1x}
|
||||
"vmla.f32 d1, d0, d2[0] \n\t" //d1 = d1 + d0*d2[0] = {p5x + p7x^3, p1x + p3x^3}
|
||||
"vmla.f32 d1, d3, d1[0] \n\t" //d1 = d1 + d3*d1[0] = {..., p1x + p3x^3 + p5x^5 + p7x^7}
|
||||
|
||||
"vmla.f32 d7, d1, d16 \n\t" //d7 = d7 + d1*d16
|
||||
|
||||
"vadd.f32 d2, d7, d7 \n\t" //d2 = d7 + d7
|
||||
"vclt.f32 d3, d6, #0 \n\t" //d3 = (d6 < 0)
|
||||
"vshr.u32 d3, #31 \n\t" //d3 = d3 >> 31;
|
||||
"vcvt.f32.u32 d3, d3 \n\t" //d3 = (float) d3
|
||||
"vmls.f32 d7, d2, d3[0] \n\t" //d7 = d7 - d2 * d3[0];
|
||||
|
||||
"vmov.f32 s0, s15 \n\t" //s0 = s3
|
||||
|
||||
:: "r"(__asinf_lut), "r"(__asinf_pi_2)
|
||||
: "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7"
|
||||
);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
float asinf_neon_sfp(float x)
|
||||
{
|
||||
#ifdef __MATH_NEON
|
||||
asm volatile ("vmov.f32 s0, r0 \n\t");
|
||||
asinf_neon_hfp(x);
|
||||
asm volatile ("vmov.f32 r0, s0 \n\t");
|
||||
#else
|
||||
return asinf_c(x);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Vendored
+170
@@ -0,0 +1,170 @@
|
||||
/*
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Lachlan Tychsen-Smith (lachlan.ts@gmail.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "math.h"
|
||||
#include "math_neon.h"
|
||||
|
||||
const float __atan2f_lut[4] = {
|
||||
-0.0443265554792128, //p7
|
||||
-0.3258083974640975, //p3
|
||||
+0.1555786518463281, //p5
|
||||
+0.9997878412794807 //p1
|
||||
};
|
||||
|
||||
const float __atan2f_pi_2 = M_PI_2;
|
||||
|
||||
float atan2f_c(float y, float x)
|
||||
{
|
||||
float a, b, c, r, xx;
|
||||
int m;
|
||||
union {
|
||||
float f;
|
||||
int i;
|
||||
} xinv;
|
||||
|
||||
//fast inverse approximation (2x newton)
|
||||
xx = fabs(x);
|
||||
xinv.f = xx;
|
||||
m = 0x3F800000 - (xinv.i & 0x7F800000);
|
||||
xinv.i = xinv.i + m;
|
||||
xinv.f = 1.41176471f - 0.47058824f * xinv.f;
|
||||
xinv.i = xinv.i + m;
|
||||
b = 2.0 - xinv.f * xx;
|
||||
xinv.f = xinv.f * b;
|
||||
b = 2.0 - xinv.f * xx;
|
||||
xinv.f = xinv.f * b;
|
||||
|
||||
c = fabs(y * xinv.f);
|
||||
|
||||
//fast inverse approximation (2x newton)
|
||||
xinv.f = c;
|
||||
m = 0x3F800000 - (xinv.i & 0x7F800000);
|
||||
xinv.i = xinv.i + m;
|
||||
xinv.f = 1.41176471f - 0.47058824f * xinv.f;
|
||||
xinv.i = xinv.i + m;
|
||||
b = 2.0 - xinv.f * c;
|
||||
xinv.f = xinv.f * b;
|
||||
b = 2.0 - xinv.f * c;
|
||||
xinv.f = xinv.f * b;
|
||||
|
||||
//if |x| > 1.0 -> ax = -1/ax, r = pi/2
|
||||
xinv.f = xinv.f + c;
|
||||
a = (c > 1.0f);
|
||||
c = c - a * xinv.f;
|
||||
r = a * __atan2f_pi_2;
|
||||
|
||||
//polynomial evaluation
|
||||
xx = c * c;
|
||||
a = (__atan2f_lut[0] * c) * xx + (__atan2f_lut[2] * c);
|
||||
b = (__atan2f_lut[1] * c) * xx + (__atan2f_lut[3] * c);
|
||||
xx = xx * xx;
|
||||
r = r + a * xx;
|
||||
r = r + b;
|
||||
|
||||
//determine quadrant and test for small x.
|
||||
b = M_PI;
|
||||
b = b - 2.0f * r;
|
||||
r = r + (x < 0.0f) * b;
|
||||
b = (fabs(x) < 0.000001f);
|
||||
c = !b;
|
||||
r = c * r;
|
||||
r = r + __atan2f_pi_2 * b;
|
||||
b = r + r;
|
||||
r = r - (y < 0.0f) * b;
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
float atan2f_neon_hfp(float y, float x)
|
||||
{
|
||||
#ifdef __MATH_NEON
|
||||
asm volatile (
|
||||
|
||||
"vdup.f32 d17, d0[1] \n\t" //d17 = {x, x};
|
||||
"vdup.f32 d16, d0[0] \n\t" //d16 = {y, y};
|
||||
|
||||
//1.0 / x
|
||||
"vrecpe.f32 d18, d17 \n\t" //d16 = ~ 1 / d1;
|
||||
"vrecps.f32 d19, d18, d17 \n\t" //d17 = 2.0 - d16 * d1;
|
||||
"vmul.f32 d18, d18, d19 \n\t" //d16 = d16 * d17;
|
||||
"vrecps.f32 d19, d18, d17 \n\t" //d17 = 2.0 - d16 * d1;
|
||||
"vmul.f32 d18, d18, d19 \n\t" //d16 = d16 * d17;
|
||||
|
||||
//y * (1.0 /x)
|
||||
"vmul.f32 d0, d16, d18 \n\t" //d0 = d16 * d18;
|
||||
|
||||
|
||||
"vdup.f32 d4, %1 \n\t" //d4 = {pi/2, pi/2};
|
||||
"vmov.f32 d6, d0 \n\t" //d6 = d0;
|
||||
"vabs.f32 d0, d0 \n\t" //d0 = fabs(d0) ;
|
||||
|
||||
//fast reciporical approximation
|
||||
"vrecpe.f32 d1, d0 \n\t" //d1 = ~ 1 / d0;
|
||||
"vrecps.f32 d2, d1, d0 \n\t" //d2 = 2.0 - d1 * d0;
|
||||
"vmul.f32 d1, d1, d2 \n\t" //d1 = d1 * d2;
|
||||
"vrecps.f32 d2, d1, d0 \n\t" //d2 = 2.0 - d1 * d0;
|
||||
"vmul.f32 d1, d1, d2 \n\t" //d1 = d1 * d2;
|
||||
|
||||
//if |x| > 1.0 -> ax = 1/ax, r = pi/2
|
||||
"vadd.f32 d1, d1, d0 \n\t" //d1 = d1 + d0;
|
||||
"vmov.f32 d2, #1.0 \n\t" //d2 = 1.0;
|
||||
"vcgt.f32 d3, d0, d2 \n\t" //d3 = (d0 > d2);
|
||||
"vcvt.f32.u32 d3, d3 \n\t" //d3 = (float) d3;
|
||||
"vmls.f32 d0, d1, d3 \n\t" //d0 = d0 - d1 * d3;
|
||||
"vmul.f32 d7, d3, d4 \n\t" //d7 = d3 * d4;
|
||||
|
||||
//polynomial:
|
||||
"vmul.f32 d2, d0, d0 \n\t" //d2 = d0*d0 = {ax^2, ax^2}
|
||||
"vld1.32 {d4, d5}, [%0] \n\t" //d4 = {p7, p3}, d5 = {p5, p1}
|
||||
"vmul.f32 d3, d2, d2 \n\t" //d3 = d2*d2 = {x^4, x^4}
|
||||
"vmul.f32 q0, q2, d0[0] \n\t" //q0 = q2 * d0[0] = {p7x, p3x, p5x, p1x}
|
||||
"vmla.f32 d1, d0, d2[0] \n\t" //d1 = d1 + d0*d2[0] = {p5x + p7x^3, p1x + p3x^3}
|
||||
"vmla.f32 d1, d3, d1[0] \n\t" //d1 = d1 + d3*d1[0] = {..., p1x + p3x^3 + p5x^5 + p7x^7}
|
||||
"vadd.f32 d1, d1, d7 \n\t" //d1 = d1 + d7
|
||||
|
||||
"vadd.f32 d2, d1, d1 \n\t" //d2 = d1 + d1
|
||||
"vclt.f32 d3, d6, #0 \n\t" //d3 = (d6 < 0)
|
||||
"vcvt.f32.u32 d3, d3 \n\t" //d3 = (float) d3
|
||||
"vmls.f32 d1, d3, d2 \n\t" //d1 = d1 - d2 * d3;
|
||||
|
||||
"vmov.f32 s0, s3 \n\t" //s0 = s3
|
||||
|
||||
:: "r"(__atan2f_lut), "r"(__atan2f_pi_2)
|
||||
: "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7"
|
||||
);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
float atan2f_neon_sfp(float x, float y)
|
||||
{
|
||||
#ifdef __MATH_NEON
|
||||
asm volatile ("vmov.f32 s0, r0 \n\t");
|
||||
asm volatile ("vmov.f32 s1, r1 \n\t");
|
||||
atan2f_neon_hfp(x, y);
|
||||
asm volatile ("vmov.f32 r0, s0 \n\t");
|
||||
#else
|
||||
return atan2f_c(y, x);
|
||||
#endif
|
||||
};
|
||||
Vendored
+149
@@ -0,0 +1,149 @@
|
||||
/*
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Lachlan Tychsen-Smith (lachlan.ts@gmail.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "math.h"
|
||||
#include "math_neon.h"
|
||||
|
||||
const float __atanf_lut[4] = {
|
||||
-0.0443265554792128, //p7
|
||||
-0.3258083974640975, //p3
|
||||
+0.1555786518463281, //p5
|
||||
+0.9997878412794807 //p1
|
||||
};
|
||||
|
||||
const float __atanf_pi_2 = M_PI_2;
|
||||
|
||||
float atanf_c(float x)
|
||||
{
|
||||
|
||||
float a, b, r, xx;
|
||||
int m;
|
||||
|
||||
union {
|
||||
float f;
|
||||
int i;
|
||||
} xinv, ax;
|
||||
|
||||
ax.f = fabs(x);
|
||||
|
||||
//fast inverse approximation (2x newton)
|
||||
xinv.f = ax.f;
|
||||
m = 0x3F800000 - (xinv.i & 0x7F800000);
|
||||
xinv.i = xinv.i + m;
|
||||
xinv.f = 1.41176471f - 0.47058824f * xinv.f;
|
||||
xinv.i = xinv.i + m;
|
||||
b = 2.0 - xinv.f * ax.f;
|
||||
xinv.f = xinv.f * b;
|
||||
b = 2.0 - xinv.f * ax.f;
|
||||
xinv.f = xinv.f * b;
|
||||
|
||||
//if |x| > 1.0 -> ax = -1/ax, r = pi/2
|
||||
xinv.f = xinv.f + ax.f;
|
||||
a = (ax.f > 1.0f);
|
||||
ax.f = ax.f - a * xinv.f;
|
||||
r = a * __atanf_pi_2;
|
||||
|
||||
//polynomial evaluation
|
||||
xx = ax.f * ax.f;
|
||||
a = (__atanf_lut[0] * ax.f) * xx + (__atanf_lut[2] * ax.f);
|
||||
b = (__atanf_lut[1] * ax.f) * xx + (__atanf_lut[3] * ax.f);
|
||||
xx = xx * xx;
|
||||
b = b + a * xx;
|
||||
r = r + b;
|
||||
|
||||
//if x < 0 -> r = -r
|
||||
a = 2 * r;
|
||||
b = (x < 0.0f);
|
||||
r = r - a * b;
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
float atanf_neon_hfp(float x)
|
||||
{
|
||||
#ifdef __MATH_NEON
|
||||
asm volatile (
|
||||
|
||||
"vdup.f32 d0, d0[0] \n\t" //d0 = {x, x};
|
||||
|
||||
"vdup.f32 d4, %1 \n\t" //d4 = {pi/2, pi/2};
|
||||
"vmov.f32 d6, d0 \n\t" //d6 = d0;
|
||||
"vabs.f32 d0, d0 \n\t" //d0 = fabs(d0) ;
|
||||
|
||||
//fast reciporical approximation
|
||||
"vrecpe.f32 d1, d0 \n\t" //d1 = ~ 1 / d0;
|
||||
"vrecps.f32 d2, d1, d0 \n\t" //d2 = 2.0 - d1 * d0;
|
||||
"vmul.f32 d1, d1, d2 \n\t" //d1 = d1 * d2;
|
||||
"vrecps.f32 d2, d1, d0 \n\t" //d2 = 2.0 - d1 * d0;
|
||||
"vmul.f32 d1, d1, d2 \n\t" //d1 = d1 * d2;
|
||||
|
||||
|
||||
//if |x| > 1.0 -> ax = -1/ax, r = pi/2
|
||||
"vadd.f32 d1, d1, d0 \n\t" //d1 = d1 + d0;
|
||||
"vmov.f32 d2, #1.0 \n\t" //d2 = 1.0;
|
||||
"vcgt.f32 d3, d0, d2 \n\t" //d3 = (d0 > d2);
|
||||
"vshr.u32 d3, #31 \n\t" //d3 = (d0 > d2);
|
||||
"vcvt.f32.u32 d3, d3 \n\t" //d5 = (float) d3;
|
||||
"vmls.f32 d0, d1, d3[0] \n\t" //d0 = d0 - d1 * d3[0];
|
||||
"vmul.f32 d7, d4, d3[0] \n\t" //d7 = d5 * d4;
|
||||
|
||||
//polynomial:
|
||||
"vmul.f32 d2, d0, d0 \n\t" //d2 = d0*d0 = {ax^2, ax^2}
|
||||
"vld1.32 {d4, d5}, [%0] \n\t" //d4 = {p7, p3}, d5 = {p5, p1}
|
||||
"vmul.f32 d3, d2, d2 \n\t" //d3 = d2*d2 = {x^4, x^4}
|
||||
"vmul.f32 q0, q2, d0[0] \n\t" //q0 = q2 * d0[0] = {p7x, p3x, p5x, p1x}
|
||||
"vmla.f32 d1, d0, d2[0] \n\t" //d1 = d1 + d0*d2[0] = {p5x + p7x^3, p1x + p3x^3}
|
||||
"vmla.f32 d1, d3, d1[0] \n\t" //d1 = d1 + d3*d1[0] = {..., p1x + p3x^3 + p5x^5 + p7x^7}
|
||||
"vadd.f32 d1, d1, d7 \n\t" //d1 = d1 + d7
|
||||
|
||||
"vadd.f32 d2, d1, d1 \n\t" //d2 = d1 + d1
|
||||
"vclt.f32 d3, d6, #0 \n\t" //d3 = (d6 < 0)
|
||||
"vshr.u32 d3, #31 \n\t" //d3 = (d0 > d2);
|
||||
"vcvt.f32.u32 d3, d3 \n\t" //d3 = (float) d3
|
||||
"vmls.f32 d1, d3, d2 \n\t" //d1 = d1 - d2 * d3;
|
||||
|
||||
"vmov.f32 s0, s3 \n\t" //s0 = s3
|
||||
|
||||
:: "r"(__atanf_lut), "r"(__atanf_pi_2)
|
||||
: "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7"
|
||||
);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
float atanf_neon_sfp(float x)
|
||||
{
|
||||
#ifdef __MATH_NEON
|
||||
asm volatile ("vdup.f32 d0, r0 \n\t");
|
||||
atanf_neon_hfp(x);
|
||||
asm volatile ("vmov.f32 r0, s0 \n\t");
|
||||
#else
|
||||
return atanf_c(x);
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
|
||||
Vendored
+71
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Lachlan Tychsen-Smith (lachlan.ts@gmail.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
Assumes the floating point value |x| < 2147483648
|
||||
*/
|
||||
|
||||
#include "math.h"
|
||||
#include "math_neon.h"
|
||||
|
||||
float ceilf_c(float x)
|
||||
{
|
||||
int n;
|
||||
float r;
|
||||
n = (int) x;
|
||||
r = (float) n;
|
||||
r = r + (x > r);
|
||||
return r;
|
||||
}
|
||||
|
||||
float ceilf_neon_hfp(float x)
|
||||
{
|
||||
#ifdef __MATH_NEON
|
||||
asm volatile (
|
||||
|
||||
"vcvt.s32.f32 d1, d0 \n\t" //d1 = (int) d0;
|
||||
"vcvt.f32.s32 d1, d1 \n\t" //d1 = (float) d1;
|
||||
"vcgt.f32 d0, d0, d1 \n\t" //d0 = (d0 > d1);
|
||||
"vshr.u32 d0, #31 \n\t" //d0 = d0 >> 31;
|
||||
"vcvt.f32.u32 d0, d0 \n\t" //d0 = (float) d0;
|
||||
"vadd.f32 d0, d1, d0 \n\t" //d0 = d1 + d0;
|
||||
|
||||
::: "d0", "d1"
|
||||
);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
float ceilf_neon_sfp(float x)
|
||||
{
|
||||
#ifdef __MATH_NEON
|
||||
asm volatile ("vmov.f32 s0, r0 \n\t");
|
||||
ceilf_neon_hfp(x);
|
||||
asm volatile ("vmov.f32 r0, s0 \n\t");
|
||||
#else
|
||||
return ceilf_c(x);
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
Vendored
+50
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Lachlan Tychsen-Smith (lachlan.ts@gmail.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "math_neon.h"
|
||||
|
||||
float cosf_c(float x)
|
||||
{
|
||||
return sinf_c(x + M_PI_2);
|
||||
}
|
||||
|
||||
float cosf_neon_hfp(float x)
|
||||
{
|
||||
#ifdef __MATH_NEON
|
||||
float xx = x + M_PI_2;
|
||||
return sinf_neon_hfp(xx);
|
||||
#endif
|
||||
}
|
||||
|
||||
float cosf_neon_sfp(float x)
|
||||
{
|
||||
#ifdef __MATH_NEON
|
||||
asm volatile ("vdup.f32 d0, r0 \n\t");
|
||||
cosf_neon_hfp(x);
|
||||
asm volatile ("vmov.f32 r0, s0 \n\t");
|
||||
#else
|
||||
return cosf_c(x);
|
||||
#endif
|
||||
};
|
||||
|
||||
Vendored
+120
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Lachlan Tychsen-Smith (lachlan.ts@gmail.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "math.h"
|
||||
#include "math_neon.h"
|
||||
|
||||
const float __coshf_rng[2] = {
|
||||
1.442695041f,
|
||||
0.693147180f
|
||||
};
|
||||
|
||||
const float __coshf_lut[16] = {
|
||||
0.00019578093328483123, //p7
|
||||
0.00019578093328483123, //p7
|
||||
0.0014122663401803872, //p6
|
||||
0.0014122663401803872, //p6
|
||||
0.008336936973260111, //p5
|
||||
0.008336936973260111, //p5
|
||||
0.04165989275009526, //p4
|
||||
0.04165989275009526, //p4
|
||||
0.16666570253074878, //p3
|
||||
0.16666570253074878, //p3
|
||||
0.5000006143673624, //p2
|
||||
0.5000006143673624, //p2
|
||||
1.000000059694879, //p1
|
||||
1.000000059694879, //p1
|
||||
0.9999999916728642, //p0
|
||||
0.9999999916728642 //p0
|
||||
};
|
||||
|
||||
|
||||
float coshf_c(float x)
|
||||
{
|
||||
float a, b, xx;
|
||||
xx = -x;
|
||||
a = expf_c(x);
|
||||
b = expf_c(xx);
|
||||
a = a * 0.5f;
|
||||
a = a + 0.5f * b;
|
||||
return a;
|
||||
}
|
||||
|
||||
|
||||
float coshf_neon_hfp(float x)
|
||||
{
|
||||
#ifdef __MATH_NEON
|
||||
asm volatile (
|
||||
"vdup.f32 d0, d0[0] \n\t" //d0 = {x, x}
|
||||
"fnegs s1, s1 \n\t" //s1 = -s1
|
||||
|
||||
//Range Reduction:
|
||||
"vld1.32 d2, [%0] \n\t" //d2 = {invrange, range}
|
||||
"vld1.32 {d16, d17}, [%1]! \n\t"
|
||||
"vmul.f32 d6, d0, d2[0] \n\t" //d6 = d0 * d2[0]
|
||||
"vcvt.s32.f32 d6, d6 \n\t" //d6 = (int) d6
|
||||
"vld1.32 {d18}, [%1]! \n\t"
|
||||
"vcvt.f32.s32 d1, d6 \n\t" //d1 = (float) d6
|
||||
"vld1.32 {d19}, [%1]! \n\t"
|
||||
"vmls.f32 d0, d1, d2[1] \n\t" //d0 = d0 - d1 * d2[1]
|
||||
"vld1.32 {d20}, [%1]! \n\t"
|
||||
|
||||
//polynomial:
|
||||
"vmla.f32 d17, d16, d0 \n\t" //d17 = d17 + d16 * d0;
|
||||
"vld1.32 {d21}, [%1]! \n\t"
|
||||
"vmla.f32 d18, d17, d0 \n\t" //d18 = d18 + d17 * d0;
|
||||
"vld1.32 {d22}, [%1]! \n\t"
|
||||
"vmla.f32 d19, d18, d0 \n\t" //d19 = d19 + d18 * d0;
|
||||
"vld1.32 {d23}, [%1]! \n\t"
|
||||
"vmla.f32 d20, d19, d0 \n\t" //d20 = d20 + d19 * d0;
|
||||
"vmla.f32 d21, d20, d0 \n\t" //d21 = d21 + d20 * d0;
|
||||
"vmla.f32 d22, d21, d0 \n\t" //d22 = d22 + d21 * d0;
|
||||
"vmla.f32 d23, d22, d0 \n\t" //d23 = d23 + d22 * d0;
|
||||
|
||||
//multiply by 2 ^ m
|
||||
"vshl.i32 d6, d6, #23 \n\t" //d6 = d6 << 23
|
||||
"vadd.i32 d0, d23, d6 \n\t" //d0 = d22 + d6
|
||||
|
||||
"vdup.f32 d2, d0[1] \n\t" //d2 = s1
|
||||
"vmov.f32 d1, #0.5 \n\t" //d1 = 0.5
|
||||
"vadd.f32 d0, d0, d2 \n\t" //d0 = d0 + d2
|
||||
"vmul.f32 d0, d1 \n\t" //d0 = d0 * d1
|
||||
|
||||
:: "r"(__coshf_rng), "r"(__coshf_lut)
|
||||
: "d0", "d1", "q1", "q2", "d6"
|
||||
);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
float coshf_neon_sfp(float x)
|
||||
{
|
||||
#ifdef __MATH_NEON
|
||||
asm volatile ("vmov.f32 s0, r0 \n\t");
|
||||
coshf_neon_hfp(x);
|
||||
asm volatile ("vmov.f32 r0, s0 \n\t");
|
||||
#else
|
||||
return coshf_c(x);
|
||||
#endif
|
||||
};
|
||||
Vendored
+135
@@ -0,0 +1,135 @@
|
||||
/*
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Lachlan Tychsen-Smith (lachlan.ts@gmail.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
Based on:
|
||||
|
||||
e ^ x = (1+m) * (2^n)
|
||||
x = log(1+m) + n * log(2)
|
||||
n = (int) (x * 1.0 / log(2))
|
||||
(1+m) = e ^ (x - n * log(2))
|
||||
(1+m) = Poly(x - n * log(2))
|
||||
|
||||
where Poly(x) is the Minimax approximation of e ^ x over the
|
||||
range [-Log(2), Log(2)]
|
||||
|
||||
Test func : expf(x)
|
||||
Test Range: 0 < x < 50
|
||||
Peak Error: ~0.00024%
|
||||
RMS Error: ~0.00007%
|
||||
*/
|
||||
|
||||
#include "math.h"
|
||||
#include "math_neon.h"
|
||||
|
||||
const float __expf_rng[2] = {
|
||||
1.442695041f,
|
||||
0.693147180f
|
||||
};
|
||||
|
||||
const float __expf_lut[8] = {
|
||||
0.9999999916728642, //p0
|
||||
0.04165989275009526, //p4
|
||||
0.5000006143673624, //p2
|
||||
0.0014122663401803872, //p6
|
||||
1.000000059694879, //p1
|
||||
0.008336936973260111, //p5
|
||||
0.16666570253074878, //p3
|
||||
0.00019578093328483123 //p7
|
||||
};
|
||||
|
||||
float expf_c(float x)
|
||||
{
|
||||
float a, b, c, d, xx;
|
||||
int m;
|
||||
|
||||
union {
|
||||
float f;
|
||||
int i;
|
||||
} r;
|
||||
|
||||
//Range Reduction:
|
||||
m = (int) (x * __expf_rng[0]);
|
||||
x = x - ((float) m) * __expf_rng[1];
|
||||
|
||||
//Taylor Polynomial (Estrins)
|
||||
a = (__expf_lut[4] * x) + (__expf_lut[0]);
|
||||
b = (__expf_lut[6] * x) + (__expf_lut[2]);
|
||||
c = (__expf_lut[5] * x) + (__expf_lut[1]);
|
||||
d = (__expf_lut[7] * x) + (__expf_lut[3]);
|
||||
xx = x * x;
|
||||
a = a + b * xx;
|
||||
c = c + d * xx;
|
||||
xx = xx* xx;
|
||||
r.f = a + c * xx;
|
||||
|
||||
//multiply by 2 ^ m
|
||||
m = m << 23;
|
||||
r.i = r.i + m;
|
||||
|
||||
return r.f;
|
||||
}
|
||||
|
||||
float expf_neon_hfp(float x)
|
||||
{
|
||||
#ifdef __MATH_NEON
|
||||
asm volatile (
|
||||
"vdup.f32 d0, d0[0] \n\t" //d0 = {x, x}
|
||||
|
||||
//Range Reduction:
|
||||
"vld1.32 d2, [%0] \n\t" //d2 = {invrange, range}
|
||||
"vmul.f32 d6, d0, d2[0] \n\t" //d6 = d0 * d2[0]
|
||||
"vcvt.s32.f32 d6, d6 \n\t" //d6 = (int) d6
|
||||
"vcvt.f32.s32 d1, d6 \n\t" //d1 = (float) d6
|
||||
"vmls.f32 d0, d1, d2[1] \n\t" //d0 = d0 - d1 * d2[1]
|
||||
|
||||
//polynomial:
|
||||
"vmul.f32 d1, d0, d0 \n\t" //d1 = d0*d0 = {x^2, x^2}
|
||||
"vld1.32 {d2, d3, d4, d5}, [%1] \n\t" //q1 = {p0, p4, p2, p6}, q2 = {p1, p5, p3, p7} ;
|
||||
"vmla.f32 q1, q2, d0[0] \n\t" //q1 = q1 + q2 * d0[0]
|
||||
"vmla.f32 d2, d3, d1[0] \n\t" //d2 = d2 + d3 * d1[0]
|
||||
"vmul.f32 d1, d1, d1 \n\t" //d1 = d1 * d1 = {x^4, x^4}
|
||||
"vmla.f32 d2, d1, d2[1] \n\t" //d2 = d2 + d1 * d2[1]
|
||||
|
||||
//multiply by 2 ^ m
|
||||
"vshl.i32 d6, d6, #23 \n\t" //d6 = d6 << 23
|
||||
"vadd.i32 d0, d2, d6 \n\t" //d0 = d2 + d6
|
||||
|
||||
:: "r"(__expf_rng), "r"(__expf_lut)
|
||||
: "d0", "d1", "q1", "q2", "d6"
|
||||
);
|
||||
#endif
|
||||
}
|
||||
|
||||
float expf_neon_sfp(float x)
|
||||
{
|
||||
#ifdef __MATH_NEON
|
||||
asm volatile ("vmov.f32 s0, r0 \n\t");
|
||||
expf_neon_hfp(x);
|
||||
asm volatile ("vmov.f32 r0, s0 \n\t");
|
||||
#else
|
||||
return expf_c(x);
|
||||
#endif
|
||||
};
|
||||
|
||||
Vendored
+58
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Lachlan Tychsen-Smith (lachlan.ts@gmail.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "math_neon.h"
|
||||
|
||||
|
||||
float fabsf_c(float x)
|
||||
{
|
||||
union {
|
||||
int i;
|
||||
float f;
|
||||
} xx;
|
||||
|
||||
xx.f = x;
|
||||
xx.i = xx.i & 0x7FFFFFFF;
|
||||
return xx.f;
|
||||
}
|
||||
|
||||
float fabsf_neon_hfp(float x)
|
||||
{
|
||||
#ifdef __MATH_NEON
|
||||
asm volatile (
|
||||
"fabss s0, s0 \n\t" //s0 = fabs(s0)
|
||||
);
|
||||
#endif
|
||||
}
|
||||
|
||||
float fabsf_neon_sfp(float x)
|
||||
{
|
||||
#ifdef __MATH_NEON
|
||||
asm volatile (
|
||||
"bic r0, r0, #0x80000000 \n\t" //r0 = r0 & ~(1 << 31)
|
||||
);
|
||||
#else
|
||||
return fabsf_c(x);
|
||||
#endif
|
||||
}
|
||||
Vendored
+66
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Lachlan Tychsen-Smith (lachlan.ts@gmail.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
Assumes the floating point value |x| < 2147483648
|
||||
*/
|
||||
|
||||
#include "math.h"
|
||||
#include "math_neon.h"
|
||||
|
||||
float floorf_c(float x)
|
||||
{
|
||||
int n;
|
||||
float r;
|
||||
n = (int) x;
|
||||
r = (float) n;
|
||||
r = r - (r > x);
|
||||
return r;
|
||||
}
|
||||
|
||||
float floorf_neon_hfp(float x)
|
||||
{
|
||||
#ifdef __MATH_NEON
|
||||
asm volatile (
|
||||
"vcvt.s32.f32 d1, d0 \n\t" //d1 = (int) d0;
|
||||
"vcvt.f32.s32 d1, d1 \n\t" //d1 = (float) d1;
|
||||
"vcgt.f32 d0, d1, d0 \n\t" //d0 = (d1 > d0);
|
||||
"vshr.u32 d0, #31 \n\t" //d0 = d0 >> 31;
|
||||
"vcvt.f32.u32 d0, d0 \n\t" //d0 = (float) d0;
|
||||
"vsub.f32 d0, d1, d0 \n\t" //d0 = d1 - d0;
|
||||
::: "d0", "d1"
|
||||
);
|
||||
#endif
|
||||
}
|
||||
|
||||
float floorf_neon_sfp(float x)
|
||||
{
|
||||
#ifdef __MATH_NEON
|
||||
asm volatile ("vmov.f32 s0, r0 \n\t");
|
||||
floorf_neon_hfp(x);
|
||||
asm volatile ("vmov.f32 r0, s0 \n\t");
|
||||
#else
|
||||
return floorf_c(x);
|
||||
#endif
|
||||
};
|
||||
Vendored
+100
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Lachlan Tychsen-Smith (lachlan.ts@gmail.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
Assumes the floating point value |x / y| < 2,147,483,648
|
||||
*/
|
||||
|
||||
#include "math_neon.h"
|
||||
|
||||
float fmodf_c(float x, float y)
|
||||
{
|
||||
int n;
|
||||
union {
|
||||
float f;
|
||||
int i;
|
||||
} yinv;
|
||||
float a;
|
||||
|
||||
//fast reciporical approximation (4x Newton)
|
||||
yinv.f = y;
|
||||
n = 0x3F800000 - (yinv.i & 0x7F800000);
|
||||
yinv.i = yinv.i + n;
|
||||
yinv.f = 1.41176471f - 0.47058824f * yinv.f;
|
||||
yinv.i = yinv.i + n;
|
||||
a = 2.0 - yinv.f * y;
|
||||
yinv.f = yinv.f * a;
|
||||
a = 2.0 - yinv.f * y;
|
||||
yinv.f = yinv.f * a;
|
||||
a = 2.0 - yinv.f * y;
|
||||
yinv.f = yinv.f * a;
|
||||
a = 2.0 - yinv.f * y;
|
||||
yinv.f = yinv.f * a;
|
||||
|
||||
n = (int)(x * yinv.f);
|
||||
x = x - ((float)n) * y;
|
||||
return x;
|
||||
}
|
||||
|
||||
|
||||
float fmodf_neon_hfp(float x, float y)
|
||||
{
|
||||
#ifdef __MATH_NEON
|
||||
asm volatile (
|
||||
"vdup.f32 d1, d0[1] \n\t" //d1[0] = y
|
||||
"vdup.f32 d0, d0[0] \n\t" //d1[0] = y
|
||||
|
||||
//fast reciporical approximation
|
||||
"vrecpe.f32 d2, d1 \n\t" //d2 = ~1.0 / d1
|
||||
"vrecps.f32 d3, d2, d1 \n\t" //d3 = 2.0 - d2 * d1;
|
||||
"vmul.f32 d2, d2, d3 \n\t" //d2 = d2 * d3;
|
||||
"vrecps.f32 d3, d2, d1 \n\t" //d3 = 2.0 - d2 * d1;
|
||||
"vmul.f32 d2, d2, d3 \n\t" //d2 = d2 * d3;
|
||||
"vrecps.f32 d3, d2, d1 \n\t" //d3 = 2.0 - d2 * d1;
|
||||
"vmul.f32 d2, d2, d3 \n\t" //d2 = d2 * d3;
|
||||
"vrecps.f32 d3, d2, d1 \n\t" //d3 = 2.0 - d2 * d1;
|
||||
"vmul.f32 d2, d2, d3 \n\t" //d2 = d2 * d3;
|
||||
|
||||
"vmul.f32 d2, d2, d0 \n\t" //d2 = d2 * d0;
|
||||
"vcvt.s32.f32 d2, d2 \n\t" //d2 = (int) d2;
|
||||
"vcvt.f32.s32 d2, d2 \n\t" //d2 = (float) d2;
|
||||
"vmls.f32 d0, d1, d2 \n\t" //d0 = d0 - d1 * d2;
|
||||
|
||||
::: "d0", "d1", "d2", "d3"
|
||||
);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
float fmodf_neon_sfp(float x, float y)
|
||||
{
|
||||
#ifdef __MATH_NEON
|
||||
asm volatile ("vmov.f32 s0, r0 \n\t");
|
||||
asm volatile ("vmov.f32 s1, r1 \n\t");
|
||||
fmodf_neon_hfp(x, y);
|
||||
asm volatile ("vmov.f32 r0, s0 \n\t");
|
||||
#else
|
||||
return fmodf_c(x,y);
|
||||
#endif
|
||||
};
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Lachlan Tychsen-Smith (lachlan.ts@gmail.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "math.h"
|
||||
#include "math_neon.h"
|
||||
|
||||
float invsqrtf_c(float x)
|
||||
{
|
||||
|
||||
float b, c;
|
||||
union {
|
||||
float f;
|
||||
int i;
|
||||
} a;
|
||||
|
||||
//fast invsqrt approx
|
||||
a.f = x;
|
||||
a.i = 0x5F3759DF - (a.i >> 1); //VRSQRTE
|
||||
c = x * a.f;
|
||||
b = (3.0f - c * a.f) * 0.5; //VRSQRTS
|
||||
a.f = a.f * b;
|
||||
c = x * a.f;
|
||||
b = (3.0f - c * a.f) * 0.5;
|
||||
a.f = a.f * b;
|
||||
|
||||
return a.f;
|
||||
}
|
||||
|
||||
float invsqrtf_neon_hfp(float x)
|
||||
{
|
||||
#ifdef __MATH_NEON
|
||||
asm volatile (
|
||||
|
||||
"vmov.f32 d1, d0 \n\t" //d1 = d0
|
||||
"vrsqrte.f32 d0, d0 \n\t" //d0 = ~ 1.0 / sqrt(d0)
|
||||
"vmul.f32 d2, d0, d1 \n\t" //d2 = d0 * d1
|
||||
"vrsqrts.f32 d3, d2, d0 \n\t" //d3 = (3 - d0 * d2) / 2
|
||||
"vmul.f32 d0, d0, d3 \n\t" //d0 = d0 * d3
|
||||
"vmul.f32 d2, d0, d1 \n\t" //d2 = d0 * d1
|
||||
"vrsqrts.f32 d3, d2, d0 \n\t" //d4 = (3 - d0 * d3) / 2
|
||||
"vmul.f32 d0, d0, d3 \n\t" //d0 = d0 * d4
|
||||
|
||||
::: "d0", "d1", "d2", "d3"
|
||||
);
|
||||
#endif
|
||||
}
|
||||
|
||||
float invsqrtf_neon_sfp(float x)
|
||||
{
|
||||
#ifdef __MATH_NEON
|
||||
asm volatile ("vmov.f32 s0, r0 \n\t");
|
||||
invsqrtf_neon_hfp(x);
|
||||
asm volatile ("vmov.f32 r0, s0 \n\t");
|
||||
#else
|
||||
return invsqrtf_c(x);
|
||||
#endif
|
||||
};
|
||||
|
||||
Vendored
+67
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Lachlan Tychsen-Smith (lachlan.ts@gmail.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "math.h"
|
||||
#include "math_neon.h"
|
||||
|
||||
float ldexpf_c(float m, int e)
|
||||
{
|
||||
union {
|
||||
float f;
|
||||
int i;
|
||||
} r;
|
||||
r.f = m;
|
||||
r.i += (e << 23);
|
||||
return r.f;
|
||||
}
|
||||
|
||||
float ldexpf_neon_hfp(float m, int e)
|
||||
{
|
||||
#ifdef __MATH_NEON
|
||||
float r;
|
||||
asm volatile (
|
||||
"lsl r0, r0, #23 \n\t" //r0 = r0 << 23
|
||||
"vdup.i32 d1, r0 \n\t" //d1 = {r0, r0}
|
||||
"vadd.i32 d0, d0, d1 \n\t" //d0 = d0 + d1
|
||||
::: "d0", "d1"
|
||||
);
|
||||
#endif
|
||||
}
|
||||
|
||||
float ldexpf_neon_sfp(float m, int e)
|
||||
{
|
||||
#ifdef __MATH_NEON
|
||||
float r;
|
||||
asm volatile (
|
||||
"lsl r1, r1, #23 \n\t" //r1 = r1 << 23
|
||||
"vdup.f32 d0, r0 \n\t" //d0 = {r0, r0}
|
||||
"vdup.i32 d1, r1 \n\t" //d1 = {r1, r1}
|
||||
"vadd.i32 d0, d0, d1 \n\t" //d0 = d0 + d1
|
||||
"vmov.f32 r0, s0 \n\t" //r0 = s0
|
||||
::: "d0", "d1"
|
||||
);
|
||||
#else
|
||||
return ldexpf_c(m,e);
|
||||
#endif
|
||||
}
|
||||
Vendored
+135
@@ -0,0 +1,135 @@
|
||||
/*
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Lachlan Tychsen-Smith (lachlan.ts@gmail.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
Based on:
|
||||
|
||||
log10(x) = log10((1+m) * (2^n))
|
||||
log(x) = n * log10(2) + log10(1 + m)
|
||||
log(1+m) = Poly(1+m)
|
||||
|
||||
where Poly(x) is the Minimax approximation of log10(x) over the
|
||||
range [1, 2]
|
||||
|
||||
Test func : log10f(x)
|
||||
Test Range: 1 < x < 10000
|
||||
Peak Error: ~0.000040%
|
||||
RMS Error: ~0.000008%
|
||||
*/
|
||||
|
||||
#include "math.h"
|
||||
#include "math_neon.h"
|
||||
|
||||
const float __log10f_rng = 0.3010299957f;
|
||||
|
||||
const float __log10f_lut[8] = {
|
||||
-0.99697286229624, //p0
|
||||
-1.07301643912502, //p4
|
||||
-2.46980061535534, //p2
|
||||
-0.07176870463131, //p6
|
||||
2.247870219989470, //p1
|
||||
0.366547581117400, //p5
|
||||
1.991005185100089, //p3
|
||||
0.006135635201050, //p7
|
||||
};
|
||||
|
||||
float log10f_c(float x)
|
||||
{
|
||||
float a, b, c, d, xx;
|
||||
int m;
|
||||
|
||||
union {
|
||||
float f;
|
||||
int i;
|
||||
} r;
|
||||
|
||||
//extract exponent
|
||||
r.f = x;
|
||||
m = (r.i >> 23);
|
||||
m = m - 127;
|
||||
r.i = r.i - (m << 23);
|
||||
|
||||
//Taylor Polynomial (Estrins)
|
||||
xx = r.f * r.f;
|
||||
a = (__log10f_lut[4] * r.f) + (__log10f_lut[0]);
|
||||
b = (__log10f_lut[6] * r.f) + (__log10f_lut[2]);
|
||||
c = (__log10f_lut[5] * r.f) + (__log10f_lut[1]);
|
||||
d = (__log10f_lut[7] * r.f) + (__log10f_lut[3]);
|
||||
a = a + b * xx;
|
||||
c = c + d * xx;
|
||||
xx = xx * xx;
|
||||
r.f = a + c * xx;
|
||||
|
||||
//add exponent
|
||||
r.f = r.f + ((float) m) * __log10f_rng;
|
||||
|
||||
return r.f;
|
||||
}
|
||||
|
||||
float log10f_neon_hfp(float x)
|
||||
{
|
||||
#ifdef __MATH_NEON
|
||||
asm volatile (
|
||||
|
||||
"vdup.f32 d0, d0[0] \n\t" //d0 = {x,x};
|
||||
|
||||
//extract exponent
|
||||
"vmov.i32 d2, #127 \n\t" //d2 = 127;
|
||||
"vshr.u32 d6, d0, #23 \n\t" //d6 = d0 >> 23;
|
||||
"vsub.i32 d6, d6, d2 \n\t" //d6 = d6 - d2;
|
||||
"vshl.u32 d1, d6, #23 \n\t" //d1 = d6 << 23;
|
||||
"vsub.i32 d0, d0, d1 \n\t" //d0 = d0 + d1;
|
||||
|
||||
//polynomial:
|
||||
"vmul.f32 d1, d0, d0 \n\t" //d1 = d0*d0 = {x^2, x^2}
|
||||
"vld1.32 {d2, d3, d4, d5}, [%1] \n\t" //q1 = {p0, p4, p2, p6}, q2 = {p1, p5, p3, p7} ;
|
||||
"vmla.f32 q1, q2, d0[0] \n\t" //q1 = q1 + q2 * d0[0]
|
||||
"vmla.f32 d2, d3, d1[0] \n\t" //d2 = d2 + d3 * d1[0]
|
||||
"vmul.f32 d1, d1, d1 \n\t" //d1 = d1 * d1 = {x^4, x^4}
|
||||
"vmla.f32 d2, d1, d2[1] \n\t" //d2 = d2 + d1 * d2[1]
|
||||
|
||||
//add exponent
|
||||
"vdup.32 d7, %0 \n\t" //d7 = {rng, rng}
|
||||
"vcvt.f32.s32 d6, d6 \n\t" //d6 = (float) d6
|
||||
"vmla.f32 d2, d6, d7 \n\t" //d2 = d2 + d6 * d7
|
||||
|
||||
"vmov.f32 s0, s4 \n\t" //s0 = s4
|
||||
|
||||
:: "r"(__log10f_rng), "r"(__log10f_lut)
|
||||
: "d0", "d1", "q1", "q2", "d6", "d7"
|
||||
);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
float log10f_neon_sfp(float x)
|
||||
{
|
||||
#ifdef __MATH_NEON
|
||||
asm volatile ("vmov.f32 s0, r0 \n\t");
|
||||
log10f_neon_hfp(x);
|
||||
asm volatile ("vmov.f32 r0, s0 \n\t");
|
||||
#else
|
||||
return log10f_c(x);
|
||||
#endif
|
||||
};
|
||||
Vendored
+135
@@ -0,0 +1,135 @@
|
||||
/*
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Lachlan Tychsen-Smith (lachlan.ts@gmail.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
Based on:
|
||||
|
||||
log(x) = log((1+m) * (2^n))
|
||||
log(x) = n * log(2) + log(1 + m)
|
||||
log(1+m) = Poly(1+m)
|
||||
|
||||
where Poly(x) is the Minimax approximation of log(x) over the
|
||||
range [1, 2]
|
||||
|
||||
Test func : logf(x)
|
||||
Test Range: 1 < x < 10000
|
||||
Peak Error: ~0.000601%
|
||||
RMS Error: ~0.000005%
|
||||
*/
|
||||
|
||||
#include "math.h"
|
||||
#include "math_neon.h"
|
||||
|
||||
const float __logf_rng = 0.693147180f;
|
||||
|
||||
const float __logf_lut[8] = {
|
||||
-2.295614848256274, //p0
|
||||
-2.470711633419806, //p4
|
||||
-5.686926051100417, //p2
|
||||
-0.165253547131978, //p6
|
||||
+5.175912446351073, //p1
|
||||
+0.844006986174912, //p5
|
||||
+4.584458825456749, //p3
|
||||
+0.014127821926000 //p7
|
||||
};
|
||||
|
||||
float logf_c(float x)
|
||||
{
|
||||
float a, b, c, d, xx;
|
||||
int m;
|
||||
|
||||
union {
|
||||
float f;
|
||||
int i;
|
||||
} r;
|
||||
|
||||
//extract exponent
|
||||
r.f = x;
|
||||
m = (r.i >> 23);
|
||||
m = m - 127;
|
||||
r.i = r.i - (m << 23);
|
||||
|
||||
//Taylor Polynomial (Estrins)
|
||||
xx = r.f * r.f;
|
||||
a = (__logf_lut[4] * r.f) + (__logf_lut[0]);
|
||||
b = (__logf_lut[6] * r.f) + (__logf_lut[2]);
|
||||
c = (__logf_lut[5] * r.f) + (__logf_lut[1]);
|
||||
d = (__logf_lut[7] * r.f) + (__logf_lut[3]);
|
||||
a = a + b * xx;
|
||||
c = c + d * xx;
|
||||
xx = xx * xx;
|
||||
r.f = a + c * xx;
|
||||
|
||||
//add exponent
|
||||
r.f = r.f + ((float) m) * __logf_rng;
|
||||
|
||||
return r.f;
|
||||
}
|
||||
|
||||
float logf_neon_hfp(float x)
|
||||
{
|
||||
#ifdef __MATH_NEON
|
||||
asm volatile (
|
||||
|
||||
"vdup.f32 d0, d0[0] \n\t" //d0 = {x,x};
|
||||
|
||||
//extract exponent
|
||||
"vmov.i32 d2, #127 \n\t" //d2 = 127;
|
||||
"vshr.u32 d6, d0, #23 \n\t" //d6 = d0 >> 23;
|
||||
"vsub.i32 d6, d6, d2 \n\t" //d6 = d6 - d2;
|
||||
"vshl.u32 d1, d6, #23 \n\t" //d1 = d6 << 23;
|
||||
"vsub.i32 d0, d0, d1 \n\t" //d0 = d0 + d1;
|
||||
|
||||
//polynomial:
|
||||
"vmul.f32 d1, d0, d0 \n\t" //d1 = d0*d0 = {x^2, x^2}
|
||||
"vld1.32 {d2, d3, d4, d5}, [%1] \n\t" //q1 = {p0, p4, p2, p6}, q2 = {p1, p5, p3, p7} ;
|
||||
"vmla.f32 q1, q2, d0[0] \n\t" //q1 = q1 + q2 * d0[0]
|
||||
"vmla.f32 d2, d3, d1[0] \n\t" //d2 = d2 + d3 * d1[0]
|
||||
"vmul.f32 d1, d1, d1 \n\t" //d1 = d1 * d1 = {x^4, x^4}
|
||||
"vmla.f32 d2, d1, d2[1] \n\t" //d2 = d2 + d1 * d2[1]
|
||||
|
||||
//add exponent
|
||||
"vdup.32 d7, %0 \n\t" //d7 = {rng, rng}
|
||||
"vcvt.f32.s32 d6, d6 \n\t" //d6 = (float) d6
|
||||
"vmla.f32 d2, d6, d7 \n\t" //d2 = d2 + d6 * d7
|
||||
|
||||
"vmov.f32 s0, s4 \n\t" //s0 = s4
|
||||
|
||||
:: "r"(__logf_rng), "r"(__logf_lut)
|
||||
: "d0", "d1", "q1", "q2", "d6", "d7"
|
||||
);
|
||||
#endif
|
||||
}
|
||||
|
||||
float logf_neon_sfp(float x)
|
||||
{
|
||||
#ifdef __MATH_NEON
|
||||
asm volatile ("vmov.f32 s0, r0 \n\t");
|
||||
logf_neon_hfp(x);
|
||||
asm volatile ("vmov.f32 r0, s0 \n\t");
|
||||
#else
|
||||
return logf_c(x);
|
||||
#endif
|
||||
};
|
||||
|
||||
Vendored
+95
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Lachlan Tychsen-Smith (lachlan.ts@gmail.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
Matrices are specified in column major format:
|
||||
|
||||
| a c |
|
||||
| b d |
|
||||
|
||||
therefore m[2] = c
|
||||
*/
|
||||
|
||||
#include "math_neon.h"
|
||||
|
||||
//matrix matrix multipication. d = m0 * m1;
|
||||
void
|
||||
matmul2_c(float m0[4], float m1[4], float d[4])
|
||||
{
|
||||
d[0] = m0[0]*m1[0] + m0[2]*m1[1];
|
||||
d[1] = m0[1]*m1[0] + m0[3]*m1[1];
|
||||
d[2] = m0[0]*m1[2] + m0[2]*m1[3];
|
||||
d[3] = m0[1]*m1[2] + m0[3]*m1[3];
|
||||
}
|
||||
|
||||
void
|
||||
matmul2_neon(float m0[4], float m1[4], float d[4])
|
||||
{
|
||||
#ifdef __MATH_NEON
|
||||
asm volatile (
|
||||
"vld1.32 {d0, d1}, [%0] \n\t" //Q1 = m0
|
||||
"vld1.32 {d2, d3}, [%1] \n\t" //Q2 = m1
|
||||
|
||||
"vmul.f32 d4, d0, d2[0] \n\t" //D4 = D0*D2[0]
|
||||
"vmul.f32 d5, d0, d3[0] \n\t" //D5 = D0*D3[0]
|
||||
"vmla.f32 d4, d1, d2[1] \n\t" //D4 += D1*D2[1]
|
||||
"vmla.f32 d5, d1, d3[1] \n\t" //D5 += D1*D3[1]
|
||||
|
||||
"vst1.32 {d4, d5}, [%2] \n\t" //Q4 = m+12
|
||||
:: "r"(m0), "r"(m1), "r"(d)
|
||||
: "q0", "q1", "q2", "memory"
|
||||
);
|
||||
#else
|
||||
matmul2_c(m0, m1, d);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
//matrix vector multiplication. d = m * v
|
||||
void
|
||||
matvec2_c(float m[4], float v[2], float d[2])
|
||||
{
|
||||
d[0] = m[0]*v[0] + m[2]*v[1];
|
||||
d[1] = m[1]*v[0] + m[3]*v[1];
|
||||
}
|
||||
|
||||
void
|
||||
matvec2_neon(float m[4], float v[2], float d[2])
|
||||
{
|
||||
#ifdef __MATH_NEON
|
||||
asm volatile (
|
||||
"vld1.32 d0, [%1] \n\t" //d0 = v
|
||||
"vld1.32 {d1, d2}, [%0] \n\t" //Q1 = m
|
||||
|
||||
"vmul.f32 d3, d1, d0[0] \n\t" //Q5 = Q1*d0[0]
|
||||
"vmla.f32 d3, d2, d0[1] \n\t" //Q5 += Q1*d0[1]
|
||||
|
||||
"vst1.32 d3, [%2] \n\t" //Q4 = m+12
|
||||
:: "r"(m), "r"(v), "r"(d)
|
||||
: "d0", "d1", "d2","d3", "memory"
|
||||
);
|
||||
#else
|
||||
matvec2_c(m, v, d);
|
||||
#endif
|
||||
}
|
||||
Vendored
+131
@@ -0,0 +1,131 @@
|
||||
/*
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Lachlan Tychsen-Smith (lachlan.ts@gmail.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
Matrices are specified in row major format:
|
||||
|
||||
| x0 x2 |
|
||||
| x1 x3 |
|
||||
|
||||
therefore m[2] = x2
|
||||
|
||||
*/
|
||||
|
||||
#include "math_neon.h"
|
||||
|
||||
//matrix matrix multipication. d = m0 * m1;
|
||||
void
|
||||
matmul3_c(float m0[9], float m1[9], float d[9])
|
||||
{
|
||||
d[0] = m0[0]*m1[0] + m0[3]*m1[1] + m0[6]*m1[2];
|
||||
d[1] = m0[1]*m1[0] + m0[4]*m1[1] + m0[7]*m1[2];
|
||||
d[2] = m0[2]*m1[0] + m0[5]*m1[1] + m0[8]*m1[2];
|
||||
d[3] = m0[0]*m1[3] + m0[3]*m1[4] + m0[6]*m1[5];
|
||||
d[4] = m0[1]*m1[3] + m0[4]*m1[4] + m0[7]*m1[5];
|
||||
d[5] = m0[2]*m1[3] + m0[5]*m1[4] + m0[8]*m1[5];
|
||||
d[6] = m0[0]*m1[6] + m0[3]*m1[7] + m0[6]*m1[8];
|
||||
d[7] = m0[1]*m1[6] + m0[4]*m1[7] + m0[7]*m1[8];
|
||||
d[8] = m0[2]*m1[6] + m0[5]*m1[7] + m0[8]*m1[8];
|
||||
}
|
||||
|
||||
void
|
||||
matmul3_neon(float m0[9], float m1[9], float d[9])
|
||||
{
|
||||
#ifdef __MATH_NEON
|
||||
asm volatile (
|
||||
"vld1.32 {d0, d1}, [%1]! \n\t" //q0 = m1
|
||||
"vld1.32 {d2, d3}, [%1]! \n\t" //q1 = m1+4
|
||||
"flds s8, [%1] \n\t" //q2 = m1+8
|
||||
|
||||
"vld1.32 {d6, d7}, [%0] \n\t" //q3[0] = m0
|
||||
"add %0, %0, #12 \n\t" //q3[0] = m0
|
||||
"vld1.32 {d8, d9}, [%0] \n\t" //q4[0] = m0+12
|
||||
"add %0, %0, #12 \n\t" //q3[0] = m0
|
||||
"vld1.32 {d10}, [%0] \n\t" //q5[0] = m0+24
|
||||
"add %0, %0, #8 \n\t" //q3[0] = m0
|
||||
"flds s22, [%0] \n\t" //q2 = m1+8
|
||||
|
||||
"vmul.f32 q6, q3, d0[0] \n\t" //q12 = q3 * d0[0]
|
||||
"vmul.f32 q7, q3, d1[1] \n\t" //q13 = q3 * d2[0]
|
||||
"vmul.f32 q8, q3, d3[0] \n\t" //q14 = q3 * d4[0]
|
||||
"vmla.f32 q6, q4, d0[1] \n\t" //q12 = q9 * d0[1]
|
||||
"vmla.f32 q7, q4, d2[0] \n\t" //q13 = q9 * d2[1]
|
||||
"vmla.f32 q8, q4, d3[1] \n\t" //q14 = q9 * d4[1]
|
||||
"vmla.f32 q6, q5, d1[0] \n\t" //q12 = q10 * d0[0]
|
||||
"vmla.f32 q7, q5, d2[1] \n\t" //q13 = q10 * d2[0]
|
||||
"vmla.f32 q8, q5, d4[0] \n\t" //q14 = q10 * d4[0]
|
||||
|
||||
"vmov.f32 q0, q8 \n\t" //q14 = q10 * d4[0]
|
||||
"vst1.32 {d12, d13}, [%2] \n\t" //d = q12
|
||||
"add %2, %2, #12 \n\t" //q3[0] = m0
|
||||
"vst1.32 {d14, d15}, [%2] \n\t" //d+4 = q13
|
||||
"add %2, %2, #12 \n\t" //q3[0] = m0
|
||||
"vst1.32 {d0}, [%2] \n\t" //d+8 = q14
|
||||
"add %2, %2, #8 \n\t" //q3[0] = m0
|
||||
"fsts s2, [%2] \n\t" //d = q12
|
||||
|
||||
: "+r"(m0), "+r"(m1), "+r"(d):
|
||||
: "d8", "d9", "d10", "d11", "d12", "d13", "d14", "d15", "memory"
|
||||
);
|
||||
#else
|
||||
matmul3_c(m0, m1, d);
|
||||
#endif
|
||||
};
|
||||
|
||||
//matrix vector multiplication. d = m * v
|
||||
void
|
||||
matvec3_c(float m[9], float v[3], float d[3])
|
||||
{
|
||||
d[0] = m[0]*v[0] + m[3]*v[1] + m[6]*v[2];
|
||||
d[1] = m[1]*v[0] + m[4]*v[1] + m[7]*v[2];
|
||||
d[2] = m[2]*v[0] + m[5]*v[1] + m[8]*v[2];
|
||||
}
|
||||
|
||||
void
|
||||
matvec3_neon(float m[9], float v[3], float d[3])
|
||||
{
|
||||
#ifdef __MATH_NEON
|
||||
int tmp;
|
||||
asm volatile (
|
||||
"mov %3, #12 \n\t" //r3 = 12
|
||||
"vld1.32 {d0, d1}, [%1] \n\t" //Q0 = v
|
||||
"vld1.32 {d2, d3}, [%0], %3 \n\t" //Q1 = m
|
||||
"vld1.32 {d4, d5}, [%0], %3 \n\t" //Q2 = m+12
|
||||
"vld1.32 {d6, d7}, [%0], %3 \n\t" //Q3 = m+24
|
||||
|
||||
"vmul.f32 q9, q1, d0[0] \n\t" //Q9 = Q1*Q0[0]
|
||||
"vmla.f32 q9, q2, d0[1] \n\t" //Q9 += Q2*Q0[1]
|
||||
"vmla.f32 q9, q3, d1[0] \n\t" //Q9 += Q3*Q0[2]
|
||||
"vmov.f32 q0, q9 \n\t" //Q0 = q9
|
||||
|
||||
"vst1.32 d0, [%2]! \n\t" //r2 = D24
|
||||
"fsts s2, [%2] \n\t" //r2 = D25[0]
|
||||
|
||||
: "+r"(m), "+r"(v), "+r"(d), "+r"(tmp):
|
||||
: "q0", "q9", "q10","q11", "q12", "q13", "memory"
|
||||
);
|
||||
#else
|
||||
matvec3_c(m, v, d);
|
||||
#endif
|
||||
}
|
||||
Vendored
+144
@@ -0,0 +1,144 @@
|
||||
/*
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Lachlan Tychsen-Smith (lachlan.ts@gmail.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
Matrices are specified in row major format:
|
||||
|
||||
| x0 x2 |
|
||||
| x1 x3 |
|
||||
|
||||
therefore m[2] = x2
|
||||
|
||||
*/
|
||||
|
||||
#include "math_neon.h"
|
||||
|
||||
//matrix matrix multipication. d = m0 * m1;
|
||||
void
|
||||
matmul4_c(float m0[16], float m1[16], float d[16])
|
||||
{
|
||||
d[0] = m0[0]*m1[0] + m0[4]*m1[1] + m0[8]*m1[2] + m0[12]*m1[3];
|
||||
d[1] = m0[1]*m1[0] + m0[5]*m1[1] + m0[9]*m1[2] + m0[13]*m1[3];
|
||||
d[2] = m0[2]*m1[0] + m0[6]*m1[1] + m0[10]*m1[2] + m0[14]*m1[3];
|
||||
d[3] = m0[3]*m1[0] + m0[7]*m1[1] + m0[11]*m1[2] + m0[15]*m1[3];
|
||||
d[4] = m0[0]*m1[4] + m0[4]*m1[5] + m0[8]*m1[6] + m0[12]*m1[7];
|
||||
d[5] = m0[1]*m1[4] + m0[5]*m1[5] + m0[9]*m1[6] + m0[13]*m1[7];
|
||||
d[6] = m0[2]*m1[4] + m0[6]*m1[5] + m0[10]*m1[6] + m0[14]*m1[7];
|
||||
d[7] = m0[3]*m1[4] + m0[7]*m1[5] + m0[11]*m1[6] + m0[15]*m1[7];
|
||||
d[8] = m0[0]*m1[8] + m0[4]*m1[9] + m0[8]*m1[10] + m0[12]*m1[11];
|
||||
d[9] = m0[1]*m1[8] + m0[5]*m1[9] + m0[9]*m1[10] + m0[13]*m1[11];
|
||||
d[10] = m0[2]*m1[8] + m0[6]*m1[9] + m0[10]*m1[10] + m0[14]*m1[11];
|
||||
d[11] = m0[3]*m1[8] + m0[7]*m1[9] + m0[11]*m1[10] + m0[15]*m1[11];
|
||||
d[12] = m0[0]*m1[12] + m0[4]*m1[13] + m0[8]*m1[14] + m0[12]*m1[15];
|
||||
d[13] = m0[1]*m1[12] + m0[5]*m1[13] + m0[9]*m1[14] + m0[13]*m1[15];
|
||||
d[14] = m0[2]*m1[12] + m0[6]*m1[13] + m0[10]*m1[14] + m0[14]*m1[15];
|
||||
d[15] = m0[3]*m1[12] + m0[7]*m1[13] + m0[11]*m1[14] + m0[15]*m1[15];
|
||||
}
|
||||
|
||||
void
|
||||
matmul4_neon(float m0[16], float m1[16], float d[16])
|
||||
{
|
||||
#ifdef __MATH_NEON
|
||||
asm volatile (
|
||||
"vld1.32 {d0, d1}, [%1]! \n\t" //q0 = m1
|
||||
"vld1.32 {d2, d3}, [%1]! \n\t" //q1 = m1+4
|
||||
"vld1.32 {d4, d5}, [%1]! \n\t" //q2 = m1+8
|
||||
"vld1.32 {d6, d7}, [%1] \n\t" //q3 = m1+12
|
||||
"vld1.32 {d16, d17}, [%0]! \n\t" //q8 = m0
|
||||
"vld1.32 {d18, d19}, [%0]! \n\t" //q9 = m0+4
|
||||
"vld1.32 {d20, d21}, [%0]! \n\t" //q10 = m0+8
|
||||
"vld1.32 {d22, d23}, [%0] \n\t" //q11 = m0+12
|
||||
|
||||
"vmul.f32 q12, q8, d0[0] \n\t" //q12 = q8 * d0[0]
|
||||
"vmul.f32 q13, q8, d2[0] \n\t" //q13 = q8 * d2[0]
|
||||
"vmul.f32 q14, q8, d4[0] \n\t" //q14 = q8 * d4[0]
|
||||
"vmul.f32 q15, q8, d6[0] \n\t" //q15 = q8 * d6[0]
|
||||
"vmla.f32 q12, q9, d0[1] \n\t" //q12 = q9 * d0[1]
|
||||
"vmla.f32 q13, q9, d2[1] \n\t" //q13 = q9 * d2[1]
|
||||
"vmla.f32 q14, q9, d4[1] \n\t" //q14 = q9 * d4[1]
|
||||
"vmla.f32 q15, q9, d6[1] \n\t" //q15 = q9 * d6[1]
|
||||
"vmla.f32 q12, q10, d1[0] \n\t" //q12 = q10 * d0[0]
|
||||
"vmla.f32 q13, q10, d3[0] \n\t" //q13 = q10 * d2[0]
|
||||
"vmla.f32 q14, q10, d5[0] \n\t" //q14 = q10 * d4[0]
|
||||
"vmla.f32 q15, q10, d7[0] \n\t" //q15 = q10 * d6[0]
|
||||
"vmla.f32 q12, q11, d1[1] \n\t" //q12 = q11 * d0[1]
|
||||
"vmla.f32 q13, q11, d3[1] \n\t" //q13 = q11 * d2[1]
|
||||
"vmla.f32 q14, q11, d5[1] \n\t" //q14 = q11 * d4[1]
|
||||
"vmla.f32 q15, q11, d7[1] \n\t" //q15 = q11 * d6[1]
|
||||
|
||||
"vst1.32 {d24, d25}, [%2]! \n\t" //d = q12
|
||||
"vst1.32 {d26, d27}, [%2]! \n\t" //d+4 = q13
|
||||
"vst1.32 {d28, d29}, [%2]! \n\t" //d+8 = q14
|
||||
"vst1.32 {d30, d31}, [%2] \n\t" //d+12 = q15
|
||||
|
||||
: "+r"(m0), "+r"(m1), "+r"(d) :
|
||||
: "q0", "q1", "q2", "q3", "q8", "q9", "q10", "q11", "q12", "q13", "q14", "q15",
|
||||
"memory"
|
||||
);
|
||||
#else
|
||||
matmul4_c(m0, m1, d);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
//matrix vector multiplication. d = m * v
|
||||
void
|
||||
matvec4_c(float m[16], float v[4], float d[4])
|
||||
{
|
||||
d[0] = m[0]*v[0] + m[4]*v[1] + m[8]*v[2] + m[12]*v[3];
|
||||
d[1] = m[1]*v[0] + m[5]*v[1] + m[9]*v[2] + m[13]*v[3];
|
||||
d[2] = m[2]*v[0] + m[6]*v[1] + m[10]*v[2] + m[14]*v[3];
|
||||
d[3] = m[3]*v[0] + m[7]*v[1] + m[11]*v[2] + m[15]*v[3];
|
||||
}
|
||||
|
||||
void
|
||||
matvec4_neon(float m[16], float v[4], float d[4])
|
||||
{
|
||||
#ifdef __MATH_NEON
|
||||
asm volatile (
|
||||
"vld1.32 {d0, d1}, [%1] \n\t" //Q0 = v
|
||||
"vld1.32 {d18, d19}, [%0]! \n\t" //Q1 = m
|
||||
"vld1.32 {d20, d21}, [%0]! \n\t" //Q2 = m+4
|
||||
"vld1.32 {d22, d23}, [%0]! \n\t" //Q3 = m+8
|
||||
"vld1.32 {d24, d25}, [%0]! \n\t" //Q4 = m+12
|
||||
|
||||
"vmul.f32 q13, q9, d0[0] \n\t" //Q5 = Q1*Q0[0]
|
||||
"vmla.f32 q13, q10, d0[1] \n\t" //Q5 += Q1*Q0[1]
|
||||
"vmla.f32 q13, q11, d1[0] \n\t" //Q5 += Q2*Q0[2]
|
||||
"vmla.f32 q13, q12, d1[1] \n\t" //Q5 += Q3*Q0[3]
|
||||
|
||||
"vst1.32 {d26, d27}, [%2] \n\t" //Q4 = m+12
|
||||
:
|
||||
: "r"(m), "r"(v), "r"(d)
|
||||
: "q0", "q9", "q10","q11", "q12", "q13", "memory"
|
||||
);
|
||||
#else
|
||||
matvec4_c(m, v, d);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Loaded 100 of 627 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user