mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-09 03:29:43 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
53a0d6a5b7 | ||
|
|
dc9fc004ae | ||
|
|
1e9e1fc885 | ||
|
|
398f0c8e17 | ||
|
|
0d2962afef | ||
|
|
a3c2cbda55 | ||
|
|
aad8e3581c | ||
|
|
6d277de62b | ||
|
|
eab8890ecf | ||
|
|
f816829d99 | ||
|
|
33315d4b66 | ||
|
|
8569028189 | ||
|
|
6239635eba | ||
|
|
979c6d003e | ||
|
|
6af35e8739 | ||
|
|
66e54f86bb | ||
|
|
5d678a626f | ||
|
|
d38e8544b8 | ||
|
|
44f4ccc054 | ||
|
|
4478ff62c0 | ||
|
|
67c0bc25f4 | ||
|
|
f5bddd45e8 | ||
|
|
0cb2bbd420 | ||
|
|
16b6ff7f9b | ||
|
|
4df71207ff | ||
|
|
194eaf3053 | ||
|
|
010fe1bb1b | ||
|
|
fabf68e441 | ||
|
|
1035029a89 | ||
|
|
5c55c098f6 | ||
|
|
d6ac759e97 | ||
|
|
e8ff596177 | ||
|
|
745bc1eb0d | ||
|
|
664f90b023 | ||
|
|
401eb7bc7a | ||
|
|
14797ae18e | ||
|
|
68a5cdb984 | ||
|
|
922eddcfb5 | ||
|
|
ce36860be2 | ||
|
|
164b28a4fa | ||
|
|
ad5db2f8cf | ||
|
|
a9d801a5fc | ||
|
|
22ad4e98b6 | ||
|
|
ea175fd26f | ||
|
|
6d870129c6 | ||
|
|
b03e3791b5 | ||
|
|
41651fa772 | ||
|
|
d4b3fa30df | ||
|
|
91771f8b7c | ||
|
|
16df630035 | ||
|
|
4c9245b7d9 | ||
|
|
9bf63a7809 | ||
|
|
d4051fcc27 | ||
|
|
99d450673e | ||
|
|
d0818e6e62 | ||
|
|
aa9dcc2a8e | ||
|
|
e3c4388f76 | ||
|
|
2d6f0f194b | ||
|
|
36a8c96e29 | ||
|
|
296c869b4c | ||
|
|
9ecf04a999 | ||
|
|
f5cedc6129 | ||
|
|
bc71585714 | ||
|
|
d903ad2b97 | ||
|
|
490af3cb3e | ||
|
|
a13b07551c | ||
|
|
cc40d68e8b | ||
|
|
f91a44cbc7 | ||
|
|
d4fb4ba87d | ||
|
|
40e2103640 | ||
|
|
16727bc85a | ||
|
|
ca527de877 | ||
|
|
3d52f5e19c | ||
|
|
60d3b22bb6 | ||
|
|
b78fcb3e21 | ||
|
|
b4dbc16024 | ||
|
|
0a216caf66 | ||
|
|
8fc3d36a73 | ||
|
|
72ad824a15 | ||
|
|
bf68611929 | ||
|
|
99b1ffd406 | ||
|
|
321e62c867 | ||
|
|
3f29e731e2 | ||
|
|
defe51ff69 | ||
|
|
f596d1f99d | ||
|
|
daee8afa19 | ||
|
|
94a67fe28b | ||
|
|
3db30a9440 | ||
|
|
ecb69ad938 | ||
|
|
050e29140b | ||
|
|
db43a86b01 | ||
|
|
ebeba581da | ||
|
|
33c5fa6ade | ||
|
|
34fd48c961 | ||
|
|
38005a4b0a | ||
|
|
486ac44b71 | ||
|
|
5be5b98d26 | ||
|
|
ed14b37899 | ||
|
|
70b8af4a6c | ||
|
|
4381c606d8 | ||
|
|
2285797ef8 | ||
|
|
9c91885301 | ||
|
|
3966979043 | ||
|
|
9a54657a77 | ||
|
|
c451b94bd9 | ||
|
|
0fef69a678 | ||
|
|
346e3af66c | ||
|
|
d0bced56c2 | ||
|
|
9173397f08 | ||
|
|
840ff59dd0 | ||
|
|
66df62938c | ||
|
|
7d518bd4a8 | ||
|
|
37aee162c9 | ||
|
|
de21d31352 | ||
|
|
acc0a6261d | ||
|
|
ec7db6b4b6 | ||
|
|
c9f2ad1b5e | ||
|
|
db74b7cbbc | ||
|
|
9f4c08caee | ||
|
|
c37e610f10 | ||
|
|
167c83b6e6 | ||
|
|
fbd3b4898f | ||
|
|
34c6b1f306 | ||
|
|
71d25c779a | ||
|
|
eb37e95cca | ||
|
|
c53bb5c7be | ||
|
|
730f02c7e9 | ||
|
|
ad36b8ba76 | ||
|
|
9d55e3dc84 | ||
|
|
7bae0a3170 | ||
|
|
c938f86235 | ||
|
|
4e347d96b8 | ||
|
|
f95b42011f | ||
|
|
91a946e447 | ||
|
|
a922a14191 | ||
|
|
4237590bfc | ||
|
|
44800c1205 | ||
|
|
976d52e7c9 | ||
|
|
2dc4f87995 | ||
|
|
b9f0cb1116 | ||
|
|
19c93cb58e | ||
|
|
9d10c3ff16 | ||
|
|
b211f8b76a | ||
|
|
20d7987d27 | ||
|
|
97fb56b334 | ||
|
|
06bf29ba4c | ||
|
|
0ba2bac778 | ||
|
|
89db0793b4 | ||
|
|
519e4e038a | ||
|
|
158e4614dd | ||
|
|
0bc4248084 | ||
|
|
1fc3f2b057 | ||
|
|
093e05c411 | ||
|
|
01541d3108 | ||
|
|
5e665045e4 | ||
|
|
97dfcbc4b4 | ||
|
|
9cdfad3fd4 | ||
|
|
26f5970ffb | ||
|
|
5be5409431 | ||
|
|
f8d844e150 | ||
|
|
2fce2f4045 | ||
|
|
f94a8743a1 | ||
|
|
7d73e17b6f | ||
|
|
6c2856926c | ||
|
|
df5d46594b | ||
|
|
a8d4d3cc35 | ||
|
|
c8415e9194 | ||
|
|
180c0c87c1 | ||
|
|
e0504bfc62 | ||
|
|
968dcf4d39 | ||
|
|
2965d89707 | ||
|
|
0d1f92bf16 | ||
|
|
499c531d08 | ||
|
|
d203ec2244 | ||
|
|
d0dd77ae42 | ||
|
|
b580599710 | ||
|
|
fffd104c0d | ||
|
|
1b28ff59ba | ||
|
|
dfeb46f0f2 | ||
|
|
b57a203557 | ||
|
|
2dac910964 | ||
|
|
6cb11da46b | ||
|
|
0b3f45a58a | ||
|
|
0cda65967d | ||
|
|
60eb15bf0b | ||
|
|
5cefbbfc57 | ||
|
|
e5bde97a2d | ||
|
|
b774fda697 | ||
|
|
97be5b164f | ||
|
|
7aaa39a5db | ||
|
|
bfe472af09 | ||
|
|
9adc8e34c0 | ||
|
|
a8004dee3d | ||
|
|
f107af6b55 | ||
|
|
7d16016d96 | ||
|
|
555c54bdb8 | ||
|
|
8430697116 | ||
|
|
a1e517470c | ||
|
|
14a7f2b442 | ||
|
|
efc0371a4e | ||
|
|
b78dbf7453 | ||
|
|
bcf74d9685 | ||
|
|
c66ada4e90 | ||
|
|
e1a5379886 | ||
|
|
80e3170e93 | ||
|
|
3f6623fa6e | ||
|
|
c746f4dbbc | ||
|
|
bddd93bcaa | ||
|
|
d953be6397 | ||
|
|
e9dc729503 | ||
|
|
8d5f34eeb9 | ||
|
|
76cc6fd8ec | ||
|
|
24bfad033f | ||
|
|
05467443a2 | ||
|
|
a735114780 | ||
|
|
260d3634f2 | ||
|
|
c8b7bc9845 | ||
|
|
6cdc34e891 | ||
|
|
1a148da76a | ||
|
|
cd4ff2eac8 | ||
|
|
84d656ea67 | ||
|
|
4b75304d15 | ||
|
|
5cf1f9ec61 | ||
|
|
df7870c2ea | ||
|
|
a081cf805f | ||
|
|
eacd59b841 | ||
|
|
c561d8c4e6 | ||
|
|
af52f1532f | ||
|
|
d382e1069e | ||
|
|
07c34accf5 | ||
|
|
76b4828105 | ||
|
|
035e7889d1 | ||
|
|
4511b1c09c | ||
|
|
3113f51102 | ||
|
|
471d06d133 | ||
|
|
d2fafc5451 | ||
|
|
e9046dd06f | ||
|
|
a2c435ab2c | ||
|
|
51e2da2cbd | ||
|
|
599385de87 | ||
|
|
3e859da48b | ||
|
|
6a9fb1186d | ||
|
|
c8349862e1 | ||
|
|
6d667b5250 | ||
|
|
a9750e0232 | ||
|
|
170f8da759 | ||
|
|
58c6590dca | ||
|
|
1ecdc1e8b7 | ||
|
|
39c50094da | ||
|
|
c6d4dce410 | ||
|
|
0346cf70d5 | ||
|
|
b0ea1e09ac | ||
|
|
b2bc4cd300 | ||
|
|
5d70242dee | ||
|
|
cdc7c1283b | ||
|
|
6c18c17703 | ||
|
|
27c0702919 | ||
|
|
26afec3b08 | ||
|
|
abebc88195 | ||
|
|
fa2d1c25a2 | ||
|
|
54e137d9f7 | ||
|
|
fe1dc51889 | ||
|
|
a8bba31429 | ||
|
|
d53cbfbdfb | ||
|
|
0775687008 | ||
|
|
97de8a35ec | ||
|
|
3c81b2597d | ||
|
|
abe2a14b16 | ||
|
|
84d9a58ec8 | ||
|
|
1b76f42b00 | ||
|
|
f011c4c9d6 | ||
|
|
662497d897 | ||
|
|
951686ba59 | ||
|
|
40998967c3 | ||
|
|
e4d89b4b11 | ||
|
|
d9bf45d2e7 | ||
|
|
18e3843db7 | ||
|
|
370c4cb6a7 | ||
|
|
03f7bd5e7b | ||
|
|
eadae793c6 | ||
|
|
fe70f766f1 | ||
|
|
9596c7b3c4 | ||
|
|
f513e1fac2 | ||
|
|
9d3251a54b | ||
|
|
9f53ad9c45 | ||
|
|
e68d2c656f | ||
|
|
1cc2ae692b | ||
|
|
f469f40381 | ||
|
|
f7648bc95c | ||
|
|
688cad2593 | ||
|
|
550b3e5633 | ||
|
|
129a3463f5 | ||
|
|
79761446c8 | ||
|
|
5039d7a444 | ||
|
|
37f64d39a3 | ||
|
|
947ef60a0f | ||
|
|
71c20c9650 | ||
|
|
02f8d54c31 | ||
|
|
a697e2507e | ||
|
|
0ff36406ee | ||
|
|
56ef899946 | ||
|
|
14329b0656 | ||
|
|
6f241e80a0 | ||
|
|
cddb0a3b48 | ||
|
|
0ecb2379ff | ||
|
|
20fa4499d2 | ||
|
|
45e3c60d22 | ||
|
|
474430b043 | ||
|
|
45c33c7acf | ||
|
|
e36107530e | ||
|
|
dc7a225f8d | ||
|
|
5953b63b4f | ||
|
|
8408b753af | ||
|
|
f4bacc7afd | ||
|
|
928eb582f6 | ||
|
|
303897924c | ||
|
|
2009c72baa | ||
|
|
2520a8a5f6 | ||
|
|
2f04b7035a | ||
|
|
41459fc1d4 | ||
|
|
0eb467e04d | ||
|
|
dcbd68b11b | ||
|
|
1e9300be68 | ||
|
|
dc4275b673 | ||
|
|
241670cec2 | ||
|
|
86fa52a2ea | ||
|
|
394cbbef59 | ||
|
|
13cadc6c1d | ||
|
|
a38675a562 | ||
|
|
94735f9034 | ||
|
|
b88e117d0b | ||
|
|
0ddb064314 | ||
|
|
36223d551d | ||
|
|
6d531f1892 | ||
|
|
f5881c17ef | ||
|
|
10d9e2a261 | ||
|
|
8c442985cb | ||
|
|
bb15d50ff9 | ||
|
|
bd8a7d030e | ||
|
|
4970aacc68 | ||
|
|
3d27895adf | ||
|
|
31056286e8 | ||
|
|
b8f40af467 | ||
|
|
471ffc53fd | ||
|
|
9836b97554 | ||
|
|
2119e4559d | ||
|
|
82a77279f3 | ||
|
|
01ab13f62c | ||
|
|
e321d34d08 | ||
|
|
10e0411b21 | ||
|
|
22ac73ba26 | ||
|
|
9ee55cf7cc | ||
|
|
ebb75f99fc | ||
|
|
9fab75c4b5 | ||
|
|
f51dfa1de9 | ||
|
|
21134eb28c | ||
|
|
0547a71a52 | ||
|
|
fbc83640b6 | ||
|
|
acd68519de | ||
|
|
e4be1f53a3 | ||
|
|
52db4d226a | ||
|
|
4ea5fe4169 | ||
|
|
6756501dac | ||
|
|
e61593d80c | ||
|
|
eb4d8678e9 | ||
|
|
83bafe1b19 | ||
|
|
543c188da6 | ||
|
|
5f71ecc1d1 | ||
|
|
5d7367e89a | ||
|
|
a1cf6f29f4 | ||
|
|
24ec6928dc | ||
|
|
3f8b1d04ed | ||
|
|
08f26fafbd | ||
|
|
c83477cb62 | ||
|
|
a301562149 | ||
|
|
668b4b5d26 | ||
|
|
1226c71b98 | ||
|
|
2bd3e94e5e | ||
|
|
a7e8707f7d | ||
|
|
c38c28a0f5 | ||
|
|
eafce41a16 | ||
|
|
f4ef5e82c2 | ||
|
|
037633cf33 | ||
|
|
298b753e41 | ||
|
|
f53783dfe8 | ||
|
|
4168e541c9 | ||
|
|
0f18ade02a | ||
|
|
900fc57773 | ||
|
|
d79da7fc1f | ||
|
|
b8ac629fbf | ||
|
|
397c8acd51 | ||
|
|
3c7dc0a62e | ||
|
|
b409ced5ad | ||
|
|
39778066dd | ||
|
|
087e26bd2d | ||
|
|
88784aa702 | ||
|
|
8d7540c449 | ||
|
|
7e55d0da17 | ||
|
|
417f3afdb0 | ||
|
|
982dd47f01 | ||
|
|
96bb85fb41 | ||
|
|
2a9bf91e0d | ||
|
|
5d89bf970f | ||
|
|
08dbbe1a55 | ||
|
|
d9a33dfe04 | ||
|
|
50f538dc9e | ||
|
|
099be6ed2d | ||
|
|
b593e73896 | ||
|
|
7647c9be59 | ||
|
|
ca3eecf5c0 | ||
|
|
51b2e920fe | ||
|
|
c03e566eba | ||
|
|
0709f2b11b | ||
|
|
d94098cca1 | ||
|
|
13dd8e4905 | ||
|
|
b0584a950d | ||
|
|
e75a586ead | ||
|
|
0a0f9cdec3 | ||
|
|
e03a6284d1 | ||
|
|
d589dd5d8f | ||
|
|
fa7eb9d8c8 | ||
|
|
5ba74302b2 | ||
|
|
7a745c3f70 | ||
|
|
58b95752e8 | ||
|
|
e162882406 | ||
|
|
481e7d2f34 | ||
|
|
7aff07f6ac | ||
|
|
97fd53cd5f | ||
|
|
342bcebc59 | ||
|
|
1661fa552f | ||
|
|
5045a0faff | ||
|
|
43426df4f6 | ||
|
|
d600075012 | ||
|
|
52a9a465df | ||
|
|
64c85771b2 | ||
|
|
35605f43fa | ||
|
|
24ead80e8b | ||
|
|
218c9b4487 | ||
|
|
7eefeddea9 | ||
|
|
1c1c1fa32c | ||
|
|
0f1b18d2e5 | ||
|
|
a24d43c8fd | ||
|
|
d00ae6b66b | ||
|
|
4d089a7fba | ||
|
|
53faa0c92d | ||
|
|
d431f77960 | ||
|
|
2cc765b27c | ||
|
|
7bca682549 | ||
|
|
9574a929bc | ||
|
|
030841756b | ||
|
|
90e8bb3f52 | ||
|
|
792008d558 | ||
|
|
996f9a59b7 | ||
|
|
18978c5f01 | ||
|
|
b40c31384e | ||
|
|
5b388d8c92 | ||
|
|
2a860abcfd | ||
|
|
c80127d29d | ||
|
|
4abb0ef331 | ||
|
|
58703de05c | ||
|
|
6841b5ad00 | ||
|
|
4729ec9e1b | ||
|
|
36c235556a | ||
|
|
097b02a8a1 | ||
|
|
aefcca125a | ||
|
|
21bb5331f9 | ||
|
|
62b1c5a7af | ||
|
|
a51a259e58 | ||
|
|
728249fa61 | ||
|
|
f5bfbdeebe | ||
|
|
946de514dc | ||
|
|
d411bfa5de | ||
|
|
6e3d3d94d4 | ||
|
|
582bd50719 | ||
|
|
07ce0eabd9 | ||
|
|
5dd4c88011 | ||
|
|
5a77baf185 | ||
|
|
fd5d19eaab | ||
|
|
a6a0960f77 | ||
|
|
4ddeda2511 | ||
|
|
d6975325d9 | ||
|
|
f017c64220 | ||
|
|
3cd76a6849 | ||
|
|
a68a33c559 | ||
|
|
280ea0535f | ||
|
|
b990f34054 | ||
|
|
465ac5707c | ||
|
|
05fb0a1eeb | ||
|
|
22331b5821 | ||
|
|
95ad02e742 | ||
|
|
eea287d156 | ||
|
|
1a60d257ee | ||
|
|
3a4a00ffe6 | ||
|
|
7b460c14b7 | ||
|
|
00ff63e0bb | ||
|
|
3b9b54ba2d | ||
|
|
54c1759f45 | ||
|
|
7330f96946 | ||
|
|
1da2e2dbab | ||
|
|
178b479072 | ||
|
|
f6bbe69096 | ||
|
|
961daf8067 | ||
|
|
020d7cec0a | ||
|
|
88cc0ce8bb | ||
|
|
016983c9eb | ||
|
|
2dddc3fc88 | ||
|
|
87d36489a1 | ||
|
|
e9b39cc17f | ||
|
|
6424f8efcf | ||
|
|
fcc238d310 | ||
|
|
251f9021ad | ||
|
|
f9b535ea91 | ||
|
|
9a5b13cccf | ||
|
|
9f8b57baca | ||
|
|
e91136017e | ||
|
|
0d3955196d | ||
|
|
10a6d7a458 | ||
|
|
6ab368811f | ||
|
|
c794d89bcf | ||
|
|
dc127f1555 | ||
|
|
b013a9c863 | ||
|
|
596cd320c6 | ||
|
|
3ee172c410 | ||
|
|
89a5983c3c | ||
|
|
972a5db7ae | ||
|
|
de36f572d1 | ||
|
|
07880e3f45 | ||
|
|
2293bce616 | ||
|
|
d043123f71 | ||
|
|
82c7aa0e6f | ||
|
|
e0114e08ba | ||
|
|
3dff698644 | ||
|
|
5b1347a788 | ||
|
|
b86274aa95 | ||
|
|
49e8baa61d | ||
|
|
c6e835685f | ||
|
|
65ecec9391 | ||
|
|
f0f9847647 | ||
|
|
485d646e90 | ||
|
|
3e0184201e | ||
|
|
4ae6cda6b1 | ||
|
|
fcb324e272 | ||
|
|
528b2b9b00 | ||
|
|
3afd1c1e07 | ||
|
|
3f7ca00e6d | ||
|
|
55f2019517 | ||
|
|
d8d0fdd11f | ||
|
|
b434f0863a | ||
|
|
a6bfc6240f | ||
|
|
dee7533d65 | ||
|
|
f177d22007 | ||
|
|
9d6086813b | ||
|
|
197ce259f1 | ||
|
|
11819e2d47 | ||
|
|
1f028395d2 | ||
|
|
549bc8dc5e | ||
|
|
1e91689919 | ||
|
|
4b96bfe46e | ||
|
|
02ad99048d | ||
|
|
ee9cb593c5 | ||
|
|
f5fcd45a3f | ||
|
|
735dc822ca | ||
|
|
8a8fadc5b2 | ||
|
|
ecf88d0114 | ||
|
|
8afdfdf7af | ||
|
|
e854691e87 | ||
|
|
60669c84c9 | ||
|
|
f7bd9a7843 | ||
|
|
80f2e11799 | ||
|
|
712fb03341 | ||
|
|
e77599be32 | ||
|
|
27070dcb57 | ||
|
|
0f813e1dea | ||
|
|
97b0211880 | ||
|
|
982330ef86 | ||
|
|
4eaf718a6e | ||
|
|
f423564895 | ||
|
|
2b3718a86c | ||
|
|
2cb1636ea4 | ||
|
|
ffdf6eae8e | ||
|
|
4b91a6b121 | ||
|
|
00ec3e7846 | ||
|
|
c14e8ba6ca | ||
|
|
a302d78989 | ||
|
|
4e534fec6f | ||
|
|
1bb8ae4a1d | ||
|
|
36db065495 | ||
|
|
974231ee72 | ||
|
|
20e86afbf2 | ||
|
|
1fb2144a48 | ||
|
|
f9d9070de8 | ||
|
|
7ca00fafc0 | ||
|
|
9aa29d9fc5 | ||
|
|
c9f047edd3 | ||
|
|
e3fa9ae5ee | ||
|
|
e35ecd5eb7 | ||
|
|
10157c302b | ||
|
|
d9651023c4 | ||
|
|
1bdf3d395d | ||
|
|
6024eda7f9 | ||
|
|
9bcf3fef44 | ||
|
|
e7821f34ee | ||
|
|
67d98dbbea | ||
|
|
7e067aa000 | ||
|
|
8a7b73761d | ||
|
|
35ea096db7 | ||
|
|
e892bf6e8b | ||
|
|
c3eda56561 | ||
|
|
003f1ba913 | ||
|
|
68bf755fe7 | ||
|
|
07c218ad51 | ||
|
|
d2c9c280fe | ||
|
|
c2c59e8e16 | ||
|
|
9fafac8b60 | ||
|
|
a585017208 | ||
|
|
f22755f31b | ||
|
|
450e1f4746 | ||
|
|
e59fb6c0d9 | ||
|
|
7d3780e09f | ||
|
|
7d93f63e6a | ||
|
|
2ebd6e6f49 | ||
|
|
4622d46ad3 | ||
|
|
fa08613637 | ||
|
|
390a7d76c6 | ||
|
|
560f8dda60 | ||
|
|
d2eeb6fab0 | ||
|
|
35b078857d | ||
|
|
b3188195a8 | ||
|
|
c448beafa8 | ||
|
|
f764980eb8 | ||
|
|
ef4753dc05 | ||
|
|
32c4f74f7d | ||
|
|
59b8b3b9ed | ||
|
|
3bf5a89901 | ||
|
|
cfd7b9c6c1 | ||
|
|
46cdea48c2 | ||
|
|
e064207a59 | ||
|
|
284f8cfd23 | ||
|
|
69c82da160 | ||
|
|
75b9a1312d | ||
|
|
114cc081aa | ||
|
|
1fa36689d8 | ||
|
|
dce009ae78 | ||
|
|
f442d8235f | ||
|
|
f69f57c566 | ||
|
|
ed75a83e6a | ||
|
|
5075712cac | ||
|
|
65dff0a03a | ||
|
|
a741dadf20 | ||
|
|
77d0745f38 | ||
|
|
43c25383e3 | ||
|
|
462dda944c | ||
|
|
8644e8e26b | ||
|
|
096ca1851b | ||
|
|
90dd86a66a | ||
|
|
6949cfde68 | ||
|
|
31c1f31299 | ||
|
|
b82f4daae9 | ||
|
|
0d9b345ae0 | ||
|
|
df57b3062a | ||
|
|
6c045ab24e | ||
|
|
a52e55e909 | ||
|
|
d0697236f0 | ||
|
|
ebfb7652b0 | ||
|
|
b510b2fe26 | ||
|
|
442ebf2acf | ||
|
|
f4772f07f3 | ||
|
|
761ddc6f9c | ||
|
|
3a031c3b48 | ||
|
|
01f5d854e3 | ||
|
|
cb848b9711 | ||
|
|
b55c17e7c5 | ||
|
|
3b0983cf97 | ||
|
|
3573050d28 | ||
|
|
de8d2f2417 | ||
|
|
94cbeb754e | ||
|
|
94325f9466 | ||
|
|
7841427848 | ||
|
|
7ef67f5a0f | ||
|
|
177d1852b8 | ||
|
|
db7258d682 | ||
|
|
89b0b62429 | ||
|
|
f207b1be2b | ||
|
|
2de1857ca6 | ||
|
|
a77a8e0200 | ||
|
|
ab57f4b400 | ||
|
|
86b54d66ac | ||
|
|
1c2548062f | ||
|
|
b9b4c09212 | ||
|
|
381ff665cd | ||
|
|
40a73b3265 | ||
|
|
3c755d7cff | ||
|
|
bcaebd2b76 | ||
|
|
05b64b8081 | ||
|
|
5429d3874c | ||
|
|
c6f1fdb552 | ||
|
|
10bdcbff17 | ||
|
|
66ed9f46f0 | ||
|
|
2a01112406 | ||
|
|
02f8ba9393 | ||
|
|
8556a4c5f0 | ||
|
|
0845852806 | ||
|
|
a6ececc063 | ||
|
|
57fd346492 | ||
|
|
6d79f1bab9 | ||
|
|
40476efc59 | ||
|
|
ab5b90d3cd | ||
|
|
c82387c747 | ||
|
|
bfd30161de | ||
|
|
49c4f45dc4 | ||
|
|
c025f7a8c8 | ||
|
|
204f5cddfc | ||
|
|
f0ec4ea7de | ||
|
|
cb2d93b8fb | ||
|
|
b5c63869ee | ||
|
|
8a06bd4104 | ||
|
|
f28f364ec3 | ||
|
|
8ac995197a | ||
|
|
9c085512eb | ||
|
|
ba94acc631 | ||
|
|
9feffb4f89 | ||
|
|
1be6453450 | ||
|
|
766ad7fe3e | ||
|
|
1186cf645e | ||
|
|
433186c2b0 | ||
|
|
4b8ca83567 | ||
|
|
51356fb293 | ||
|
|
5b849a82b0 | ||
|
|
28538b95a7 | ||
|
|
054781c3f3 | ||
|
|
7e675b4f8a | ||
|
|
3ee6a64b8c | ||
|
|
66c09aa7e8 | ||
|
|
87b9e1310d | ||
|
|
04d46957cc | ||
|
|
63a4bea997 | ||
|
|
8e0ad1b1fd | ||
|
|
69c148f9a3 | ||
|
|
6831b51649 | ||
|
|
3328d88c68 | ||
|
|
8c75bc7618 | ||
|
|
9456f05991 | ||
|
|
7297ced92a | ||
|
|
f76e7549ce | ||
|
|
14b0b75fe9 | ||
|
|
99f1d6123e | ||
|
|
e122fd95dd | ||
|
|
c25eca9d10 | ||
|
|
ff36aa94e5 | ||
|
|
643557d9d6 | ||
|
|
ca2c2feda5 | ||
|
|
60cfc95c1c | ||
|
|
4700ff55a1 | ||
|
|
b3d7a2cb6f | ||
|
|
79bd87e12a | ||
|
|
41c7d76017 | ||
|
|
84e3a8c717 | ||
|
|
fd40636f76 | ||
|
|
7358b598ed | ||
|
|
bc5194fe6f | ||
|
|
b606d47622 | ||
|
|
f7f56edffd | ||
|
|
c480e940ef | ||
|
|
4ef5b42cab | ||
|
|
1acc59b598 | ||
|
|
e3954eda54 | ||
|
|
a2947da8ec | ||
|
|
07b655f03d | ||
|
|
0eb847e9b1 | ||
|
|
f190d2ebbc | ||
|
|
bc8cf99ddd | ||
|
|
8e9adba956 | ||
|
|
ee90fa3015 | ||
|
|
a94b2a47f1 | ||
|
|
ac26746106 | ||
|
|
929f26742f | ||
|
|
eb0ea9d738 | ||
|
|
b0932af025 | ||
|
|
796c06e01e | ||
|
|
3b3e822d78 | ||
|
|
03b93b224c | ||
|
|
e94873727e | ||
|
|
a48ea15497 | ||
|
|
13bbf9d18f | ||
|
|
8357467937 | ||
|
|
1000c08a7f | ||
|
|
4ec1a9e337 | ||
|
|
b872260bf3 | ||
|
|
96073cf057 | ||
|
|
eee57a77ad | ||
|
|
0adee8b775 | ||
|
|
3d784d41d3 | ||
|
|
c3e2052ac3 | ||
|
|
0305770f4b | ||
|
|
cd35bfaecb | ||
|
|
e01668701f | ||
|
|
6f405da27d | ||
|
|
59fd4b30d9 | ||
|
|
7e822f8126 | ||
|
|
39742dae1f | ||
|
|
4676d16f8d | ||
|
|
6131dde4d8 | ||
|
|
795bdd351b | ||
|
|
d88b6c9921 | ||
|
|
313e2f12b9 | ||
|
|
5a9daac855 | ||
|
|
9d1f35e901 | ||
|
|
7a1705c4e0 | ||
|
|
9222aa3cd2 | ||
|
|
b3858c5173 | ||
|
|
b436200887 | ||
|
|
8545a58c41 | ||
|
|
f80adc7eba | ||
|
|
a12ebdaf5b | ||
|
|
ae2be8b53b | ||
|
|
844656255c | ||
|
|
a9ccc00216 | ||
|
|
a7ced34810 | ||
|
|
fef0d968cd | ||
|
|
8fb7285577 | ||
|
|
0f37ee5fef | ||
|
|
18b5ab2265 | ||
|
|
395c601159 | ||
|
|
697a753ecc | ||
|
|
0ab069d9fd | ||
|
|
bba9610199 | ||
|
|
269faab4ab | ||
|
|
3ecb515307 | ||
|
|
d8e5d9cf42 | ||
|
|
2e6b7cf413 | ||
|
|
f56ab959b7 | ||
|
|
8e454f7127 | ||
|
|
72355683a3 | ||
|
|
4282fd0c21 | ||
|
|
bf708362b4 | ||
|
|
782f17ec23 | ||
|
|
4a552b66ff | ||
|
|
64cb4b53df | ||
|
|
2d61c6d2ed | ||
|
|
992adbc2d4 | ||
|
|
88112c5732 | ||
|
|
63d8020fa0 | ||
|
|
3320e44329 | ||
|
|
b6972f9926 | ||
|
|
f19d96d3c4 | ||
|
|
c67c37d641 | ||
|
|
e2d8a1b961 | ||
|
|
d59f137e69 | ||
|
|
2acb04649e | ||
|
|
707c56dab3 | ||
|
|
1ae4d9b22a | ||
|
|
fce884775c | ||
|
|
9b75ec2a77 | ||
|
|
547e240296 | ||
|
|
2afecd8c57 | ||
|
|
c22c7688a8 | ||
|
|
c097eed755 | ||
|
|
362f50caf2 | ||
|
|
5f41c35190 | ||
|
|
4feaeae2a3 | ||
|
|
abd1776240 | ||
|
|
e91d9d5637 | ||
|
|
f14a97ecf4 | ||
|
|
66a116deca | ||
|
|
cfd34334a4 | ||
|
|
a24107b22a | ||
|
|
3fac600038 | ||
|
|
d5c2d85fbb | ||
|
|
65d33f33c9 | ||
|
|
064aa8f9fa | ||
|
|
6cc02cd400 | ||
|
|
e1316cb7ba | ||
|
|
e92d240f08 | ||
|
|
db679a85f3 | ||
|
|
9aece7b695 | ||
|
|
c05742c1fc | ||
|
|
dcbba1a261 | ||
|
|
99d09f779f | ||
|
|
619b8a42e0 | ||
|
|
b0f07a3106 | ||
|
|
85612fc84f | ||
|
|
6be45c9392 | ||
|
|
2d55e35201 | ||
|
|
e3b4a79b1b | ||
|
|
455b28eaca | ||
|
|
962c52c5ae | ||
|
|
58dae07212 | ||
|
|
86e2925cf5 | ||
|
|
7e31e71d5b | ||
|
|
38ab9c8003 | ||
|
|
c05f873dff | ||
|
|
417439ba60 | ||
|
|
c819686ba4 | ||
|
|
1534ec916b | ||
|
|
69c983a741 | ||
|
|
2f08e760ff | ||
|
|
5ddec4efc2 | ||
|
|
0e5e45595e | ||
|
|
df9f1585de | ||
|
|
a8042bdc0c | ||
|
|
49ceee1206 | ||
|
|
53e46676f5 | ||
|
|
f7d3ded79c | ||
|
|
c6196152e9 | ||
|
|
d3d5d80e62 | ||
|
|
5b5cde28ce | ||
|
|
61b7d13086 | ||
|
|
dd04705d25 | ||
|
|
177c96a382 | ||
|
|
8e1e20fc5d | ||
|
|
f8448dc7f3 | ||
|
|
8720048b4e | ||
|
|
6f3b8c4049 | ||
|
|
e1002719c0 | ||
|
|
3864574541 | ||
|
|
5f064245c8 | ||
|
|
def3ea9f0a | ||
|
|
03dd7d4b51 | ||
|
|
34d9daf7e3 | ||
|
|
8adda6e822 | ||
|
|
277e46badc | ||
|
|
5435a1ad7d | ||
|
|
e64b5cc62f | ||
|
|
ef808b6591 | ||
|
|
2071f8eaaf | ||
|
|
3625158e63 | ||
|
|
aeffde9b3e | ||
|
|
1159ca17ff | ||
|
|
fef343ff9e | ||
|
|
0ee7eeb450 | ||
|
|
49a2a61354 | ||
|
|
fa46693f77 | ||
|
|
8910e66eb0 | ||
|
|
91e9b22b02 | ||
|
|
9508730682 | ||
|
|
53dac26509 | ||
|
|
042ebca2ef | ||
|
|
69503880f5 | ||
|
|
27ef0cf9c7 | ||
|
|
fcda911a10 | ||
|
|
ca4f719811 | ||
|
|
cb915e2998 | ||
|
|
244b147b0c | ||
|
|
c65fc21bac | ||
|
|
2bf2131224 | ||
|
|
f30aae9c8d | ||
|
|
21be54501b | ||
|
|
118022ae88 | ||
|
|
6c6cca33a1 | ||
|
|
e7b4f4fd4d | ||
|
|
9970e9c089 | ||
|
|
3ca57ddd84 | ||
|
|
c50aa6f088 | ||
|
|
8ddafd0023 | ||
|
|
dae55553b7 | ||
|
|
040798cdb9 | ||
|
|
75cdcf25ad | ||
|
|
2b37c92a64 | ||
|
|
3c71f273a1 | ||
|
|
35b48bca2c | ||
|
|
e8988e29da | ||
|
|
b11bfc8a73 | ||
|
|
8431b63235 | ||
|
|
a01985273b | ||
|
|
19d4498d2c | ||
|
|
6283cb5eef | ||
|
|
ae894fb015 | ||
|
|
d7c2201385 | ||
|
|
c3056a0d06 | ||
|
|
9a25826ae9 | ||
|
|
f0e05ecbc8 | ||
|
|
94545127a6 | ||
|
|
0c87175a61 | ||
|
|
7dc6d0f369 | ||
|
|
6f8b6a22b7 | ||
|
|
7c904d47c2 | ||
|
|
8badf1787d | ||
|
|
917e3078e9 | ||
|
|
8990736e66 | ||
|
|
8cfb5b2922 | ||
|
|
1e13cb9c69 | ||
|
|
deda6fdf01 | ||
|
|
3d2cc8b14a | ||
|
|
5b76402e6b | ||
|
|
7d0cb7c689 | ||
|
|
f3815ed815 | ||
|
|
5ea923030b | ||
|
|
538a8d9e18 | ||
|
|
c254c69c1a | ||
|
|
ecb5c1adc0 | ||
|
|
92bba6e46e | ||
|
|
78904911ca | ||
|
|
6989d60cdc | ||
|
|
0d3a866356 | ||
|
|
89e3ce381d | ||
|
|
8e20b9e938 | ||
|
|
8a0b258fcd | ||
|
|
cab9e0645c | ||
|
|
e1733697c3 | ||
|
|
43dbbc20e0 | ||
|
|
0f90a3352b | ||
|
|
a66a46ca25 | ||
|
|
6e9a4ef4a0 | ||
|
|
fec9c0c42b | ||
|
|
7fbc9097f6 | ||
|
|
53efdc11f0 | ||
|
|
6bd20c5aff | ||
|
|
490ba62973 | ||
|
|
45fa93543c | ||
|
|
d9ebecb0ea | ||
|
|
7bab58b4bf | ||
|
|
a7ff4da4c5 | ||
|
|
acf0a74e6d | ||
|
|
69f32c3a35 | ||
|
|
b4085b6118 | ||
|
|
83a1d9ac1f | ||
|
|
c011090ebb | ||
|
|
f183fab022 | ||
|
|
50a2091cc6 | ||
|
|
4481486071 | ||
|
|
fa883d62fc | ||
|
|
e4f25d9984 | ||
|
|
4ad2eba602 | ||
|
|
035f6ca210 | ||
|
|
a63fcc36aa | ||
|
|
7c92289a96 | ||
|
|
9944ec98fd | ||
|
|
8c5238c349 | ||
|
|
051cc3fe4d | ||
|
|
b70c5b7529 | ||
|
|
152adc953c | ||
|
|
a877fc24fb | ||
|
|
4d529ffbc0 | ||
|
|
c47b58228f | ||
|
|
ac29a2acc2 | ||
|
|
29012aa74f | ||
|
|
008e622843 | ||
|
|
5a746e04c2 | ||
|
|
817b63be99 | ||
|
|
1cd441b125 | ||
|
|
82ae93e348 | ||
|
|
8088df5f09 | ||
|
|
9e5ad14da0 | ||
|
|
d9e61e5153 | ||
|
|
7a3e3ab46b | ||
|
|
969ef4b88d | ||
|
|
0e01a3c84b | ||
|
|
d63442ca3b | ||
|
|
47abc22fe9 | ||
|
|
d178f90cc1 | ||
|
|
f170856374 | ||
|
|
0a7bc4d21f | ||
|
|
615fc0432f | ||
|
|
047ffe9d30 | ||
|
|
6cf905508e | ||
|
|
3c7fafe9a3 | ||
|
|
aa81c1d82f | ||
|
|
1fc0009cdc | ||
|
|
a6406a57ca | ||
|
|
10a25209da | ||
|
|
a247b16164 | ||
|
|
c35e75a0bd | ||
|
|
793d0de45c | ||
|
|
b7d3ed5264 | ||
|
|
4e91f6fcd0 | ||
|
|
710a3fe249 | ||
|
|
991ea3c008 | ||
|
|
70b1f385e8 | ||
|
|
20766147a6 | ||
|
|
3f44ba59eb | ||
|
|
dbf59a72bd | ||
|
|
f4c3a41f84 | ||
|
|
ba962d5dda | ||
|
|
02910fd64d | ||
|
|
c1a321015a | ||
|
|
4dded0c76b | ||
|
|
3aeecc7eb2 | ||
|
|
3b16eb1e91 | ||
|
|
f17b4fba05 | ||
|
|
07ca97618d | ||
|
|
ee8277b31c | ||
|
|
febe0a2a1e | ||
|
|
a90bd8cb67 | ||
|
|
b83d58cd59 | ||
|
|
cf996f724e | ||
|
|
afe67ca254 | ||
|
|
f15b722786 | ||
|
|
9b60b81f70 | ||
|
|
180fb9cbff | ||
|
|
b45824a7a8 | ||
|
|
63af59a198 | ||
|
|
689b95f2f2 | ||
|
|
175ec67112 | ||
|
|
b1fe3506d7 | ||
|
|
d14444e0fc | ||
|
|
53701a565f | ||
|
|
6fc943228e | ||
|
|
d44062d841 | ||
|
|
d5db2a940a | ||
|
|
afe68b2a62 | ||
|
|
d240437f6b | ||
|
|
e3919c9d49 | ||
|
|
c374c9853d | ||
|
|
14fce400ce | ||
|
|
23064f0590 | ||
|
|
52b7a95a2b | ||
|
|
883d9ff6b5 | ||
|
|
9777ea933f | ||
|
|
8ce0f9cf0a | ||
|
|
8bef9743aa | ||
|
|
4dd7bc4f72 | ||
|
|
4b76f88939 | ||
|
|
ea5f458fbd | ||
|
|
b78b29cb14 | ||
|
|
c4cea05399 | ||
|
|
77d5de3b4c | ||
|
|
3e3ceba9aa | ||
|
|
5721ce16e9 | ||
|
|
7b43376dfb | ||
|
|
6009d4a8b6 | ||
|
|
d8890b486a | ||
|
|
2667289d45 | ||
|
|
fafb5cc272 | ||
|
|
fa3fee12e9 | ||
|
|
22358d4a92 | ||
|
|
ed2177d524 | ||
|
|
680aafe8f8 | ||
|
|
5a80bd6b30 | ||
|
|
2b338651ab | ||
|
|
1d3d07ad7d | ||
|
|
7ea0a19a4f | ||
|
|
7e2a077bd5 | ||
|
|
414ced5901 | ||
|
|
6d11f4ab9b | ||
|
|
b110b08b25 | ||
|
|
f77f743403 | ||
|
|
a6175a3989 | ||
|
|
693ce8f6e5 | ||
|
|
c1f9d7b498 | ||
|
|
b80bba2061 | ||
|
|
553ff7f69f | ||
|
|
c61748d2a0 | ||
|
|
620f541ca1 | ||
|
|
5004113ce1 | ||
|
|
5f87717295 | ||
|
|
f8274800fb | ||
|
|
52aba3c4d6 | ||
|
|
f3d0860483 | ||
|
|
bb0a633296 | ||
|
|
6889b58270 | ||
|
|
ca6f539ff5 | ||
|
|
e4d202458a | ||
|
|
b87bbc7f98 | ||
|
|
85802e6d5a | ||
|
|
b59f7c0276 | ||
|
|
51c875fdee | ||
|
|
96d9a851b1 | ||
|
|
f80ecf7739 | ||
|
|
86b35c8ff2 | ||
|
|
20540a8f42 | ||
|
|
93acf0caa9 | ||
|
|
28aafddd91 | ||
|
|
aa81de0ca0 | ||
|
|
2f7bc8760c | ||
|
|
e3f594564a | ||
|
|
757c83ea58 | ||
|
|
242e3d6a9e | ||
|
|
8e9bb03301 | ||
|
|
6484fb0c75 | ||
|
|
1a64520a23 | ||
|
|
d845093c7b | ||
|
|
4b0401462f | ||
|
|
cfc3b97808 | ||
|
|
4a649695a5 | ||
|
|
75781bb256 | ||
|
|
fc9954d967 | ||
|
|
b5830de236 | ||
|
|
abbd39fc6e | ||
|
|
c63f11f6fd | ||
|
|
52d85c50d2 | ||
|
|
bb5107b5fa | ||
|
|
47c7330cc8 | ||
|
|
80b194f491 | ||
|
|
37d4dcfac1 | ||
|
|
deb3efb8db | ||
|
|
860fb1d525 | ||
|
|
7a564720fb | ||
|
|
98014f7b66 | ||
|
|
810447e3ec | ||
|
|
fe0391825b | ||
|
|
f2f38be4e6 | ||
|
|
e6c7450c53 | ||
|
|
0ae7bf2a53 | ||
|
|
f8901d4e47 | ||
|
|
f7bcc68cd9 | ||
|
|
999437f31b | ||
|
|
b4c340ca88 | ||
|
|
492818deed | ||
|
|
efc8df02f0 | ||
|
|
d739e4771e | ||
|
|
24688469b0 | ||
|
|
2d649f5147 | ||
|
|
f490b2b58a | ||
|
|
9dec15767a | ||
|
|
0c3bc35be1 | ||
|
|
745b204a8f | ||
|
|
5e5e1e6d50 | ||
|
|
8093d2f124 | ||
|
|
94e16e638d | ||
|
|
05c4308cac | ||
|
|
aedd7fa53e | ||
|
|
cd49b89bbf | ||
|
|
2f1fb7783d | ||
|
|
962cd48dc0 | ||
|
|
5cf1b4b233 | ||
|
|
be08e07a66 | ||
|
|
bc7e7a26f0 | ||
|
|
d75fc24ad7 | ||
|
|
61e1c13ae6 | ||
|
|
563089558b | ||
|
|
b88db89b89 | ||
|
|
45d6b4a228 | ||
|
|
b7bf13ed1c | ||
|
|
a759694b97 | ||
|
|
e23b39d2b5 | ||
|
|
be96ad0932 | ||
|
|
d7d5f29c90 | ||
|
|
f9098208a0 | ||
|
|
cbae4af38a | ||
|
|
d6d757e240 | ||
|
|
7d30885ab9 | ||
|
|
8595e4cf75 | ||
|
|
f675c5fdc7 | ||
|
|
6628da2646 | ||
|
|
748a913a6d | ||
|
|
87788f0ffb | ||
|
|
4293e14dea | ||
|
|
1ab94a2c9a | ||
|
|
0b6578f869 | ||
|
|
6e86f3ab5b | ||
|
|
7d7a9a2384 | ||
|
|
8a6f1be61c | ||
|
|
3ef925d692 | ||
|
|
44dc3f70b4 | ||
|
|
0ae2e90783 | ||
|
|
30d3cf8a4e | ||
|
|
4cfe09faed | ||
|
|
59413e0289 | ||
|
|
01390f8ceb | ||
|
|
1aef6ddbc8 | ||
|
|
bcf636283b | ||
|
|
169b5e7a6b | ||
|
|
d95c421ba9 | ||
|
|
a503db016e | ||
|
|
d40eade52c | ||
|
|
e9cf351c67 | ||
|
|
cd615b3e79 | ||
|
|
04fc5d042f | ||
|
|
7fb9ec5223 | ||
|
|
a86cf6b99d | ||
|
|
5230aeb9d0 | ||
|
|
7ce2ac082a | ||
|
|
07932bff3e | ||
|
|
8fc8ff4ed9 | ||
|
|
8ce3c2bbc8 | ||
|
|
8486bf0058 | ||
|
|
63b3f30112 | ||
|
|
ddc3c2adcc | ||
|
|
34ad3bd103 | ||
|
|
75ad88e171 | ||
|
|
a5dbae0505 | ||
|
|
48987918e4 | ||
|
|
7625a790ba | ||
|
|
2f133a6835 | ||
|
|
f83dfb0621 | ||
|
|
36e33bde90 | ||
|
|
c2dd8b884e | ||
|
|
3b83b6d030 | ||
|
|
21bc56aa04 | ||
|
|
ff8d00e12b | ||
|
|
2b33c731d0 | ||
|
|
d9ba04e470 | ||
|
|
b34786171e | ||
|
|
5f843d30a0 | ||
|
|
6e1e8b3785 | ||
|
|
98278cc5cc | ||
|
|
4c53bdf4f9 | ||
|
|
9c8f29c1ec | ||
|
|
ac6a319a9d | ||
|
|
294777166f | ||
|
|
4dc3fe9f8c | ||
|
|
97427b343b | ||
|
|
858aae10cb | ||
|
|
29ca5b8c34 | ||
|
|
9b2f6522a2 | ||
|
|
9ab4e79503 | ||
|
|
1156406dfc | ||
|
|
79c94513ec | ||
|
|
307361e12c | ||
|
|
7b04375c9b | ||
|
|
d8b3597455 | ||
|
|
f1160f19b3 | ||
|
|
d6430b2f5e | ||
|
|
65d5ebc2bb | ||
|
|
3d338446f8 | ||
|
|
9f4a6bbae2 | ||
|
|
04c30c77e0 | ||
|
|
1f3790fafa | ||
|
|
36106dd90a | ||
|
|
43f06aecd9 | ||
|
|
280eb95b9a | ||
|
|
c7acb4658b | ||
|
|
da7f6a2a3b | ||
|
|
5eb43846da | ||
|
|
bc3eb34da5 | ||
|
|
da6ac4aae7 | ||
|
|
9bb8c41ff6 | ||
|
|
ffdad57318 | ||
|
|
2e42778f1e | ||
|
|
bedd67a8b8 | ||
|
|
cf91d006b3 | ||
|
|
0c686e15db | ||
|
|
5097240aef | ||
|
|
5b52098c54 | ||
|
|
0b47d98169 | ||
|
|
ccf80cbaa9 | ||
|
|
b23784ddc5 | ||
|
|
632cc599d6 | ||
|
|
0f12336737 | ||
|
|
d93d8e7a8f | ||
|
|
e820759ed2 | ||
|
|
ad3669a926 | ||
|
|
e58dda0623 | ||
|
|
6213b9d3f1 | ||
|
|
1f8b4d6b9a | ||
|
|
9e9cc3835f | ||
|
|
d7bfe70ca1 | ||
|
|
00f0a7dd91 | ||
|
|
b1daca2582 | ||
|
|
9cc830ecd6 | ||
|
|
88eab60b13 | ||
|
|
516918c163 | ||
|
|
6f3a78b41a | ||
|
|
d9ea20727c | ||
|
|
419cdced44 | ||
|
|
e222df4eb6 | ||
|
|
97a4f0d2fd | ||
|
|
d39d925c1d | ||
|
|
78b208c441 | ||
|
|
eafb235e66 | ||
|
|
bf6fa07b25 | ||
|
|
2859f6f18d | ||
|
|
efaf6e10ee | ||
|
|
fdb218f64e | ||
|
|
e0885a71e3 | ||
|
|
383a5968cc | ||
|
|
f8ed8ebde4 | ||
|
|
1b0c224c02 | ||
|
|
da6a74b2dc | ||
|
|
2056d25e3e | ||
|
|
e331281d6a | ||
|
|
3d5cc14030 | ||
|
|
653359911a | ||
|
|
2b5aae8a21 | ||
|
|
828b9c6c46 | ||
|
|
954aaa3fc6 | ||
|
|
c0d86cd8d3 | ||
|
|
e8eb0ef013 | ||
|
|
c16cae7ef9 | ||
|
|
ccd5b2f73d | ||
|
|
7d26034ebe | ||
|
|
c00f8c5dd6 | ||
|
|
534c923b6b | ||
|
|
eeddd7072b | ||
|
|
1c868ffaa2 | ||
|
|
a6f95b307f | ||
|
|
49f050b386 | ||
|
|
a70d8e43d9 | ||
|
|
e8a02dd448 | ||
|
|
130411365b | ||
|
|
9d6eda5409 | ||
|
|
e7aedb6fb9 | ||
|
|
bf04b798fe | ||
|
|
6dc2e8ca45 | ||
|
|
d791da9507 | ||
|
|
dd03076976 | ||
|
|
2b4baa0452 | ||
|
|
fad2acf1ee | ||
|
|
e41efa9849 | ||
|
|
a743c779f8 | ||
|
|
0d271b0ca7 | ||
|
|
150d05c160 | ||
|
|
af4d085632 | ||
|
|
72e67acec0 | ||
|
|
b81b5b0dfe | ||
|
|
bd5c0effa4 | ||
|
|
5a7ab3a394 | ||
|
|
189f8d58ec | ||
|
|
1d632e26fe | ||
|
|
584ec83840 | ||
|
|
d6a36f3768 | ||
|
|
a1034716e1 | ||
|
|
03ded43280 | ||
|
|
a98616b45b | ||
|
|
142dd82067 | ||
|
|
e297da1b71 | ||
|
|
4f98cf05f4 | ||
|
|
0f954fd4c8 | ||
|
|
9624406438 | ||
|
|
a816d150b1 | ||
|
|
427c73e7fd | ||
|
|
5366e88d1b | ||
|
|
7d12408f24 | ||
|
|
4981cc65c9 | ||
|
|
f0157dea52 | ||
|
|
023088e618 | ||
|
|
befda7bcc9 | ||
|
|
ebc8edd2bf | ||
|
|
20cc877ad3 | ||
|
|
c8f1125e20 | ||
|
|
9d1273ce58 | ||
|
|
093b009422 | ||
|
|
7780162d53 | ||
|
|
da5fb291a6 | ||
|
|
22de61ff3d | ||
|
|
e31c53c144 | ||
|
|
a79882bfc8 | ||
|
|
b08aa06779 | ||
|
|
ed911fcf27 | ||
|
|
6d7dc34238 | ||
|
|
ae1522293e | ||
|
|
c5c6713489 | ||
|
|
ddeb2b5ac0 | ||
|
|
abbd269f02 | ||
|
|
2f7684c743 | ||
|
|
7859868ffc | ||
|
|
a27849cbfa | ||
|
|
58328fa2b0 | ||
|
|
b6b2fdfaa6 | ||
|
|
73c78947b0 | ||
|
|
08c136aab2 | ||
|
|
38305f8fb7 | ||
|
|
8b1604325f | ||
|
|
40023833e0 | ||
|
|
8c106eb010 | ||
|
|
581f53a7c2 | ||
|
|
f7ff1c66c4 | ||
|
|
cd176d0737 | ||
|
|
ae0da06d8f | ||
|
|
5a4ada4311 | ||
|
|
20aa9ed25a | ||
|
|
d037d12faa | ||
|
|
25eaab0a2b | ||
|
|
edebf76df6 | ||
|
|
a82a8cad51 | ||
|
|
bfa6f49ae6 | ||
|
|
26190043eb | ||
|
|
42971febba | ||
|
|
4e07d14488 | ||
|
|
ec88b464c3 | ||
|
|
72d37e3917 | ||
|
|
8a71830d44 | ||
|
|
46872f8fcb | ||
|
|
3cc84d60c8 | ||
|
|
fc37ef5c7d | ||
|
|
fae5eb89df | ||
|
|
d04810f5fd | ||
|
|
ae4cd05690 | ||
|
|
7e6f23ea54 | ||
|
|
1fe1b2318a | ||
|
|
5656959085 | ||
|
|
160ac49089 | ||
|
|
fd7e2cd394 | ||
|
|
8f7e253f1f | ||
|
|
ffaa32842f | ||
|
|
c1e82d3f1a | ||
|
|
4e74a990d4 | ||
|
|
1b35da2bd8 | ||
|
|
811f4f59de | ||
|
|
452957a117 | ||
|
|
420d8a5fb2 | ||
|
|
aae721a9d0 | ||
|
|
d1d46a59db | ||
|
|
b01b7cf7cb | ||
|
|
2824057652 | ||
|
|
1b9e222e6e | ||
|
|
b58b002501 | ||
|
|
41b6b82b24 | ||
|
|
690530e7aa | ||
|
|
0f42249dd5 | ||
|
|
47c2b9ed43 | ||
|
|
334cbd55d8 | ||
|
|
9bea4deac0 | ||
|
|
497e424fc1 | ||
|
|
28ef2201cd | ||
|
|
8f054aeb29 | ||
|
|
b3cab9223c | ||
|
|
07b3a081c0 | ||
|
|
ac407588fa | ||
|
|
8d4c06e133 | ||
|
|
86b5b361da | ||
|
|
4717a2df64 | ||
|
|
9300313fce | ||
|
|
4a7bbc4dcc | ||
|
|
9253eb52eb | ||
|
|
0bd999faa5 | ||
|
|
59e465ea8c | ||
|
|
30e9cc1f10 | ||
|
|
80abd06bd8 | ||
|
|
845dcef6ab | ||
|
|
4c3281bd39 | ||
|
|
c17315cd27 | ||
|
|
d5d2f7f8ee | ||
|
|
974d3245d2 | ||
|
|
69759f5fd7 | ||
|
|
39faa9be1b | ||
|
|
91220c3448 | ||
|
|
5e5bb8e39b | ||
|
|
2855526566 | ||
|
|
7c0532c3e7 | ||
|
|
1eecb570aa | ||
|
|
0cff019c37 | ||
|
|
ea5f3d30e4 | ||
|
|
44edf684db | ||
|
|
faef7b498d | ||
|
|
0a3224180b | ||
|
|
c72222b572 | ||
|
|
86ef11e756 | ||
|
|
09b10943b2 | ||
|
|
1be1c6a6e2 | ||
|
|
18bff0401b | ||
|
|
14c0984497 | ||
|
|
d9884b486a | ||
|
|
06aa001b82 | ||
|
|
aeaaf7a319 | ||
|
|
7fc64b2c5e | ||
|
|
0692a321c5 | ||
|
|
44bf799d36 | ||
|
|
2f1063ff72 | ||
|
|
40e1082cda | ||
|
|
7fe5d21452 | ||
|
|
2f2ddb472a | ||
|
|
0798157df3 | ||
|
|
b7e15c2fe1 | ||
|
|
e4a44cbf13 | ||
|
|
59f3e733fb | ||
|
|
6c840cdd59 | ||
|
|
57f797dad6 | ||
|
|
6bd7fd482c | ||
|
|
72e1a33715 | ||
|
|
218ecc07c1 | ||
|
|
6b0c978acb | ||
|
|
dbb8cf7e32 | ||
|
|
45cbe06401 | ||
|
|
fec5aca60b | ||
|
|
2cd64c276f | ||
|
|
b7d5c1d3e8 | ||
|
|
94a9e7b923 | ||
|
|
fe516b0d01 | ||
|
|
1fd7cf473d | ||
|
|
d02d27f92a | ||
|
|
a49ef997de | ||
|
|
4389008be6 | ||
|
|
0e88d99798 | ||
|
|
c2942b0873 | ||
|
|
323d5b1c6c | ||
|
|
1f7c51b458 | ||
|
|
e133ce31e8 | ||
|
|
c104bc094b | ||
|
|
85331042be | ||
|
|
aabb1e409c | ||
|
|
67e1e5a9d0 | ||
|
|
033bc60939 | ||
|
|
ceb657eba2 | ||
|
|
6c2e933321 | ||
|
|
a0974a899d | ||
|
|
257d8a8cf0 | ||
|
|
0c2958e384 | ||
|
|
bebcc1c274 | ||
|
|
2116c0cc4e | ||
|
|
824315865f | ||
|
|
ae478b71b7 | ||
|
|
e59cd92108 | ||
|
|
ad78fddf4e | ||
|
|
cb4db5c5ab | ||
|
|
091496f74d | ||
|
|
017ef3fef7 | ||
|
|
f1d859b826 | ||
|
|
c93b78147b | ||
|
|
4697d10e8c | ||
|
|
70a4361d29 | ||
|
|
3d87398011 | ||
|
|
09b3a6f2c5 | ||
|
|
8b93439738 | ||
|
|
d53b245528 | ||
|
|
7aadde73d8 | ||
|
|
3cf591ec09 | ||
|
|
e21a655dc6 | ||
|
|
5050ccf519 | ||
|
|
b5b3d699bf | ||
|
|
0986e2af7f | ||
|
|
64a9cd29d3 | ||
|
|
5488806108 | ||
|
|
de2d15c716 | ||
|
|
b052f07f6b | ||
|
|
9b572d0fe4 | ||
|
|
c369a00a3e | ||
|
|
7e36dcb27f | ||
|
|
4fd3a4743a | ||
|
|
265c931c46 | ||
|
|
bc53d6fdc3 | ||
|
|
e2b5c69af9 | ||
|
|
1ef5eee8b3 | ||
|
|
dd774bd13c | ||
|
|
9bc11731fb | ||
|
|
248b99e8e7 | ||
|
|
492dd59164 | ||
|
|
4309793b1d | ||
|
|
56ce7b9b22 | ||
|
|
cecb50bd19 | ||
|
|
4af31cee97 | ||
|
|
070b7b78b1 | ||
|
|
8b915bbc22 | ||
|
|
8c640a28c6 | ||
|
|
558dfd64f2 | ||
|
|
1166be62ae | ||
|
|
52948b436e | ||
|
|
e7e9e90b0d | ||
|
|
b268869669 | ||
|
|
99bcf5946c | ||
|
|
7a282eab23 | ||
|
|
2559139154 | ||
|
|
4a0334b4fa | ||
|
|
9b421948e4 | ||
|
|
81c7a8ac04 | ||
|
|
ce434a7f1c | ||
|
|
86a82a47f6 | ||
|
|
df3547c65f | ||
|
|
679c0e829c | ||
|
|
07c56b4340 | ||
|
|
747bac1cca | ||
|
|
ce240dd47f | ||
|
|
146d2c8a1d | ||
|
|
5555d18a52 | ||
|
|
a64f0a24c6 | ||
|
|
50c176310c | ||
|
|
beac855ff7 | ||
|
|
ce0376e382 | ||
|
|
ee90ce4b54 | ||
|
|
0e3ff650c2 | ||
|
|
25ec6a8872 | ||
|
|
f052ebf872 | ||
|
|
185050075a | ||
|
|
6c79ecdae7 | ||
|
|
808004a132 | ||
|
|
609d00b3d7 | ||
|
|
9202256c3c | ||
|
|
a5cf78fd68 | ||
|
|
b83e43e8ce | ||
|
|
64c176288b | ||
|
|
c62f8cc7f4 | ||
|
|
747fe1ae63 | ||
|
|
679cabd430 | ||
|
|
52937d4b02 | ||
|
|
fcf2decb2e | ||
|
|
47cb3b899a | ||
|
|
e2e53026aa | ||
|
|
80ce237878 | ||
|
|
6c9715027f | ||
|
|
0d850b9bda | ||
|
|
c19a39f49c | ||
|
|
4b2d9a9ae5 | ||
|
|
e9d29d246a | ||
|
|
2fa1c5abb2 | ||
|
|
3f9afce2cd | ||
|
|
9e9584c42d | ||
|
|
d2fc91295e | ||
|
|
1be3042ef9 | ||
|
|
b9dde5320f | ||
|
|
6c62c297fd | ||
|
|
bb1d1da693 | ||
|
|
e10270d459 | ||
|
|
d681d30249 | ||
|
|
fa5971737e | ||
|
|
0f35487e17 | ||
|
|
064e6a70bc | ||
|
|
6305f12ba2 | ||
|
|
722eb5a69c | ||
|
|
18a991e014 | ||
|
|
3e91a4bb68 | ||
|
|
f70dc77a61 | ||
|
|
81f669ca61 | ||
|
|
cb801ec065 | ||
|
|
c66219846f | ||
|
|
e95bb7e37a | ||
|
|
8cd2d1deff | ||
|
|
3678c4e72a | ||
|
|
9c33d91e68 | ||
|
|
a687c47f7e | ||
|
|
923d0a879b | ||
|
|
75160c6524 | ||
|
|
4d30d931fe | ||
|
|
3cb26268ee | ||
|
|
d4732d048e | ||
|
|
fe2eb7f4c1 | ||
|
|
cb22859250 | ||
|
|
57fedb9fa8 | ||
|
|
9846aeb53a | ||
|
|
3ea4f494d7 | ||
|
|
6ef0b86e30 | ||
|
|
30e45902f2 | ||
|
|
43b88cfba9 | ||
|
|
e13bb23ea0 | ||
|
|
d84be35fcc | ||
|
|
cde1fb0490 | ||
|
|
96b673f809 | ||
|
|
65d33700d4 | ||
|
|
a3ca1029f0 | ||
|
|
3725644ce6 | ||
|
|
c21f84fd9b | ||
|
|
0c1d639911 | ||
|
|
2422dfbbbe | ||
|
|
d7b28d3b24 | ||
|
|
1405db5b19 | ||
|
|
08e637a573 | ||
|
|
9a43dfda51 | ||
|
|
99855eb666 | ||
|
|
fd951be053 | ||
|
|
281a33d61f | ||
|
|
f5bc75c640 | ||
|
|
18355d4748 | ||
|
|
449c7483cd | ||
|
|
c0e447a3af | ||
|
|
afa99db9dc | ||
|
|
b9ce94b360 | ||
|
|
0433d3ca6e | ||
|
|
822d66f401 | ||
|
|
a7502a3599 | ||
|
|
01e3362f21 | ||
|
|
0d833c903a | ||
|
|
cda8e7b560 | ||
|
|
1983604134 | ||
|
|
8de39f261c | ||
|
|
e2cc3bc08d | ||
|
|
c28b4da58c | ||
|
|
8f2c665dc7 | ||
|
|
e5f00e8346 | ||
|
|
c010d81919 | ||
|
|
b4abec5181 | ||
|
|
d63e7defb5 | ||
|
|
67d08f6790 | ||
|
|
c15ec92c83 | ||
|
|
2f69c20e39 | ||
|
|
52d6a21e55 | ||
|
|
4ae92cfc4b | ||
|
|
e730dd6ae2 | ||
|
|
acce19d5b3 | ||
|
|
a9c959b7e5 | ||
|
|
73cc9c4b15 | ||
|
|
01777ac500 | ||
|
|
cb73de77e9 | ||
|
|
f8982a89d7 | ||
|
|
271f4b6f8d | ||
|
|
b56f880c44 | ||
|
|
00d0cdd04e | ||
|
|
33e9003107 | ||
|
|
92b1398a79 | ||
|
|
c1633a8695 | ||
|
|
4680d7059a | ||
|
|
ca0634e16d | ||
|
|
2ea009d301 | ||
|
|
8b9cabf41d | ||
|
|
1e27312c25 | ||
|
|
cd0b925fa1 | ||
|
|
d3f4be0bbc | ||
|
|
9e1276d76f | ||
|
|
3257ecdaef | ||
|
|
23f410c5fe | ||
|
|
f8e99403a4 | ||
|
|
42adb48d9c | ||
|
|
acbc9116e3 | ||
|
|
7a16cf8806 | ||
|
|
e56abc03b3 | ||
|
|
5a4b062b0d | ||
|
|
19eaa05040 | ||
|
|
fad7f8c1df | ||
|
|
7c1938b674 | ||
|
|
025c51e4c9 | ||
|
|
bdf4a173f2 | ||
|
|
a283923393 | ||
|
|
101539b489 | ||
|
|
ee95af8ae3 | ||
|
|
fa27a8447e | ||
|
|
1623d538d5 | ||
|
|
1512d36220 | ||
|
|
1e872108b7 | ||
|
|
f2912eb4c3 | ||
|
|
8efe2de0ec | ||
|
|
5068accc4e | ||
|
|
17d39fd54f | ||
|
|
d3df016005 | ||
|
|
98a403defd | ||
|
|
4ba5ae42a6 | ||
|
|
13f49e1d9a | ||
|
|
6daf6e2270 | ||
|
|
d040263a83 | ||
|
|
f20b969165 | ||
|
|
af39105c04 | ||
|
|
bc8b75148e | ||
|
|
031686f27a | ||
|
|
be506c6d64 | ||
|
|
3bdfbb6318 | ||
|
|
597102e863 | ||
|
|
cba281052a | ||
|
|
315c6b9687 | ||
|
|
193eb62354 | ||
|
|
a7d4379011 | ||
|
|
df3b090d7a | ||
|
|
6b33c19802 | ||
|
|
35bf38e05c | ||
|
|
c1bfe795f8 | ||
|
|
1d98d3c17f | ||
|
|
e1d9e34183 | ||
|
|
f0b99edafc | ||
|
|
21438fc0af | ||
|
|
2321ee829f | ||
|
|
67e64f4ca6 | ||
|
|
c9d3936ee5 | ||
|
|
670b564f13 | ||
|
|
367150b487 | ||
|
|
1abe81b222 | ||
|
|
07101f48d3 | ||
|
|
e3802c499f | ||
|
|
28dd2c2545 | ||
|
|
4100bf95b4 | ||
|
|
90d7722125 | ||
|
|
cf3f8d587c | ||
|
|
a082198d4b | ||
|
|
0e972b9804 | ||
|
|
5cc86384b8 | ||
|
|
dc46c0d012 | ||
|
|
322d11e387 | ||
|
|
22bea3a50b | ||
|
|
daf031173f | ||
|
|
123025665d | ||
|
|
5845a9944d | ||
|
|
377f09f12a | ||
|
|
fc56f6ebdb | ||
|
|
78783cc2aa | ||
|
|
b0342ebe44 | ||
|
|
7ebfe1b66d | ||
|
|
030513bcee | ||
|
|
95a6428915 | ||
|
|
b9df6f52f5 | ||
|
|
5ad45ea17f | ||
|
|
e6969f7ced | ||
|
|
556017f23d | ||
|
|
e6f55814a9 | ||
|
|
1b4d744dcd | ||
|
|
1ac30884c4 | ||
|
|
4ad23c927a | ||
|
|
2c6cf33dec | ||
|
|
19afc807ef | ||
|
|
8420480981 | ||
|
|
3d7be61363 | ||
|
|
d9393d5872 | ||
|
|
c62723ebe2 | ||
|
|
44ab560dd6 | ||
|
|
eec4218ebb | ||
|
|
9aed52ac65 | ||
|
|
1fdc547a97 | ||
|
|
1bef3665e2 | ||
|
|
2235aad731 | ||
|
|
fe4ef69aaf | ||
|
|
4a7ab8366b | ||
|
|
f49dcd0739 | ||
|
|
7a0ff5911d | ||
|
|
9f4a308c1a | ||
|
|
723463149e | ||
|
|
16894e5a5a | ||
|
|
35ea37b37f | ||
|
|
2b8ff3bf38 | ||
|
|
0d371def5c | ||
|
|
288dbe2bd0 | ||
|
|
b79b2dca13 | ||
|
|
4a49c197c9 | ||
|
|
a4ccfc4d96 | ||
|
|
58ae02207f | ||
|
|
4e04588d2d | ||
|
|
d160ed322e | ||
|
|
dc0616d678 | ||
|
|
55c5052253 | ||
|
|
8b07f39d6f | ||
|
|
ea8715ca92 | ||
|
|
f3af0263ed | ||
|
|
bb063fb692 | ||
|
|
8d3f6c39ac | ||
|
|
b59b56d2fc | ||
|
|
3c4329aa1f | ||
|
|
88f259d3ef | ||
|
|
c321c161a8 | ||
|
|
60b8cf7993 | ||
|
|
f931ce7606 | ||
|
|
7462988f33 | ||
|
|
2fb69c4a33 | ||
|
|
bab8935b58 | ||
|
|
5e7e4c2f3a | ||
|
|
3db9623809 | ||
|
|
b9c9df3a8b | ||
|
|
91d2af7e36 | ||
|
|
bca9c687a1 | ||
|
|
71c5b4972c | ||
|
|
f2631809bb | ||
|
|
7c20f2b868 | ||
|
|
88ae5c0875 | ||
|
|
b2f5e2ac08 | ||
|
|
dde471e001 | ||
|
|
2ebb92834c | ||
|
|
0e08dbe931 | ||
|
|
24a4436c9f | ||
|
|
938257b1ed | ||
|
|
d0f6facc0f | ||
|
|
5d821f42a3 | ||
|
|
af2a33a8cb | ||
|
|
2c6d6a223c | ||
|
|
3dc55d4e72 | ||
|
|
b3422b33fd | ||
|
|
f15f28ce02 | ||
|
|
2691ab0c7d | ||
|
|
c6e65e1669 | ||
|
|
523ebed112 | ||
|
|
a98ef36d36 | ||
|
|
3c74031c2f | ||
|
|
1e87fed448 | ||
|
|
6bbe5fb83a | ||
|
|
1cd98f1cf7 | ||
|
|
6ae20f2016 | ||
|
|
7ba97e8703 | ||
|
|
7ca75d46f8 | ||
|
|
751872afa4 | ||
|
|
3722826e0a | ||
|
|
344d1bf949 | ||
|
|
d57574a2ca | ||
|
|
5f3f578311 | ||
|
|
8bcc889d90 | ||
|
|
c82505ed9e | ||
|
|
b72f7001de | ||
|
|
685b234350 | ||
|
|
372e7d94cd | ||
|
|
f8a7154557 | ||
|
|
3b344257d7 | ||
|
|
a66aa1c50d | ||
|
|
87b83ecf56 | ||
|
|
e87f030246 | ||
|
|
44ed8d1116 | ||
|
|
d50109f60a | ||
|
|
7272a3fdaf | ||
|
|
e1d04737cb | ||
|
|
9c1d1f3af8 | ||
|
|
3dfd8a0584 | ||
|
|
3e40b77108 | ||
|
|
ca976aeda9 | ||
|
|
4e535f77c6 | ||
|
|
d57395effb | ||
|
|
3f3adf0c0e | ||
|
|
6847ae689a | ||
|
|
7bb4af1e6d | ||
|
|
e07bba66f3 | ||
|
|
91835daee8 | ||
|
|
a5f06e9250 | ||
|
|
8ac6d05e55 | ||
|
|
dad33da9cf | ||
|
|
725c202498 | ||
|
|
aa32b5cc6e | ||
|
|
dfe9419522 | ||
|
|
08de0c75eb | ||
|
|
ea53567520 | ||
|
|
21907c77c8 | ||
|
|
464ed074e2 | ||
|
|
6ca2223671 | ||
|
|
219f2f2430 | ||
|
|
9c1885a46e | ||
|
|
7341501e7e | ||
|
|
737e2832f2 | ||
|
|
3002777196 | ||
|
|
1b8e8ac22a | ||
|
|
ed5954420b | ||
|
|
b20d550cc4 | ||
|
|
be1daeebd7 | ||
|
|
7399ba386a | ||
|
|
1979ea52d2 | ||
|
|
bc74e7199b | ||
|
|
510c804781 | ||
|
|
1ced4bda11 | ||
|
|
50a3cc3cf7 | ||
|
|
807b5c6325 | ||
|
|
4791c37039 | ||
|
|
de71776405 | ||
|
|
93d16aaba3 | ||
|
|
7e1a06d8dd | ||
|
|
518a83b2c3 | ||
|
|
ca79faa4ed | ||
|
|
b1f6a7e0a1 | ||
|
|
8125579b7c | ||
|
|
8b714d2932 | ||
|
|
13998f583a | ||
|
|
9dc3326d0e | ||
|
|
e1307c7d4b | ||
|
|
60789e0141 | ||
|
|
e2090dc02d | ||
|
|
0c05828874 | ||
|
|
fc5f1524cc | ||
|
|
41a8496b1c | ||
|
|
d1eb9a0d3a | ||
|
|
11ec23bc18 | ||
|
|
c3676a07b1 | ||
|
|
f91b36eec8 | ||
|
|
b9d3de70ab | ||
|
|
8870e85395 | ||
|
|
66c4f608e6 | ||
|
|
d723411436 | ||
|
|
ade5131833 | ||
|
|
951c3e4085 | ||
|
|
464a4add66 | ||
|
|
26cfedc546 | ||
|
|
8faa6231db | ||
|
|
2f6baffe45 | ||
|
|
897a058d29 | ||
|
|
889306f8ad | ||
|
|
b909342e12 | ||
|
|
b21f098119 | ||
|
|
a9cec38c1d | ||
|
|
8e599379f6 | ||
|
|
3f36c7f877 | ||
|
|
13e67aa44e | ||
|
|
0f7cdeaf78 | ||
|
|
e165954395 | ||
|
|
7e9eb5b6c4 | ||
|
|
5c269d38a1 | ||
|
|
6bf7112282 | ||
|
|
fadf87e022 | ||
|
|
ccb13cdd82 | ||
|
|
0bd45c7f51 | ||
|
|
6195deb188 | ||
|
|
eb689fdd24 | ||
|
|
b690b58f8d | ||
|
|
496fcc9798 | ||
|
|
1968b0a333 | ||
|
|
ae9ea8f2db | ||
|
|
be3f0f9267 | ||
|
|
6999322a53 | ||
|
|
a64fe6ce63 | ||
|
|
6544772fb8 | ||
|
|
831de5f15e | ||
|
|
80a453bad1 | ||
|
|
42019bd02f | ||
|
|
271a4a41ba | ||
|
|
fb62f9bef5 | ||
|
|
ef5da43d35 | ||
|
|
7f272a4bd0 | ||
|
|
0a2544c1bf | ||
|
|
c5895b4aa0 | ||
|
|
f86d4d400d | ||
|
|
7b79975516 | ||
|
|
b2df35bd7c | ||
|
|
5127536217 | ||
|
|
0ab61a2428 | ||
|
|
857a6ac479 | ||
|
|
268be70fe8 | ||
|
|
c192b8d61f | ||
|
|
b8644536d2 | ||
|
|
9ac9ed4b36 | ||
|
|
afd56893f5 | ||
|
|
b38e269215 | ||
|
|
f4553505a4 | ||
|
|
7eef9b87b0 | ||
|
|
d997526a1d | ||
|
|
dd36a3792c | ||
|
|
5d5ad0548a | ||
|
|
2e319213e3 | ||
|
|
e4c9ec0903 | ||
|
|
056e8c3ab3 | ||
|
|
eae911bcd2 | ||
|
|
77649b2f23 | ||
|
|
648da7b6e6 | ||
|
|
a85bc7bab6 | ||
|
|
6708be93e4 | ||
|
|
cdd199f763 | ||
|
|
d757889b19 | ||
|
|
9f45722020 | ||
|
|
8f6bb23f38 | ||
|
|
10fe532d29 | ||
|
|
5db093924c | ||
|
|
9c00dd0e2e | ||
|
|
3dc40263ea | ||
|
|
9cff56ea62 | ||
|
|
b5e7861125 | ||
|
|
4ec6cb47ec | ||
|
|
b91ad3a70e | ||
|
|
cce9190cb2 | ||
|
|
72bc5e134a | ||
|
|
1552975c1d | ||
|
|
ccb224043b | ||
|
|
548baa7ece | ||
|
|
b38e234d2e | ||
|
|
f46bd99d0f | ||
|
|
8be7fd5f0a | ||
|
|
8a77ac1f04 | ||
|
|
78cbf97e70 | ||
|
|
2314733af7 | ||
|
|
493ad4dfb8 | ||
|
|
18e94a5365 | ||
|
|
a7588292bf | ||
|
|
8966f46d36 | ||
|
|
c04122d385 | ||
|
|
10b0fca258 | ||
|
|
60233d1abb | ||
|
|
b2dac30a5d | ||
|
|
9b1dee0c9a | ||
|
|
1c2bf6e305 | ||
|
|
36f63e87d2 | ||
|
|
c2102ecfb5 | ||
|
|
6a7ccdf355 | ||
|
|
dc4a114d36 | ||
|
|
cf07e06191 | ||
|
|
87e22df9c8 | ||
|
|
e02a81a96a | ||
|
|
9b889e14d4 | ||
|
|
14c14b72ac | ||
|
|
400f50ddac | ||
|
|
a22b99838d | ||
|
|
d176f2d48f | ||
|
|
9d225e388f | ||
|
|
8136683ffc | ||
|
|
a0425dfb14 | ||
|
|
cc0f8160b5 | ||
|
|
d5b358fde8 | ||
|
|
e346eccbb7 | ||
|
|
b100846ad5 | ||
|
|
b8849a574c | ||
|
|
cc4b5dbf35 | ||
|
|
d3c3d20994 | ||
|
|
e482bc7556 | ||
|
|
eb2a4f5c56 | ||
|
|
2c77616ec3 | ||
|
|
1b84895ba0 | ||
|
|
d4a322add3 | ||
|
|
0ad0763413 | ||
|
|
7feac862db | ||
|
|
b0193885ca | ||
|
|
9a7bde6a02 | ||
|
|
5889489ff7 | ||
|
|
9465a00d4b | ||
|
|
55bc1ccd78 | ||
|
|
2e20e4bbdb | ||
|
|
b8e140d6c4 | ||
|
|
bfcc89f580 | ||
|
|
7b2a2f2336 | ||
|
|
71cc2fe761 | ||
|
|
3567c40bb7 | ||
|
|
2c3ca6efed | ||
|
|
bf53a939da | ||
|
|
dce7730928 | ||
|
|
9b36274a95 | ||
|
|
3c23159148 | ||
|
|
83584c84f8 | ||
|
|
66b6129e98 | ||
|
|
dca400aa40 | ||
|
|
3ba02a3786 | ||
|
|
a393d9a75b | ||
|
|
803c27c582 | ||
|
|
51565e6336 | ||
|
|
f9bd28663a | ||
|
|
d8dcaab996 | ||
|
|
64501d2cb0 | ||
|
|
22f69da0e3 | ||
|
|
0e774f28d8 | ||
|
|
93df66ea2f | ||
|
|
acd1e0b1e1 | ||
|
|
f60676f43e | ||
|
|
35b7d0423f | ||
|
|
fd2096f3dc | ||
|
|
a3f3f00959 | ||
|
|
c7067356b5 | ||
|
|
80509fdf7a | ||
|
|
6f292fb435 | ||
|
|
406f084c4b | ||
|
|
e04bbfbae2 | ||
|
|
c7b96b75b8 | ||
|
|
02736963bc | ||
|
|
8ade7fb274 | ||
|
|
72f65396c7 |
No files matched your search
+3
-3
@@ -1,6 +1,6 @@
|
||||
[submodule "deps/glslang/glslang"]
|
||||
path = deps/glslang/glslang
|
||||
url = git://github.com/KhronosGroup/glslang.git
|
||||
[submodule "deps/spir2cross"]
|
||||
path = deps/spir2cross
|
||||
url = git://github.com/ARM-software/spir2cross
|
||||
[submodule "deps/SPIRV-Cross"]
|
||||
path = deps/SPIRV-Cross
|
||||
url = git://github.com/KhronosGroup/SPIRV-Cross
|
||||
@@ -1,4 +1,5 @@
|
||||
HAVE_FILE_LOGGER=1
|
||||
NEED_CXX_LINKER=0
|
||||
MISSING_DECLS =0
|
||||
|
||||
ifneq ($(C90_BUILD),)
|
||||
@@ -33,7 +34,7 @@ endif
|
||||
HEADERS = $(wildcard */*/*.h) $(wildcard */*.h) $(wildcard *.h)
|
||||
|
||||
ifeq ($(MISSING_DECLS), 1)
|
||||
DEFINES += -Werror=missing-declarations
|
||||
DEFINES += -Werror=missing-declarations
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_DYLIB), 1)
|
||||
@@ -54,9 +55,9 @@ ifeq ($(DEBUG), 1)
|
||||
OPTIMIZE_FLAG = -O0 -g
|
||||
else
|
||||
OPTIMIZE_FLAG = -O3 -ffast-math
|
||||
ifneq ($(findstring Win32,$(OS)),)
|
||||
LDFLAGS += -mwindows
|
||||
endif
|
||||
ifneq ($(findstring Win32,$(OS)),)
|
||||
LDFLAGS += -mwindows
|
||||
endif
|
||||
endif
|
||||
|
||||
CFLAGS += -Wall $(OPTIMIZE_FLAG) $(INCLUDE_DIRS) $(DEBUG_FLAG) -I.
|
||||
@@ -68,10 +69,12 @@ OBJCFLAGS := $(CFLAGS) -D__STDC_CONSTANT_MACROS
|
||||
ifeq ($(CXX_BUILD), 1)
|
||||
LINK = $(CXX)
|
||||
CFLAGS := $(CXXFLAGS) -xc++
|
||||
CFLAGS += -DCXX_BUILD
|
||||
CXXFLAGS += -DCXX_BUILD
|
||||
CFLAGS += -DCXX_BUILD
|
||||
CXXFLAGS += -DCXX_BUILD
|
||||
else
|
||||
ifeq ($(findstring Win32,$(OS)),)
|
||||
ifeq ($(NEED_CXX_LINKER),1)
|
||||
LINK = $(CXX)
|
||||
else ifeq ($(findstring Win32,$(OS)),)
|
||||
LINK = $(CC)
|
||||
else
|
||||
# directx-related code is c++
|
||||
@@ -117,10 +120,14 @@ endif
|
||||
|
||||
all: $(TARGET) config.mk
|
||||
|
||||
ifeq ($(MAKECMDGOALS),clean)
|
||||
config.mk:
|
||||
else
|
||||
-include $(RARCH_OBJ:.o=.d)
|
||||
config.mk: configure qb/*
|
||||
@echo "config.mk is outdated or non-existing. Run ./configure again."
|
||||
@exit 1
|
||||
endif
|
||||
|
||||
retroarch: $(RARCH_OBJ)
|
||||
@$(if $(Q), $(shell echo echo LD $@),)
|
||||
@@ -163,14 +170,14 @@ install: $(TARGET)
|
||||
mkdir -p $(DESTDIR)$(PREFIX)/bin 2>/dev/null || /bin/true
|
||||
mkdir -p $(DESTDIR)$(GLOBAL_CONFIG_DIR) 2>/dev/null || /bin/true
|
||||
mkdir -p $(DESTDIR)$(PREFIX)/share/applications 2>/dev/null || /bin/true
|
||||
mkdir -p $(DESTDIR)$(MAN_DIR) 2>/dev/null || /bin/true
|
||||
mkdir -p $(DESTDIR)$(MAN_DIR)/man6 2>/dev/null || /bin/true
|
||||
mkdir -p $(DESTDIR)$(PREFIX)/share/pixmaps 2>/dev/null || /bin/true
|
||||
install -m755 $(TARGET) $(DESTDIR)$(PREFIX)/bin
|
||||
install -m755 tools/cg2glsl.py $(DESTDIR)$(PREFIX)/bin/retroarch-cg2glsl
|
||||
install -m644 retroarch.cfg $(DESTDIR)$(GLOBAL_CONFIG_DIR)/retroarch.cfg
|
||||
install -m644 retroarch.desktop $(DESTDIR)$(PREFIX)/share/applications
|
||||
install -m644 docs/retroarch.1 $(DESTDIR)$(MAN_DIR)
|
||||
install -m644 docs/retroarch-cg2glsl.1 $(DESTDIR)$(MAN_DIR)
|
||||
install -m644 docs/retroarch.6 $(DESTDIR)$(MAN_DIR)/man6
|
||||
install -m644 docs/retroarch-cg2glsl.6 $(DESTDIR)$(MAN_DIR)/man6
|
||||
install -m644 media/retroarch.svg $(DESTDIR)$(PREFIX)/share/pixmaps
|
||||
|
||||
uninstall:
|
||||
@@ -178,8 +185,8 @@ uninstall:
|
||||
rm -f $(DESTDIR)$(PREFIX)/bin/retroarch-cg2glsl
|
||||
rm -f $(DESTDIR)$(GLOBAL_CONFIG_DIR)/retroarch.cfg
|
||||
rm -f $(DESTDIR)$(PREFIX)/share/applications/retroarch.desktop
|
||||
rm -f $(DESTDIR)$(MAN_DIR)/retroarch.1
|
||||
rm -f $(DESTDIR)$(MAN_DIR)/retroarch-cg2glsl.1
|
||||
rm -f $(DESTDIR)$(MAN_DIR)/man6/retroarch.6
|
||||
rm -f $(DESTDIR)$(MAN_DIR)/man6/retroarch-cg2glsl.6
|
||||
rm -f $(DESTDIR)$(PREFIX)/share/pixmaps/retroarch.svg
|
||||
|
||||
clean:
|
||||
|
||||
+221
-123
@@ -18,6 +18,10 @@ ifeq ($(HAVE_LIBRETRODB),)
|
||||
HAVE_LIBRETRODB = 1
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_HID), 1)
|
||||
DEFINES += -DHAVE_HID
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_LIBRETRODB), 1)
|
||||
DEFINES += -DHAVE_LIBRETRODB
|
||||
endif
|
||||
@@ -44,6 +48,11 @@ ifeq ($(GL_DEBUG), 1)
|
||||
CXXFLAGS += -DGL_DEBUG
|
||||
endif
|
||||
|
||||
ifeq ($(VULKAN_DEBUG), 1)
|
||||
CFLAGS += -DVULKAN_DEBUG
|
||||
CXXFLAGS += -DVULKAN_DEBUG
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_HARD_FLOAT), 1)
|
||||
DEFINES += -mfloat-abi=hard
|
||||
endif
|
||||
@@ -56,6 +65,10 @@ ifeq ($(HAVE_FILE_LOGGER), 1)
|
||||
CFLAGS += -DHAVE_FILE_LOGGER
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_SHADERPIPELINE), 1)
|
||||
CFLAGS += -DHAVE_SHADERPIPELINE
|
||||
endif
|
||||
|
||||
CFLAGS += -I./libretro-common/include
|
||||
|
||||
# Switches
|
||||
@@ -65,6 +78,7 @@ CFLAGS += -I./libretro-common/include
|
||||
|
||||
ifneq ($(findstring BSD,$(OS)),)
|
||||
BSD_LOCAL_INC += -I/usr/local/include
|
||||
OBJ += frontend/drivers/platform_bsd.o
|
||||
endif
|
||||
|
||||
ifneq ($(findstring Darwin,$(OS)),)
|
||||
@@ -108,33 +122,31 @@ OBJ += frontend/frontend.o \
|
||||
frontend/drivers/platform_null.o \
|
||||
ui/ui_companion_driver.o \
|
||||
ui/drivers/ui_null.o \
|
||||
libretro_version_1.o \
|
||||
ui/drivers/null/ui_null_window.o \
|
||||
ui/drivers/null/ui_null_browser_window.o \
|
||||
ui/drivers/null/ui_null_msg_window.o \
|
||||
ui/drivers/null/ui_null_application.o \
|
||||
core_impl.o \
|
||||
retroarch.o \
|
||||
input/input_keyboard.o \
|
||||
command_event.o \
|
||||
command.o \
|
||||
msg_hash.o \
|
||||
intl/msg_hash_de.o \
|
||||
intl/msg_hash_eo.o \
|
||||
intl/msg_hash_es.o \
|
||||
intl/msg_hash_fr.o \
|
||||
intl/msg_hash_it.o \
|
||||
intl/msg_hash_nl.o \
|
||||
intl/msg_hash_pl.o \
|
||||
intl/msg_hash_pt.o \
|
||||
intl/msg_hash_us.o \
|
||||
runloop.o \
|
||||
libretro-common/algorithms/mismatch.o \
|
||||
libretro-common/queues/task_queue.o \
|
||||
tasks/tasks_internal.o \
|
||||
tasks/task_content.o \
|
||||
tasks/task_save_ram.o \
|
||||
tasks/task_save_state.o \
|
||||
tasks/task_file_transfer.o \
|
||||
content.o \
|
||||
tasks/task_image.o \
|
||||
libretro-common/encodings/encoding_utf.o \
|
||||
libretro-common/lists/file_list.o \
|
||||
libretro-common/lists/dir_list.o \
|
||||
libretro-common/file/retro_dirent.o \
|
||||
libretro-common/streams/file_stream.o \
|
||||
libretro-common/streams/interface_stream.o \
|
||||
libretro-common/streams/memory_stream.o \
|
||||
libretro-common/streams/interface_stream.o \
|
||||
libretro-common/streams/memory_stream.o \
|
||||
libretro-common/file/retro_stat.o \
|
||||
libretro-common/lists/string_list.o \
|
||||
libretro-common/string/stdstring.o \
|
||||
@@ -143,10 +155,10 @@ OBJ += frontend/frontend.o \
|
||||
libretro-common/file/nbio/nbio_stdio.o \
|
||||
libretro-common/file/file_path.o \
|
||||
file_path_special.o \
|
||||
file_path_str.o \
|
||||
libretro-common/hash/rhash.o \
|
||||
audio/audio_driver.o \
|
||||
input/input_driver.o \
|
||||
input/input_hid_driver.o \
|
||||
gfx/video_coord_array.o \
|
||||
gfx/video_driver.o \
|
||||
camera/camera_driver.o \
|
||||
@@ -157,7 +169,7 @@ OBJ += frontend/frontend.o \
|
||||
dynamic.o \
|
||||
cores/dynamic_dummy.o \
|
||||
libretro-common/queues/message_queue.o \
|
||||
rewind.o \
|
||||
managers/state_manager.o \
|
||||
gfx/drivers_font_renderer/bitmapfont.o \
|
||||
input/input_autodetect.o \
|
||||
input/input_joypad_driver.o \
|
||||
@@ -168,14 +180,14 @@ OBJ += frontend/frontend.o \
|
||||
input/input_overlay.o \
|
||||
patch.o \
|
||||
libretro-common/queues/fifo_queue.o \
|
||||
core_options.o \
|
||||
managers/core_option_manager.o \
|
||||
libretro-common/compat/compat_fnmatch.o \
|
||||
libretro-common/compat/compat_posix_string.o \
|
||||
cheats.o \
|
||||
managers/cheat_manager.o \
|
||||
core_info.o \
|
||||
libretro-common/file/config_file.o \
|
||||
config_file_userdata.o \
|
||||
screenshot.o \
|
||||
tasks/task_screenshot.o \
|
||||
libretro-common/gfx/scaler/scaler.o \
|
||||
gfx/drivers_shader/shader_null.o \
|
||||
gfx/video_shader_driver.o \
|
||||
@@ -198,14 +210,27 @@ OBJ += frontend/frontend.o \
|
||||
input/drivers/nullinput.o \
|
||||
input/drivers_hid/null_hid.o \
|
||||
input/drivers_joypad/null_joypad.o \
|
||||
input/drivers_joypad/hid_joypad.o \
|
||||
playlist.o \
|
||||
movie.o \
|
||||
record/record_driver.o \
|
||||
record/drivers/record_null.o \
|
||||
performance.o \
|
||||
libretro-common/features/features_cpu.o \
|
||||
performance_counters.o \
|
||||
verbosity.o
|
||||
|
||||
ifeq ($(HAVE_LANGEXTRA), 1)
|
||||
DEFINES += -DHAVE_LANGEXTRA
|
||||
OBJ += intl/msg_hash_de.o \
|
||||
intl/msg_hash_eo.o \
|
||||
intl/msg_hash_es.o \
|
||||
intl/msg_hash_fr.o \
|
||||
intl/msg_hash_it.o \
|
||||
intl/msg_hash_nl.o \
|
||||
intl/msg_hash_pl.o \
|
||||
intl/msg_hash_pt.o
|
||||
|
||||
endif
|
||||
|
||||
ifneq ($(HAVE_GETOPT_LONG), 1)
|
||||
OBJ += libretro-common/compat/compat_getopt.o
|
||||
endif
|
||||
@@ -218,7 +243,7 @@ ifneq ($(HAVE_STRL), 1)
|
||||
OBJ += libretro-common/compat/compat_strl.o
|
||||
endif
|
||||
|
||||
OBJ += gfx/video_texture_image.o
|
||||
OBJ += libretro-common/formats/image_texture.o
|
||||
|
||||
ifeq ($(HAVE_IMAGEVIEWER), 1)
|
||||
DEFINES += -DHAVE_IMAGEVIEWER
|
||||
@@ -228,9 +253,23 @@ endif
|
||||
# Qt
|
||||
|
||||
ifeq ($(HAVE_QT), 1)
|
||||
OBJ += ui/drivers/ui_qt.o
|
||||
HAVE_QT_WRAPPER=0
|
||||
OBJ += ui/drivers/ui_qt.o \
|
||||
ui/drivers/qt/ui_qt_application.o \
|
||||
ui/drivers/qt/ui_qt_window.o \
|
||||
ui/drivers/qt/ui_qt_browser_window.o \
|
||||
ui/drivers/qt/ui_qt_msg_window.o
|
||||
|
||||
ifneq ($(findstring Linux,$(OS)),)
|
||||
DEFINES += -I/usr/include/qt -fPIC
|
||||
endif
|
||||
|
||||
# TODO/FIXME - figure out which libraries we need to link against
|
||||
LIBS += -lQt5Quick -lQt5Widgets -lQt5Gui -lQt5Qml -lQt5Network -lQt5Core -lglu32 -lopengl32 -L./ui/drivers/qt/wrapper/build/release -lwrapper
|
||||
LIBS += -lQt5Quick -lQt5Widgets -lQt5Gui -lQt5Qml -lQt5Network -lQt5Core -L./ui/drivers/qt/wrapper/build/release
|
||||
|
||||
ifeq ($(HAVE_QT_WRAPPER), 1)
|
||||
LIBS += -lwrapper
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_SSA),1)
|
||||
@@ -289,8 +328,11 @@ ifeq ($(HAVE_OSS_BSD), 1)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_ALSA), 1)
|
||||
OBJ += audio/drivers/alsa.o \
|
||||
audio/drivers/alsathread.o
|
||||
OBJ += audio/drivers/alsa.o
|
||||
|
||||
ifeq ($(HAVE_THREADS), 1)
|
||||
OBJ += audio/drivers/alsathread.o
|
||||
endif
|
||||
LIBS += $(ALSA_LIBS)
|
||||
DEFINES += $(ALSA_CFLAGS)
|
||||
endif
|
||||
@@ -363,19 +405,26 @@ ifeq ($(HAVE_NEON),1)
|
||||
DEFINES += -DSINC_LOWER_QUALITY
|
||||
endif
|
||||
|
||||
OBJ += audio/audio_utils.o
|
||||
OBJ += libretro-common/conversion/s16_to_float.o \
|
||||
libretro-common/conversion/float_to_s16.o
|
||||
ifeq ($(HAVE_NEON),1)
|
||||
OBJ += audio/audio_utils_neon.o
|
||||
OBJ += libretro-common/conversion/s16_to_float_neon.o \
|
||||
libretro-common/conversion/float_to_s16_neon.o
|
||||
endif
|
||||
|
||||
ifneq ($(findstring Win32,$(OS)),)
|
||||
HAVE_VULKAN=1
|
||||
DEFINES += -DHAVE_VULKAN
|
||||
endif
|
||||
|
||||
HW_CONTEXT_MENU_DRIVERS=$(HAVE_RGUI)
|
||||
|
||||
ifeq ($(HW_CONTEXT_MENU_DRIVERS),0)
|
||||
ifeq ($(HAVE_GL_CONTEXT),1)
|
||||
HW_CONTEXT_MENU_DRIVERS=1
|
||||
HW_CONTEXT_MENU_DRIVERS=1
|
||||
endif
|
||||
ifeq ($(HAVE_VULKAN),1)
|
||||
HW_CONTEXT_MENU_DRIVERS=1
|
||||
HW_CONTEXT_MENU_DRIVERS=1
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -412,8 +461,12 @@ ifeq ($(HAVE_MATERIALUI), 1)
|
||||
DEFINES += -DHAVE_MATERIALUI
|
||||
endif
|
||||
ifeq ($(HAVE_NUKLEAR), 1)
|
||||
OBJ += menu/drivers/nk_common.o
|
||||
OBJ += menu/drivers/nk_menu.o
|
||||
OBJ += menu/drivers/nuklear/nk_common.o
|
||||
OBJ += menu/drivers/nuklear/nk_menu.o
|
||||
OBJ += menu/drivers/nuklear/nk_wnd_main.o
|
||||
OBJ += menu/drivers/nuklear/nk_wnd_file_picker.o
|
||||
OBJ += menu/drivers/nuklear/nk_wnd_shader_parameters.o
|
||||
OBJ += menu/drivers/nuklear/nk_wnd_settings.o
|
||||
OBJ += menu/drivers/nuklear.o
|
||||
DEFINES += -DHAVE_NUKLEAR
|
||||
endif
|
||||
@@ -438,18 +491,9 @@ ifeq ($(HAVE_MENU_COMMON), 1)
|
||||
else
|
||||
PSEUDO_NS :=
|
||||
endif
|
||||
OBJ += menu/menu_hash.o \
|
||||
menu/menu_driver.o \
|
||||
|
||||
OBJ += menu/menu_driver.o \
|
||||
menu/menu_content.o \
|
||||
menu/intl/menu_hash_de.o \
|
||||
menu/intl/menu_hash_es.o \
|
||||
menu/intl/menu_hash_eo.o \
|
||||
menu/intl/menu_hash_fr.o \
|
||||
menu/intl/menu_hash_it.o \
|
||||
menu/intl/menu_hash_nl.o \
|
||||
menu/intl/menu_hash_pl.o \
|
||||
menu/intl/menu_hash_pt.o \
|
||||
menu/intl/menu_hash_us$(PSEUDO_NS).o \
|
||||
menu/menu_input.o \
|
||||
menu/menu_entry.o \
|
||||
menu/menu_entries.o \
|
||||
@@ -468,6 +512,7 @@ ifeq ($(HAVE_MENU_COMMON), 1)
|
||||
menu/cbs/menu_cbs_deferred_push.o \
|
||||
menu/cbs/menu_cbs_scan.o \
|
||||
menu/cbs/menu_cbs_get_value.o \
|
||||
menu/cbs/menu_cbs_label.o \
|
||||
menu/cbs/menu_cbs_title.o \
|
||||
menu/cbs/menu_cbs_up.o \
|
||||
menu/cbs/menu_cbs_down.o \
|
||||
@@ -482,8 +527,8 @@ endif
|
||||
|
||||
ifeq ($(UTF8), 1)
|
||||
DEFINES += -DHAVE_UTF8
|
||||
OBJ += intl/msg_hash_ru.o
|
||||
DEFINES += -finput-charset=UTF-8
|
||||
OBJ += intl/msg_hash_ru.o
|
||||
DEFINES += -finput-charset=UTF-8
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_STB_FONT), 1)
|
||||
@@ -497,10 +542,8 @@ ifeq ($(HAVE_FREETYPE), 1)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_THREADS), 1)
|
||||
OBJ += autosave.o \
|
||||
libretro-common/rthreads/rthreads.o \
|
||||
OBJ += libretro-common/rthreads/rthreads.o \
|
||||
libretro-common/rthreads/rsemaphore.o \
|
||||
libretro-common/rthreads/async_job.o \
|
||||
gfx/video_thread_wrapper.o \
|
||||
audio/audio_thread_wrapper.o
|
||||
DEFINES += -DHAVE_THREADS
|
||||
@@ -509,10 +552,6 @@ ifeq ($(HAVE_THREADS), 1)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_COMMAND), 1)
|
||||
OBJ += command.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_WAYLAND), 1)
|
||||
OBJ += gfx/drivers_context/wayland_ctx.o
|
||||
DEFINES += $(WAYLAND_CFLAGS)
|
||||
@@ -536,9 +575,9 @@ ifeq ($(HAVE_XINPUT), 1)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_OPENDINGUX_FBDEV), 1)
|
||||
OBJ += gfx/drivers_context/opendingux_fbdev_ctx.o
|
||||
DEFINES += $(EGL_CFLAGS)
|
||||
LIBS += $(EGL_LIBS)
|
||||
OBJ += gfx/drivers_context/opendingux_fbdev_ctx.o
|
||||
DEFINES += $(EGL_CFLAGS)
|
||||
LIBS += $(EGL_LIBS)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_X11), 1)
|
||||
@@ -550,16 +589,16 @@ ifeq ($(HAVE_X11), 1)
|
||||
LIBS += $(X11_LIBS) $(XEXT_LIBS) $(XF86VM_LIBS) $(XINERAMA_LIBS)
|
||||
DEFINES += $(X11_CFLAGS) $(XEXT_CFLAGS) $(XF86VM_CFLAGS) $(XINERAMA_CFLAGS)
|
||||
ifeq ($(HAVE_XCB),1)
|
||||
LIBS += -lX11-xcb
|
||||
LIBS += -lX11-xcb
|
||||
endif
|
||||
ifneq ($(HAVE_GLES), 1)
|
||||
OBJ += gfx/drivers_context/x_ctx.o
|
||||
OBJ += gfx/drivers_context/x_ctx.o
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_XCB),1)
|
||||
DEFINES += $(XCB_CFLAGS)
|
||||
LIBS += $(XCB_LIBS)
|
||||
DEFINES += $(XCB_CFLAGS)
|
||||
LIBS += $(XCB_LIBS)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_XKBCOMMON), 1)
|
||||
@@ -577,18 +616,22 @@ ifeq ($(HAVE_UDEV), 1)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_LIBUSB), 1)
|
||||
ifeq ($(HAVE_THREADS), 1)
|
||||
ifeq ($(HAVE_HID), 1)
|
||||
DEFINES += -DHAVE_LIBUSB
|
||||
OBJ += input/drivers_hid/libusb_hid.o
|
||||
LIBS += -lusb-1.0
|
||||
HAVE_HID = 1
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_IOHIDMANAGER), 1)
|
||||
ifeq ($(HAVE_HID), 1)
|
||||
DEFINES += -DHAVE_IOHIDMANAGER
|
||||
OBJ += input/drivers_hid/iohidmanager_hid.o
|
||||
HAVE_HID = 1
|
||||
LIBS += -framework IOKit
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_CORELOCATION), 1)
|
||||
DEFINES += -DHAVE_CORELOCATION
|
||||
@@ -597,8 +640,10 @@ endif
|
||||
|
||||
ifeq ($(HAVE_HID), 1)
|
||||
DEFINES += -DHAVE_HID
|
||||
OBJ += input/connect/joypad_connection.o \
|
||||
input/connect/connect_ps2adapter.o \
|
||||
OBJ += input/input_hid_driver.o \
|
||||
input/drivers_joypad/hid_joypad.o \
|
||||
input/connect/joypad_connection.o \
|
||||
input/connect/connect_ps2adapter.o \
|
||||
input/connect/connect_ps3.o \
|
||||
input/connect/connect_ps4.o \
|
||||
input/connect/connect_wii.o \
|
||||
@@ -615,7 +660,11 @@ endif
|
||||
# Companion UI
|
||||
|
||||
ifneq ($(findstring Win32,$(OS)),)
|
||||
OBJ += ui/drivers/ui_win32.o
|
||||
OBJ += ui/drivers/ui_win32.o \
|
||||
ui/drivers/win32/ui_win32_window.o \
|
||||
ui/drivers/win32/ui_win32_browser_window.o \
|
||||
ui/drivers/win32/ui_win32_msg_window.o \
|
||||
ui/drivers/win32/ui_win32_application.o
|
||||
endif
|
||||
|
||||
# Video
|
||||
@@ -623,14 +672,20 @@ endif
|
||||
OBJ += gfx/video_context_driver.o \
|
||||
gfx/drivers_context/gfx_null_ctx.o \
|
||||
gfx/video_state_tracker.o \
|
||||
libretro-common/gfx/math/vector_2.o \
|
||||
libretro-common/gfx/math/vector_3.o \
|
||||
libretro-common/gfx/math/matrix_4x4.o \
|
||||
libretro-common/gfx/math/matrix_3x3.o
|
||||
|
||||
ifeq ($(HAVE_KMS), 1)
|
||||
HAVE_AND_WILL_USE_DRM = 1
|
||||
OBJ += gfx/drivers_context/drm_ctx.o
|
||||
DEFINES += $(GBM_CFLAGS) $(DRM_CFLAGS) $(EGL_CFLAGS)
|
||||
LIBS += $(GBM_LIBS) $(DRM_LIBS) $(EGL_LIBS)
|
||||
HAVE_AND_WILL_USE_DRM = 1
|
||||
OBJ += gfx/drivers_context/drm_ctx.o
|
||||
DEFINES += $(GBM_CFLAGS) $(DRM_CFLAGS) $(EGL_CFLAGS)
|
||||
LIBS += $(GBM_LIBS) $(DRM_LIBS) $(EGL_LIBS)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_PLAIN_DRM), 1)
|
||||
OBJ += gfx/drivers/drm_gfx.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_GL_CONTEXT), 1)
|
||||
@@ -674,6 +729,15 @@ ifeq ($(HAVE_GL_CONTEXT), 1)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_FFMPEG), 1)
|
||||
ifneq ($(C89_BUILD), 1)
|
||||
ifneq ($(HAVE_GLES), 1)
|
||||
OBJ += cores/libretro-ffmpeg/fft/fft.o
|
||||
DEFINES += -Ideps -DHAVE_GL_FFT
|
||||
NEED_CXX_LINKER=1
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_GLES), 1)
|
||||
LIBS += $(GLES_LIBS)
|
||||
@@ -738,49 +802,61 @@ ifeq ($(HAVE_SDL2), 1)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_VULKAN), 1)
|
||||
ifeq ($(platform), win)
|
||||
GLSLANG_PLATFORM := Windows
|
||||
else
|
||||
GLSLANG_PLATFORM := Unix
|
||||
endif
|
||||
GLSLANG_SOURCES := \
|
||||
$(wildcard deps/glslang/*.cpp) \
|
||||
$(wildcard deps/glslang/glslang/SPIRV/*.cpp) \
|
||||
$(wildcard deps/glslang/glslang/glslang/GenericCodeGen/*.cpp) \
|
||||
$(wildcard deps/glslang/glslang/OGLCompilersDLL/*.cpp) \
|
||||
$(wildcard deps/glslang/glslang/glslang/MachineIndependent/*.cpp) \
|
||||
$(wildcard deps/glslang/glslang/glslang/MachineIndependent/preprocessor/*.cpp) \
|
||||
$(wildcard deps/glslang/glslang/glslang/OSDependent/$(GLSLANG_PLATFORM)/*.cpp)
|
||||
ifneq ($(findstring Win32,$(OS)),)
|
||||
GLSLANG_PLATFORM := Windows
|
||||
else
|
||||
GLSLANG_PLATFORM := Unix
|
||||
endif
|
||||
|
||||
SPIR2CROSS_SOURCES := deps/spir2cross/spir2cross.cpp
|
||||
GLSLANG_SOURCES := \
|
||||
$(wildcard deps/glslang/*.cpp) \
|
||||
$(wildcard deps/glslang/glslang/SPIRV/*.cpp) \
|
||||
$(wildcard deps/glslang/glslang/glslang/GenericCodeGen/*.cpp) \
|
||||
$(wildcard deps/glslang/glslang/OGLCompilersDLL/*.cpp) \
|
||||
$(wildcard deps/glslang/glslang/glslang/MachineIndependent/*.cpp) \
|
||||
$(wildcard deps/glslang/glslang/glslang/MachineIndependent/preprocessor/*.cpp) \
|
||||
$(wildcard deps/glslang/glslang/hlsl/*.cpp) \
|
||||
$(wildcard deps/glslang/glslang/glslang/OSDependent/$(GLSLANG_PLATFORM)/*.cpp)
|
||||
|
||||
DEFINES += \
|
||||
-Ideps/glslang/glslang/glslang/OSDependent/$(GLSLANG_PLATFORM) \
|
||||
-Ideps/glslang/glslang \
|
||||
-Ideps/glslang/glslang/glslang/MachineIndependent \
|
||||
-Ideps/glslang/glslang/glslang/Public \
|
||||
-Ideps/glslang/glslang/SPIRV \
|
||||
-Ideps/glslang \
|
||||
-Ideps/spir2cross
|
||||
SPIRV_CROSS_SOURCES := deps/SPIRV-Cross/spirv_cross.cpp
|
||||
ifneq ($(findstring Win32,$(OS)),)
|
||||
# Trivial temporary workaround for MinGW and glslang.
|
||||
CXXFLAGS += -fpermissive
|
||||
endif
|
||||
|
||||
CXXFLAGS += -Wno-switch -Wno-sign-compare -fno-strict-aliasing -Wno-maybe-uninitialized -Wno-reorder -I./gfx/include/vulkan
|
||||
CFLAGS += -I./gfx/include/vulkan
|
||||
DEFINES += \
|
||||
-Ideps/glslang/glslang/glslang/OSDependent/$(GLSLANG_PLATFORM) \
|
||||
-Ideps/glslang/glslang/OGLCompilersDLL \
|
||||
-Ideps/glslang/glslang \
|
||||
-Ideps/glslang/glslang/glslang/MachineIndependent \
|
||||
-Ideps/glslang/glslang/glslang/Public \
|
||||
-Ideps/glslang/glslang/SPIRV \
|
||||
-Ideps/glslang \
|
||||
-Ideps/SPIRV-Cross
|
||||
|
||||
GLSLANG_OBJ := $(GLSLANG_SOURCES:.cpp=.o)
|
||||
SPIR2CROSS_OBJ := $(SPIR2CROSS_SOURCES:.cpp=.o)
|
||||
CXXFLAGS += -Wno-switch -Wno-sign-compare -fno-strict-aliasing -Wno-maybe-uninitialized -Wno-reorder -Wno-parentheses -Igfx/include
|
||||
CFLAGS += -Igfx/include
|
||||
|
||||
OBJ += gfx/drivers/vulkan.o \
|
||||
gfx/common/vulkan_common.o \
|
||||
gfx/drivers_font/vulkan_raster_font.o \
|
||||
gfx/drivers_shader/shader_vulkan.o \
|
||||
gfx/drivers_shader/glslang_util.o \
|
||||
gfx/drivers_shader/slang_reflection.o \
|
||||
$(GLSLANG_OBJ) \
|
||||
$(SPIR2CROSS_OBJ)
|
||||
ifeq ($(HAVE_MENU_COMMON), 1)
|
||||
OBJ += menu/drivers_display/menu_display_vulkan.o
|
||||
endif
|
||||
LIBS += -lstdc++
|
||||
GLSLANG_OBJ := $(GLSLANG_SOURCES:.cpp=.o)
|
||||
SPIRV_CROSS_OBJ := $(SPIRV_CROSS_SOURCES:.cpp=.o)
|
||||
|
||||
OBJ += gfx/drivers/vulkan.o \
|
||||
gfx/common/vulkan_common.o \
|
||||
libretro-common/vulkan/vulkan_symbol_wrapper.o \
|
||||
gfx/drivers_font/vulkan_raster_font.o \
|
||||
gfx/drivers_shader/shader_vulkan.o \
|
||||
gfx/drivers_shader/glslang_util.o \
|
||||
gfx/drivers_shader/slang_reflection.o \
|
||||
$(GLSLANG_OBJ) \
|
||||
$(SPIRV_CROSS_OBJ)
|
||||
|
||||
ifeq ($(HAVE_VULKAN_KHR_DISPLAY), 1)
|
||||
OBJ += gfx/drivers_context/khr_display_ctx.o
|
||||
endif
|
||||
ifeq ($(HAVE_MENU_COMMON), 1)
|
||||
OBJ += menu/drivers_display/menu_display_vulkan.o
|
||||
endif
|
||||
LIBS += -lstdc++
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_OMAP), 1)
|
||||
@@ -887,7 +963,6 @@ ifeq ($(HAVE_ZLIB), 1)
|
||||
tasks/task_decompress.o
|
||||
OBJ += $(ZLIB_OBJS)
|
||||
DEFINES += -DHAVE_ZLIB
|
||||
HAVE_RPNG = 1
|
||||
HAVE_COMPRESSION = 1
|
||||
ifeq ($(WANT_ZLIB), 1)
|
||||
DEFINES += -DWANT_ZLIB
|
||||
@@ -897,17 +972,30 @@ ifeq ($(HAVE_ZLIB), 1)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef HAVE_RPNG
|
||||
DEFINES += -DHAVE_RPNG
|
||||
ifeq ($(HAVE_RTGA), 1)
|
||||
DEFINES += -DHAVE_RTGA
|
||||
OBJ += libretro-common/formats/tga/rtga.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_RPNG), 1)
|
||||
DEFINES += -DHAVE_RPNG
|
||||
OBJ += libretro-common/formats/png/rpng.o \
|
||||
libretro-common/formats/png/rpng_encode.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_RJPEG), 1)
|
||||
DEFINES += -DHAVE_RJPEG
|
||||
OBJ += libretro-common/formats/jpeg/rjpeg.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_RBMP), 1)
|
||||
DEFINES += -DHAVE_RBMP
|
||||
OBJ += libretro-common/formats/bmp/rbmp.o
|
||||
endif
|
||||
|
||||
OBJ += libretro-common/formats/bmp/rbmp_encode.o \
|
||||
libretro-common/formats/tga/rtga.o \
|
||||
libretro-common/formats/json/jsonsax.o
|
||||
libretro-common/formats/json/jsonsax.o \
|
||||
libretro-common/formats/image_transfer.o
|
||||
|
||||
ifdef HAVE_COMPRESSION
|
||||
DEFINES += -DHAVE_COMPRESSION
|
||||
@@ -952,18 +1040,18 @@ ifeq ($(HAVE_NETWORKING), 1)
|
||||
DEFINES += -DHAVE_NETWORKING
|
||||
OBJ += libretro-common/net/net_compat.o \
|
||||
libretro-common/net/net_http.o \
|
||||
libretro-common/net/net_socket.o \
|
||||
net_http_special.o \
|
||||
libretro-common/net/net_socket.o \
|
||||
network/net_http_special.o \
|
||||
tasks/task_http.o
|
||||
|
||||
ifneq ($(HAVE_SOCKET_LEGACY),1)
|
||||
OBJ += libretro-common/net/net_ifinfo.o
|
||||
endif
|
||||
OBJ += libretro-common/net/net_ifinfo.o
|
||||
endif
|
||||
|
||||
ifeq ($(WANT_IFADDRS), 1)
|
||||
DEFINES += -DWANT_IFADDRS
|
||||
OBJ += libretro-common/compat/compat_ifaddrs.o
|
||||
endif
|
||||
DEFINES += -DWANT_IFADDRS
|
||||
OBJ += libretro-common/compat/compat_ifaddrs.o
|
||||
endif
|
||||
|
||||
ifneq ($(findstring Win32,$(OS)),)
|
||||
LIBS += -lws2_32 -liphlpapi
|
||||
@@ -972,8 +1060,11 @@ ifeq ($(HAVE_NETWORKING), 1)
|
||||
# Netplay
|
||||
|
||||
ifeq ($(HAVE_NETPLAY), 1)
|
||||
DEFINES += -DHAVE_NETPLAY -DHAVE_NETWORK_CMD -DHAVE_NETWORK_GAMEPAD
|
||||
OBJ += netplay/netplay_net.o netplay/netplay_spectate.o netplay/netplay_common.o netplay/netplay.o
|
||||
DEFINES += -DHAVE_NETPLAY -DHAVE_NETWORK_CMD
|
||||
OBJ += network/netplay/netplay_net.o \
|
||||
network/netplay/netplay_spectate.o \
|
||||
network/netplay/netplay_common.o \
|
||||
network/netplay/netplay.o
|
||||
endif
|
||||
|
||||
# Retro Achievements (also depends on threads)
|
||||
@@ -985,8 +1076,9 @@ ifeq ($(HAVE_NETWORKING), 1)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_NETWORK_GAMEPAD), 1)
|
||||
OBJ += remote.o
|
||||
ifeq ($(HAVE_NETWORKGAMEPAD), 1)
|
||||
OBJ += input/input_remote.o \
|
||||
cores/libretro-net-retropad/net_retropad_core.o
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -1011,9 +1103,11 @@ endif
|
||||
ifeq ($(HAVE_FFMPEG), 1)
|
||||
OBJ += record/drivers/record_ffmpeg.o \
|
||||
cores/libretro-ffmpeg/ffmpeg_core.o
|
||||
|
||||
|
||||
LIBS += $(AVCODEC_LIBS) $(AVFORMAT_LIBS) $(AVUTIL_LIBS) $(SWSCALE_LIBS) $(SWRESAMPLE_LIBS) $(FFMPEG_LIBS)
|
||||
DEFINES += $(AVCODEC_CFLAGS) $(AVFORMAT_CFLAGS) $(AVUTIL_CFLAGS) $(SWSCALE_CFLAGS) $(SWRESAMPLE_CFLAGS)
|
||||
DEFINES += -DHAVE_FFMPEG -Iffmpeg
|
||||
DEFINES += -Wno-deprecated-declarations -DHAVE_FFMPEG -Iffmpeg
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_COMPRESSION), 1)
|
||||
@@ -1029,6 +1123,10 @@ ifeq ($(HAVE_COCOA),1)
|
||||
OBJ += input/drivers/cocoa_input.o \
|
||||
input/drivers_keyboard/keyboard_event_apple.o \
|
||||
ui/drivers/ui_cocoa.o \
|
||||
ui/drivers/cocoa/ui_cocoa_window.o \
|
||||
ui/drivers/cocoa/ui_cocoa_browser_window.o \
|
||||
ui/drivers/cocoa/ui_cocoa_msg_window.o \
|
||||
ui/drivers/cocoa/ui_cocoa_application.o \
|
||||
ui/drivers/cocoa/cocoa_common.o \
|
||||
gfx/drivers_context/cocoa_gl_ctx.o
|
||||
endif
|
||||
+2
-2
@@ -61,7 +61,7 @@ else
|
||||
OBJS += libretro-common/hash/rhash.o
|
||||
OBJS += gfx/video_context_driver.o
|
||||
OBJS += gfx/drivers_context/gfx_null_ctx.o
|
||||
OBJS += gfx/video_texture_image.o
|
||||
OBJS += libretro-common/formats/image_texture.o
|
||||
OBJS += libretro-common/formats/tga/rtga.o
|
||||
OBJS += libretro-common/formats/png/rpng.o
|
||||
OBJS += libretro-common/formats/png/rpng_encode.o
|
||||
@@ -292,7 +292,7 @@ CFLAGS += -I. -Ideps/zlib -Ideps/7zip -Ilibretro-common/include
|
||||
|
||||
CFLAGS += -DRARCH_INTERNAL -DRARCH_CONSOLE -DSINC_LOWEST_QUALITY
|
||||
CFLAGS += -DHAVE_GRIFFIN=1 -DHAVE_FILTERS_BUILTIN -DHAVE_MENU -DHAVE_RGUI
|
||||
CFLAGS += -DHAVE_ZLIB -DHAVE_RPNG -DWANT_ZLIB -DHAVE_BUILTIN_AUTOCONFIG
|
||||
CFLAGS += -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA -DWANT_ZLIB -DHAVE_BUILTIN_AUTOCONFIG
|
||||
|
||||
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11
|
||||
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@ else
|
||||
CFLAGS += -O2
|
||||
endif
|
||||
|
||||
CFLAGS += -DWANT_RPNG -Wall -Wno-unused-result -Wno-unused-variable -I. -Ilibretro-common/include -std=gnu99 -s USE_ZLIB=1 \
|
||||
CFLAGS += -DHAVE_RPNG -DHAVE_RJPEG -Wall -Wno-unused-result -Wno-unused-variable -I. -Ilibretro-common/include -std=gnu99 -s USE_ZLIB=1 \
|
||||
-s EXPORTED_FUNCTIONS="['_main', '_malloc', '_cmd_savefiles', '_cmd_save_state', '_cmd_take_screenshot']"
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
+29
-4
@@ -127,6 +127,9 @@ endif
|
||||
HAVE_FILTERS_BUILTIN := 1
|
||||
HAVE_THREADS := 1
|
||||
HAVE_RPNG := 1
|
||||
HAVE_RJPEG := 1
|
||||
HAVE_RBMP := 1
|
||||
HAVE_RTGA := 1
|
||||
HAVE_OVERLAY := 1
|
||||
HAVE_BUILTIN_AUTOCONFIG := 1
|
||||
HAVE_ZLIB := 1
|
||||
@@ -134,6 +137,7 @@ endif
|
||||
RARCH_CONSOLE = 1
|
||||
|
||||
ifeq ($(platform), wii)
|
||||
HAVE_LANGEXTRA := 1
|
||||
HAVE_WIIUSB_HID := 1
|
||||
HAVE_RARCH_EXEC := 1
|
||||
HAVE_RSOUND := 1
|
||||
@@ -185,7 +189,11 @@ else ifeq ($(platform), psp1)
|
||||
|
||||
BUILD_PRX = 1
|
||||
HAVE_RPNG := 1
|
||||
HAVE_RJPEG := 1
|
||||
HAVE_RBMP := 1
|
||||
HAVE_RTGA := 1
|
||||
HAVE_KERNEL_PRX := 1
|
||||
HAVE_LANGEXTRA := 1
|
||||
RARCH_CONSOLE = 1
|
||||
|
||||
ifeq ($(BUILD_PRX), 1)
|
||||
@@ -205,7 +213,8 @@ else ifeq ($(platform), vita)
|
||||
-lSceSysmodule_stub -lSceCtrl_stub -lSceAudio_stub -lUVLoader_stub \
|
||||
-lScePower_stub -lSceRtc_stub -lSceCommonDialog_stub -lfreetype -lz -lm -lc -lpng
|
||||
|
||||
PLATOBJS += audio/audio_utils_neon.o audio/drivers_resampler/sinc_resampler_neon.o \
|
||||
PLATOBJS += libretro-common/conversion/s16_to_float_neon.o \
|
||||
audio/drivers_resampler/sinc_resampler_neon.o \
|
||||
audio/drivers_resampler/cc_resampler_neon.o
|
||||
|
||||
LIBDIRS += -L.
|
||||
@@ -213,7 +222,11 @@ else ifeq ($(platform), vita)
|
||||
|
||||
HAVE_FILTERS_BUILTIN := 1
|
||||
HAVE_BUILTIN_AUTOCONFIG := 1
|
||||
HAVE_LANGEXTRA := 1
|
||||
HAVE_RPNG := 1
|
||||
HAVE_RJPEG := 1
|
||||
HAVE_RBMP := 1
|
||||
HAVE_RTGA := 1
|
||||
HAVE_ZLIB := 1
|
||||
HAVE_VITA2D := 1
|
||||
HAVE_NETWORKING := 1
|
||||
@@ -262,8 +275,8 @@ ifeq ($(BIG_STACK),1)
|
||||
CFLAGS += -DBIG_STACK
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_RPNG), 1)
|
||||
CFLAGS += -DWANT_RPNG
|
||||
ifeq ($(HAVE_RJPEG), 1)
|
||||
CFLAGS += -DHAVE_RJPEG
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_FILE_LOGGER), 1)
|
||||
@@ -282,6 +295,14 @@ ifeq ($(HAVE_RPNG), 1)
|
||||
CFLAGS += -DHAVE_RPNG
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_RBMP), 1)
|
||||
CFLAGS += -DHAVE_RBMP
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_RTGA), 1)
|
||||
CFLAGS += -DHAVE_RTGA
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_7ZIP), 1)
|
||||
CFLAGS += -DHAVE_7ZIP
|
||||
endif
|
||||
@@ -312,6 +333,10 @@ endif
|
||||
|
||||
CFLAGS += -std=gnu99 -DSINC_LOWER_QUALITY -DHAVE_RGUI -DHAVE_MENU -DHAVE_GRIFFIN=1 -Wno-char-subscripts -DRARCH_INTERNAL
|
||||
|
||||
ifeq ($(HAVE_LANGEXTRA), 1)
|
||||
CFLAGS += -DHAVE_LANGEXTRA
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_FILTERS_BUILTIN), 1)
|
||||
CFLAGS += -DHAVE_FILTERS_BUILTIN
|
||||
endif
|
||||
@@ -350,7 +375,7 @@ all: $(EXT_TARGET)
|
||||
|
||||
%.velf: %.elf
|
||||
arm-vita-eabi-strip -g $<
|
||||
vita-elf-create $< $@ $(VITASDK)/bin/db.json $(VITASDK)/bin/extra.json
|
||||
vita-elf-create $< $@ $(VITASDK)/share/db.json $(VITASDK)/share/extra.json
|
||||
|
||||
%.elf32: %.elf
|
||||
ifeq ($(platform), xenon360)
|
||||
|
||||
@@ -10,12 +10,12 @@ TARGET := retroarch-pandora
|
||||
LDDIRS = -L. -L$(PNDSDK)/usr/lib
|
||||
INCDIRS = -I. -I$(PNDSDK)/usr/include
|
||||
|
||||
OBJ = griffin/griffin.o audio/resamplers/sinc_resampler_neon.o audio/audio_utils_neon.o
|
||||
OBJ = griffin/griffin.o audio/resamplers/sinc_resampler_neon.o libretro-common/conversion/s16_to_float_neon.o libretro-common/conversion/float_to_s16_neon.o
|
||||
LDFLAGS = -L$(PNDSDK)/usr/lib -Wl,-rpath,$(PNDSDK)/usr/lib
|
||||
|
||||
LIBS = -lGLESv2 -lEGL -ldl -lm -lpthread -lrt -lasound
|
||||
DEFINES = -std=gnu99 -DHAVE_THREADS -DHAVE_GETOPT_LONG=1 -DHAVE_GRIFFIN -DRARCH_INTERNAL
|
||||
DEFINES += -D__ARM_ARCH_6__ -DSINC_LOWER_QUALITY -DHAVE_OPENGL -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DHAVE_GLSL -DHAVE_DYNAMIC -DWANT_RPNG -DWANT_ZLIB -DHAVE_OVERLAY -DHAVE_ALSA -DHAVE_ZLIB -D__linux__
|
||||
DEFINES += -D__ARM_ARCH_6__ -DSINC_LOWER_QUALITY -DHAVE_OPENGL -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DHAVE_GLSL -DHAVE_DYNAMIC -DHAVE_RPNG -DHAVE_RJPEG -DWANT_ZLIB -DHAVE_OVERLAY -DHAVE_ALSA -DHAVE_ZLIB -D__linux__
|
||||
DEFINES += $(INCDIRS)
|
||||
DEFINES += -D__OPENPANDORA__ -DPANDORA
|
||||
DEFINES += -marm -march=armv7-a -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize
|
||||
|
||||
+2
-2
@@ -68,7 +68,7 @@ ifeq ($(HAVE_RLAUNCH), 1)
|
||||
DEFINES += -DHAVE_RLAUNCH
|
||||
endif
|
||||
|
||||
DEFINES += -DHAVE_MENU -DHAVE_RGUI -DRARCH_INTERNAL -DMSB_FIRST -DHAVE_OVERLAY
|
||||
DEFINES += -DHAVE_MENU -DHAVE_RGUI -DHAVE_XMB -DHAVE_MATERIALUI -DHAVE_SHADERPIPELINE -DRARCH_INTERNAL -DMSB_FIRST -DHAVE_OVERLAY
|
||||
|
||||
ifeq ($(HAVE_GCMGL), 1)
|
||||
DEFINES += -DHAVE_GCMGL
|
||||
@@ -106,7 +106,7 @@ PPU_LDLIBS = $(FONT_LIBS) $(GL_LIBS) $(WHOLE_START) -lretro_ps3 $(WHOLE_END) -l
|
||||
|
||||
PPU_RANLIB = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ranlib.exe
|
||||
|
||||
DEFINES += -DHAVE_THREADS -DRARCH_CONSOLE -DHAVE_OPENGL -DHAVE_HEADSET -DHAVE_OPENGLES -DHAVE_OPENGLES1 -DHAVE_PSGL -DHAVE_CG -DHAVE_CG_RUNTIME_COMPILER -DHAVE_FBO -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_RSOUND -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_7Z -DWANT_ZLIB -DSINC_LOWER_QUALITY -D__CELLOS_LV2__ -DHAVE_NETPLAY=1 -DHAVE_NETWORKING=1 -DHAVE_SOCKET_LEGACY=1 -DHAVE_MOUSE -DHAVE_GRIFFIN=1 -DHAVE_MULTIMAN=1 -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT) -DHAVE_FILTERS_BUILTIN -DHAVE_BUILTIN_AUTOCONFIG
|
||||
DEFINES += -DHAVE_THREADS -DRARCH_CONSOLE -DHAVE_OPENGL -DHAVE_HEADSET -DHAVE_LANGEXTRA -DHAVE_OPENGLES -DHAVE_OPENGLES1 -DHAVE_PSGL -DHAVE_CG -DHAVE_CG_RUNTIME_COMPILER -DHAVE_FBO -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_RSOUND -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA -DHAVE_7Z -DWANT_ZLIB -DSINC_LOWER_QUALITY -D__CELLOS_LV2__ -DHAVE_NETPLAY=1 -DHAVE_NETWORKING=1 -DHAVE_SOCKET_LEGACY=1 -DHAVE_MOUSE -DHAVE_GRIFFIN=1 -DHAVE_MULTIMAN=1 -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT) -DHAVE_FILTERS_BUILTIN -DHAVE_BUILTIN_AUTOCONFIG
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
PPU_OPTIMIZE_LV := -O0 -g
|
||||
|
||||
@@ -33,11 +33,12 @@ PPU_SRCS = frontend/frontend_salamander.c \
|
||||
libretro-common/compat/compat_strl.c \
|
||||
libretro-common/streams/file_stream.c \
|
||||
libretro-common/file/config_file.c \
|
||||
file_path_str.c \
|
||||
verbosity.c
|
||||
|
||||
ifeq ($(HAVE_LOGGER), 1)
|
||||
PPU_CFLAGS += -DHAVE_LOGGER
|
||||
PPU_SRCS += netlogger.c \
|
||||
PPU_SRCS += network/net_logger.c \
|
||||
libretro-common/net/net_compat.c \
|
||||
libretro-common/net/net_socket.c
|
||||
endif
|
||||
|
||||
@@ -83,7 +83,6 @@ OBJ = griffin/griffin.o
|
||||
|
||||
ifeq ($(HAVE_LOGGER), 1)
|
||||
CFLAGS += -DHAVE_LOGGER
|
||||
CFLAGS += -Ilogger/netlogger
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_FILE_LOGGER), 1)
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ INCDIR = deps/zlib deps/7zip libretro-common/include
|
||||
CFLAGS = $(OPTIMIZE_LV) -G0 -std=gnu99 -ffast-math
|
||||
ASFLAGS = $(CFLAGS)
|
||||
|
||||
RARCH_DEFINES = -DPSP -D_MIPS_ARCH_ALLEGREX -DHAVE_ZLIB -DHAVE_RPNG -DWANT_ZLIB -DHAVE_GRIFFIN=1 -DRARCH_INTERNAL -DRARCH_CONSOLE -DHAVE_MENU -DHAVE_RGUI -DWANT_RPNG -DSINC_LOWEST_QUALITY -DHAVE_BUILTIN_AUTOCONFIG -DHAVE_FILTERS_BUILTIN -DHAVE_7ZIP
|
||||
RARCH_DEFINES = -DPSP -D_MIPS_ARCH_ALLEGREX -DHAVE_LANGEXTRA -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DWANT_ZLIB -DHAVE_GRIFFIN=1 -DRARCH_INTERNAL -DRARCH_CONSOLE -DHAVE_MENU -DHAVE_RGUI -DSINC_LOWEST_QUALITY -DHAVE_BUILTIN_AUTOCONFIG -DHAVE_FILTERS_BUILTIN -DHAVE_7ZIP
|
||||
|
||||
LIBDIR =
|
||||
LDFLAGS =
|
||||
|
||||
@@ -45,6 +45,7 @@ OBJS = frontend/frontend_salamander.o \
|
||||
libretro-common/streams/file_stream.o \
|
||||
libretro-common/file/retro_stat.o \
|
||||
libretro-common/hash/rhash.o \
|
||||
file_path_str.o \
|
||||
verbosity.o \
|
||||
bootstrap/psp1/kernel_functions.o
|
||||
|
||||
|
||||
@@ -54,13 +54,14 @@ OBJ = frontend/frontend_salamander.o \
|
||||
libretro-common/file/retro_stat.o \
|
||||
libretro-common/compat/compat_strl.o \
|
||||
libretro-common/file/config_file.o \
|
||||
file_path_str.o \
|
||||
verbosity.o \
|
||||
$(APP_BOOTER_DIR)/app_booter.binobj
|
||||
|
||||
ifeq ($(HAVE_LOGGER), 1)
|
||||
CFLAGS += -DHAVE_LOGGER
|
||||
CFLAGS += -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT)
|
||||
OBJ += logger/netlogger.o \
|
||||
OBJ += network/net_logger.o \
|
||||
libretro-common/net/net_compat.o \
|
||||
libretro-common/net/net_socket.o
|
||||
endif
|
||||
|
||||
@@ -120,7 +120,6 @@ ifeq ($(DEBUG), 1)
|
||||
else
|
||||
CFLAGS += -O3 -ffast-math
|
||||
CXXFLAGS += -O3 -ffast-math
|
||||
LDCXXFLAGS += -s
|
||||
endif
|
||||
|
||||
CFLAGS += -Wall -Wno-unused-result -Wno-unused-variable -I.
|
||||
|
||||
@@ -14,7 +14,7 @@ A libretro core written in portable C or C++ can run seamlessly on many platform
|
||||
While RetroArch is the reference frontend for libretro, several other projects have used the libretro
|
||||
interface to include support for emulators and/or game engines. libretro is completely open and free for anyone to use.
|
||||
|
||||
[libretro API header](https://github.com/libretro/RetroArch/blob/master/libretro.h)
|
||||
[libretro API header](https://github.com/libretro/RetroArch/blob/master/libretro-common/include/libretro.h)
|
||||
|
||||
## Binaries
|
||||
|
||||
|
||||
+292
-238
@@ -19,18 +19,19 @@
|
||||
#include <retro_assert.h>
|
||||
|
||||
#include <lists/string_list.h>
|
||||
#include <conversion/float_to_s16.h>
|
||||
#include <conversion/s16_to_float.h>
|
||||
|
||||
#include "audio_driver.h"
|
||||
#include "audio_resampler_driver.h"
|
||||
#include "../record/record_driver.h"
|
||||
#include "audio_utils.h"
|
||||
#include "audio_thread_wrapper.h"
|
||||
|
||||
#include "../command_event.h"
|
||||
#include "../command.h"
|
||||
#include "../configuration.h"
|
||||
#include "../retroarch.h"
|
||||
#include "../runloop.h"
|
||||
#include "../performance.h"
|
||||
#include "../performance_counters.h"
|
||||
#include "../verbosity.h"
|
||||
#include "../list_special.h"
|
||||
|
||||
@@ -38,7 +39,7 @@
|
||||
#define AUDIO_BUFFER_FREE_SAMPLES_COUNT (8 * 1024)
|
||||
#endif
|
||||
|
||||
typedef struct audio_driver_input_data
|
||||
struct audio_driver_input_data
|
||||
{
|
||||
float *data;
|
||||
|
||||
@@ -88,12 +89,12 @@ typedef struct audio_driver_input_data
|
||||
unsigned buf[AUDIO_BUFFER_FREE_SAMPLES_COUNT];
|
||||
uint64_t count;
|
||||
} free_samples;
|
||||
} audio_driver_input_data_t;
|
||||
};
|
||||
|
||||
static const audio_driver_t *audio_drivers[] = {
|
||||
#ifdef HAVE_ALSA
|
||||
&audio_alsa,
|
||||
#ifndef __QNX__
|
||||
#if !defined(__QNX__) && defined(HAVE_THREADS)
|
||||
&audio_alsathread,
|
||||
#endif
|
||||
#endif
|
||||
@@ -153,9 +154,16 @@ static const audio_driver_t *audio_drivers[] = {
|
||||
NULL,
|
||||
};
|
||||
|
||||
static audio_driver_input_data_t audio_driver_data;
|
||||
static const audio_driver_t *current_audio = NULL;
|
||||
static void *audio_driver_context_audio_data = NULL;
|
||||
static struct audio_driver_input_data audio_driver_data;
|
||||
static struct retro_audio_callback audio_callback;
|
||||
static struct string_list *audio_driver_devices_list = NULL;
|
||||
static struct retro_perf_counter resampler_proc = {0};
|
||||
static const rarch_resampler_t *audio_driver_resampler = NULL;
|
||||
static void *audio_driver_resampler_data = NULL;
|
||||
static bool audio_driver_active = false;
|
||||
static bool audio_driver_data_own = false;
|
||||
static const audio_driver_t *current_audio = NULL;
|
||||
static void *audio_driver_context_audio_data = NULL;
|
||||
|
||||
/**
|
||||
* compute_audio_buffer_statistics:
|
||||
@@ -253,7 +261,6 @@ const char *config_get_audio_driver_options(void)
|
||||
return char_list_new_special(STRING_LIST_AUDIO_DRIVERS, NULL);
|
||||
}
|
||||
|
||||
|
||||
static bool uninit_audio(void)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
@@ -277,11 +284,11 @@ static bool uninit_audio(void)
|
||||
|
||||
if (!settings->audio.enable)
|
||||
{
|
||||
audio_driver_ctl(RARCH_AUDIO_CTL_UNSET_ACTIVE, NULL);
|
||||
audio_driver_unset_active();
|
||||
return false;
|
||||
}
|
||||
|
||||
audio_driver_ctl(RARCH_AUDIO_CTL_RESAMPLER_DEINIT, NULL);
|
||||
audio_driver_deinit_resampler();
|
||||
|
||||
if (audio_driver_data.data)
|
||||
free(audio_driver_data.data);
|
||||
@@ -291,27 +298,29 @@ static bool uninit_audio(void)
|
||||
free(audio_driver_data.output_samples.buf);
|
||||
audio_driver_data.output_samples.buf = NULL;
|
||||
|
||||
event_cmd_ctl(EVENT_CMD_DSP_FILTER_DEINIT, NULL);
|
||||
command_event(CMD_EVENT_DSP_FILTER_DEINIT, NULL);
|
||||
|
||||
compute_audio_buffer_statistics();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool init_audio(bool audio_cb_inited)
|
||||
static bool audio_driver_init_internal(bool audio_cb_inited)
|
||||
{
|
||||
size_t outsamples_max, max_bufsamples = AUDIO_CHUNK_SIZE_NONBLOCKING * 2;
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
audio_convert_init_simd();
|
||||
convert_s16_to_float_init_simd();
|
||||
convert_float_to_s16_init_simd();
|
||||
|
||||
/* Accomodate rewind since at some point we might have two full buffers. */
|
||||
outsamples_max = max_bufsamples * AUDIO_MAX_RATIO *
|
||||
settings->slowmotion_ratio;
|
||||
|
||||
audio_driver_data.output_samples.conv_buf =
|
||||
(int16_t*)malloc(outsamples_max * sizeof(int16_t));
|
||||
/* Used for recording even if audio isn't enabled. */
|
||||
retro_assert(audio_driver_data.output_samples.conv_buf =
|
||||
(int16_t*)malloc(outsamples_max * sizeof(int16_t)));
|
||||
retro_assert(audio_driver_data.output_samples.conv_buf != NULL);
|
||||
|
||||
if (!audio_driver_data.output_samples.conv_buf)
|
||||
goto error;
|
||||
@@ -322,8 +331,9 @@ static bool init_audio(bool audio_cb_inited)
|
||||
|
||||
/* Needs to be able to hold full content of a full max_bufsamples
|
||||
* in addition to its own. */
|
||||
retro_assert(audio_driver_data.rewind.buf = (int16_t*)
|
||||
malloc(max_bufsamples * sizeof(int16_t)));
|
||||
audio_driver_data.rewind.buf = (int16_t*)malloc
|
||||
(max_bufsamples * sizeof(int16_t));
|
||||
retro_assert(audio_driver_data.rewind.buf != NULL);
|
||||
|
||||
if (!audio_driver_data.rewind.buf)
|
||||
goto error;
|
||||
@@ -332,16 +342,16 @@ static bool init_audio(bool audio_cb_inited)
|
||||
|
||||
if (!settings->audio.enable)
|
||||
{
|
||||
audio_driver_ctl(RARCH_AUDIO_CTL_UNSET_ACTIVE, NULL);
|
||||
audio_driver_unset_active();
|
||||
return false;
|
||||
}
|
||||
|
||||
audio_driver_ctl(RARCH_AUDIO_CTL_FIND_DRIVER, NULL);
|
||||
audio_driver_find_driver();
|
||||
#ifdef HAVE_THREADS
|
||||
if (audio_cb_inited)
|
||||
{
|
||||
RARCH_LOG("Starting threaded audio driver ...\n");
|
||||
if (!rarch_threaded_audio_init(
|
||||
if (!audio_init_thread(
|
||||
¤t_audio,
|
||||
&audio_driver_context_audio_data,
|
||||
*settings->audio.device ? settings->audio.device : NULL,
|
||||
@@ -349,7 +359,7 @@ static bool init_audio(bool audio_cb_inited)
|
||||
current_audio))
|
||||
{
|
||||
RARCH_ERR("Cannot open threaded audio driver ... Exiting ...\n");
|
||||
retro_fail(1, "init_audio()");
|
||||
retroarch_fail(1, "audio_driver_init_internal()");
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -364,17 +374,17 @@ static bool init_audio(bool audio_cb_inited)
|
||||
if (!audio_driver_context_audio_data)
|
||||
{
|
||||
RARCH_ERR("Failed to initialize audio driver. Will continue without audio.\n");
|
||||
audio_driver_ctl(RARCH_AUDIO_CTL_UNSET_ACTIVE, NULL);
|
||||
audio_driver_unset_active();
|
||||
}
|
||||
|
||||
audio_driver_data.use_float = false;
|
||||
if ( audio_driver_ctl(RARCH_AUDIO_CTL_IS_ACTIVE, NULL)
|
||||
if ( audio_driver_is_active()
|
||||
&& current_audio->use_float(audio_driver_context_audio_data))
|
||||
audio_driver_data.use_float = true;
|
||||
|
||||
if (!settings->audio.sync && audio_driver_ctl(RARCH_AUDIO_CTL_IS_ACTIVE, NULL))
|
||||
if (!settings->audio.sync && audio_driver_is_active())
|
||||
{
|
||||
event_cmd_ctl(EVENT_CMD_AUDIO_SET_NONBLOCKING_STATE, NULL);
|
||||
command_event(CMD_EVENT_AUDIO_SET_NONBLOCKING_STATE, NULL);
|
||||
audio_driver_data.chunk.size = audio_driver_data.chunk.nonblock_size;
|
||||
}
|
||||
|
||||
@@ -390,15 +400,16 @@ static bool init_audio(bool audio_cb_inited)
|
||||
audio_driver_data.audio_rate.source_ratio.current =
|
||||
(double)settings->audio.out_rate / audio_driver_data.audio_rate.input;
|
||||
|
||||
if (!audio_driver_ctl(RARCH_AUDIO_CTL_RESAMPLER_INIT, NULL))
|
||||
if (!audio_driver_init_resampler())
|
||||
{
|
||||
RARCH_ERR("Failed to initialize resampler \"%s\".\n",
|
||||
settings->audio.resampler);
|
||||
audio_driver_ctl(RARCH_AUDIO_CTL_UNSET_ACTIVE, NULL);
|
||||
audio_driver_unset_active();
|
||||
}
|
||||
|
||||
retro_assert(audio_driver_data.data = (float*)
|
||||
malloc(max_bufsamples * sizeof(float)));
|
||||
audio_driver_data.data = (float*)
|
||||
malloc(max_bufsamples * sizeof(float));
|
||||
retro_assert(audio_driver_data.data != NULL);
|
||||
|
||||
if (!audio_driver_data.data)
|
||||
goto error;
|
||||
@@ -407,8 +418,10 @@ static bool init_audio(bool audio_cb_inited)
|
||||
|
||||
retro_assert(settings->audio.out_rate <
|
||||
audio_driver_data.audio_rate.input * AUDIO_MAX_RATIO);
|
||||
retro_assert(audio_driver_data.output_samples.buf = (float*)
|
||||
malloc(outsamples_max * sizeof(float)));
|
||||
|
||||
audio_driver_data.output_samples.buf = (float*)
|
||||
malloc(outsamples_max * sizeof(float));
|
||||
retro_assert(audio_driver_data.output_samples.buf != NULL);
|
||||
|
||||
if (!audio_driver_data.output_samples.buf)
|
||||
goto error;
|
||||
@@ -416,7 +429,7 @@ static bool init_audio(bool audio_cb_inited)
|
||||
audio_driver_data.audio_rate.control = false;
|
||||
if (
|
||||
!audio_cb_inited
|
||||
&& audio_driver_ctl(RARCH_AUDIO_CTL_IS_ACTIVE, NULL)
|
||||
&& audio_driver_is_active()
|
||||
&& settings->audio.rate_control
|
||||
)
|
||||
{
|
||||
@@ -432,22 +445,22 @@ static bool init_audio(bool audio_cb_inited)
|
||||
RARCH_WARN("Audio rate control was desired, but driver does not support needed features.\n");
|
||||
}
|
||||
|
||||
event_cmd_ctl(EVENT_CMD_DSP_FILTER_INIT, NULL);
|
||||
command_event(CMD_EVENT_DSP_FILTER_INIT, NULL);
|
||||
|
||||
audio_driver_data.free_samples.count = 0;
|
||||
|
||||
/* Threaded driver is initially stopped. */
|
||||
if (
|
||||
audio_driver_ctl(RARCH_AUDIO_CTL_IS_ACTIVE, NULL)
|
||||
audio_driver_is_active()
|
||||
&& !settings->audio.mute_enable
|
||||
&& audio_cb_inited
|
||||
)
|
||||
audio_driver_ctl(RARCH_AUDIO_CTL_START, NULL);
|
||||
audio_driver_start();
|
||||
|
||||
return true;
|
||||
|
||||
error:
|
||||
return audio_driver_ctl(RARCH_AUDIO_CTL_DEINIT, NULL);
|
||||
return audio_driver_deinit();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -487,7 +500,7 @@ void audio_driver_set_nonblocking_state(bool enable)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
if (
|
||||
audio_driver_ctl(RARCH_AUDIO_CTL_IS_ACTIVE, NULL)
|
||||
audio_driver_is_active()
|
||||
&& audio_driver_context_audio_data
|
||||
)
|
||||
current_audio->set_nonblock_state(audio_driver_context_audio_data,
|
||||
@@ -525,16 +538,16 @@ static bool audio_driver_flush(const int16_t *data, size_t samples)
|
||||
|
||||
if (runloop_ctl(RUNLOOP_CTL_IS_PAUSED, NULL) || settings->audio.mute_enable)
|
||||
return true;
|
||||
if (!audio_driver_ctl(RARCH_AUDIO_CTL_IS_ACTIVE, NULL))
|
||||
if (!audio_driver_is_active())
|
||||
return false;
|
||||
if (!audio_driver_data.data)
|
||||
return false;
|
||||
|
||||
rarch_perf_init(&audio_convert_s16, "audio_convert_s16");
|
||||
retro_perf_start(&audio_convert_s16);
|
||||
audio_convert_s16_to_float(audio_driver_data.data, data, samples,
|
||||
performance_counter_init(&audio_convert_s16, "audio_convert_s16");
|
||||
performance_counter_start(&audio_convert_s16);
|
||||
convert_s16_to_float(audio_driver_data.data, data, samples,
|
||||
audio_driver_data.volume_gain);
|
||||
retro_perf_stop(&audio_convert_s16);
|
||||
performance_counter_stop(&audio_convert_s16);
|
||||
|
||||
src_data.data_in = audio_driver_data.data;
|
||||
src_data.input_frames = samples >> 1;
|
||||
@@ -544,10 +557,10 @@ static bool audio_driver_flush(const int16_t *data, size_t samples)
|
||||
|
||||
if (audio_driver_data.dsp)
|
||||
{
|
||||
rarch_perf_init(&audio_dsp, "audio_dsp");
|
||||
retro_perf_start(&audio_dsp);
|
||||
performance_counter_init(&audio_dsp, "audio_dsp");
|
||||
performance_counter_start(&audio_dsp);
|
||||
rarch_dsp_filter_process(audio_driver_data.dsp, &dsp_data);
|
||||
retro_perf_stop(&audio_dsp);
|
||||
performance_counter_stop(&audio_dsp);
|
||||
|
||||
if (dsp_data.output)
|
||||
{
|
||||
@@ -566,18 +579,18 @@ static bool audio_driver_flush(const int16_t *data, size_t samples)
|
||||
if (runloop_ctl(RUNLOOP_CTL_IS_SLOWMOTION, NULL))
|
||||
src_data.ratio *= settings->slowmotion_ratio;
|
||||
|
||||
audio_driver_ctl(RARCH_AUDIO_CTL_RESAMPLER_PROCESS, &src_data);
|
||||
audio_driver_process_resampler(&src_data);
|
||||
|
||||
output_data = audio_driver_data.output_samples.buf;
|
||||
output_frames = src_data.output_frames;
|
||||
|
||||
if (!audio_driver_data.use_float)
|
||||
{
|
||||
rarch_perf_init(&audio_convert_float, "audio_convert_float");
|
||||
retro_perf_start(&audio_convert_float);
|
||||
audio_convert_float_to_s16(audio_driver_data.output_samples.conv_buf,
|
||||
performance_counter_init(&audio_convert_float, "audio_convert_float");
|
||||
performance_counter_start(&audio_convert_float);
|
||||
convert_float_to_s16(audio_driver_data.output_samples.conv_buf,
|
||||
(const float*)output_data, output_frames * 2);
|
||||
retro_perf_stop(&audio_convert_float);
|
||||
performance_counter_stop(&audio_convert_float);
|
||||
|
||||
output_data = audio_driver_data.output_samples.conv_buf;
|
||||
output_size = sizeof(int16_t);
|
||||
@@ -586,7 +599,7 @@ static bool audio_driver_flush(const int16_t *data, size_t samples)
|
||||
if (current_audio->write(audio_driver_context_audio_data,
|
||||
output_data, output_frames * output_size * 2) < 0)
|
||||
{
|
||||
audio_driver_ctl(RARCH_AUDIO_CTL_UNSET_ACTIVE, NULL);
|
||||
audio_driver_unset_active();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -699,8 +712,7 @@ void audio_driver_set_buffer_size(size_t bufsize)
|
||||
audio_driver_data.driver_buffer_size = bufsize;
|
||||
}
|
||||
|
||||
|
||||
static void audio_monitor_adjust_system_rates(void)
|
||||
void audio_driver_monitor_adjust_system_rates(void)
|
||||
{
|
||||
float timing_skew;
|
||||
settings_t *settings = config_get_ptr();
|
||||
@@ -723,7 +735,7 @@ static void audio_monitor_adjust_system_rates(void)
|
||||
audio_driver_data.audio_rate.input);
|
||||
}
|
||||
|
||||
static void audio_driver_setup_rewind(void)
|
||||
void audio_driver_setup_rewind(void)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
@@ -742,7 +754,7 @@ static void audio_driver_setup_rewind(void)
|
||||
audio_driver_data.data_ptr = 0;
|
||||
}
|
||||
|
||||
static bool find_audio_driver(void)
|
||||
bool audio_driver_find_driver(void)
|
||||
{
|
||||
int i;
|
||||
driver_ctx_info_t drv;
|
||||
@@ -770,202 +782,244 @@ static bool find_audio_driver(void)
|
||||
current_audio = (const audio_driver_t*)audio_driver_find_handle(0);
|
||||
|
||||
if (!current_audio)
|
||||
retro_fail(1, "find_audio_driver()");
|
||||
retroarch_fail(1, "audio_driver_find()");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool audio_driver_ctl(enum rarch_audio_ctl_state state, void *data)
|
||||
void audio_driver_deinit_resampler(void)
|
||||
{
|
||||
static struct retro_audio_callback audio_callback;
|
||||
static struct string_list *audio_driver_devices_list = NULL;
|
||||
static struct retro_perf_counter resampler_proc = {0};
|
||||
static const rarch_resampler_t *audio_driver_resampler = NULL;
|
||||
static void *audio_driver_resampler_data = NULL;
|
||||
static bool audio_driver_active = false;
|
||||
static bool audio_driver_data_own = false;
|
||||
settings_t *settings = config_get_ptr();
|
||||
rarch_resampler_freep(&audio_driver_resampler,
|
||||
&audio_driver_resampler_data);
|
||||
}
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case RARCH_AUDIO_CTL_RESAMPLER_DEINIT:
|
||||
rarch_resampler_freep(&audio_driver_resampler,
|
||||
&audio_driver_resampler_data);
|
||||
break;
|
||||
case RARCH_AUDIO_CTL_DEVICES_LIST_FREE:
|
||||
if (!current_audio || !current_audio->device_list_free
|
||||
|| !audio_driver_context_audio_data)
|
||||
return false;
|
||||
current_audio->device_list_free(audio_driver_context_audio_data,
|
||||
audio_driver_devices_list);
|
||||
audio_driver_devices_list = NULL;
|
||||
break;
|
||||
case RARCH_AUDIO_CTL_DEVICES_LIST_NEW:
|
||||
if (!current_audio || !current_audio->device_list_new
|
||||
|| !audio_driver_context_audio_data)
|
||||
return false;
|
||||
audio_driver_devices_list = (struct string_list*)
|
||||
current_audio->device_list_new(audio_driver_context_audio_data);
|
||||
if (!audio_driver_devices_list)
|
||||
return false;
|
||||
break;
|
||||
case RARCH_AUDIO_CTL_DEVICES_LIST_GET:
|
||||
{
|
||||
struct string_list**ptr = (struct string_list**)data;
|
||||
if (!ptr)
|
||||
return false;
|
||||
*ptr = audio_driver_devices_list;
|
||||
}
|
||||
break;
|
||||
case RARCH_AUDIO_CTL_RESAMPLER_INIT:
|
||||
return rarch_resampler_realloc(
|
||||
&audio_driver_resampler_data,
|
||||
&audio_driver_resampler,
|
||||
settings->audio.resampler,
|
||||
audio_driver_data.audio_rate.source_ratio.original);
|
||||
case RARCH_AUDIO_CTL_RESAMPLER_PROCESS:
|
||||
rarch_perf_init(&resampler_proc, "resampler_proc");
|
||||
retro_perf_start(&resampler_proc);
|
||||
rarch_resampler_process(audio_driver_resampler,
|
||||
audio_driver_resampler_data,
|
||||
(struct resampler_data*)data);
|
||||
retro_perf_stop(&resampler_proc);
|
||||
break;
|
||||
case RARCH_AUDIO_CTL_INIT:
|
||||
return init_audio(audio_callback.callback != NULL);
|
||||
case RARCH_AUDIO_CTL_DESTROY:
|
||||
audio_driver_active = false;
|
||||
audio_driver_data_own = false;
|
||||
current_audio = NULL;
|
||||
break;
|
||||
case RARCH_AUDIO_CTL_DESTROY_DATA:
|
||||
audio_driver_context_audio_data = NULL;
|
||||
break;
|
||||
case RARCH_AUDIO_CTL_DEINIT:
|
||||
audio_driver_ctl(RARCH_AUDIO_CTL_DEVICES_LIST_FREE, NULL);
|
||||
if (!uninit_audio())
|
||||
return false;
|
||||
break;
|
||||
case RARCH_AUDIO_CTL_SETUP_REWIND:
|
||||
audio_driver_setup_rewind();
|
||||
break;
|
||||
case RARCH_AUDIO_CTL_SET_CALLBACK_ENABLE:
|
||||
if (!audio_driver_ctl(RARCH_AUDIO_CTL_HAS_CALLBACK, NULL))
|
||||
return false;
|
||||
if (audio_callback.set_state)
|
||||
audio_callback.set_state(true);
|
||||
break;
|
||||
case RARCH_AUDIO_CTL_SET_CALLBACK_DISABLE:
|
||||
if (!audio_driver_ctl(RARCH_AUDIO_CTL_HAS_CALLBACK, NULL))
|
||||
return false;
|
||||
bool audio_driver_free_devices_list(void)
|
||||
{
|
||||
if (!current_audio || !current_audio->device_list_free
|
||||
|| !audio_driver_context_audio_data)
|
||||
return false;
|
||||
current_audio->device_list_free(audio_driver_context_audio_data,
|
||||
audio_driver_devices_list);
|
||||
audio_driver_devices_list = NULL;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (audio_callback.set_state)
|
||||
audio_callback.set_state(false);
|
||||
break;
|
||||
case RARCH_AUDIO_CTL_HAS_CALLBACK:
|
||||
return audio_callback.callback;
|
||||
case RARCH_AUDIO_CTL_CALLBACK:
|
||||
if (!audio_driver_ctl(RARCH_AUDIO_CTL_HAS_CALLBACK, NULL))
|
||||
return false;
|
||||
bool audio_driver_new_devices_list(void)
|
||||
{
|
||||
if (!current_audio || !current_audio->device_list_new
|
||||
|| !audio_driver_context_audio_data)
|
||||
return false;
|
||||
audio_driver_devices_list = (struct string_list*)
|
||||
current_audio->device_list_new(audio_driver_context_audio_data);
|
||||
if (!audio_driver_devices_list)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (audio_callback.callback)
|
||||
audio_callback.callback();
|
||||
break;
|
||||
case RARCH_AUDIO_CTL_UNSET_CALLBACK:
|
||||
audio_callback.callback = NULL;
|
||||
audio_callback.set_state = NULL;
|
||||
break;
|
||||
case RARCH_AUDIO_CTL_SET_CALLBACK:
|
||||
{
|
||||
const struct retro_audio_callback *cb =
|
||||
(const struct retro_audio_callback*)data;
|
||||
bool audio_driver_init(void)
|
||||
{
|
||||
return audio_driver_init_internal(audio_callback.callback != NULL);
|
||||
}
|
||||
|
||||
bool audio_driver_get_devices_list(void **data)
|
||||
{
|
||||
struct string_list**ptr = (struct string_list**)data;
|
||||
if (!ptr)
|
||||
return false;
|
||||
*ptr = audio_driver_devices_list;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool audio_driver_init_resampler(void)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
return rarch_resampler_realloc(
|
||||
&audio_driver_resampler_data,
|
||||
&audio_driver_resampler,
|
||||
settings->audio.resampler,
|
||||
audio_driver_data.audio_rate.source_ratio.original);
|
||||
}
|
||||
|
||||
void audio_driver_process_resampler(struct resampler_data *data)
|
||||
{
|
||||
performance_counter_init(&resampler_proc, "resampler_proc");
|
||||
performance_counter_start(&resampler_proc);
|
||||
rarch_resampler_process(audio_driver_resampler,
|
||||
audio_driver_resampler_data, data);
|
||||
performance_counter_stop(&resampler_proc);
|
||||
}
|
||||
|
||||
bool audio_driver_deinit(void)
|
||||
{
|
||||
audio_driver_free_devices_list();
|
||||
if (!uninit_audio())
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool audio_driver_set_callback(const void *data)
|
||||
{
|
||||
const struct retro_audio_callback *cb = (const struct retro_audio_callback*)data;
|
||||
#ifdef HAVE_NETPLAY
|
||||
global_t *global = global_get_ptr();
|
||||
global_t *global = global_get_ptr();
|
||||
#endif
|
||||
|
||||
if (recording_driver_get_data_ptr()) /* A/V sync is a must. */
|
||||
return false;
|
||||
if (recording_driver_get_data_ptr()) /* A/V sync is a must. */
|
||||
return false;
|
||||
|
||||
#ifdef HAVE_NETPLAY
|
||||
if (global->netplay.enable)
|
||||
return false;
|
||||
if (global->netplay.enable)
|
||||
return false;
|
||||
#endif
|
||||
if (cb)
|
||||
audio_callback = *cb;
|
||||
}
|
||||
break;
|
||||
case RARCH_AUDIO_CTL_MONITOR_ADJUST_SYSTEM_RATES:
|
||||
audio_monitor_adjust_system_rates();
|
||||
break;
|
||||
case RARCH_AUDIO_CTL_MONITOR_SET_REFRESH_RATE:
|
||||
{
|
||||
double new_src_ratio = (double)settings->audio.out_rate /
|
||||
audio_driver_data.audio_rate.input;
|
||||
|
||||
audio_driver_data.audio_rate.source_ratio.original = new_src_ratio;
|
||||
audio_driver_data.audio_rate.source_ratio.current = new_src_ratio;
|
||||
}
|
||||
break;
|
||||
case RARCH_AUDIO_CTL_MUTE_TOGGLE:
|
||||
if (!audio_driver_context_audio_data)
|
||||
return false;
|
||||
if (!audio_driver_ctl(RARCH_AUDIO_CTL_IS_ACTIVE, NULL))
|
||||
return false;
|
||||
|
||||
settings->audio.mute_enable = !settings->audio.mute_enable;
|
||||
|
||||
if (settings->audio.mute_enable)
|
||||
event_cmd_ctl(EVENT_CMD_AUDIO_STOP, NULL);
|
||||
else if (!event_cmd_ctl(EVENT_CMD_AUDIO_START, NULL))
|
||||
{
|
||||
audio_driver_ctl(RARCH_AUDIO_CTL_UNSET_ACTIVE, NULL);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case RARCH_AUDIO_CTL_ALIVE:
|
||||
if (!current_audio || !current_audio->alive
|
||||
|| !audio_driver_context_audio_data)
|
||||
return false;
|
||||
return current_audio->alive(audio_driver_context_audio_data);
|
||||
case RARCH_AUDIO_CTL_START:
|
||||
if (!current_audio || !current_audio->start
|
||||
|| !audio_driver_context_audio_data)
|
||||
return false;
|
||||
return current_audio->start(audio_driver_context_audio_data);
|
||||
case RARCH_AUDIO_CTL_STOP:
|
||||
if (!current_audio || !current_audio->stop
|
||||
|| !audio_driver_context_audio_data)
|
||||
return false;
|
||||
return current_audio->stop(audio_driver_context_audio_data);
|
||||
case RARCH_AUDIO_CTL_FIND_DRIVER:
|
||||
return find_audio_driver();
|
||||
case RARCH_AUDIO_CTL_SET_OWN_DRIVER:
|
||||
audio_driver_data_own = true;
|
||||
break;
|
||||
case RARCH_AUDIO_CTL_UNSET_OWN_DRIVER:
|
||||
audio_driver_data_own = false;
|
||||
break;
|
||||
case RARCH_AUDIO_CTL_OWNS_DRIVER:
|
||||
return audio_driver_data_own;
|
||||
case RARCH_AUDIO_CTL_SET_ACTIVE:
|
||||
audio_driver_active = true;
|
||||
break;
|
||||
case RARCH_AUDIO_CTL_UNSET_ACTIVE:
|
||||
audio_driver_active = false;
|
||||
break;
|
||||
case RARCH_AUDIO_CTL_IS_ACTIVE:
|
||||
return audio_driver_active;
|
||||
case RARCH_AUDIO_CTL_FRAME_IS_REVERSE:
|
||||
/* We just rewound. Flush rewind audio buffer. */
|
||||
audio_driver_flush(
|
||||
audio_driver_data.rewind.buf + audio_driver_data.rewind.ptr,
|
||||
audio_driver_data.rewind.size - audio_driver_data.rewind.ptr);
|
||||
break;
|
||||
case RARCH_AUDIO_CTL_NONE:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (cb)
|
||||
audio_callback = *cb;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool audio_driver_enable_callback(void)
|
||||
{
|
||||
if (!audio_driver_has_callback())
|
||||
return false;
|
||||
if (audio_callback.set_state)
|
||||
audio_callback.set_state(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool audio_driver_disable_callback(void)
|
||||
{
|
||||
if (!audio_driver_has_callback())
|
||||
return false;
|
||||
|
||||
if (audio_callback.set_state)
|
||||
audio_callback.set_state(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Sets audio monitor rate to new value. */
|
||||
void audio_driver_monitor_set_rate(void)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
double new_src_ratio = (double)settings->audio.out_rate /
|
||||
audio_driver_data.audio_rate.input;
|
||||
|
||||
audio_driver_data.audio_rate.source_ratio.original = new_src_ratio;
|
||||
audio_driver_data.audio_rate.source_ratio.current = new_src_ratio;
|
||||
}
|
||||
|
||||
bool audio_driver_callback(void)
|
||||
{
|
||||
if (!audio_driver_has_callback())
|
||||
return false;
|
||||
|
||||
if (audio_callback.callback)
|
||||
audio_callback.callback();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool audio_driver_has_callback(void)
|
||||
{
|
||||
return audio_callback.callback;
|
||||
}
|
||||
|
||||
bool audio_driver_toggle_mute(void)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
if (!audio_driver_context_audio_data)
|
||||
return false;
|
||||
if (!audio_driver_is_active())
|
||||
return false;
|
||||
|
||||
settings->audio.mute_enable = !settings->audio.mute_enable;
|
||||
|
||||
if (settings->audio.mute_enable)
|
||||
command_event(CMD_EVENT_AUDIO_STOP, NULL);
|
||||
else if (!command_event(CMD_EVENT_AUDIO_START, NULL))
|
||||
{
|
||||
audio_driver_unset_active();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool audio_driver_start(void)
|
||||
{
|
||||
if (!current_audio || !current_audio->start
|
||||
|| !audio_driver_context_audio_data)
|
||||
return false;
|
||||
return current_audio->start(audio_driver_context_audio_data);
|
||||
}
|
||||
|
||||
bool audio_driver_stop(void)
|
||||
{
|
||||
if (!current_audio || !current_audio->stop
|
||||
|| !audio_driver_context_audio_data)
|
||||
return false;
|
||||
return current_audio->stop(audio_driver_context_audio_data);
|
||||
}
|
||||
|
||||
void audio_driver_unset_callback(void)
|
||||
{
|
||||
audio_callback.callback = NULL;
|
||||
audio_callback.set_state = NULL;
|
||||
}
|
||||
|
||||
bool audio_driver_alive(void)
|
||||
{
|
||||
if (!current_audio || !current_audio->alive
|
||||
|| !audio_driver_context_audio_data)
|
||||
return false;
|
||||
return current_audio->alive(audio_driver_context_audio_data);
|
||||
}
|
||||
|
||||
void audio_driver_frame_is_reverse(void)
|
||||
{
|
||||
/* We just rewound. Flush rewind audio buffer. */
|
||||
audio_driver_flush(
|
||||
audio_driver_data.rewind.buf + audio_driver_data.rewind.ptr,
|
||||
audio_driver_data.rewind.size - audio_driver_data.rewind.ptr);
|
||||
}
|
||||
|
||||
void audio_driver_destroy_data(void)
|
||||
{
|
||||
audio_driver_context_audio_data = NULL;
|
||||
}
|
||||
|
||||
void audio_driver_set_own_driver(void)
|
||||
{
|
||||
audio_driver_data_own = true;
|
||||
}
|
||||
|
||||
void audio_driver_unset_own_driver(void)
|
||||
{
|
||||
audio_driver_data_own = false;
|
||||
}
|
||||
|
||||
bool audio_driver_owns_driver(void)
|
||||
{
|
||||
return audio_driver_data_own;
|
||||
}
|
||||
|
||||
void audio_driver_set_active(void)
|
||||
{
|
||||
audio_driver_active = true;
|
||||
}
|
||||
|
||||
void audio_driver_unset_active(void)
|
||||
{
|
||||
audio_driver_active = false;
|
||||
}
|
||||
|
||||
bool audio_driver_is_active(void)
|
||||
{
|
||||
return audio_driver_active;
|
||||
}
|
||||
|
||||
void audio_driver_destroy(void)
|
||||
{
|
||||
audio_driver_active = false;
|
||||
audio_driver_data_own = false;
|
||||
current_audio = NULL;
|
||||
}
|
||||
+69
-46
@@ -20,12 +20,14 @@
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <sys/types.h>
|
||||
#include <boolean.h>
|
||||
#include "audio_dsp_filter.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#include <boolean.h>
|
||||
#include <retro_common_api.h>
|
||||
|
||||
#include "audio_dsp_filter.h"
|
||||
#include "audio_resampler_driver.h"
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
#define AUDIO_CHUNK_SIZE_BLOCKING 512
|
||||
|
||||
@@ -34,43 +36,6 @@ extern "C" {
|
||||
|
||||
#define AUDIO_MAX_RATIO 16
|
||||
|
||||
enum rarch_audio_ctl_state
|
||||
{
|
||||
RARCH_AUDIO_CTL_NONE = 0,
|
||||
RARCH_AUDIO_CTL_INIT,
|
||||
RARCH_AUDIO_CTL_DEINIT,
|
||||
RARCH_AUDIO_CTL_DESTROY,
|
||||
RARCH_AUDIO_CTL_DESTROY_DATA,
|
||||
RARCH_AUDIO_CTL_START,
|
||||
RARCH_AUDIO_CTL_STOP,
|
||||
RARCH_AUDIO_CTL_FIND_DRIVER,
|
||||
RARCH_AUDIO_CTL_SETUP_REWIND,
|
||||
/* Sets audio monitor refresh rate to new value. */
|
||||
RARCH_AUDIO_CTL_MONITOR_SET_REFRESH_RATE,
|
||||
RARCH_AUDIO_CTL_MONITOR_ADJUST_SYSTEM_RATES,
|
||||
RARCH_AUDIO_CTL_MUTE_TOGGLE,
|
||||
RARCH_AUDIO_CTL_SET_CALLBACK_ENABLE,
|
||||
RARCH_AUDIO_CTL_SET_CALLBACK_DISABLE,
|
||||
RARCH_AUDIO_CTL_SET_CALLBACK,
|
||||
RARCH_AUDIO_CTL_UNSET_CALLBACK,
|
||||
RARCH_AUDIO_CTL_CALLBACK,
|
||||
RARCH_AUDIO_CTL_HAS_CALLBACK,
|
||||
RARCH_AUDIO_CTL_ALIVE,
|
||||
RARCH_AUDIO_CTL_FRAME_IS_REVERSE,
|
||||
RARCH_AUDIO_CTL_SET_OWN_DRIVER,
|
||||
RARCH_AUDIO_CTL_UNSET_OWN_DRIVER,
|
||||
RARCH_AUDIO_CTL_OWNS_DRIVER,
|
||||
RARCH_AUDIO_CTL_SET_ACTIVE,
|
||||
RARCH_AUDIO_CTL_UNSET_ACTIVE,
|
||||
RARCH_AUDIO_CTL_IS_ACTIVE,
|
||||
RARCH_AUDIO_CTL_RESAMPLER_DEINIT,
|
||||
RARCH_AUDIO_CTL_RESAMPLER_INIT,
|
||||
RARCH_AUDIO_CTL_RESAMPLER_PROCESS,
|
||||
RARCH_AUDIO_CTL_DEVICES_LIST_NEW,
|
||||
RARCH_AUDIO_CTL_DEVICES_LIST_FREE,
|
||||
RARCH_AUDIO_CTL_DEVICES_LIST_GET
|
||||
};
|
||||
|
||||
typedef struct audio_driver
|
||||
{
|
||||
/* Creates and initializes handle to audio driver.
|
||||
@@ -122,8 +87,33 @@ typedef struct audio_driver
|
||||
size_t (*buffer_size)(void *data);
|
||||
} audio_driver_t;
|
||||
|
||||
void audio_driver_destroy_data(void);
|
||||
|
||||
bool audio_driver_ctl(enum rarch_audio_ctl_state state, void *data);
|
||||
void audio_driver_set_own_driver(void);
|
||||
|
||||
void audio_driver_unset_own_driver(void);
|
||||
|
||||
void audio_driver_set_active(void);
|
||||
|
||||
void audio_driver_unset_active(void);
|
||||
|
||||
bool audio_driver_is_active(void);
|
||||
|
||||
void audio_driver_destroy(void);
|
||||
|
||||
void audio_driver_deinit_resampler(void);
|
||||
|
||||
bool audio_driver_init_resampler(void);
|
||||
|
||||
void audio_driver_process_resampler(struct resampler_data *data);
|
||||
|
||||
bool audio_driver_free_devices_list(void);
|
||||
|
||||
bool audio_driver_new_devices_list(void);
|
||||
|
||||
bool audio_driver_enable_callback(void);
|
||||
|
||||
bool audio_driver_disable_callback(void);
|
||||
|
||||
/**
|
||||
* audio_driver_find_handle:
|
||||
@@ -170,6 +160,41 @@ void audio_driver_dsp_filter_init(const char *device);
|
||||
|
||||
void audio_driver_set_buffer_size(size_t bufsize);
|
||||
|
||||
bool audio_driver_get_devices_list(void **ptr);
|
||||
|
||||
void audio_driver_setup_rewind(void);
|
||||
|
||||
void audio_driver_monitor_adjust_system_rates(void);
|
||||
|
||||
bool audio_driver_set_callback(const void *data);
|
||||
|
||||
bool audio_driver_callback(void);
|
||||
|
||||
bool audio_driver_has_callback(void);
|
||||
|
||||
/* Sets audio monitor rate to new value. */
|
||||
void audio_driver_monitor_set_rate(void);
|
||||
|
||||
bool audio_driver_find_driver(void);
|
||||
|
||||
bool audio_driver_toggle_mute(void);
|
||||
|
||||
bool audio_driver_start(void);
|
||||
|
||||
bool audio_driver_stop(void);
|
||||
|
||||
bool audio_driver_owns_driver(void);
|
||||
|
||||
void audio_driver_unset_callback(void);
|
||||
|
||||
void audio_driver_frame_is_reverse(void);
|
||||
|
||||
bool audio_driver_alive(void);
|
||||
|
||||
bool audio_driver_deinit(void);
|
||||
|
||||
bool audio_driver_init(void);
|
||||
|
||||
extern audio_driver_t audio_rsound;
|
||||
extern audio_driver_t audio_oss;
|
||||
extern audio_driver_t audio_alsa;
|
||||
@@ -192,8 +217,6 @@ extern audio_driver_t audio_ctr_dsp;
|
||||
extern audio_driver_t audio_rwebaudio;
|
||||
extern audio_driver_t audio_null;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
@@ -23,13 +23,14 @@
|
||||
|
||||
#include <file/file_path.h>
|
||||
#include <lists/dir_list.h>
|
||||
#include <features/features_cpu.h>
|
||||
|
||||
#include "audio_dsp_filter.h"
|
||||
#include "audio_filters/dspfilter.h"
|
||||
|
||||
#include "../config_file_userdata.h"
|
||||
#include "../frontend/frontend_driver.h"
|
||||
#include "../performance.h"
|
||||
#include "../performance_counters.h"
|
||||
#include "../dynamic.h"
|
||||
|
||||
struct rarch_dsp_plug
|
||||
@@ -146,7 +147,7 @@ static const dspfilter_get_implementation_t dsp_plugs_builtin[] = {
|
||||
static bool append_plugs(rarch_dsp_filter_t *dsp, struct string_list *list)
|
||||
{
|
||||
unsigned i;
|
||||
dspfilter_simd_mask_t mask = retro_get_cpu_features();
|
||||
dspfilter_simd_mask_t mask = cpu_features_get();
|
||||
|
||||
(void)list;
|
||||
|
||||
@@ -170,7 +171,7 @@ static bool append_plugs(rarch_dsp_filter_t *dsp, struct string_list *list)
|
||||
static bool append_plugs(rarch_dsp_filter_t *dsp, struct string_list *list)
|
||||
{
|
||||
unsigned i;
|
||||
dspfilter_simd_mask_t mask = retro_get_cpu_features();
|
||||
dspfilter_simd_mask_t mask = cpu_features_get();
|
||||
|
||||
for (i = 0; i < list->size; i++)
|
||||
{
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
#ifndef __AUDIO_DSP_FILTER_H__
|
||||
#define __AUDIO_DSP_FILTER_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#include <retro_common_api.h>
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
typedef struct rarch_dsp_filter rarch_dsp_filter_t;
|
||||
|
||||
@@ -41,9 +41,7 @@ struct rarch_dsp_data
|
||||
void rarch_dsp_filter_process(rarch_dsp_filter_t *dsp,
|
||||
struct rarch_dsp_data *data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
#ifndef DSPFILTER_API_H__
|
||||
#define DSPFILTER_API_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#include <retro_common_api.h>
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
#define DSPFILTER_SIMD_SSE (1 << 0)
|
||||
#define DSPFILTER_SIMD_SSE2 (1 << 1)
|
||||
@@ -177,8 +177,6 @@ struct dspfilter_implementation
|
||||
const char *short_ident;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
@@ -17,61 +17,10 @@
|
||||
#define RARCH_FFT_H__
|
||||
|
||||
#include <retro_inline.h>
|
||||
#include <math/complex.h>
|
||||
|
||||
typedef struct fft fft_t;
|
||||
|
||||
// C99 <complex.h> would be nice.
|
||||
typedef struct
|
||||
{
|
||||
float real;
|
||||
float imag;
|
||||
} fft_complex_t;
|
||||
|
||||
static INLINE fft_complex_t fft_complex_mul(fft_complex_t a,
|
||||
fft_complex_t b)
|
||||
{
|
||||
fft_complex_t out = {
|
||||
a.real * b.real - a.imag * b.imag,
|
||||
a.imag * b.real + a.real * b.imag,
|
||||
};
|
||||
|
||||
return out;
|
||||
|
||||
}
|
||||
|
||||
static INLINE fft_complex_t fft_complex_add(fft_complex_t a,
|
||||
fft_complex_t b)
|
||||
{
|
||||
fft_complex_t out = {
|
||||
a.real + b.real,
|
||||
a.imag + b.imag,
|
||||
};
|
||||
|
||||
return out;
|
||||
|
||||
}
|
||||
|
||||
static INLINE fft_complex_t fft_complex_sub(fft_complex_t a,
|
||||
fft_complex_t b)
|
||||
{
|
||||
fft_complex_t out = {
|
||||
a.real - b.real,
|
||||
a.imag - b.imag,
|
||||
};
|
||||
|
||||
return out;
|
||||
|
||||
}
|
||||
|
||||
static INLINE fft_complex_t fft_complex_conj(fft_complex_t a)
|
||||
{
|
||||
fft_complex_t out = {
|
||||
a.real, -a.imag,
|
||||
};
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
fft_t *fft_new(unsigned block_size_log2);
|
||||
|
||||
void fft_free(fft_t *fft);
|
||||
|
||||
@@ -17,15 +17,14 @@
|
||||
#include <string.h>
|
||||
|
||||
#include <string/stdstring.h>
|
||||
#include <features/features_cpu.h>
|
||||
|
||||
#include "audio_resampler_driver.h"
|
||||
#include "../config_file_userdata.h"
|
||||
#ifdef RARCH_INTERNAL
|
||||
#include "../performance.h"
|
||||
#include "../performance_counters.h"
|
||||
#endif
|
||||
#ifndef DONT_HAVE_STRING_LIST
|
||||
#include "../list_special.h"
|
||||
#endif
|
||||
|
||||
static const rarch_resampler_t *resampler_drivers[] = {
|
||||
&sinc_resampler,
|
||||
@@ -93,7 +92,6 @@ const char *audio_resampler_driver_find_ident(int idx)
|
||||
return drv->ident;
|
||||
}
|
||||
|
||||
#ifndef DONT_HAVE_STRING_LIST
|
||||
/**
|
||||
* config_get_audio_resampler_driver_options:
|
||||
*
|
||||
@@ -105,7 +103,6 @@ const char* config_get_audio_resampler_driver_options(void)
|
||||
{
|
||||
return char_list_new_special(STRING_LIST_AUDIO_RESAMPLER_DRIVERS, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* find_resampler_driver:
|
||||
@@ -126,26 +123,9 @@ static const rarch_resampler_t *find_resampler_driver(const char *ident)
|
||||
return resampler_drivers[0];
|
||||
}
|
||||
|
||||
#ifndef RARCH_INTERNAL
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
retro_get_cpu_features_t perf_get_cpu_features_cb;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
static resampler_simd_mask_t resampler_get_cpu_features(void)
|
||||
{
|
||||
#ifdef RARCH_INTERNAL
|
||||
return retro_get_cpu_features();
|
||||
#else
|
||||
return perf_get_cpu_features_cb();
|
||||
#endif
|
||||
return cpu_features_get();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,16 +18,16 @@
|
||||
#ifndef __AUDIO_RESAMPLER_DRIVER_H
|
||||
#define __AUDIO_RESAMPLER_DRIVER_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <math.h>
|
||||
#include <boolean.h>
|
||||
|
||||
#include <boolean.h>
|
||||
#include <retro_common_api.h>
|
||||
#include <retro_miscellaneous.h>
|
||||
#include <libretro.h>
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
#define RESAMPLER_SIMD_SSE (1 << 0)
|
||||
#define RESAMPLER_SIMD_SSE2 (1 << 1)
|
||||
@@ -200,14 +200,6 @@ bool rarch_resampler_realloc(void **re, const rarch_resampler_t **backend,
|
||||
(backend)->process(handle, data); \
|
||||
} while(0)
|
||||
|
||||
#ifndef RARCH_INTERNAL
|
||||
#include "libretro.h"
|
||||
extern retro_get_cpu_features_t perf_get_cpu_features_cb;
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <rthreads/rthreads.h>
|
||||
|
||||
#include "audio_thread_wrapper.h"
|
||||
#include "../performance.h"
|
||||
#include "../performance_counters.h"
|
||||
#include "../verbosity.h"
|
||||
|
||||
typedef struct audio_thread
|
||||
@@ -81,8 +81,8 @@ static void audio_thread_loop(void *data)
|
||||
if (!thr->alive)
|
||||
{
|
||||
scond_signal(thr->cond);
|
||||
slock_unlock(thr->lock);
|
||||
thr->stopped_ack = true;
|
||||
slock_unlock(thr->lock);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ static void audio_thread_loop(void *data)
|
||||
}
|
||||
|
||||
slock_unlock(thr->lock);
|
||||
audio_driver_ctl(RARCH_AUDIO_CTL_CALLBACK, NULL);
|
||||
audio_driver_callback();
|
||||
}
|
||||
|
||||
RARCH_LOG("[Audio Thread]: Tearing down driver.\n");
|
||||
@@ -190,7 +190,7 @@ static bool audio_thread_stop(void *data)
|
||||
audio_thread_block(thr);
|
||||
thr->is_paused = true;
|
||||
|
||||
audio_driver_ctl(RARCH_AUDIO_CTL_SET_CALLBACK_DISABLE, NULL);
|
||||
audio_driver_disable_callback();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -202,7 +202,7 @@ static bool audio_thread_start(void *data)
|
||||
if (!thr)
|
||||
return false;
|
||||
|
||||
audio_driver_ctl(RARCH_AUDIO_CTL_SET_CALLBACK_ENABLE, NULL);
|
||||
audio_driver_enable_callback();
|
||||
|
||||
thr->is_paused = false;
|
||||
audio_thread_unblock(thr);
|
||||
@@ -260,7 +260,7 @@ static const audio_driver_t audio_thread = {
|
||||
};
|
||||
|
||||
/**
|
||||
* rarch_threaded_audio_init:
|
||||
* audio_init_thread:
|
||||
* @out_driver : output driver
|
||||
* @out_data : output audio data
|
||||
* @device : audio device (optional)
|
||||
@@ -275,7 +275,7 @@ static const audio_driver_t audio_thread = {
|
||||
*
|
||||
* Returns: true (1) if successful, otherwise false (0).
|
||||
**/
|
||||
bool rarch_threaded_audio_init(const audio_driver_t **out_driver,
|
||||
bool audio_init_thread(const audio_driver_t **out_driver,
|
||||
void **out_data, const char *device, unsigned audio_out_rate,
|
||||
unsigned latency, const audio_driver_t *drv)
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "audio_driver.h"
|
||||
|
||||
/**
|
||||
* rarch_threaded_audio_init:
|
||||
* audio_init_thread:
|
||||
* @out_driver : output driver
|
||||
* @out_data : output audio data
|
||||
* @device : audio device (optional)
|
||||
@@ -36,7 +36,7 @@
|
||||
*
|
||||
* Returns: true (1) if successful, otherwise false (0).
|
||||
**/
|
||||
bool rarch_threaded_audio_init(const audio_driver_t **out_driver, void **out_data,
|
||||
bool audio_init_thread(const audio_driver_t **out_driver, void **out_data,
|
||||
const char *device, unsigned out_rate, unsigned latency,
|
||||
const audio_driver_t *driver);
|
||||
|
||||
|
||||
@@ -1,435 +0,0 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2014-2016 - Ali Bouhlel ( [email protected] )
|
||||
*
|
||||
* 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 <boolean.h>
|
||||
#include "audio_utils.h"
|
||||
|
||||
#if defined(__SSE2__)
|
||||
#include <emmintrin.h>
|
||||
#elif defined(__ALTIVEC__)
|
||||
#include <altivec.h>
|
||||
#endif
|
||||
|
||||
#ifdef RARCH_INTERNAL
|
||||
#include "../performance.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* audio_convert_s16_to_float_C:
|
||||
* @out : output buffer
|
||||
* @in : input buffer
|
||||
* @samples : size of samples to be converted
|
||||
* @gain : gain applied to the audio volume
|
||||
*
|
||||
* Converts audio samples from signed integer 16-bit
|
||||
* to floating point.
|
||||
*
|
||||
* C implementation callback function.
|
||||
**/
|
||||
void audio_convert_s16_to_float_C(float *out,
|
||||
const int16_t *in, size_t samples, float gain)
|
||||
{
|
||||
size_t i;
|
||||
gain = gain / 0x8000;
|
||||
for (i = 0; i < samples; i++)
|
||||
out[i] = (float)in[i] * gain;
|
||||
}
|
||||
|
||||
/**
|
||||
* audio_convert_float_to_s16_C:
|
||||
* @out : output buffer
|
||||
* @in : input buffer
|
||||
* @samples : size of samples to be converted
|
||||
*
|
||||
* Converts audio samples from floating point
|
||||
* to signed integer 16-bit.
|
||||
*
|
||||
* C implementation callback function.
|
||||
**/
|
||||
void audio_convert_float_to_s16_C(int16_t *out,
|
||||
const float *in, size_t samples)
|
||||
{
|
||||
size_t i;
|
||||
for (i = 0; i < samples; i++)
|
||||
{
|
||||
int32_t val = (int32_t)(in[i] * 0x8000);
|
||||
out[i] = (val > 0x7FFF) ? 0x7FFF :
|
||||
(val < -0x8000 ? -0x8000 : (int16_t)val);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(__SSE2__)
|
||||
/**
|
||||
* audio_convert_s16_to_float_SSE2:
|
||||
* @out : output buffer
|
||||
* @in : input buffer
|
||||
* @samples : size of samples to be converted
|
||||
* @gain : gain applied to the audio volume
|
||||
*
|
||||
* Converts audio samples from signed integer 16-bit
|
||||
* to floating point.
|
||||
*
|
||||
* SSE2 implementation callback function.
|
||||
**/
|
||||
void audio_convert_s16_to_float_SSE2(float *out,
|
||||
const int16_t *in, size_t samples, float gain)
|
||||
{
|
||||
size_t i;
|
||||
float fgain = gain / UINT32_C(0x80000000);
|
||||
__m128 factor = _mm_set1_ps(fgain);
|
||||
|
||||
for (i = 0; i + 8 <= samples; i += 8, in += 8, out += 8)
|
||||
{
|
||||
__m128i input = _mm_loadu_si128((const __m128i *)in);
|
||||
__m128i regs_l = _mm_unpacklo_epi16(_mm_setzero_si128(), input);
|
||||
__m128i regs_r = _mm_unpackhi_epi16(_mm_setzero_si128(), input);
|
||||
__m128 output_l = _mm_mul_ps(_mm_cvtepi32_ps(regs_l), factor);
|
||||
__m128 output_r = _mm_mul_ps(_mm_cvtepi32_ps(regs_r), factor);
|
||||
|
||||
_mm_storeu_ps(out + 0, output_l);
|
||||
_mm_storeu_ps(out + 4, output_r);
|
||||
}
|
||||
|
||||
audio_convert_s16_to_float_C(out, in, samples - i, gain);
|
||||
}
|
||||
|
||||
/**
|
||||
* audio_convert_float_to_s16_SSE2:
|
||||
* @out : output buffer
|
||||
* @in : input buffer
|
||||
* @samples : size of samples to be converted
|
||||
*
|
||||
* Converts audio samples from floating point
|
||||
* to signed integer 16-bit.
|
||||
*
|
||||
* SSE2 implementation callback function.
|
||||
**/
|
||||
void audio_convert_float_to_s16_SSE2(int16_t *out,
|
||||
const float *in, size_t samples)
|
||||
{
|
||||
size_t i;
|
||||
__m128 factor = _mm_set1_ps((float)0x8000);
|
||||
|
||||
for (i = 0; i + 8 <= samples; i += 8, in += 8, out += 8)
|
||||
{
|
||||
__m128 input_l = _mm_loadu_ps(in + 0);
|
||||
__m128 input_r = _mm_loadu_ps(in + 4);
|
||||
__m128 res_l = _mm_mul_ps(input_l, factor);
|
||||
__m128 res_r = _mm_mul_ps(input_r, factor);
|
||||
__m128i ints_l = _mm_cvtps_epi32(res_l);
|
||||
__m128i ints_r = _mm_cvtps_epi32(res_r);
|
||||
__m128i packed = _mm_packs_epi32(ints_l, ints_r);
|
||||
|
||||
_mm_storeu_si128((__m128i *)out, packed);
|
||||
}
|
||||
|
||||
audio_convert_float_to_s16_C(out, in, samples - i);
|
||||
}
|
||||
#elif defined(__ALTIVEC__)
|
||||
/**
|
||||
* audio_convert_s16_to_float_altivec:
|
||||
* @out : output buffer
|
||||
* @in : input buffer
|
||||
* @samples : size of samples to be converted
|
||||
* @gain : gain applied to the audio volume
|
||||
*
|
||||
* Converts audio samples from signed integer 16-bit
|
||||
* to floating point.
|
||||
*
|
||||
* AltiVec implementation callback function.
|
||||
**/
|
||||
void audio_convert_s16_to_float_altivec(float *out,
|
||||
const int16_t *in, size_t samples, float gain)
|
||||
{
|
||||
size_t samples_in = samples;
|
||||
|
||||
/* Unaligned loads/store is a bit expensive, so we
|
||||
* optimize for the good path (very likely). */
|
||||
if (((uintptr_t)out & 15) + ((uintptr_t)in & 15) == 0)
|
||||
{
|
||||
size_t i;
|
||||
const vector float gain_vec = { gain, gain , gain, gain };
|
||||
const vector float zero_vec = { 0.0f, 0.0f, 0.0f, 0.0f};
|
||||
|
||||
for (i = 0; i + 8 <= samples; i += 8, in += 8, out += 8)
|
||||
{
|
||||
vector signed short input = vec_ld(0, in);
|
||||
vector signed int hi = vec_unpackh(input);
|
||||
vector signed int lo = vec_unpackl(input);
|
||||
vector float out_hi = vec_madd(vec_ctf(hi, 15), gain_vec, zero_vec);
|
||||
vector float out_lo = vec_madd(vec_ctf(lo, 15), gain_vec, zero_vec);
|
||||
|
||||
vec_st(out_hi, 0, out);
|
||||
vec_st(out_lo, 16, out);
|
||||
}
|
||||
|
||||
samples_in -= i;
|
||||
}
|
||||
audio_convert_s16_to_float_C(out, in, samples_in, gain);
|
||||
}
|
||||
|
||||
/**
|
||||
* audio_convert_float_to_s16_altivec:
|
||||
* @out : output buffer
|
||||
* @in : input buffer
|
||||
* @samples : size of samples to be converted
|
||||
*
|
||||
* Converts audio samples from floating point
|
||||
* to signed integer 16-bit.
|
||||
*
|
||||
* AltiVec implementation callback function.
|
||||
**/
|
||||
void audio_convert_float_to_s16_altivec(int16_t *out,
|
||||
const float *in, size_t samples)
|
||||
{
|
||||
int samples_in = samples;
|
||||
|
||||
/* Unaligned loads/store is a bit expensive,
|
||||
* so we optimize for the good path (very likely). */
|
||||
if (((uintptr_t)out & 15) + ((uintptr_t)in & 15) == 0)
|
||||
{
|
||||
size_t i;
|
||||
for (i = 0; i + 8 <= samples; i += 8, in += 8, out += 8)
|
||||
{
|
||||
vector float input0 = vec_ld( 0, in);
|
||||
vector float input1 = vec_ld(16, in);
|
||||
vector signed int result0 = vec_cts(input0, 15);
|
||||
vector signed int result1 = vec_cts(input1, 15);
|
||||
vec_st(vec_packs(result0, result1), 0, out);
|
||||
}
|
||||
|
||||
samples_in -= i;
|
||||
}
|
||||
audio_convert_float_to_s16_C(out, in, samples_in);
|
||||
}
|
||||
#elif defined(__ARM_NEON__) && !defined(VITA)
|
||||
/* Avoid potential hard-float/soft-float ABI issues. */
|
||||
void audio_convert_s16_float_asm(float *out, const int16_t *in,
|
||||
size_t samples, const float *gain);
|
||||
|
||||
/**
|
||||
* audio_convert_s16_to_float_neon:
|
||||
* @out : output buffer
|
||||
* @in : input buffer
|
||||
* @samples : size of samples to be converted
|
||||
* @gain : gain applied to the audio volume
|
||||
*
|
||||
* Converts audio samples from signed integer 16-bit
|
||||
* to floating point.
|
||||
*
|
||||
* ARM NEON implementation callback function.
|
||||
**/
|
||||
static void audio_convert_s16_to_float_neon(float *out,
|
||||
const int16_t *in, size_t samples, float gain)
|
||||
{
|
||||
size_t aligned_samples = samples & ~7;
|
||||
if (aligned_samples)
|
||||
audio_convert_s16_float_asm(out, in, aligned_samples, &gain);
|
||||
|
||||
/* Could do all conversion in ASM, but keep it simple for now. */
|
||||
audio_convert_s16_to_float_C(out + aligned_samples, in + aligned_samples,
|
||||
samples - aligned_samples, gain);
|
||||
}
|
||||
|
||||
void audio_convert_float_s16_asm(int16_t *out, const float *in, size_t samples);
|
||||
|
||||
/**
|
||||
* audio_convert_float_to_s16_neon:
|
||||
* @out : output buffer
|
||||
* @in : input buffer
|
||||
* @samples : size of samples to be converted
|
||||
*
|
||||
* Converts audio samples from floating point
|
||||
* to signed integer 16-bit.
|
||||
*
|
||||
* ARM NEON implementation callback function.
|
||||
**/
|
||||
static void audio_convert_float_to_s16_neon(int16_t *out,
|
||||
const float *in, size_t samples)
|
||||
{
|
||||
size_t aligned_samples = samples & ~7;
|
||||
if (aligned_samples)
|
||||
audio_convert_float_s16_asm(out, in, aligned_samples);
|
||||
|
||||
audio_convert_float_to_s16_C(out + aligned_samples, in + aligned_samples,
|
||||
samples - aligned_samples);
|
||||
}
|
||||
#elif defined(_MIPS_ARCH_ALLEGREX)
|
||||
|
||||
/**
|
||||
* audio_convert_s16_to_float_ALLEGREX:
|
||||
* @out : output buffer
|
||||
* @in : input buffer
|
||||
* @samples : size of samples to be converted
|
||||
* @gain : gain applied to the audio volume
|
||||
*
|
||||
* Converts audio samples from signed integer 16-bit
|
||||
* to floating point.
|
||||
*
|
||||
* MIPS ALLEGREX implementation callback function.
|
||||
**/
|
||||
void audio_convert_s16_to_float_ALLEGREX(float *out,
|
||||
const int16_t *in, size_t samples, float gain)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
/* Make sure the buffer is 16 byte aligned, this should be the
|
||||
* default behaviour of malloc in the PSPSDK.
|
||||
* Only the output buffer can be assumed to be 16-byte aligned. */
|
||||
retro_assert(((uintptr_t)out & 0xf) == 0);
|
||||
#endif
|
||||
|
||||
size_t i;
|
||||
gain = gain / 0x8000;
|
||||
__asm__ (
|
||||
".set push \n"
|
||||
".set noreorder \n"
|
||||
"mtv %0, s200 \n"
|
||||
".set pop \n"
|
||||
::"r"(gain));
|
||||
|
||||
for (i = 0; i + 16 <= samples; i += 16)
|
||||
{
|
||||
__asm__ (
|
||||
".set push \n"
|
||||
".set noreorder \n"
|
||||
|
||||
"lv.s s100, 0(%0) \n"
|
||||
"lv.s s101, 4(%0) \n"
|
||||
"lv.s s110, 8(%0) \n"
|
||||
"lv.s s111, 12(%0) \n"
|
||||
"lv.s s120, 16(%0) \n"
|
||||
"lv.s s121, 20(%0) \n"
|
||||
"lv.s s130, 24(%0) \n"
|
||||
"lv.s s131, 28(%0) \n"
|
||||
|
||||
"vs2i.p c100, c100 \n"
|
||||
"vs2i.p c110, c110 \n"
|
||||
"vs2i.p c120, c120 \n"
|
||||
"vs2i.p c130, c130 \n"
|
||||
|
||||
"vi2f.q c100, c100, 16 \n"
|
||||
"vi2f.q c110, c110, 16 \n"
|
||||
"vi2f.q c120, c120, 16 \n"
|
||||
"vi2f.q c130, c130, 16 \n"
|
||||
|
||||
"vmscl.q e100, e100, s200 \n"
|
||||
|
||||
"sv.q c100, 0(%1) \n"
|
||||
"sv.q c110, 16(%1) \n"
|
||||
"sv.q c120, 32(%1) \n"
|
||||
"sv.q c130, 48(%1) \n"
|
||||
|
||||
".set pop \n"
|
||||
:: "r"(in + i), "r"(out + i));
|
||||
}
|
||||
|
||||
for (; i < samples; i++)
|
||||
out[i] = (float)in[i] * gain;
|
||||
}
|
||||
|
||||
/**
|
||||
* audio_convert_float_to_s16_ALLEGREX:
|
||||
* @out : output buffer
|
||||
* @in : input buffer
|
||||
* @samples : size of samples to be converted
|
||||
*
|
||||
* Converts audio samples from floating point
|
||||
* to signed integer 16-bit.
|
||||
*
|
||||
* MIPS ALLEGREX implementation callback function.
|
||||
**/
|
||||
void audio_convert_float_to_s16_ALLEGREX(int16_t *out,
|
||||
const float *in, size_t samples)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
#ifdef DEBUG
|
||||
/* Make sure the buffers are 16 byte aligned, this should be
|
||||
* the default behaviour of malloc in the PSPSDK.
|
||||
* Both buffers are allocated by RetroArch, so can assume alignment. */
|
||||
retro_assert(((uintptr_t)in & 0xf) == 0);
|
||||
retro_assert(((uintptr_t)out & 0xf) == 0);
|
||||
#endif
|
||||
|
||||
for (i = 0; i + 8 <= samples; i += 8)
|
||||
{
|
||||
__asm__ (
|
||||
".set push \n"
|
||||
".set noreorder \n"
|
||||
|
||||
"lv.q c100, 0(%0) \n"
|
||||
"lv.q c110, 16(%0) \n"
|
||||
|
||||
"vf2in.q c100, c100, 31 \n"
|
||||
"vf2in.q c110, c110, 31 \n"
|
||||
"vi2s.q c100, c100 \n"
|
||||
"vi2s.q c102, c110 \n"
|
||||
|
||||
"sv.q c100, 0(%1) \n"
|
||||
|
||||
".set pop \n"
|
||||
:: "r"(in + i), "r"(out + i));
|
||||
}
|
||||
|
||||
for (; i < samples; i++)
|
||||
{
|
||||
int32_t val = (int32_t)(in[i] * 0x8000);
|
||||
out[i] = (val > 0x7FFF) ? 0x7FFF :
|
||||
(val < -0x8000 ? -0x8000 : (int16_t)val);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef RARCH_INTERNAL
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
retro_get_cpu_features_t perf_get_cpu_features_cb;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
static unsigned audio_convert_get_cpu_features(void)
|
||||
{
|
||||
#ifdef RARCH_INTERNAL
|
||||
return retro_get_cpu_features();
|
||||
#else
|
||||
return perf_get_cpu_features_cb();
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* audio_convert_init_simd:
|
||||
*
|
||||
* Sets up function pointers for audio conversion
|
||||
* functions based on CPU features.
|
||||
**/
|
||||
void audio_convert_init_simd(void)
|
||||
{
|
||||
unsigned cpu = audio_convert_get_cpu_features();
|
||||
|
||||
(void)cpu;
|
||||
#if defined(__ARM_NEON__) && !defined(VITA)
|
||||
audio_convert_s16_to_float_arm = (cpu & RETRO_SIMD_NEON) ?
|
||||
audio_convert_s16_to_float_neon : audio_convert_s16_to_float_C;
|
||||
audio_convert_float_to_s16_arm = (cpu & RETRO_SIMD_NEON) ?
|
||||
audio_convert_float_to_s16_neon : audio_convert_float_to_s16_C;
|
||||
#endif
|
||||
}
|
||||
@@ -1,184 +0,0 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef AUDIO_UTILS_H
|
||||
#define AUDIO_UTILS_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "../config.h"
|
||||
#endif
|
||||
|
||||
#if defined(__SSE2__)
|
||||
#define audio_convert_s16_to_float audio_convert_s16_to_float_SSE2
|
||||
#define audio_convert_float_to_s16 audio_convert_float_to_s16_SSE2
|
||||
|
||||
/**
|
||||
* audio_convert_s16_to_float_SSE2:
|
||||
* @out : output buffer
|
||||
* @in : input buffer
|
||||
* @samples : size of samples to be converted
|
||||
* @gain : gain applied to the audio volume
|
||||
*
|
||||
* Converts audio samples from signed integer 16-bit
|
||||
* to floating point.
|
||||
*
|
||||
* SSE2 implementation callback function.
|
||||
**/
|
||||
void audio_convert_s16_to_float_SSE2(float *out,
|
||||
const int16_t *in, size_t samples, float gain);
|
||||
|
||||
/**
|
||||
* audio_convert_float_to_s16_SSE2:
|
||||
* @out : output buffer
|
||||
* @in : input buffer
|
||||
* @samples : size of samples to be converted
|
||||
*
|
||||
* Converts audio samples from floating point
|
||||
* to signed integer 16-bit.
|
||||
*
|
||||
* SSE2 implementation callback function.
|
||||
**/
|
||||
void audio_convert_float_to_s16_SSE2(int16_t *out,
|
||||
const float *in, size_t samples);
|
||||
|
||||
#elif defined(__ALTIVEC__)
|
||||
#define audio_convert_s16_to_float audio_convert_s16_to_float_altivec
|
||||
#define audio_convert_float_to_s16 audio_convert_float_to_s16_altivec
|
||||
|
||||
/**
|
||||
* audio_convert_s16_to_float_altivec:
|
||||
* @out : output buffer
|
||||
* @in : input buffer
|
||||
* @samples : size of samples to be converted
|
||||
* @gain : gain applied to the audio volume
|
||||
*
|
||||
* Converts audio samples from signed integer 16-bit
|
||||
* to floating point.
|
||||
*
|
||||
* AltiVec implementation callback function.
|
||||
**/
|
||||
void audio_convert_s16_to_float_altivec(float *out,
|
||||
const int16_t *in, size_t samples, float gain);
|
||||
|
||||
/**
|
||||
* audio_convert_float_to_s16_altivec:
|
||||
* @out : output buffer
|
||||
* @in : input buffer
|
||||
* @samples : size of samples to be converted
|
||||
*
|
||||
* Converts audio samples from floating point
|
||||
* to signed integer 16-bit.
|
||||
*
|
||||
* AltiVec implementation callback function.
|
||||
**/
|
||||
void audio_convert_float_to_s16_altivec(int16_t *out,
|
||||
const float *in, size_t samples);
|
||||
|
||||
#elif defined(__ARM_NEON__) && !defined(VITA)
|
||||
#define audio_convert_s16_to_float audio_convert_s16_to_float_arm
|
||||
#define audio_convert_float_to_s16 audio_convert_float_to_s16_arm
|
||||
|
||||
void (*audio_convert_s16_to_float_arm)(float *out,
|
||||
const int16_t *in, size_t samples, float gain);
|
||||
|
||||
void (*audio_convert_float_to_s16_arm)(int16_t *out,
|
||||
const float *in, size_t samples);
|
||||
|
||||
#elif defined(_MIPS_ARCH_ALLEGREX)
|
||||
#define audio_convert_s16_to_float audio_convert_s16_to_float_ALLEGREX
|
||||
#define audio_convert_float_to_s16 audio_convert_float_to_s16_ALLEGREX
|
||||
|
||||
/**
|
||||
* audio_convert_s16_to_float_ALLEGREX:
|
||||
* @out : output buffer
|
||||
* @in : input buffer
|
||||
* @samples : size of samples to be converted
|
||||
* @gain : gain applied to the audio volume
|
||||
*
|
||||
* Converts audio samples from signed integer 16-bit
|
||||
* to floating point.
|
||||
*
|
||||
* MIPS ALLEGREX implementation callback function.
|
||||
**/
|
||||
void audio_convert_s16_to_float_ALLEGREX(float *out,
|
||||
const int16_t *in, size_t samples, float gain);
|
||||
|
||||
/**
|
||||
* audio_convert_float_to_s16_ALLEGREX:
|
||||
* @out : output buffer
|
||||
* @in : input buffer
|
||||
* @samples : size of samples to be converted
|
||||
*
|
||||
* Converts audio samples from floating point
|
||||
* to signed integer 16-bit.
|
||||
*
|
||||
* MIPS ALLEGREX implementation callback function.
|
||||
**/
|
||||
void audio_convert_float_to_s16_ALLEGREX(int16_t *out,
|
||||
const float *in, size_t samples);
|
||||
#else
|
||||
#define audio_convert_s16_to_float audio_convert_s16_to_float_C
|
||||
#define audio_convert_float_to_s16 audio_convert_float_to_s16_C
|
||||
#endif
|
||||
|
||||
/**
|
||||
* audio_convert_s16_to_float_C:
|
||||
* @out : output buffer
|
||||
* @in : input buffer
|
||||
* @samples : size of samples to be converted
|
||||
* @gain : gain applied to the audio volume
|
||||
*
|
||||
* Converts audio samples from signed integer 16-bit
|
||||
* to floating point.
|
||||
*
|
||||
* C implementation callback function.
|
||||
**/
|
||||
void audio_convert_s16_to_float_C(float *out,
|
||||
const int16_t *in, size_t samples, float gain);
|
||||
|
||||
/**
|
||||
* audio_convert_float_to_s16_C:
|
||||
* @out : output buffer
|
||||
* @in : input buffer
|
||||
* @samples : size of samples to be converted
|
||||
*
|
||||
* Converts audio samples from floating point
|
||||
* to signed integer 16-bit.
|
||||
*
|
||||
* C implementation callback function.
|
||||
**/
|
||||
void audio_convert_float_to_s16_C(int16_t *out,
|
||||
const float *in, size_t samples);
|
||||
|
||||
/**
|
||||
* audio_convert_init_simd:
|
||||
*
|
||||
* Sets up function pointers for audio conversion
|
||||
* functions based on CPU features.
|
||||
**/
|
||||
void audio_convert_init_simd(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -156,7 +156,10 @@ error:
|
||||
if (alsa)
|
||||
{
|
||||
if (alsa->pcm)
|
||||
{
|
||||
snd_pcm_close(alsa->pcm);
|
||||
snd_config_update_free_global();
|
||||
}
|
||||
|
||||
free(alsa);
|
||||
}
|
||||
@@ -298,7 +301,9 @@ static void alsa_free(void *data)
|
||||
{
|
||||
snd_pcm_drop(alsa->pcm);
|
||||
snd_pcm_close(alsa->pcm);
|
||||
snd_config_update_free_global();
|
||||
}
|
||||
|
||||
free(alsa);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,7 +132,9 @@ static void alsa_thread_free(void *data)
|
||||
{
|
||||
if (alsa->worker_thread)
|
||||
{
|
||||
slock_lock(alsa->cond_lock);
|
||||
alsa->thread_dead = true;
|
||||
slock_unlock(alsa->cond_lock);
|
||||
sthread_join(alsa->worker_thread);
|
||||
}
|
||||
if (alsa->buffer)
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
#include "../audio_driver.h"
|
||||
#include "../../configuration.h"
|
||||
#include "../../performance.h"
|
||||
#include "../../performance_counters.h"
|
||||
#include "../../runloop.h"
|
||||
|
||||
typedef struct
|
||||
@@ -169,8 +169,8 @@ static ssize_t ctr_csnd_audio_write(void *data, const void *buf, size_t size)
|
||||
(void)samples_played;
|
||||
(void)current_tick;
|
||||
|
||||
rarch_perf_init(&ctraudio_f, "ctraudio_f");
|
||||
retro_perf_start(&ctraudio_f);
|
||||
performance_counter_init(&ctraudio_f, "ctraudio_f");
|
||||
performance_counter_start(&ctraudio_f);
|
||||
|
||||
ctr_csnd_audio_update_playpos(ctr);
|
||||
|
||||
@@ -202,7 +202,7 @@ static ssize_t ctr_csnd_audio_write(void *data, const void *buf, size_t size)
|
||||
GSPGPU_FlushDataCache(ctr->l, CTR_CSND_AUDIO_SIZE);
|
||||
GSPGPU_FlushDataCache(ctr->r, CTR_CSND_AUDIO_SIZE);
|
||||
|
||||
retro_perf_stop(&ctraudio_f);
|
||||
performance_counter_stop(&ctraudio_f);
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
#include "../audio_driver.h"
|
||||
#include "../../configuration.h"
|
||||
#include "../../performance.h"
|
||||
#include "../../performance_counters.h"
|
||||
#include "../../runloop.h"
|
||||
#include "../../ctr/ctr_debug.h"
|
||||
|
||||
@@ -116,8 +116,8 @@ static ssize_t ctr_dsp_audio_write(void *data, const void *buf, size_t size)
|
||||
}
|
||||
}
|
||||
|
||||
rarch_perf_init(&ctraudio_dsp_f, "ctraudio_dsp_f");
|
||||
retro_perf_start(&ctraudio_dsp_f);
|
||||
performance_counter_init(&ctraudio_dsp_f, "ctraudio_dsp_f");
|
||||
performance_counter_start(&ctraudio_dsp_f);
|
||||
|
||||
pos = ctr->pos << 2;
|
||||
|
||||
@@ -140,7 +140,7 @@ static ssize_t ctr_dsp_audio_write(void *data, const void *buf, size_t size)
|
||||
ctr->pos += size >> 2;
|
||||
ctr->pos &= CTR_DSP_AUDIO_COUNT_MASK;
|
||||
|
||||
retro_perf_stop(&ctraudio_dsp_f);
|
||||
performance_counter_stop(&ctraudio_dsp_f);
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
@@ -41,8 +41,10 @@ typedef struct jack
|
||||
bool nonblock;
|
||||
bool is_paused;
|
||||
|
||||
#ifdef HAVE_THREADS
|
||||
scond_t *cond;
|
||||
slock_t *cond_lock;
|
||||
#endif
|
||||
size_t buffer_size;
|
||||
} jack_t;
|
||||
|
||||
@@ -54,7 +56,9 @@ static int process_cb(jack_nframes_t nframes, void *data)
|
||||
|
||||
if (nframes <= 0)
|
||||
{
|
||||
#ifdef HAVE_THREADS
|
||||
scond_signal(jd->cond);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -74,7 +78,9 @@ static int process_cb(jack_nframes_t nframes, void *data)
|
||||
for (f = min_avail; f < nframes; f++)
|
||||
out[f] = 0.0f;
|
||||
}
|
||||
#ifdef HAVE_THREADS
|
||||
scond_signal(jd->cond);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -86,7 +92,9 @@ static void shutdown_cb(void *data)
|
||||
return;
|
||||
|
||||
jd->shutdown = true;
|
||||
#ifdef HAVE_THREADS
|
||||
scond_signal(jd->cond);
|
||||
#endif
|
||||
}
|
||||
|
||||
static int parse_ports(char **dest_ports, const char **jports)
|
||||
@@ -149,8 +157,10 @@ static void *ja_init(const char *device, unsigned rate, unsigned latency)
|
||||
if (!jd)
|
||||
return NULL;
|
||||
|
||||
#ifdef HAVE_THREADS
|
||||
jd->cond = scond_new();
|
||||
jd->cond_lock = slock_new();
|
||||
#endif
|
||||
|
||||
jd->client = jack_client_open("RetroArch", JackNullOption, NULL);
|
||||
if (jd->client == NULL)
|
||||
@@ -216,6 +226,7 @@ static void *ja_init(const char *device, unsigned rate, unsigned latency)
|
||||
error:
|
||||
if (jports != NULL)
|
||||
jack_free(jports);
|
||||
free(jd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -258,12 +269,14 @@ static size_t write_buffer(jack_t *jd, const float *buf, size_t size)
|
||||
}
|
||||
written += write_frames;
|
||||
}
|
||||
#ifdef HAVE_THREADS
|
||||
else
|
||||
{
|
||||
slock_lock(jd->cond_lock);
|
||||
scond_wait(jd->cond, jd->cond_lock);
|
||||
slock_unlock(jd->cond_lock);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (jd->nonblock)
|
||||
break;
|
||||
@@ -327,10 +340,12 @@ static void ja_free(void *data)
|
||||
if (jd->buffer[i] != NULL)
|
||||
jack_ringbuffer_free(jd->buffer[i]);
|
||||
|
||||
#ifdef HAVE_THREADS
|
||||
if (jd->cond_lock)
|
||||
slock_free(jd->cond_lock);
|
||||
if (jd->cond)
|
||||
scond_free(jd->cond);
|
||||
#endif
|
||||
free(jd);
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ typedef struct psp_audio
|
||||
#define AUDIO_BUFFER_SIZE_MASK (AUDIO_BUFFER_SIZE-1)
|
||||
|
||||
#ifdef VITA
|
||||
#define PSP_THREAD_STOPPED PSP2_THREAD_STOPPED
|
||||
#define PSP_THREAD_STOPPED SCE_THREAD_STOPPED
|
||||
#else
|
||||
#define SceKernelThreadInfo SceKernelThreadRunStatus
|
||||
#define sceKernelGetThreadInfo sceKernelReferThreadRunStatus
|
||||
@@ -60,8 +60,8 @@ static int audioMainLoop(SceSize args, void* argp)
|
||||
psp_audio_t* psp = *((psp_audio_t**)argp);
|
||||
|
||||
#ifdef VITA
|
||||
int port = sceAudioOutOpenPort(PSP2_AUDIO_OUT_PORT_TYPE_MAIN, AUDIO_OUT_COUNT,
|
||||
psp->rate, PSP2_AUDIO_OUT_MODE_STEREO);
|
||||
int port = sceAudioOutOpenPort(SCE_AUDIO_OUT_PORT_TYPE_MAIN, AUDIO_OUT_COUNT,
|
||||
psp->rate, SCE_AUDIO_OUT_MODE_STEREO);
|
||||
#else
|
||||
sceAudioSRCChReserve(AUDIO_OUT_COUNT, psp->rate, 2);
|
||||
#endif
|
||||
|
||||
@@ -24,11 +24,13 @@
|
||||
|
||||
#include "../audio_driver.h"
|
||||
#include "../../configuration.h"
|
||||
#include "../../verbosity.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
roar_vs_t *vss;
|
||||
bool nonblocking;
|
||||
bool is_paused;
|
||||
} roar_t;
|
||||
|
||||
static void *ra_init(const char *device, unsigned rate, unsigned latency)
|
||||
|
||||
+4
-11
@@ -16,14 +16,6 @@
|
||||
#ifndef __RSOUND_H
|
||||
#define __RSOUND_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
#define STANDALONE
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <rthreads/rthreads.h>
|
||||
@@ -32,8 +24,11 @@ extern "C" {
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#include <retro_common_api.h>
|
||||
#include <queues/fifo_queue.h>
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
#ifdef _WIN32
|
||||
#define RSD_DEFAULT_HOST "127.0.0.1" /* Stupid Windows. */
|
||||
#else
|
||||
@@ -323,8 +318,6 @@ int rsd_pause (rsound_t *rd, int enable);
|
||||
/* Frees an rsound_t struct. Make sure that the stream is properly closed down with rsd_stop() before calling rsd_free(). */
|
||||
int rsd_free (rsound_t *rd);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
@@ -35,8 +35,10 @@ typedef struct sdl_audio
|
||||
bool nonblock;
|
||||
bool is_paused;
|
||||
|
||||
#ifdef HAVE_THREADS
|
||||
slock_t *lock;
|
||||
scond_t *cond;
|
||||
#endif
|
||||
fifo_buffer_t *buffer;
|
||||
} sdl_audio_t;
|
||||
|
||||
@@ -47,7 +49,9 @@ static void sdl_audio_cb(void *data, Uint8 *stream, int len)
|
||||
size_t write_size = len > (int)avail ? avail : len;
|
||||
|
||||
fifo_read(sdl->buffer, stream, write_size);
|
||||
#ifdef HAVE_THREADS
|
||||
scond_signal(sdl->cond);
|
||||
#endif
|
||||
|
||||
/* If underrun, fill rest with silence. */
|
||||
memset(stream + write_size, 0, len - write_size);
|
||||
@@ -109,8 +113,10 @@ static void *sdl_audio_init(const char *device,
|
||||
|
||||
settings->audio.out_rate = out.freq;
|
||||
|
||||
#ifdef HAVE_THREADS
|
||||
sdl->lock = slock_new();
|
||||
sdl->cond = scond_new();
|
||||
#endif
|
||||
|
||||
RARCH_LOG("SDL audio: Requested %u ms latency, got %d ms\n",
|
||||
latency, (int)(out.samples * 4 * 1000 / settings->audio.out_rate));
|
||||
@@ -160,9 +166,11 @@ static ssize_t sdl_audio_write(void *data, const void *buf, size_t size)
|
||||
if (avail == 0)
|
||||
{
|
||||
SDL_UnlockAudio();
|
||||
#ifdef HAVE_THREADS
|
||||
slock_lock(sdl->lock);
|
||||
scond_wait(sdl->cond, sdl->lock);
|
||||
slock_unlock(sdl->lock);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -220,8 +228,10 @@ static void sdl_audio_free(void *data)
|
||||
if (sdl)
|
||||
{
|
||||
fifo_free(sdl->buffer);
|
||||
#ifdef HAVE_THREADS
|
||||
slock_free(sdl->lock);
|
||||
scond_free(sdl->cond);
|
||||
#endif
|
||||
}
|
||||
free(sdl);
|
||||
}
|
||||
|
||||
+2
-2
@@ -80,7 +80,7 @@ int main(int argc, char *argv[])
|
||||
uniform = (2.0 * rand()) / RAND_MAX - 1.0;
|
||||
rate_mod = 1.0 + ratio_max_deviation * uniform;
|
||||
|
||||
audio_convert_s16_to_float(input_f, input_i, 1024, 1.0f);
|
||||
convert_s16_to_float(input_f, input_i, 1024, 1.0f);
|
||||
|
||||
data.data_in = input_f;
|
||||
data.data_out = output_f;
|
||||
@@ -91,7 +91,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
output_samples = data.output_frames * 2;
|
||||
|
||||
audio_convert_float_to_s16(output_i, output_f, output_samples);
|
||||
convert_float_to_s16(output_i, output_f, output_samples);
|
||||
|
||||
if (fwrite(output_i, sizeof(int16_t), output_samples, stdout) != output_samples)
|
||||
break;
|
||||
|
||||
+11
-13
@@ -17,34 +17,32 @@
|
||||
#ifndef __RARCH_AUTOSAVE_H
|
||||
#define __RARCH_AUTOSAVE_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include <retro_common_api.h>
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
typedef struct autosave autosave_t;
|
||||
|
||||
/**
|
||||
* lock_autosave:
|
||||
* autosave_lock:
|
||||
*
|
||||
* Lock autosave.
|
||||
**/
|
||||
void lock_autosave(void);
|
||||
void autosave_lock(void);
|
||||
|
||||
/**
|
||||
* unlock_autosave:
|
||||
* autosave_unlock:
|
||||
*
|
||||
* Unlocks autosave.
|
||||
**/
|
||||
void unlock_autosave(void);
|
||||
void autosave_unlock(void);
|
||||
|
||||
void autosave_event_init(void);
|
||||
void autosave_init(void);
|
||||
|
||||
void autosave_event_deinit(void);
|
||||
void autosave_deinit(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
@@ -153,7 +153,7 @@ bool camera_driver_ctl(enum rarch_camera_ctl_state state, void *data)
|
||||
camera_driver = (const camera_driver_t*)camera_driver_find_handle(0);
|
||||
|
||||
if (!camera_driver)
|
||||
retro_fail(1, "find_camera_driver()");
|
||||
retroarch_fail(1, "find_camera_driver()");
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -18,12 +18,12 @@
|
||||
#define __CAMERA_DRIVER__H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <boolean.h>
|
||||
#include "../libretro.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#include <boolean.h>
|
||||
#include <retro_common_api.h>
|
||||
#include <libretro.h>
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
enum rarch_camera_ctl_state
|
||||
{
|
||||
@@ -107,8 +107,6 @@ bool driver_camera_start(void);
|
||||
|
||||
bool camera_driver_ctl(enum rarch_camera_ctl_state state, void *data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
@@ -41,7 +41,7 @@
|
||||
#include <compat/strl.h>
|
||||
|
||||
#include "../camera_driver.h"
|
||||
#include "../../performance.h"
|
||||
#include "../../performance_counters.h"
|
||||
#include "../../verbosity.h"
|
||||
|
||||
struct buffer
|
||||
@@ -70,10 +70,10 @@ static void process_image(video4linux_t *v4l, const uint8_t *buffer_yuv)
|
||||
{
|
||||
static struct retro_perf_counter yuv_convert_direct = {0};
|
||||
|
||||
rarch_perf_init(&yuv_convert_direct, "yuv_convert_direct");
|
||||
retro_perf_start(&yuv_convert_direct);
|
||||
performance_counter_init(&yuv_convert_direct, "yuv_convert_direct");
|
||||
performance_counter_start(&yuv_convert_direct);
|
||||
scaler_ctx_scale(&v4l->scaler, v4l->buffer_output, buffer_yuv);
|
||||
retro_perf_stop(&yuv_convert_direct);
|
||||
performance_counter_stop(&yuv_convert_direct);
|
||||
}
|
||||
|
||||
static int xioctl(int fd, int request, void *args)
|
||||
@@ -95,8 +95,8 @@ static bool init_mmap(void *data)
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
|
||||
req.count = 4;
|
||||
req.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||
req.count = 4;
|
||||
req.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||
req.memory = V4L2_MEMORY_MMAP;
|
||||
|
||||
if (xioctl(v4l->fd, (uint8_t)VIDIOC_REQBUFS, &req) == -1)
|
||||
@@ -249,9 +249,9 @@ static void v4l_stop(void *data)
|
||||
|
||||
static bool v4l_start(void *data)
|
||||
{
|
||||
video4linux_t *v4l = (video4linux_t*)data;
|
||||
unsigned i;
|
||||
enum v4l2_buf_type type;
|
||||
video4linux_t *v4l = (video4linux_t*)data;
|
||||
|
||||
for (i = 0; i < v4l->n_buffers; i++)
|
||||
{
|
||||
@@ -259,9 +259,9 @@ static bool v4l_start(void *data)
|
||||
|
||||
memset(&buf, 0, sizeof(buf));
|
||||
|
||||
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||
buf.memory = V4L2_MEMORY_MMAP;
|
||||
buf.index = i;
|
||||
buf.index = i;
|
||||
|
||||
if (xioctl(v4l->fd, (uint8_t)VIDIOC_QBUF, &buf) == -1)
|
||||
{
|
||||
|
||||
@@ -19,28 +19,9 @@
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
enum cheevos_ctl_state
|
||||
{
|
||||
CHEEVOS_CTL_NONE = 0,
|
||||
CHEEVOS_CTL_TEST,
|
||||
CHEEVOS_CTL_LOAD,
|
||||
#include <retro_common_api.h>
|
||||
|
||||
CHEEVOS_CTL_APPLY_CHEATS,
|
||||
|
||||
/* Unload the achievements from memory. */
|
||||
CHEEVOS_CTL_UNLOAD,
|
||||
|
||||
/* Toggle Hardcore Mode */
|
||||
CHEEVOS_CTL_TOGGLE_HARDCORE_MODE,
|
||||
|
||||
/* Load the achievements into memory if
|
||||
* the game has content. */
|
||||
CHEEVOS_CTL_SET_CHEATS,
|
||||
|
||||
CHEEVOS_CTL_GET_DESCRIPTION,
|
||||
|
||||
CHEEVOS_CTL_POPULATE_MENU
|
||||
};
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
typedef struct cheevos_ctx_desc
|
||||
{
|
||||
@@ -49,6 +30,37 @@ typedef struct cheevos_ctx_desc
|
||||
size_t len;
|
||||
} cheevos_ctx_desc_t;
|
||||
|
||||
bool cheevos_ctl(enum cheevos_ctl_state state, void *data);
|
||||
bool cheevos_load(const void *data);
|
||||
|
||||
void cheevos_populate_menu(void *data);
|
||||
|
||||
bool cheevos_get_description(cheevos_ctx_desc_t *desc);
|
||||
|
||||
bool cheevos_apply_cheats(bool *data_bool);
|
||||
|
||||
bool cheevos_unload(void);
|
||||
|
||||
bool cheevos_toggle_hardcore_mode(void);
|
||||
|
||||
bool cheevos_test(void);
|
||||
|
||||
bool cheevos_set_cheats(void);
|
||||
|
||||
void cheevos_set_support_cheevos(bool state);
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned size;
|
||||
unsigned type;
|
||||
int bank_id;
|
||||
unsigned value;
|
||||
unsigned previous;
|
||||
} cheevos_var_t;
|
||||
|
||||
void cheevos_parse_guest_addr(cheevos_var_t *var, unsigned value);
|
||||
uint8_t *cheevos_get_memory(const cheevos_var_t *var);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif /* __RARCH_CHEEVOS_H */
|
||||
@@ -23,37 +23,230 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include <boolean.h>
|
||||
#include <retro_common_api.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
enum rarch_cmd_ctl_state
|
||||
typedef struct command command_t;
|
||||
|
||||
typedef struct command_handle
|
||||
{
|
||||
RARCH_CMD_CTL_NONE = 0,
|
||||
RARCH_CMD_CTL_GET,
|
||||
RARCH_CMD_CTL_SET,
|
||||
RARCH_CMD_CTL_POLL,
|
||||
RARCH_CMD_CTL_NETWORK_SEND,
|
||||
RARCH_CMD_CTL_FREE
|
||||
command_t *handle;
|
||||
unsigned id;
|
||||
} command_handle_t;
|
||||
|
||||
enum event_command
|
||||
{
|
||||
CMD_EVENT_NONE = 0,
|
||||
/* Resets RetroArch. */
|
||||
CMD_EVENT_RESET,
|
||||
CMD_EVENT_SET_PER_GAME_RESOLUTION,
|
||||
CMD_EVENT_SET_FRAME_LIMIT,
|
||||
/* Loads core. */
|
||||
CMD_EVENT_LOAD_CORE_DEINIT,
|
||||
CMD_EVENT_LOAD_CORE,
|
||||
CMD_EVENT_LOAD_CORE_PERSIST,
|
||||
CMD_EVENT_UNLOAD_CORE,
|
||||
CMD_EVENT_LOAD_STATE,
|
||||
/* Swaps the current state with what's on the undo load buffer */
|
||||
CMD_EVENT_UNDO_LOAD_STATE,
|
||||
/* Rewrites a savestate on disk */
|
||||
CMD_EVENT_UNDO_SAVE_STATE,
|
||||
CMD_EVENT_SAVE_STATE,
|
||||
CMD_EVENT_SAVE_STATE_DECREMENT,
|
||||
CMD_EVENT_SAVE_STATE_INCREMENT,
|
||||
/* Takes screenshot. */
|
||||
CMD_EVENT_TAKE_SCREENSHOT,
|
||||
/* Quits RetroArch. */
|
||||
CMD_EVENT_QUIT,
|
||||
/* Reinitialize all drivers. */
|
||||
CMD_EVENT_REINIT,
|
||||
/* Toggles cheevos hardcore mode. */
|
||||
CMD_EVENT_CHEEVOS_HARDCORE_MODE_TOGGLE,
|
||||
/* Deinitialize rewind. */
|
||||
CMD_EVENT_REWIND_DEINIT,
|
||||
/* Initializes rewind. */
|
||||
CMD_EVENT_REWIND_INIT,
|
||||
/* Toggles rewind. */
|
||||
CMD_EVENT_REWIND_TOGGLE,
|
||||
/* Deinitializes autosave. */
|
||||
CMD_EVENT_AUTOSAVE_DEINIT,
|
||||
/* Initializes autosave. */
|
||||
CMD_EVENT_AUTOSAVE_INIT,
|
||||
CMD_EVENT_AUTOSAVE_STATE,
|
||||
/* Stops audio. */
|
||||
CMD_EVENT_AUDIO_STOP,
|
||||
/* Starts audio. */
|
||||
CMD_EVENT_AUDIO_START,
|
||||
/* Mutes audio. */
|
||||
CMD_EVENT_AUDIO_MUTE_TOGGLE,
|
||||
/* Initializes overlay. */
|
||||
CMD_EVENT_OVERLAY_INIT,
|
||||
/* Deinitializes overlay. */
|
||||
CMD_EVENT_OVERLAY_DEINIT,
|
||||
/* Sets current scale factor for overlay. */
|
||||
CMD_EVENT_OVERLAY_SET_SCALE_FACTOR,
|
||||
/* Sets current alpha modulation for overlay. */
|
||||
CMD_EVENT_OVERLAY_SET_ALPHA_MOD,
|
||||
/* Cycle to next overlay. */
|
||||
CMD_EVENT_OVERLAY_NEXT,
|
||||
/* Deinitializes overlay. */
|
||||
CMD_EVENT_DSP_FILTER_INIT,
|
||||
/* Deinitializes graphics filter. */
|
||||
CMD_EVENT_DSP_FILTER_DEINIT,
|
||||
/* Deinitializes GPU recoring. */
|
||||
CMD_EVENT_GPU_RECORD_DEINIT,
|
||||
/* Initializes recording system. */
|
||||
CMD_EVENT_RECORD_INIT,
|
||||
/* Deinitializes recording system. */
|
||||
CMD_EVENT_RECORD_DEINIT,
|
||||
/* Deinitializes history playlist. */
|
||||
CMD_EVENT_HISTORY_DEINIT,
|
||||
/* Initializes history playlist. */
|
||||
CMD_EVENT_HISTORY_INIT,
|
||||
/* Deinitializes core information. */
|
||||
CMD_EVENT_CORE_INFO_DEINIT,
|
||||
/* Initializes core information. */
|
||||
CMD_EVENT_CORE_INFO_INIT,
|
||||
/* Deinitializes core. */
|
||||
CMD_EVENT_CORE_DEINIT,
|
||||
/* Initializes core. */
|
||||
CMD_EVENT_CORE_INIT,
|
||||
/* Set audio blocking state. */
|
||||
CMD_EVENT_AUDIO_SET_BLOCKING_STATE,
|
||||
/* Set audio nonblocking state. */
|
||||
CMD_EVENT_AUDIO_SET_NONBLOCKING_STATE,
|
||||
/* Apply video state changes. */
|
||||
CMD_EVENT_VIDEO_APPLY_STATE_CHANGES,
|
||||
/* Set video blocking state. */
|
||||
CMD_EVENT_VIDEO_SET_BLOCKING_STATE,
|
||||
/* Set video nonblocking state. */
|
||||
CMD_EVENT_VIDEO_SET_NONBLOCKING_STATE,
|
||||
/* Sets current aspect ratio index. */
|
||||
CMD_EVENT_VIDEO_SET_ASPECT_RATIO,
|
||||
CMD_EVENT_RESET_CONTEXT,
|
||||
/* Restarts RetroArch. */
|
||||
CMD_EVENT_RESTART_RETROARCH,
|
||||
/* Shutdown the OS */
|
||||
CMD_EVENT_SHUTDOWN,
|
||||
/* Reboot the OS */
|
||||
CMD_EVENT_REBOOT,
|
||||
/* Resume RetroArch when in menu. */
|
||||
CMD_EVENT_RESUME,
|
||||
/* Toggles pause. */
|
||||
CMD_EVENT_PAUSE_TOGGLE,
|
||||
/* Pauses RetroArch. */
|
||||
CMD_EVENT_UNPAUSE,
|
||||
/* Unpauses retroArch. */
|
||||
CMD_EVENT_PAUSE,
|
||||
CMD_EVENT_PAUSE_CHECKS,
|
||||
CMD_EVENT_MENU_SAVE_CURRENT_CONFIG,
|
||||
CMD_EVENT_MENU_SAVE_CONFIG,
|
||||
CMD_EVENT_MENU_PAUSE_LIBRETRO,
|
||||
/* Toggles menu on/off. */
|
||||
CMD_EVENT_MENU_TOGGLE,
|
||||
CMD_EVENT_MENU_REFRESH,
|
||||
/* Applies shader changes. */
|
||||
CMD_EVENT_SHADERS_APPLY_CHANGES,
|
||||
/* Initializes shader directory. */
|
||||
CMD_EVENT_SHADER_DIR_INIT,
|
||||
/* Deinitializes shader directory. */
|
||||
CMD_EVENT_SHADER_DIR_DEINIT,
|
||||
/* Initializes controllers. */
|
||||
CMD_EVENT_CONTROLLERS_INIT,
|
||||
CMD_EVENT_SAVEFILES,
|
||||
/* Initializes savefiles. */
|
||||
CMD_EVENT_SAVEFILES_INIT,
|
||||
/* Deinitializes savefiles. */
|
||||
CMD_EVENT_SAVEFILES_DEINIT,
|
||||
/* Initializes cheats. */
|
||||
CMD_EVENT_CHEATS_INIT,
|
||||
/* Deinitializes cheats. */
|
||||
CMD_EVENT_CHEATS_DEINIT,
|
||||
/* Apply cheats. */
|
||||
CMD_EVENT_CHEATS_APPLY,
|
||||
/* Deinitializes network system. */
|
||||
CMD_EVENT_NETWORK_DEINIT,
|
||||
/* Initializes network system. */
|
||||
CMD_EVENT_NETWORK_INIT,
|
||||
/* Initializes netplay system. */
|
||||
CMD_EVENT_NETPLAY_INIT,
|
||||
/* Deinitializes netplay system. */
|
||||
CMD_EVENT_NETPLAY_DEINIT,
|
||||
/* Flip netplay players. */
|
||||
CMD_EVENT_NETPLAY_FLIP_PLAYERS,
|
||||
/* Initializes BSV movie. */
|
||||
CMD_EVENT_BSV_MOVIE_INIT,
|
||||
/* Deinitializes BSV movie. */
|
||||
CMD_EVENT_BSV_MOVIE_DEINIT,
|
||||
/* Initializes command interface. */
|
||||
CMD_EVENT_COMMAND_INIT,
|
||||
/* Deinitialize command interface. */
|
||||
CMD_EVENT_COMMAND_DEINIT,
|
||||
/* Initializes remote gamepad interface. */
|
||||
CMD_EVENT_REMOTE_INIT,
|
||||
/* Deinitializes remote gamepad interface. */
|
||||
CMD_EVENT_REMOTE_DEINIT,
|
||||
/* Reinitializes audio driver. */
|
||||
CMD_EVENT_AUDIO_REINIT,
|
||||
/* Resizes windowed scale. Will reinitialize video driver. */
|
||||
CMD_EVENT_RESIZE_WINDOWED_SCALE,
|
||||
/* Deinitializes temporary content. */
|
||||
CMD_EVENT_TEMPORARY_CONTENT_DEINIT,
|
||||
CMD_EVENT_SUBSYSTEM_FULLPATHS_DEINIT,
|
||||
CMD_EVENT_LOG_FILE_DEINIT,
|
||||
/* Toggles disk eject. */
|
||||
CMD_EVENT_DISK_EJECT_TOGGLE,
|
||||
/* Cycle to next disk. */
|
||||
CMD_EVENT_DISK_NEXT,
|
||||
/* Cycle to previous disk. */
|
||||
CMD_EVENT_DISK_PREV,
|
||||
/* Appends disk image to disk image list. */
|
||||
CMD_EVENT_DISK_APPEND_IMAGE,
|
||||
/* Stops rumbling. */
|
||||
CMD_EVENT_RUMBLE_STOP,
|
||||
/* Toggles mouse grab. */
|
||||
CMD_EVENT_GRAB_MOUSE_TOGGLE,
|
||||
/* Toggles fullscreen mode. */
|
||||
CMD_EVENT_FULLSCREEN_TOGGLE,
|
||||
CMD_EVENT_PERFCNT_REPORT_FRONTEND_LOG,
|
||||
CMD_EVENT_VOLUME_UP,
|
||||
CMD_EVENT_VOLUME_DOWN,
|
||||
CMD_EVENT_DISABLE_OVERRIDES
|
||||
};
|
||||
|
||||
typedef struct rarch_cmd rarch_cmd_t;
|
||||
|
||||
typedef struct rarch_cmd_handle
|
||||
{
|
||||
rarch_cmd_t *handle;
|
||||
unsigned id;
|
||||
} rarch_cmd_handle_t;
|
||||
|
||||
rarch_cmd_t *rarch_cmd_new(bool stdin_enable,
|
||||
bool network_enable, uint16_t port);
|
||||
|
||||
bool rarch_cmd_ctl(enum rarch_cmd_ctl_state state, void *data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#ifdef HAVE_COMMAND
|
||||
#if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY)
|
||||
bool command_network_send(const char *cmd_);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
bool command_network_new(
|
||||
command_t *handle,
|
||||
bool stdin_enable,
|
||||
bool network_enable,
|
||||
uint16_t port);
|
||||
|
||||
command_t *command_new(bool local_enable);
|
||||
|
||||
bool command_poll(command_t *handle);
|
||||
|
||||
bool command_get(command_handle_t *handle);
|
||||
|
||||
bool command_set(command_handle_t *handle);
|
||||
|
||||
bool command_free(command_t *handle);
|
||||
|
||||
/**
|
||||
* command_event:
|
||||
* @cmd : Command index.
|
||||
*
|
||||
* Performs RetroArch command with index @cmd.
|
||||
*
|
||||
* Returns: true (1) on success, otherwise false (0).
|
||||
**/
|
||||
bool command_event(enum event_command action, void *data);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
-1723
File diff suppressed because it is too large.
Load diff
-225
@@ -1,225 +0,0 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* 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-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef COMMAND_EVENT_H__
|
||||
#define COMMAND_EVENT_H__
|
||||
|
||||
#include <stdint.h>
|
||||
#include <boolean.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum event_command
|
||||
{
|
||||
EVENT_CMD_NONE = 0,
|
||||
/* Resets RetroArch. */
|
||||
EVENT_CMD_RESET,
|
||||
/* Loads content file. */
|
||||
EVENT_CMD_LOAD_CONTENT,
|
||||
EVENT_CMD_LOAD_CONTENT_PERSIST,
|
||||
#ifdef HAVE_FFMPEG
|
||||
EVENT_CMD_LOAD_CONTENT_FFMPEG,
|
||||
#endif
|
||||
EVENT_CMD_LOAD_CONTENT_IMAGEVIEWER,
|
||||
EVENT_CMD_SET_PER_GAME_RESOLUTION,
|
||||
EVENT_CMD_SET_FRAME_LIMIT,
|
||||
/* Loads core. */
|
||||
EVENT_CMD_LOAD_CORE_DEINIT,
|
||||
EVENT_CMD_LOAD_CORE,
|
||||
EVENT_CMD_LOAD_CORE_PERSIST,
|
||||
EVENT_CMD_UNLOAD_CORE,
|
||||
EVENT_CMD_LOAD_STATE,
|
||||
EVENT_CMD_SAVE_STATE,
|
||||
EVENT_CMD_SAVE_STATE_DECREMENT,
|
||||
EVENT_CMD_SAVE_STATE_INCREMENT,
|
||||
/* Takes screenshot. */
|
||||
EVENT_CMD_TAKE_SCREENSHOT,
|
||||
/* Quits RetroArch. */
|
||||
EVENT_CMD_QUIT,
|
||||
/* Reinitialize all drivers. */
|
||||
EVENT_CMD_REINIT,
|
||||
/* Toggles cheevos hardcore mode. */
|
||||
EVENT_CMD_CHEEVOS_HARDCORE_MODE_TOGGLE,
|
||||
/* Deinitialize rewind. */
|
||||
EVENT_CMD_REWIND_DEINIT,
|
||||
/* Initializes rewind. */
|
||||
EVENT_CMD_REWIND_INIT,
|
||||
/* Toggles rewind. */
|
||||
EVENT_CMD_REWIND_TOGGLE,
|
||||
/* Deinitializes autosave. */
|
||||
EVENT_CMD_AUTOSAVE_DEINIT,
|
||||
/* Initializes autosave. */
|
||||
EVENT_CMD_AUTOSAVE_INIT,
|
||||
EVENT_CMD_AUTOSAVE_STATE,
|
||||
/* Stops audio. */
|
||||
EVENT_CMD_AUDIO_STOP,
|
||||
/* Starts audio. */
|
||||
EVENT_CMD_AUDIO_START,
|
||||
/* Mutes audio. */
|
||||
EVENT_CMD_AUDIO_MUTE_TOGGLE,
|
||||
/* Initializes overlay. */
|
||||
EVENT_CMD_OVERLAY_INIT,
|
||||
/* Deinitializes overlay. */
|
||||
EVENT_CMD_OVERLAY_DEINIT,
|
||||
/* Sets current scale factor for overlay. */
|
||||
EVENT_CMD_OVERLAY_SET_SCALE_FACTOR,
|
||||
/* Sets current alpha modulation for overlay. */
|
||||
EVENT_CMD_OVERLAY_SET_ALPHA_MOD,
|
||||
/* Cycle to next overlay. */
|
||||
EVENT_CMD_OVERLAY_NEXT,
|
||||
/* Deinitializes overlay. */
|
||||
EVENT_CMD_DSP_FILTER_INIT,
|
||||
/* Deinitializes graphics filter. */
|
||||
EVENT_CMD_DSP_FILTER_DEINIT,
|
||||
/* Deinitializes GPU recoring. */
|
||||
EVENT_CMD_GPU_RECORD_DEINIT,
|
||||
/* Initializes recording system. */
|
||||
EVENT_CMD_RECORD_INIT,
|
||||
/* Deinitializes recording system. */
|
||||
EVENT_CMD_RECORD_DEINIT,
|
||||
/* Deinitializes history playlist. */
|
||||
EVENT_CMD_HISTORY_DEINIT,
|
||||
/* Initializes history playlist. */
|
||||
EVENT_CMD_HISTORY_INIT,
|
||||
/* Deinitializes core information. */
|
||||
EVENT_CMD_CORE_INFO_DEINIT,
|
||||
/* Initializes core information. */
|
||||
EVENT_CMD_CORE_INFO_INIT,
|
||||
/* Deinitializes core. */
|
||||
EVENT_CMD_CORE_DEINIT,
|
||||
/* Initializes core. */
|
||||
EVENT_CMD_CORE_INIT,
|
||||
/* Set audio blocking state. */
|
||||
EVENT_CMD_AUDIO_SET_BLOCKING_STATE,
|
||||
/* Set audio nonblocking state. */
|
||||
EVENT_CMD_AUDIO_SET_NONBLOCKING_STATE,
|
||||
/* Apply video state changes. */
|
||||
EVENT_CMD_VIDEO_APPLY_STATE_CHANGES,
|
||||
/* Set video blocking state. */
|
||||
EVENT_CMD_VIDEO_SET_BLOCKING_STATE,
|
||||
/* Set video nonblocking state. */
|
||||
EVENT_CMD_VIDEO_SET_NONBLOCKING_STATE,
|
||||
/* Sets current aspect ratio index. */
|
||||
EVENT_CMD_VIDEO_SET_ASPECT_RATIO,
|
||||
EVENT_CMD_RESET_CONTEXT,
|
||||
/* Restarts RetroArch. */
|
||||
EVENT_CMD_RESTART_RETROARCH,
|
||||
/* Force-quit RetroArch. */
|
||||
EVENT_CMD_QUIT_RETROARCH,
|
||||
/* Shutdown the OS */
|
||||
EVENT_CMD_SHUTDOWN,
|
||||
/* Reboot the OS */
|
||||
EVENT_CMD_REBOOT,
|
||||
/* Resume RetroArch when in menu. */
|
||||
EVENT_CMD_RESUME,
|
||||
/* Toggles pause. */
|
||||
EVENT_CMD_PAUSE_TOGGLE,
|
||||
/* Pauses RetroArch. */
|
||||
EVENT_CMD_UNPAUSE,
|
||||
/* Unpauses retroArch. */
|
||||
EVENT_CMD_PAUSE,
|
||||
EVENT_CMD_PAUSE_CHECKS,
|
||||
EVENT_CMD_MENU_SAVE_CURRENT_CONFIG,
|
||||
EVENT_CMD_MENU_SAVE_CONFIG,
|
||||
EVENT_CMD_MENU_PAUSE_LIBRETRO,
|
||||
/* Toggles menu on/off. */
|
||||
EVENT_CMD_MENU_TOGGLE,
|
||||
EVENT_CMD_MENU_REFRESH,
|
||||
/* Applies shader changes. */
|
||||
EVENT_CMD_SHADERS_APPLY_CHANGES,
|
||||
/* Initializes shader directory. */
|
||||
EVENT_CMD_SHADER_DIR_INIT,
|
||||
/* Deinitializes shader directory. */
|
||||
EVENT_CMD_SHADER_DIR_DEINIT,
|
||||
/* Initializes controllers. */
|
||||
EVENT_CMD_CONTROLLERS_INIT,
|
||||
EVENT_CMD_SAVEFILES,
|
||||
/* Initializes savefiles. */
|
||||
EVENT_CMD_SAVEFILES_INIT,
|
||||
/* Deinitializes savefiles. */
|
||||
EVENT_CMD_SAVEFILES_DEINIT,
|
||||
/* Initializes cheats. */
|
||||
EVENT_CMD_CHEATS_INIT,
|
||||
/* Deinitializes cheats. */
|
||||
EVENT_CMD_CHEATS_DEINIT,
|
||||
/* Apply cheats. */
|
||||
EVENT_CMD_CHEATS_APPLY,
|
||||
/* Deinitializes network system. */
|
||||
EVENT_CMD_NETWORK_DEINIT,
|
||||
/* Initializes network system. */
|
||||
EVENT_CMD_NETWORK_INIT,
|
||||
/* Initializes netplay system. */
|
||||
EVENT_CMD_NETPLAY_INIT,
|
||||
/* Deinitializes netplay system. */
|
||||
EVENT_CMD_NETPLAY_DEINIT,
|
||||
/* Flip netplay players. */
|
||||
EVENT_CMD_NETPLAY_FLIP_PLAYERS,
|
||||
/* Initializes BSV movie. */
|
||||
EVENT_CMD_BSV_MOVIE_INIT,
|
||||
/* Deinitializes BSV movie. */
|
||||
EVENT_CMD_BSV_MOVIE_DEINIT,
|
||||
/* Initializes command interface. */
|
||||
EVENT_CMD_COMMAND_INIT,
|
||||
/* Deinitialize command interface. */
|
||||
EVENT_CMD_COMMAND_DEINIT,
|
||||
/* Initializes remote gamepad interface. */
|
||||
EVENT_CMD_REMOTE_INIT,
|
||||
/* Deinitializes remote gamepad interface. */
|
||||
EVENT_CMD_REMOTE_DEINIT,
|
||||
/* Reinitializes audio driver. */
|
||||
EVENT_CMD_AUDIO_REINIT,
|
||||
/* Resizes windowed scale. Will reinitialize video driver. */
|
||||
EVENT_CMD_RESIZE_WINDOWED_SCALE,
|
||||
/* Deinitializes temporary content. */
|
||||
EVENT_CMD_TEMPORARY_CONTENT_DEINIT,
|
||||
EVENT_CMD_SUBSYSTEM_FULLPATHS_DEINIT,
|
||||
EVENT_CMD_LOG_FILE_DEINIT,
|
||||
/* Toggles disk eject. */
|
||||
EVENT_CMD_DISK_EJECT_TOGGLE,
|
||||
/* Cycle to next disk. */
|
||||
EVENT_CMD_DISK_NEXT,
|
||||
/* Cycle to previous disk. */
|
||||
EVENT_CMD_DISK_PREV,
|
||||
/* Appends disk image to disk image list. */
|
||||
EVENT_CMD_DISK_APPEND_IMAGE,
|
||||
/* Stops rumbling. */
|
||||
EVENT_CMD_RUMBLE_STOP,
|
||||
/* Toggles mouse grab. */
|
||||
EVENT_CMD_GRAB_MOUSE_TOGGLE,
|
||||
/* Toggles fullscreen mode. */
|
||||
EVENT_CMD_FULLSCREEN_TOGGLE,
|
||||
EVENT_CMD_PERFCNT_REPORT_FRONTEND_LOG,
|
||||
EVENT_CMD_VOLUME_UP,
|
||||
EVENT_CMD_VOLUME_DOWN,
|
||||
EVENT_CMD_EXEC
|
||||
};
|
||||
|
||||
/**
|
||||
* event_command:
|
||||
* @cmd : Command index.
|
||||
*
|
||||
* Performs RetroArch command with index @cmd.
|
||||
*
|
||||
* Returns: true (1) on success, otherwise false (0).
|
||||
**/
|
||||
bool event_cmd_ctl(enum event_command action, void *data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+22
-3
@@ -29,6 +29,7 @@ enum
|
||||
{
|
||||
VIDEO_GL = 0,
|
||||
VIDEO_VULKAN,
|
||||
VIDEO_DRM,
|
||||
VIDEO_XVIDEO,
|
||||
VIDEO_SDL,
|
||||
VIDEO_SDL2,
|
||||
@@ -131,7 +132,9 @@ enum
|
||||
RECORD_NULL
|
||||
};
|
||||
|
||||
#ifdef GEKKO
|
||||
#if defined(HW_RVL)
|
||||
#define MAX_GAMMA_SETTING 30
|
||||
#elif defined(GEKKO)
|
||||
#define MAX_GAMMA_SETTING 2
|
||||
#else
|
||||
#define MAX_GAMMA_SETTING 1
|
||||
@@ -321,7 +324,7 @@ enum
|
||||
|
||||
#if defined(HAVE_XUI)
|
||||
#define MENU_DEFAULT_DRIVER MENU_XUI
|
||||
#elif defined(IOS) || defined(ANDROID)
|
||||
#elif defined(IOS) || defined(ANDROID) || defined(__QNX__)
|
||||
#define MENU_DEFAULT_DRIVER MENU_MATERIALUI
|
||||
#elif defined(__MACH__) && defined(HAVE_XMB) || defined(__CELLOS_LV2__)
|
||||
#define MENU_DEFAULT_DRIVER MENU_XMB
|
||||
@@ -409,6 +412,8 @@ static const bool disable_composition = false;
|
||||
/* Video VSYNC (recommended) */
|
||||
static const bool vsync = true;
|
||||
|
||||
static const unsigned max_swapchain_images = 3;
|
||||
|
||||
/* Attempts to hard-synchronize CPU and GPU.
|
||||
* Can reduce latency at cost of performance. */
|
||||
static const bool hard_sync = false;
|
||||
@@ -507,11 +512,15 @@ static const bool default_overlay_enable = false;
|
||||
static const bool overlay_hide_in_menu = true;
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
#include "menu/menu_display.h"
|
||||
|
||||
static bool default_block_config_read = true;
|
||||
|
||||
static unsigned xmb_scale_factor = 100;
|
||||
static unsigned xmb_alpha_factor = 75;
|
||||
static unsigned xmb_theme = 0;
|
||||
|
||||
static unsigned xmb_icon_theme = XMB_ICON_THEME_MONOCHROME;
|
||||
static unsigned xmb_theme = XMB_THEME_ELECTRIC_BLUE;
|
||||
|
||||
#ifdef HAVE_LAKKA
|
||||
static bool xmb_shadows_enable = false;
|
||||
@@ -519,13 +528,21 @@ static bool xmb_shadows_enable = false;
|
||||
static bool xmb_shadows_enable = true;
|
||||
#endif
|
||||
|
||||
static float menu_wallpaper_opacity = 0.300;
|
||||
|
||||
static float menu_footer_opacity = 1.000;
|
||||
|
||||
static float menu_header_opacity = 1.000;
|
||||
|
||||
static unsigned menu_background_gradient = 4;
|
||||
|
||||
#if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL) || defined(HAVE_VULKAN)
|
||||
#if defined(HAVE_OPENGLES2) || defined(OSX_PPC)
|
||||
static unsigned menu_shader_pipeline = 1;
|
||||
#else
|
||||
static unsigned menu_shader_pipeline = 2;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static bool show_advanced_settings = true;
|
||||
static const uint32_t menu_entry_normal_color = 0xffffffff;
|
||||
@@ -780,6 +797,8 @@ static const unsigned input_max_users = 5;
|
||||
|
||||
static const unsigned input_poll_type_behavior = 2;
|
||||
|
||||
static const unsigned input_bind_timeout = 5;
|
||||
|
||||
static const unsigned menu_thumbnails_default = 3;
|
||||
|
||||
#ifdef IOS
|
||||
|
||||
+20
-2
@@ -32,7 +32,7 @@ static const bool _network_command_supp = true;
|
||||
static const bool _network_command_supp = false;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_NETWORK_GAMEPAD
|
||||
#ifdef HAVE_NETWORKGAMEPAD
|
||||
static const bool _network_gamepad_supp = true;
|
||||
#else
|
||||
static const bool _network_gamepad_supp = false;
|
||||
@@ -80,7 +80,7 @@ static const bool _vulkan_supp = true;
|
||||
static const bool _vulkan_supp = false;
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_OPENGLES) || defined(HAVE_OPENGLES2) || defined(HAVE_OPENGLES3)
|
||||
#if defined(HAVE_OPENGLES) || defined(HAVE_OPENGLES2) || defined(HAVE_OPENGLES3) || defined(HAVE_OPENGLES_3_1) || defined(HAVE_OPENGLES_3_2)
|
||||
static const bool _opengles_supp = true;
|
||||
#else
|
||||
static const bool _opengles_supp = false;
|
||||
@@ -302,6 +302,24 @@ static const bool _rpng_supp = true;
|
||||
static const bool _rpng_supp = false;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_RJPEG
|
||||
static const bool _rjpeg_supp = true;
|
||||
#else
|
||||
static const bool _rjpeg_supp = false;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_RBMP
|
||||
static const bool _rbmp_supp = true;
|
||||
#else
|
||||
static const bool _rbmp_supp = false;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_RTGA
|
||||
static const bool _rtga_supp = true;
|
||||
#else
|
||||
static const bool _rtga_supp = false;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CORETEXT
|
||||
static const bool _coretext_supp = true;
|
||||
#else
|
||||
|
||||
+56
-36
@@ -25,36 +25,6 @@
|
||||
|
||||
#include "config_file_userdata.h"
|
||||
|
||||
#define get_array_setup() \
|
||||
char key[2][256]; \
|
||||
bool got; \
|
||||
struct config_file_userdata *usr = (struct config_file_userdata*)userdata; \
|
||||
char *str = NULL; \
|
||||
fill_pathname_join_delim(key[0], usr->prefix[0], key_str, '_', sizeof(key[0])); \
|
||||
fill_pathname_join_delim(key[1], usr->prefix[1], key_str, '_', sizeof(key[1])); \
|
||||
got = config_get_string(usr->conf, key[0], &str); \
|
||||
got = got || config_get_string(usr->conf, key[1], &str);
|
||||
|
||||
#define get_array_body(T) \
|
||||
if (got) \
|
||||
{ \
|
||||
unsigned i; \
|
||||
struct string_list *list = string_split(str, " "); \
|
||||
*values = (T*)calloc(list->size, sizeof(T)); \
|
||||
for (i = 0; i < list->size; i++) \
|
||||
(*values)[i] = (T)strtod(list->elems[i].data, NULL); \
|
||||
*out_num_values = list->size; \
|
||||
string_list_free(list); \
|
||||
return true; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
*values = (T*)calloc(num_default_values, sizeof(T)); \
|
||||
memcpy(*values, default_values, sizeof(T) * num_default_values); \
|
||||
*out_num_values = num_default_values; \
|
||||
return false; \
|
||||
}
|
||||
|
||||
int config_userdata_get_float(void *userdata, const char *key_str,
|
||||
float *value, float default_value)
|
||||
{
|
||||
@@ -95,24 +65,74 @@ int config_userdata_get_float_array(void *userdata, const char *key_str,
|
||||
float **values, unsigned *out_num_values,
|
||||
const float *default_values, unsigned num_default_values)
|
||||
{
|
||||
get_array_setup()
|
||||
get_array_body(float)
|
||||
char key[2][256];
|
||||
struct config_file_userdata *usr = (struct config_file_userdata*)userdata;
|
||||
char *str = NULL;
|
||||
|
||||
fill_pathname_join_delim(key[0], usr->prefix[0], key_str, '_', sizeof(key[0]));
|
||||
fill_pathname_join_delim(key[1], usr->prefix[1], key_str, '_', sizeof(key[1]));
|
||||
|
||||
if ( config_get_string(usr->conf, key[0], &str) ||
|
||||
config_get_string(usr->conf, key[1], &str))
|
||||
{
|
||||
unsigned i;
|
||||
struct string_list *list = string_split(str, " ");
|
||||
*values = (float*)calloc(list->size, sizeof(float));
|
||||
for (i = 0; i < list->size; i++)
|
||||
(*values)[i] = (float)strtod(list->elems[i].data, NULL);
|
||||
*out_num_values = list->size;
|
||||
string_list_free(list);
|
||||
free(str);
|
||||
return true;
|
||||
}
|
||||
|
||||
*values = (float*)calloc(num_default_values, sizeof(float));
|
||||
memcpy(*values, default_values, sizeof(float) * num_default_values);
|
||||
*out_num_values = num_default_values;
|
||||
return false;
|
||||
}
|
||||
|
||||
int config_userdata_get_int_array(void *userdata, const char *key_str,
|
||||
int **values, unsigned *out_num_values,
|
||||
const int *default_values, unsigned num_default_values)
|
||||
{
|
||||
get_array_setup()
|
||||
get_array_body(int)
|
||||
char key[2][256];
|
||||
struct config_file_userdata *usr = (struct config_file_userdata*)userdata;
|
||||
char *str = NULL;
|
||||
fill_pathname_join_delim(key[0], usr->prefix[0], key_str, '_', sizeof(key[0]));
|
||||
fill_pathname_join_delim(key[1], usr->prefix[1], key_str, '_', sizeof(key[1]));
|
||||
|
||||
if ( config_get_string(usr->conf, key[0], &str) ||
|
||||
config_get_string(usr->conf, key[1], &str))
|
||||
{
|
||||
unsigned i;
|
||||
struct string_list *list = string_split(str, " ");
|
||||
*values = (int*)calloc(list->size, sizeof(int));
|
||||
for (i = 0; i < list->size; i++)
|
||||
(*values)[i] = (int)strtod(list->elems[i].data, NULL);
|
||||
*out_num_values = list->size;
|
||||
string_list_free(list);
|
||||
free(str);
|
||||
return true;
|
||||
}
|
||||
|
||||
*values = (int*)calloc(num_default_values, sizeof(int));
|
||||
memcpy(*values, default_values, sizeof(int) * num_default_values);
|
||||
*out_num_values = num_default_values;
|
||||
return false;
|
||||
}
|
||||
|
||||
int config_userdata_get_string(void *userdata, const char *key_str,
|
||||
char **output, const char *default_output)
|
||||
{
|
||||
get_array_setup()
|
||||
char key[2][256];
|
||||
struct config_file_userdata *usr = (struct config_file_userdata*)userdata;
|
||||
char *str = NULL;
|
||||
fill_pathname_join_delim(key[0], usr->prefix[0], key_str, '_', sizeof(key[0]));
|
||||
fill_pathname_join_delim(key[1], usr->prefix[1], key_str, '_', sizeof(key[1]));
|
||||
|
||||
if (got)
|
||||
if ( config_get_string(usr->conf, key[0], &str) ||
|
||||
config_get_string(usr->conf, key[1], &str))
|
||||
{
|
||||
*output = str;
|
||||
return true;
|
||||
|
||||
+637
-408
File diff suppressed because it is too large.
Load diff
+44
-14
@@ -20,6 +20,7 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include <boolean.h>
|
||||
#include <retro_common_api.h>
|
||||
|
||||
#include "gfx/video_driver.h"
|
||||
#include "driver.h"
|
||||
@@ -28,9 +29,7 @@
|
||||
#define MAX_USERS 16
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
/* All config related settings go here. */
|
||||
|
||||
@@ -56,6 +55,7 @@ typedef struct settings
|
||||
bool vsync;
|
||||
bool hard_sync;
|
||||
bool black_frame_insertion;
|
||||
unsigned max_swapchain_images;
|
||||
unsigned swap_interval;
|
||||
unsigned hard_sync_frames;
|
||||
unsigned frame_delay;
|
||||
@@ -121,6 +121,21 @@ typedef struct settings
|
||||
unsigned thumbnails;
|
||||
bool throttle;
|
||||
|
||||
struct
|
||||
{
|
||||
float opacity;
|
||||
} wallpaper;
|
||||
|
||||
struct
|
||||
{
|
||||
float opacity;
|
||||
} footer;
|
||||
|
||||
struct
|
||||
{
|
||||
float opacity;
|
||||
} header;
|
||||
|
||||
struct
|
||||
{
|
||||
bool enable;
|
||||
@@ -158,15 +173,24 @@ typedef struct settings
|
||||
unsigned entry_normal_color;
|
||||
unsigned entry_hover_color;
|
||||
unsigned title_color;
|
||||
unsigned xmb_scale_factor;
|
||||
unsigned xmb_alpha_factor;
|
||||
unsigned xmb_theme;
|
||||
unsigned background_gradient;
|
||||
bool xmb_shadows_enable;
|
||||
unsigned shader_pipeline;
|
||||
char xmb_font[PATH_MAX_LENGTH];
|
||||
bool throttle_framerate;
|
||||
bool linear_filter;
|
||||
|
||||
struct
|
||||
{
|
||||
unsigned shader_pipeline;
|
||||
char font[PATH_MAX_LENGTH];
|
||||
unsigned scale_factor;
|
||||
unsigned alpha_factor;
|
||||
unsigned theme;
|
||||
unsigned menu_color_theme;
|
||||
bool shadows_enable;
|
||||
} xmb;
|
||||
|
||||
struct
|
||||
{
|
||||
unsigned menu_color_theme;
|
||||
} materialui;
|
||||
} menu;
|
||||
#endif
|
||||
|
||||
@@ -249,6 +273,7 @@ typedef struct settings
|
||||
float overlay_opacity;
|
||||
float overlay_scale;
|
||||
|
||||
unsigned bind_timeout;
|
||||
bool input_descriptor_label_show;
|
||||
bool input_descriptor_hide_unbound;
|
||||
|
||||
@@ -405,7 +430,9 @@ typedef struct settings
|
||||
unsigned menu_scroll_up_btn;
|
||||
|
||||
char username[32];
|
||||
#ifdef HAVE_LANGEXTRA
|
||||
unsigned int user_language;
|
||||
#endif
|
||||
|
||||
bool config_save_on_exit;
|
||||
|
||||
@@ -560,14 +587,17 @@ bool config_save_autoconf_profile(const char *path, unsigned user);
|
||||
**/
|
||||
bool config_save_file(const char *path);
|
||||
|
||||
bool config_realloc(void);
|
||||
/* Replaces currently loaded configuration file with
|
||||
* another one. Will load a dummy core to flush state
|
||||
* properly. */
|
||||
bool config_replace(char *path);
|
||||
|
||||
bool config_init(void);
|
||||
|
||||
void config_free(void);
|
||||
|
||||
settings_t *config_get_ptr(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
@@ -23,71 +23,13 @@
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <boolean.h>
|
||||
#include <retro_common_api.h>
|
||||
|
||||
#include "frontend/frontend_driver.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
enum content_ctl_state
|
||||
{
|
||||
CONTENT_CTL_NONE = 0,
|
||||
|
||||
CONTENT_CTL_IS_INITED,
|
||||
|
||||
CONTENT_CTL_DOES_NOT_NEED_CONTENT,
|
||||
|
||||
CONTENT_CTL_SET_DOES_NOT_NEED_CONTENT,
|
||||
|
||||
CONTENT_CTL_UNSET_DOES_NOT_NEED_CONTENT,
|
||||
|
||||
/* Initializes and loads a content file for the currently
|
||||
* selected libretro core. */
|
||||
CONTENT_CTL_INIT,
|
||||
|
||||
CONTENT_CTL_DEINIT,
|
||||
|
||||
/* Loads content file and starts up RetroArch.
|
||||
* If no content file can be loaded, will start up RetroArch
|
||||
* as-is. */
|
||||
CONTENT_CTL_LOAD,
|
||||
|
||||
CONTENT_CTL_GET_CRC,
|
||||
|
||||
/* Load a RAM state from disk to memory. */
|
||||
CONTENT_CTL_LOAD_RAM_FILE,
|
||||
|
||||
/* Save a RAM state from memory to disk. */
|
||||
CONTENT_CTL_SAVE_RAM_FILE,
|
||||
|
||||
/* Load a state from disk to memory. */
|
||||
CONTENT_CTL_LOAD_STATE,
|
||||
|
||||
/* Save a state from memory to disk. */
|
||||
CONTENT_CTL_SAVE_STATE,
|
||||
|
||||
/* Frees temporary content handle. */
|
||||
CONTENT_CTL_TEMPORARY_FREE,
|
||||
|
||||
CONTENT_CTL_STREAM_INIT,
|
||||
|
||||
CONTENT_CTL_STREAM_CRC_CALCULATE
|
||||
};
|
||||
|
||||
typedef struct ram_type
|
||||
{
|
||||
const char *path;
|
||||
int type;
|
||||
} ram_type_t;
|
||||
|
||||
typedef struct content_stream
|
||||
{
|
||||
uint32_t a;
|
||||
const uint8_t *b;
|
||||
size_t c;
|
||||
uint32_t crc;
|
||||
} content_stream_t;
|
||||
typedef struct ram_type ram_type_t;
|
||||
|
||||
typedef struct content_ctx_info
|
||||
{
|
||||
@@ -97,13 +39,50 @@ typedef struct content_ctx_info
|
||||
environment_get_t environ_get; /* Function passed for environment_get function */
|
||||
} content_ctx_info_t;
|
||||
|
||||
void content_push_to_history_playlist(bool do_push,
|
||||
const char *path, void *data);
|
||||
/* Load a RAM state from disk to memory. */
|
||||
bool content_load_ram_file(unsigned slot);
|
||||
|
||||
bool content_ctl(enum content_ctl_state state, void *data);
|
||||
/* Save a RAM state from memory to disk. */
|
||||
bool content_save_ram_file(unsigned slot);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/* Load a state from disk to memory. */
|
||||
bool content_load_state(const char* path, bool load_to_backup_buffer);
|
||||
|
||||
/* Save a state from memory to disk. */
|
||||
bool content_save_state(const char *path, bool save_to_disk);
|
||||
|
||||
/* Copy a save state. */
|
||||
bool content_rename_state(const char *origin, const char *dest);
|
||||
|
||||
/* Undoes the last load state operation that was done */
|
||||
bool content_undo_load_state(void);
|
||||
|
||||
/* Restores the last savestate file which was overwritten */
|
||||
bool content_undo_save_state(void);
|
||||
|
||||
bool content_does_not_need_content(void);
|
||||
|
||||
void content_set_does_not_need_content(void);
|
||||
|
||||
void content_unset_does_not_need_content(void);
|
||||
|
||||
bool content_get_crc(uint32_t **content_crc_ptr);
|
||||
|
||||
bool content_is_inited(void);
|
||||
|
||||
void content_deinit(void);
|
||||
|
||||
/* Initializes and loads a content file for the currently
|
||||
* selected libretro core. */
|
||||
bool content_init(void);
|
||||
|
||||
/* Resets the state and savefile backup buffers */
|
||||
bool content_reset_savestate_backups(void);
|
||||
|
||||
/* Checks if the buffers are empty */
|
||||
bool content_undo_load_buf_is_empty(void);
|
||||
bool content_undo_save_buf_is_empty(void);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
@@ -15,16 +15,16 @@
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _RETRO_IMPLEMENTATION_V1_H
|
||||
#define _RETRO_IMPLEMENTATION_V1_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#ifndef _LIBRETRO_CORE_IMPL_H
|
||||
#define _LIBRETRO_CORE_IMPL_H
|
||||
|
||||
#include <boolean.h>
|
||||
#include <libretro.h>
|
||||
#include <retro_common_api.h>
|
||||
|
||||
#include "libretro.h"
|
||||
#include "core_type.h"
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
enum
|
||||
{
|
||||
@@ -40,83 +40,6 @@ enum
|
||||
POLL_TYPE_LATE
|
||||
};
|
||||
|
||||
enum core_ctl_state
|
||||
{
|
||||
CORE_CTL_NONE = 0,
|
||||
|
||||
CORE_CTL_INIT,
|
||||
|
||||
CORE_CTL_DEINIT,
|
||||
|
||||
|
||||
CORE_CTL_SET_CBS,
|
||||
|
||||
CORE_CTL_SET_CBS_REWIND,
|
||||
|
||||
CORE_CTL_SET_POLL_TYPE,
|
||||
|
||||
/* Runs the core for one frame. */
|
||||
CORE_CTL_RETRO_RUN,
|
||||
|
||||
CORE_CTL_RETRO_INIT,
|
||||
|
||||
CORE_CTL_RETRO_DEINIT,
|
||||
|
||||
CORE_CTL_RETRO_UNLOAD_GAME,
|
||||
|
||||
CORE_CTL_RETRO_RESET,
|
||||
|
||||
CORE_CTL_RETRO_GET_SYSTEM_AV_INFO,
|
||||
|
||||
CORE_CTL_RETRO_CTX_FRAME_CB,
|
||||
|
||||
CORE_CTL_RETRO_CTX_POLL_CB,
|
||||
|
||||
CORE_CTL_RETRO_SET_ENVIRONMENT,
|
||||
|
||||
CORE_CTL_RETRO_SERIALIZE_SIZE,
|
||||
|
||||
CORE_CTL_RETRO_SERIALIZE,
|
||||
|
||||
CORE_CTL_RETRO_UNSERIALIZE,
|
||||
|
||||
CORE_CTL_RETRO_SYMBOLS_INIT,
|
||||
|
||||
CORE_CTL_RETRO_CHEAT_SET,
|
||||
|
||||
CORE_CTL_RETRO_CHEAT_RESET,
|
||||
|
||||
CORE_CTL_RETRO_SET_INPUT_STATE,
|
||||
|
||||
CORE_CTL_RETRO_API_VERSION,
|
||||
|
||||
/* Compare libretro core API version against API version
|
||||
* used by RetroArch.
|
||||
*
|
||||
* TODO - when libretro v2 gets added, allow for switching
|
||||
* between libretro version backend dynamically.
|
||||
*/
|
||||
CORE_CTL_VERIFY_API_VERSION,
|
||||
|
||||
CORE_CTL_RETRO_GET_MEMORY,
|
||||
|
||||
/* Initialize system A/V information. */
|
||||
CORE_CTL_INIT_SYSTEM_AV_INFO,
|
||||
|
||||
/* Get system A/V information. */
|
||||
CORE_CTL_RETRO_GET_SYSTEM_INFO,
|
||||
|
||||
CORE_CTL_RETRO_LOAD_GAME,
|
||||
|
||||
CORE_CTL_RETRO_SET_CONTROLLER_PORT_DEVICE,
|
||||
|
||||
CORE_CTL_HAS_SET_INPUT_DESCRIPTORS,
|
||||
|
||||
CORE_CTL_SET_INPUT_DESCRIPTORS,
|
||||
|
||||
CORE_CTL_UNSET_INPUT_DESCRIPTORS
|
||||
};
|
||||
|
||||
typedef struct retro_ctx_input_state_info
|
||||
{
|
||||
retro_input_state_t cb;
|
||||
@@ -188,10 +111,77 @@ typedef struct retro_callbacks
|
||||
retro_input_poll_t poll_cb;
|
||||
} retro_callbacks_t;
|
||||
|
||||
bool core_ctl(enum core_ctl_state state, void *data);
|
||||
bool core_load(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
bool core_unload(void);
|
||||
|
||||
bool core_set_default_callbacks(void *data);
|
||||
|
||||
bool core_set_rewind_callbacks(void);
|
||||
|
||||
bool core_set_poll_type(unsigned *type);
|
||||
|
||||
/* Runs the core for one frame. */
|
||||
bool core_run(void);
|
||||
|
||||
bool core_init(void);
|
||||
|
||||
bool core_deinit(void *data);
|
||||
|
||||
bool core_unload_game(void);
|
||||
|
||||
bool core_reset(void);
|
||||
|
||||
bool core_frame(retro_ctx_frame_info_t *info);
|
||||
|
||||
bool core_poll(void);
|
||||
|
||||
bool core_set_environment(retro_ctx_environ_info_t *info);
|
||||
|
||||
bool core_serialize_size(retro_ctx_size_info_t *info);
|
||||
|
||||
bool core_serialize(retro_ctx_serialize_info_t *info);
|
||||
|
||||
bool core_unserialize(retro_ctx_serialize_info_t *info);
|
||||
|
||||
bool core_init_symbols(enum rarch_core_type *type);
|
||||
|
||||
bool core_set_cheat(retro_ctx_cheat_info_t *info);
|
||||
|
||||
bool core_reset_cheat(void);
|
||||
|
||||
bool core_api_version(retro_ctx_api_info_t *api);
|
||||
|
||||
/* Compare libretro core API version against API version
|
||||
* used by RetroArch.
|
||||
*
|
||||
* TODO - when libretro v2 gets added, allow for switching
|
||||
* between libretro version backend dynamically.
|
||||
*/
|
||||
bool core_verify_api_version(void);
|
||||
|
||||
bool core_get_memory(retro_ctx_memory_info_t *info);
|
||||
|
||||
/* Initialize system A/V information. */
|
||||
bool core_get_system_av_info(struct retro_system_av_info *av_info);
|
||||
|
||||
/* Get system A/V information. */
|
||||
bool core_get_system_info(struct retro_system_info *system);
|
||||
|
||||
bool core_load_game(retro_ctx_load_content_info_t *load_info);
|
||||
|
||||
bool core_set_controller_port_device(retro_ctx_controller_info_t *pad);
|
||||
|
||||
bool core_has_set_input_descriptor(void);
|
||||
|
||||
void core_set_input_descriptors(void);
|
||||
|
||||
void core_unset_input_descriptors(void);
|
||||
|
||||
bool core_uninit_libretro_callbacks(void);
|
||||
|
||||
void core_set_input_state(retro_ctx_input_state_info_t *info);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
+409
@@ -0,0 +1,409 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
* Copyright (C) 2012-2015 - Michael Lelli
|
||||
*
|
||||
* 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 <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <retro_inline.h>
|
||||
#include <boolean.h>
|
||||
#include <lists/string_list.h>
|
||||
#include <libretro.h>
|
||||
|
||||
#include "dynamic.h"
|
||||
#include "core.h"
|
||||
#include "general.h"
|
||||
#include "msg_hash.h"
|
||||
#include "managers/state_manager.h"
|
||||
#include "system.h"
|
||||
#include "gfx/video_driver.h"
|
||||
#include "audio/audio_driver.h"
|
||||
|
||||
#ifdef HAVE_NETPLAY
|
||||
#include "network/netplay/netplay.h"
|
||||
#endif
|
||||
|
||||
static struct retro_core_t core;
|
||||
static unsigned core_poll_type;
|
||||
static bool core_input_polled;
|
||||
static bool core_has_set_input_descriptors = false;
|
||||
static struct retro_callbacks retro_ctx;
|
||||
|
||||
static void core_input_state_poll_maybe(void)
|
||||
{
|
||||
if (core_poll_type == POLL_TYPE_NORMAL)
|
||||
input_poll();
|
||||
}
|
||||
|
||||
static int16_t core_input_state_poll(unsigned port,
|
||||
unsigned device, unsigned idx, unsigned id)
|
||||
{
|
||||
if (core_poll_type == POLL_TYPE_LATE)
|
||||
{
|
||||
if (!core_input_polled)
|
||||
input_poll();
|
||||
|
||||
core_input_polled = true;
|
||||
}
|
||||
return input_state(port, device, idx, id);
|
||||
}
|
||||
|
||||
void core_set_input_state(retro_ctx_input_state_info_t *info)
|
||||
{
|
||||
core.retro_set_input_state(info->cb);
|
||||
}
|
||||
|
||||
/**
|
||||
* core_init_libretro_cbs:
|
||||
* @data : pointer to retro_callbacks object
|
||||
*
|
||||
* Initializes libretro callbacks, and binds the libretro callbacks
|
||||
* to default callback functions.
|
||||
**/
|
||||
static bool core_init_libretro_cbs(void *data)
|
||||
{
|
||||
struct retro_callbacks *cbs = (struct retro_callbacks*)data;
|
||||
#ifdef HAVE_NETPLAY
|
||||
global_t *global = global_get_ptr();
|
||||
#endif
|
||||
|
||||
if (!cbs)
|
||||
return false;
|
||||
|
||||
core.retro_set_video_refresh(video_driver_frame);
|
||||
core.retro_set_audio_sample(audio_driver_sample);
|
||||
core.retro_set_audio_sample_batch(audio_driver_sample_batch);
|
||||
core.retro_set_input_state(core_input_state_poll);
|
||||
core.retro_set_input_poll(core_input_state_poll_maybe);
|
||||
|
||||
core_set_default_callbacks(cbs);
|
||||
|
||||
#ifdef HAVE_NETPLAY
|
||||
if (!netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_DATA_INITED, NULL))
|
||||
return true;
|
||||
|
||||
/* Force normal poll type for netplay. */
|
||||
core_poll_type = POLL_TYPE_NORMAL;
|
||||
|
||||
if (global->netplay.is_spectate)
|
||||
{
|
||||
core.retro_set_input_state(
|
||||
(global->netplay.is_client ?
|
||||
input_state_spectate_client : input_state_spectate)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
core.retro_set_video_refresh(video_frame_net);
|
||||
core.retro_set_audio_sample(audio_sample_net);
|
||||
core.retro_set_audio_sample_batch(audio_sample_batch_net);
|
||||
core.retro_set_input_state(input_state_net);
|
||||
}
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* core_set_default_callbacks:
|
||||
* @data : pointer to retro_callbacks object
|
||||
*
|
||||
* Binds the libretro callbacks to default callback functions.
|
||||
**/
|
||||
bool core_set_default_callbacks(void *data)
|
||||
{
|
||||
struct retro_callbacks *cbs = (struct retro_callbacks*)data;
|
||||
|
||||
if (!cbs)
|
||||
return false;
|
||||
|
||||
cbs->frame_cb = video_driver_frame;
|
||||
cbs->sample_cb = audio_driver_sample;
|
||||
cbs->sample_batch_cb = audio_driver_sample_batch;
|
||||
cbs->state_cb = core_input_state_poll;
|
||||
cbs->poll_cb = input_poll;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool core_deinit(void *data)
|
||||
{
|
||||
struct retro_callbacks *cbs = (struct retro_callbacks*)data;
|
||||
|
||||
if (!cbs)
|
||||
return false;
|
||||
|
||||
cbs->frame_cb = NULL;
|
||||
cbs->sample_cb = NULL;
|
||||
cbs->sample_batch_cb = NULL;
|
||||
cbs->state_cb = NULL;
|
||||
cbs->poll_cb = NULL;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool core_uninit_libretro_callbacks(void)
|
||||
{
|
||||
return core_deinit(&retro_ctx);
|
||||
}
|
||||
|
||||
/**
|
||||
* core_set_rewind_callbacks:
|
||||
*
|
||||
* Sets the audio sampling callbacks based on whether or not
|
||||
* rewinding is currently activated.
|
||||
**/
|
||||
bool core_set_rewind_callbacks(void)
|
||||
{
|
||||
if (state_manager_frame_is_reversed())
|
||||
{
|
||||
core.retro_set_audio_sample(audio_driver_sample_rewind);
|
||||
core.retro_set_audio_sample_batch(audio_driver_sample_batch_rewind);
|
||||
}
|
||||
else
|
||||
{
|
||||
core.retro_set_audio_sample(audio_driver_sample);
|
||||
core.retro_set_audio_sample_batch(audio_driver_sample_batch);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool core_set_cheat(retro_ctx_cheat_info_t *info)
|
||||
{
|
||||
core.retro_cheat_set(info->index, info->enabled, info->code);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool core_reset_cheat(void)
|
||||
{
|
||||
core.retro_cheat_reset();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool core_api_version(retro_ctx_api_info_t *api)
|
||||
{
|
||||
if (!api)
|
||||
return false;
|
||||
api->version = core.retro_api_version();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool core_set_poll_type(unsigned *type)
|
||||
{
|
||||
core_poll_type = *type;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool core_init_symbols(enum rarch_core_type *type)
|
||||
{
|
||||
if (!type)
|
||||
return false;
|
||||
init_libretro_sym(*type, &core);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool core_set_controller_port_device(retro_ctx_controller_info_t *pad)
|
||||
{
|
||||
if (!pad)
|
||||
return false;
|
||||
core.retro_set_controller_port_device(pad->port, pad->device);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool core_get_memory(retro_ctx_memory_info_t *info)
|
||||
{
|
||||
if (!info)
|
||||
return false;
|
||||
info->size = core.retro_get_memory_size(info->id);
|
||||
info->data = core.retro_get_memory_data(info->id);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool core_load_game(retro_ctx_load_content_info_t *load_info)
|
||||
{
|
||||
if (!load_info)
|
||||
return false;
|
||||
|
||||
if (load_info->special)
|
||||
return core.retro_load_game_special(load_info->special->id, load_info->info, load_info->content->size);
|
||||
return core.retro_load_game(*load_info->content->elems[0].data ? load_info->info : NULL);
|
||||
}
|
||||
|
||||
bool core_get_system_info(struct retro_system_info *system)
|
||||
{
|
||||
if (!system)
|
||||
return false;
|
||||
core.retro_get_system_info(system);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool core_unserialize(retro_ctx_serialize_info_t *info)
|
||||
{
|
||||
if (!info)
|
||||
return false;
|
||||
if (!core.retro_unserialize(info->data_const, info->size))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool core_serialize(retro_ctx_serialize_info_t *info)
|
||||
{
|
||||
if (!info)
|
||||
return false;
|
||||
if (!core.retro_serialize(info->data, info->size))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool core_serialize_size(retro_ctx_size_info_t *info)
|
||||
{
|
||||
if (!info)
|
||||
return false;
|
||||
info->size = core.retro_serialize_size();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool core_frame(retro_ctx_frame_info_t *info)
|
||||
{
|
||||
if (!info || !retro_ctx.frame_cb)
|
||||
return false;
|
||||
|
||||
retro_ctx.frame_cb(
|
||||
info->data, info->width, info->height, info->pitch);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool core_poll(void)
|
||||
{
|
||||
if (!retro_ctx.poll_cb)
|
||||
return false;
|
||||
retro_ctx.poll_cb();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool core_set_environment(retro_ctx_environ_info_t *info)
|
||||
{
|
||||
if (!info)
|
||||
return false;
|
||||
core.retro_set_environment(info->env);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool core_get_system_av_info(struct retro_system_av_info *av_info)
|
||||
{
|
||||
if (!av_info)
|
||||
return false;
|
||||
core.retro_get_system_av_info(av_info);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool core_reset(void)
|
||||
{
|
||||
core.retro_reset();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool core_init(void)
|
||||
{
|
||||
core.retro_init();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool core_unload(void)
|
||||
{
|
||||
core.retro_deinit();
|
||||
uninit_libretro_sym(&core);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool core_unload_game(void)
|
||||
{
|
||||
video_driver_deinit_hw_context();
|
||||
audio_driver_stop();
|
||||
core.retro_unload_game();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool core_run(void)
|
||||
{
|
||||
switch (core_poll_type)
|
||||
{
|
||||
case POLL_TYPE_EARLY:
|
||||
input_poll();
|
||||
break;
|
||||
case POLL_TYPE_LATE:
|
||||
core_input_polled = false;
|
||||
break;
|
||||
}
|
||||
if (core.retro_run)
|
||||
core.retro_run();
|
||||
if (core_poll_type == POLL_TYPE_LATE && !core_input_polled)
|
||||
input_poll();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool core_load(void)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
core_poll_type = settings->input.poll_type_behavior;
|
||||
|
||||
if (!core_verify_api_version())
|
||||
return false;
|
||||
if (!core_init_libretro_cbs(&retro_ctx))
|
||||
return false;
|
||||
|
||||
core_get_system_av_info(video_viewport_get_system_av_info());
|
||||
runloop_ctl(RUNLOOP_CTL_SET_FRAME_LIMIT, NULL);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool core_verify_api_version(void)
|
||||
{
|
||||
unsigned api_version = core.retro_api_version();
|
||||
RARCH_LOG("%s: %u\n",
|
||||
msg_hash_to_str(MSG_VERSION_OF_LIBRETRO_API),
|
||||
api_version);
|
||||
RARCH_LOG("%s: %u\n",
|
||||
msg_hash_to_str(MSG_COMPILED_AGAINST_API),
|
||||
RETRO_API_VERSION);
|
||||
|
||||
if (api_version != RETRO_API_VERSION)
|
||||
{
|
||||
RARCH_WARN("%s\n", msg_hash_to_str(MSG_LIBRETRO_ABI_BREAK));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool core_has_set_input_descriptor(void)
|
||||
{
|
||||
return core_has_set_input_descriptors;
|
||||
}
|
||||
|
||||
void core_set_input_descriptors(void)
|
||||
{
|
||||
core_has_set_input_descriptors = true;
|
||||
}
|
||||
|
||||
void core_unset_input_descriptors(void)
|
||||
{
|
||||
core_has_set_input_descriptors = false;
|
||||
}
|
||||
+291
-291
@@ -24,6 +24,7 @@
|
||||
|
||||
#include "core_info.h"
|
||||
#include "configuration.h"
|
||||
#include "file_path_special.h"
|
||||
#include "list_special.h"
|
||||
#include "config.def.h"
|
||||
|
||||
@@ -31,8 +32,10 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
static const char *core_info_tmp_path = NULL;
|
||||
static const char *core_info_tmp_path = NULL;
|
||||
static const struct string_list *core_info_tmp_list = NULL;
|
||||
static core_info_t *core_info_current = NULL;
|
||||
static core_info_list_t *core_info_curr_list = NULL;
|
||||
|
||||
static void core_info_list_resolve_all_extensions(
|
||||
core_info_list_t *core_info_list)
|
||||
@@ -81,7 +84,7 @@ static void core_info_list_resolve_all_firmware(
|
||||
core_info_t *info = (core_info_t*)&core_info_list->list[i];
|
||||
config_file_t *config = (config_file_t*)info->config_data;
|
||||
|
||||
if (!info || !config)
|
||||
if (!config)
|
||||
continue;
|
||||
|
||||
if (!config_get_uint(config, "firmware_count", &count))
|
||||
@@ -101,7 +104,7 @@ static void core_info_list_resolve_all_firmware(
|
||||
|
||||
snprintf(path_key, sizeof(path_key), "firmware%u_path", c);
|
||||
snprintf(desc_key, sizeof(desc_key), "firmware%u_desc", c);
|
||||
snprintf(opt_key, sizeof(opt_key), "firmware%u_opt", c);
|
||||
snprintf(opt_key, sizeof(opt_key), "firmware%u_opt", c);
|
||||
|
||||
config_get_string(config, path_key, &info->firmware[c].path);
|
||||
config_get_string(config, desc_key, &info->firmware[c].desc);
|
||||
@@ -121,9 +124,6 @@ static void core_info_list_free(core_info_list_t *core_info_list)
|
||||
{
|
||||
core_info_t *info = (core_info_t*)&core_info_list->list[i];
|
||||
|
||||
if (!info)
|
||||
continue;
|
||||
|
||||
free(info->path);
|
||||
free(info->core_name);
|
||||
free(info->systemname);
|
||||
@@ -162,16 +162,15 @@ static void core_info_list_free(core_info_list_t *core_info_list)
|
||||
static config_file_t *core_info_list_iterate(
|
||||
struct string_list *contents, size_t i)
|
||||
{
|
||||
char info_path_base[PATH_MAX_LENGTH];
|
||||
char info_path[PATH_MAX_LENGTH];
|
||||
settings_t *settings = config_get_ptr();
|
||||
char info_path_base[PATH_MAX_LENGTH] = {0};
|
||||
char info_path[PATH_MAX_LENGTH] = {0};
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
if (!contents->elems[i].data)
|
||||
return NULL;
|
||||
|
||||
fill_pathname_base(info_path_base, contents->elems[i].data,
|
||||
fill_pathname_base_noext(info_path_base, contents->elems[i].data,
|
||||
sizeof(info_path_base));
|
||||
path_remove_extension(info_path_base);
|
||||
|
||||
#if defined(RARCH_MOBILE) || (defined(RARCH_CONSOLE) && !defined(PSP))
|
||||
char *substr = strrchr(info_path_base, '_');
|
||||
@@ -179,66 +178,18 @@ static config_file_t *core_info_list_iterate(
|
||||
*substr = '\0';
|
||||
#endif
|
||||
|
||||
strlcat(info_path_base, ".info", sizeof(info_path_base));
|
||||
strlcat(info_path_base,
|
||||
file_path_str(FILE_PATH_CORE_INFO_EXTENSION),
|
||||
sizeof(info_path_base));
|
||||
|
||||
fill_pathname_join(info_path, (*settings->path.libretro_info) ?
|
||||
fill_pathname_join(info_path,
|
||||
(!string_is_empty(settings->path.libretro_info)) ?
|
||||
settings->path.libretro_info : settings->directory.libretro,
|
||||
info_path_base, sizeof(info_path));
|
||||
|
||||
return config_file_new(info_path);
|
||||
}
|
||||
|
||||
void core_info_get_name(const char *path, char *s, size_t len)
|
||||
{
|
||||
size_t i;
|
||||
core_info_t *core_info = NULL;
|
||||
core_info_list_t *core_info_list = NULL;
|
||||
struct string_list *contents = dir_list_new_special(
|
||||
NULL, DIR_LIST_CORES, NULL);
|
||||
|
||||
if (!contents)
|
||||
return;
|
||||
|
||||
core_info_list = (core_info_list_t*)calloc(1, sizeof(*core_info_list));
|
||||
if (!core_info_list)
|
||||
goto error;
|
||||
|
||||
core_info = (core_info_t*)calloc(contents->size, sizeof(*core_info));
|
||||
if (!core_info)
|
||||
goto error;
|
||||
|
||||
core_info_list->list = core_info;
|
||||
core_info_list->count = contents->size;
|
||||
|
||||
for (i = 0; i < contents->size; i++)
|
||||
{
|
||||
config_file_t *conf = NULL;
|
||||
|
||||
if (!string_is_equal(contents->elems[i].data, path))
|
||||
continue;
|
||||
|
||||
conf = core_info_list_iterate(contents, i);
|
||||
|
||||
if (conf)
|
||||
{
|
||||
config_get_string(conf, "corename",
|
||||
&core_info[i].core_name);
|
||||
core_info[i].config_data = (void*)conf;
|
||||
}
|
||||
|
||||
core_info[i].path = strdup(contents->elems[i].data);
|
||||
|
||||
strlcpy(s, core_info[i].core_name, len);
|
||||
}
|
||||
|
||||
error:
|
||||
if (contents)
|
||||
dir_list_free(contents);
|
||||
contents = NULL;
|
||||
core_info_list_free(core_info_list);
|
||||
}
|
||||
|
||||
|
||||
static core_info_list_t *core_info_list_new(void)
|
||||
{
|
||||
size_t i;
|
||||
@@ -267,6 +218,7 @@ static core_info_list_t *core_info_list_new(void)
|
||||
|
||||
if (conf)
|
||||
{
|
||||
bool tmp_bool = false;
|
||||
unsigned count = 0;
|
||||
|
||||
config_get_string(conf, "display_name",
|
||||
@@ -320,8 +272,9 @@ static core_info_list_t *core_info_list_new(void)
|
||||
core_info[i].notes)
|
||||
core_info[i].note_list = string_split(core_info[i].notes, "|");
|
||||
|
||||
config_get_bool(conf, "supports_no_game",
|
||||
&core_info[i].supports_no_game);
|
||||
if (config_get_bool(conf, "supports_no_game",
|
||||
&tmp_bool))
|
||||
core_info[i].supports_no_game = tmp_bool;
|
||||
|
||||
core_info[i].config_data = conf;
|
||||
}
|
||||
@@ -346,86 +299,6 @@ error:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
size_t core_info_list_num_info_files(core_info_list_t *core_info_list)
|
||||
{
|
||||
size_t i, num = 0;
|
||||
|
||||
if (!core_info_list)
|
||||
return 0;
|
||||
|
||||
for (i = 0; i < core_info_list->count; i++)
|
||||
{
|
||||
config_file_t *conf = (config_file_t*)
|
||||
core_info_list->list[i].config_data;
|
||||
num += !!conf;
|
||||
}
|
||||
|
||||
return num;
|
||||
}
|
||||
|
||||
bool core_info_list_get_display_name(core_info_list_t *core_info_list,
|
||||
const char *path, char *s, size_t len)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
if (!core_info_list)
|
||||
return false;
|
||||
|
||||
for (i = 0; i < core_info_list->count; i++)
|
||||
{
|
||||
const core_info_t *info = &core_info_list->list[i];
|
||||
if (string_is_equal(path_basename(info->path), path_basename(path))
|
||||
&& info->display_name)
|
||||
{
|
||||
strlcpy(s, info->display_name, len);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool core_info_get_display_name(const char *path, char *s, size_t len)
|
||||
{
|
||||
char *core_name = NULL;
|
||||
char *display_name = NULL;
|
||||
config_file_t *conf = NULL;
|
||||
|
||||
if (!path_file_exists(path))
|
||||
return false;
|
||||
|
||||
conf = config_file_new(path);
|
||||
|
||||
if (!conf)
|
||||
goto error;
|
||||
|
||||
config_get_string(conf, "corename",
|
||||
&core_name);
|
||||
|
||||
config_get_string(conf, "display_name",
|
||||
&display_name);
|
||||
|
||||
config_file_free(conf);
|
||||
|
||||
if (!core_name)
|
||||
goto error;
|
||||
if (!conf)
|
||||
goto error;
|
||||
|
||||
snprintf(s, len,"%s",display_name);
|
||||
|
||||
free(core_name);
|
||||
free(display_name);
|
||||
|
||||
return true;
|
||||
|
||||
error:
|
||||
if (core_name)
|
||||
free(core_name);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Shallow-copies internal state.
|
||||
*
|
||||
* Data in *info is invalidated when the
|
||||
@@ -495,71 +368,8 @@ static int core_info_qsort_cmp(const void *a_, const void *b_)
|
||||
return strcasecmp(a->display_name, b->display_name);
|
||||
}
|
||||
|
||||
void core_info_list_get_supported_cores(core_info_list_t *core_info_list,
|
||||
const char *path, const core_info_t **infos, size_t *num_infos)
|
||||
{
|
||||
#ifdef HAVE_ZLIB
|
||||
struct string_list *list = NULL;
|
||||
#endif
|
||||
size_t supported = 0, i;
|
||||
|
||||
if (!core_info_list)
|
||||
return;
|
||||
|
||||
core_info_tmp_path = path;
|
||||
|
||||
#ifdef HAVE_ZLIB
|
||||
if (string_is_equal_noncase(path_get_extension(path), "zip"))
|
||||
list = file_archive_get_file_list(path, NULL);
|
||||
core_info_tmp_list = list;
|
||||
#endif
|
||||
|
||||
/* Let supported core come first in list so we can return
|
||||
* a pointer to them. */
|
||||
qsort(core_info_list->list, core_info_list->count,
|
||||
sizeof(core_info_t), core_info_qsort_cmp);
|
||||
|
||||
for (i = 0; i < core_info_list->count; i++, supported++)
|
||||
{
|
||||
const core_info_t *core = &core_info_list->list[i];
|
||||
|
||||
if (!core)
|
||||
continue;
|
||||
|
||||
if (core_info_does_support_file(core, path))
|
||||
continue;
|
||||
|
||||
#ifdef HAVE_ZLIB
|
||||
if (core_info_does_support_any_file(core, list))
|
||||
continue;
|
||||
#endif
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef HAVE_ZLIB
|
||||
if (list)
|
||||
string_list_free(list);
|
||||
#endif
|
||||
|
||||
*infos = core_info_list->list;
|
||||
*num_infos = supported;
|
||||
}
|
||||
|
||||
core_info_t *core_info_get(core_info_list_t *list, size_t i)
|
||||
{
|
||||
core_info_t *info = NULL;
|
||||
|
||||
if (!list)
|
||||
return NULL;
|
||||
info = (core_info_t*)&list->list[i];
|
||||
if (!info || !info->path)
|
||||
return NULL;
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
static core_info_t *core_info_find(core_info_list_t *list,
|
||||
static core_info_t *core_info_find_internal(
|
||||
core_info_list_t *list,
|
||||
const char *core)
|
||||
{
|
||||
size_t i;
|
||||
@@ -577,10 +387,10 @@ static core_info_t *core_info_find(core_info_list_t *list,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
static bool core_info_list_update_missing_firmware(
|
||||
static bool core_info_list_update_missing_firmware_internal(
|
||||
core_info_list_t *core_info_list,
|
||||
const char *core, const char *systemdir)
|
||||
const char *core,
|
||||
const char *systemdir)
|
||||
{
|
||||
size_t i;
|
||||
char path[PATH_MAX_LENGTH] = {0};
|
||||
@@ -589,7 +399,7 @@ static bool core_info_list_update_missing_firmware(
|
||||
if (!core_info_list || !core)
|
||||
return false;
|
||||
|
||||
info = core_info_find(core_info_list, core);
|
||||
info = core_info_find_internal(core_info_list, core);
|
||||
|
||||
if (!info)
|
||||
return false;
|
||||
@@ -636,7 +446,7 @@ static void core_info_list_get_missing_firmware(
|
||||
*firmware = NULL;
|
||||
*num_firmware = 0;
|
||||
|
||||
if (!(info = core_info_find(core_info_list, core)))
|
||||
if (!(info = core_info_find_internal(core_info_list, core)))
|
||||
return;
|
||||
|
||||
*firmware = info->firmware;
|
||||
@@ -654,88 +464,278 @@ static void core_info_list_get_missing_firmware(
|
||||
}
|
||||
#endif
|
||||
|
||||
bool core_info_ctl(enum core_info_state state, void *data)
|
||||
void core_info_free_current_core(void)
|
||||
{
|
||||
static core_info_t *core_info_current = NULL;
|
||||
static core_info_list_t *core_info_curr_list = NULL;
|
||||
if (core_info_current)
|
||||
free(core_info_current);
|
||||
core_info_current = NULL;
|
||||
}
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case CORE_INFO_CTL_CURRENT_CORE_FREE:
|
||||
if (core_info_current)
|
||||
free(core_info_current);
|
||||
core_info_current = NULL;
|
||||
break;
|
||||
case CORE_INFO_CTL_CURRENT_CORE_INIT:
|
||||
core_info_current = (core_info_t*)calloc(1, sizeof(core_info_t));
|
||||
if (!core_info_current)
|
||||
return false;
|
||||
break;
|
||||
case CORE_INFO_CTL_CURRENT_CORE_GET:
|
||||
{
|
||||
core_info_t **core = (core_info_t**)data;
|
||||
if (!core)
|
||||
return false;
|
||||
*core = core_info_current;
|
||||
}
|
||||
break;
|
||||
case CORE_INFO_CTL_LIST_DEINIT:
|
||||
if (core_info_curr_list)
|
||||
core_info_list_free(core_info_curr_list);
|
||||
core_info_curr_list = NULL;
|
||||
break;
|
||||
case CORE_INFO_CTL_LIST_INIT:
|
||||
core_info_curr_list = core_info_list_new();
|
||||
break;
|
||||
case CORE_INFO_CTL_LIST_GET:
|
||||
{
|
||||
core_info_list_t **core = (core_info_list_t**)data;
|
||||
if (!core)
|
||||
return false;
|
||||
*core = core_info_curr_list;
|
||||
}
|
||||
break;
|
||||
case CORE_INFO_CTL_LIST_UPDATE_MISSING_FIRMWARE:
|
||||
{
|
||||
core_info_ctx_firmware_t *info = (core_info_ctx_firmware_t*)data;
|
||||
if (!info)
|
||||
return false;
|
||||
bool core_info_init_current_core(void)
|
||||
{
|
||||
core_info_current = (core_info_t*)calloc(1, sizeof(core_info_t));
|
||||
if (!core_info_current)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
return core_info_list_update_missing_firmware(core_info_curr_list,
|
||||
info->path, info->directory.system);
|
||||
}
|
||||
case CORE_INFO_CTL_FIND:
|
||||
{
|
||||
core_info_ctx_find_t *info = (core_info_ctx_find_t*)data;
|
||||
if (!info || !core_info_curr_list)
|
||||
return false;
|
||||
info->inf = core_info_find(core_info_curr_list, info->path);
|
||||
if (!info->inf)
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case CORE_INFO_CTL_LOAD:
|
||||
{
|
||||
core_info_t *core_info = NULL;
|
||||
core_info_ctx_find_t *info = (core_info_ctx_find_t*)data;
|
||||
bool core_info_get_current_core(core_info_t **core)
|
||||
{
|
||||
if (!core)
|
||||
return false;
|
||||
*core = core_info_current;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!info)
|
||||
return false;
|
||||
void core_info_deinit_list(void)
|
||||
{
|
||||
if (core_info_curr_list)
|
||||
core_info_list_free(core_info_curr_list);
|
||||
core_info_curr_list = NULL;
|
||||
}
|
||||
|
||||
core_info_ctl(CORE_INFO_CTL_CURRENT_CORE_GET, &core_info);
|
||||
bool core_info_init_list(void)
|
||||
{
|
||||
core_info_curr_list = core_info_list_new();
|
||||
|
||||
if (!core_info_curr_list)
|
||||
return false;
|
||||
if (!core_info_curr_list)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!core_info_list_get_info(core_info_curr_list,
|
||||
core_info, info->path))
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case CORE_INFO_CTL_NONE:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
bool core_info_get_list(core_info_list_t **core)
|
||||
{
|
||||
if (!core)
|
||||
return false;
|
||||
*core = core_info_curr_list;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool core_info_list_update_missing_firmware(core_info_ctx_firmware_t *info)
|
||||
{
|
||||
if (!info)
|
||||
return false;
|
||||
|
||||
return core_info_list_update_missing_firmware_internal(
|
||||
core_info_curr_list,
|
||||
info->path, info->directory.system);
|
||||
}
|
||||
|
||||
bool core_info_load(core_info_ctx_find_t *info)
|
||||
{
|
||||
core_info_t *core_info = NULL;
|
||||
|
||||
if (!info)
|
||||
return false;
|
||||
|
||||
core_info_get_current_core(&core_info);
|
||||
|
||||
if (!core_info_curr_list)
|
||||
return false;
|
||||
|
||||
if (!core_info_list_get_info(core_info_curr_list,
|
||||
core_info, info->path))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool core_info_find(core_info_ctx_find_t *info, const char *core_path)
|
||||
{
|
||||
if (!info || !core_info_curr_list)
|
||||
return false;
|
||||
info->inf = core_info_find_internal(core_info_curr_list, core_path);
|
||||
if (!info->inf)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
core_info_t *core_info_get(core_info_list_t *list, size_t i)
|
||||
{
|
||||
core_info_t *info = NULL;
|
||||
|
||||
if (!list)
|
||||
return NULL;
|
||||
info = (core_info_t*)&list->list[i];
|
||||
if (!info || !info->path)
|
||||
return NULL;
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
void core_info_list_get_supported_cores(core_info_list_t *core_info_list,
|
||||
const char *path, const core_info_t **infos, size_t *num_infos)
|
||||
{
|
||||
#ifdef HAVE_ZLIB
|
||||
struct string_list *list = NULL;
|
||||
#endif
|
||||
size_t supported = 0, i;
|
||||
|
||||
if (!core_info_list)
|
||||
return;
|
||||
|
||||
core_info_tmp_path = path;
|
||||
|
||||
#ifdef HAVE_ZLIB
|
||||
if (string_is_equal_noncase(path_get_extension(path), "zip"))
|
||||
list = file_archive_get_file_list(path, NULL);
|
||||
core_info_tmp_list = list;
|
||||
#endif
|
||||
|
||||
/* Let supported core come first in list so we can return
|
||||
* a pointer to them. */
|
||||
qsort(core_info_list->list, core_info_list->count,
|
||||
sizeof(core_info_t), core_info_qsort_cmp);
|
||||
|
||||
for (i = 0; i < core_info_list->count; i++, supported++)
|
||||
{
|
||||
const core_info_t *core = &core_info_list->list[i];
|
||||
|
||||
if (core_info_does_support_file(core, path))
|
||||
continue;
|
||||
|
||||
#ifdef HAVE_ZLIB
|
||||
if (core_info_does_support_any_file(core, list))
|
||||
continue;
|
||||
#endif
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef HAVE_ZLIB
|
||||
if (list)
|
||||
string_list_free(list);
|
||||
#endif
|
||||
|
||||
*infos = core_info_list->list;
|
||||
*num_infos = supported;
|
||||
}
|
||||
|
||||
void core_info_get_name(const char *path, char *s, size_t len)
|
||||
{
|
||||
size_t i;
|
||||
core_info_t *core_info = NULL;
|
||||
core_info_list_t *core_info_list = NULL;
|
||||
struct string_list *contents = dir_list_new_special(
|
||||
NULL, DIR_LIST_CORES, NULL);
|
||||
|
||||
if (!contents)
|
||||
return;
|
||||
|
||||
core_info_list = (core_info_list_t*)calloc(1, sizeof(*core_info_list));
|
||||
if (!core_info_list)
|
||||
goto error;
|
||||
|
||||
core_info = (core_info_t*)calloc(contents->size, sizeof(*core_info));
|
||||
if (!core_info)
|
||||
goto error;
|
||||
|
||||
core_info_list->list = core_info;
|
||||
core_info_list->count = contents->size;
|
||||
|
||||
for (i = 0; i < contents->size; i++)
|
||||
{
|
||||
config_file_t *conf = NULL;
|
||||
|
||||
if (!string_is_equal(contents->elems[i].data, path))
|
||||
continue;
|
||||
|
||||
conf = core_info_list_iterate(contents, i);
|
||||
|
||||
if (conf)
|
||||
{
|
||||
config_get_string(conf, "corename",
|
||||
&core_info[i].core_name);
|
||||
core_info[i].config_data = (void*)conf;
|
||||
}
|
||||
|
||||
core_info[i].path = strdup(contents->elems[i].data);
|
||||
|
||||
strlcpy(s, core_info[i].core_name, len);
|
||||
}
|
||||
|
||||
error:
|
||||
if (contents)
|
||||
dir_list_free(contents);
|
||||
contents = NULL;
|
||||
core_info_list_free(core_info_list);
|
||||
}
|
||||
|
||||
size_t core_info_list_num_info_files(core_info_list_t *core_info_list)
|
||||
{
|
||||
size_t i, num = 0;
|
||||
|
||||
if (!core_info_list)
|
||||
return 0;
|
||||
|
||||
for (i = 0; i < core_info_list->count; i++)
|
||||
{
|
||||
config_file_t *conf = (config_file_t*)
|
||||
core_info_list->list[i].config_data;
|
||||
num += !!conf;
|
||||
}
|
||||
|
||||
return num;
|
||||
}
|
||||
|
||||
bool core_info_list_get_display_name(core_info_list_t *core_info_list,
|
||||
const char *path, char *s, size_t len)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
if (!core_info_list)
|
||||
return false;
|
||||
|
||||
for (i = 0; i < core_info_list->count; i++)
|
||||
{
|
||||
const core_info_t *info = &core_info_list->list[i];
|
||||
if (string_is_equal(path_basename(info->path), path_basename(path))
|
||||
&& info->display_name)
|
||||
{
|
||||
strlcpy(s, info->display_name, len);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool core_info_get_display_name(const char *path, char *s, size_t len)
|
||||
{
|
||||
char *core_name = NULL;
|
||||
char *display_name = NULL;
|
||||
config_file_t *conf = NULL;
|
||||
|
||||
if (!path_file_exists(path))
|
||||
return false;
|
||||
|
||||
conf = config_file_new(path);
|
||||
|
||||
if (!conf)
|
||||
return false;
|
||||
|
||||
config_get_string(conf, "corename",
|
||||
&core_name);
|
||||
config_get_string(conf, "display_name",
|
||||
&display_name);
|
||||
|
||||
if (!core_name || !display_name)
|
||||
goto error;
|
||||
|
||||
config_file_free(conf);
|
||||
|
||||
snprintf(s, len,"%s",display_name);
|
||||
|
||||
free(core_name);
|
||||
free(display_name);
|
||||
|
||||
return true;
|
||||
|
||||
error:
|
||||
config_file_free(conf);
|
||||
if (core_name)
|
||||
free(core_name);
|
||||
if (display_name)
|
||||
free(display_name);
|
||||
return false;
|
||||
}
|
||||
+20
-21
@@ -21,24 +21,9 @@
|
||||
#include <stddef.h>
|
||||
|
||||
#include <lists/string_list.h>
|
||||
#include <retro_common_api.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum core_info_state
|
||||
{
|
||||
CORE_INFO_CTL_NONE = 0,
|
||||
CORE_INFO_CTL_LIST_DEINIT,
|
||||
CORE_INFO_CTL_LIST_INIT,
|
||||
CORE_INFO_CTL_LIST_GET,
|
||||
CORE_INFO_CTL_LIST_UPDATE_MISSING_FIRMWARE,
|
||||
CORE_INFO_CTL_CURRENT_CORE_FREE,
|
||||
CORE_INFO_CTL_CURRENT_CORE_INIT,
|
||||
CORE_INFO_CTL_CURRENT_CORE_GET,
|
||||
CORE_INFO_CTL_LOAD,
|
||||
CORE_INFO_CTL_FIND
|
||||
};
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -116,10 +101,24 @@ void core_info_get_name(const char *path, char *s, size_t len);
|
||||
|
||||
core_info_t *core_info_get(core_info_list_t *list, size_t i);
|
||||
|
||||
bool core_info_ctl(enum core_info_state action, void *data);
|
||||
void core_info_free_current_core(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
bool core_info_init_current_core(void);
|
||||
|
||||
bool core_info_get_current_core(core_info_t **core);
|
||||
|
||||
void core_info_deinit_list(void);
|
||||
|
||||
bool core_info_init_list(void);
|
||||
|
||||
bool core_info_get_list(core_info_list_t **core);
|
||||
|
||||
bool core_info_list_update_missing_firmware(core_info_ctx_firmware_t *info);
|
||||
|
||||
bool core_info_find(core_info_ctx_find_t *info, const char *name);
|
||||
|
||||
bool core_info_load(core_info_ctx_find_t *info);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif /* CORE_INFO_H_ */
|
||||
+2
-1
@@ -21,7 +21,8 @@ enum rarch_core_type
|
||||
CORE_TYPE_PLAIN = 0,
|
||||
CORE_TYPE_DUMMY,
|
||||
CORE_TYPE_FFMPEG,
|
||||
CORE_TYPE_IMAGEVIEWER
|
||||
CORE_TYPE_IMAGEVIEWER,
|
||||
CORE_TYPE_NETRETROPAD
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -19,8 +19,9 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <libretro.h>
|
||||
|
||||
#include "internal_cores.h"
|
||||
#include "../libretro.h"
|
||||
|
||||
static uint16_t *frame_buf;
|
||||
|
||||
|
||||
+57
-1
@@ -19,7 +19,7 @@
|
||||
#define INTERNAL_CORES_H__
|
||||
|
||||
#include <boolean.h>
|
||||
#include "../libretro.h"
|
||||
#include <libretro.h>
|
||||
|
||||
void libretro_dummy_retro_init(void);
|
||||
|
||||
@@ -184,4 +184,60 @@ size_t libretro_imageviewer_retro_get_memory_size(unsigned id);
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_NETWORKGAMEPAD) && defined(HAVE_NETPLAY)
|
||||
/* Internal networked retropad core. */
|
||||
|
||||
void libretro_netretropad_retro_init(void);
|
||||
|
||||
void libretro_netretropad_retro_deinit(void);
|
||||
|
||||
unsigned libretro_netretropad_retro_api_version(void);
|
||||
|
||||
void libretro_netretropad_retro_get_system_info(struct retro_system_info *info);
|
||||
|
||||
void libretro_netretropad_retro_get_system_av_info(struct retro_system_av_info *info);
|
||||
|
||||
void libretro_netretropad_retro_set_environment(retro_environment_t cb);
|
||||
|
||||
void libretro_netretropad_retro_set_video_refresh(retro_video_refresh_t cb);
|
||||
|
||||
void libretro_netretropad_retro_set_audio_sample(retro_audio_sample_t cb);
|
||||
|
||||
void libretro_netretropad_retro_set_audio_sample_batch(retro_audio_sample_batch_t cb);
|
||||
|
||||
void libretro_netretropad_retro_set_input_poll(retro_input_poll_t cb);
|
||||
|
||||
void libretro_netretropad_retro_set_input_state(retro_input_state_t cb);
|
||||
|
||||
void libretro_netretropad_retro_set_controller_port_device(unsigned port, unsigned device);
|
||||
|
||||
void libretro_netretropad_retro_reset(void);
|
||||
|
||||
void libretro_netretropad_retro_run(void);
|
||||
|
||||
size_t libretro_netretropad_retro_serialize_size(void);
|
||||
|
||||
bool libretro_netretropad_retro_serialize(void *data, size_t size);
|
||||
|
||||
bool libretro_netretropad_retro_unserialize(const void *data, size_t size);
|
||||
|
||||
void libretro_netretropad_retro_cheat_reset(void);
|
||||
|
||||
void libretro_netretropad_retro_cheat_set(unsigned index, bool enabled, const char *code);
|
||||
|
||||
bool libretro_netretropad_retro_load_game(const struct retro_game_info *game);
|
||||
|
||||
bool libretro_netretropad_retro_load_game_special(unsigned game_type,
|
||||
const struct retro_game_info *info, size_t num_info);
|
||||
|
||||
void libretro_netretropad_retro_unload_game(void);
|
||||
|
||||
unsigned libretro_netretropad_retro_get_region(void);
|
||||
|
||||
void *libretro_netretropad_retro_get_memory_data(unsigned id);
|
||||
|
||||
size_t libretro_netretropad_retro_get_memory_size(unsigned id);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -232,12 +232,13 @@ ifeq ($(HAVE_SSA), 1)
|
||||
endif
|
||||
|
||||
LIBRETROCOMM_DIR := ../../libretro-common
|
||||
DEPS_DIR := ../../deps
|
||||
|
||||
LIBAVCODEC_SOURCE :=
|
||||
LIBAVFORMAT_SOURCE :=
|
||||
LIBAVUTIL_SOURCE :=
|
||||
LIBRETRO_SOURCE := ffmpeg_core.c \
|
||||
$(LIBRETROCOMM_DIR)/queues/fifo_buffer.c \
|
||||
$(LIBRETROCOMM_DIR)/queues/fifo_queue.c \
|
||||
$(LIBRETROCOMM_DIR)/rthreads/rthreads.c
|
||||
DEPS_SOURCE :=
|
||||
|
||||
@@ -2165,7 +2166,7 @@ else
|
||||
CFLAGS += -DHAVE_INTRINSICS_NEON=0
|
||||
endif
|
||||
|
||||
CFLAGS += -Ilibretro-common/include
|
||||
CFLAGS += -I$(LIBRETROCOMM_DIR)/include -I$(DEPS_DIR)
|
||||
|
||||
OBJECTS := $(DEPS_SOURCE:.c=.o) $(LIBRETRO_SOURCE:.c=.o) $(FFT_SOURCE:.cpp=.o) $(LIBAVUTIL_SOURCE:.c=.o) $(LIBAVFORMAT_SOURCE:.c=.o) $(LIBSWSCALE_SOURCE:.c=.o) $(LIBAVCODEC_SOURCE:.c=.o) $(LIBSWRESAMPLE_SOURCE:.c=.o)
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ extern "C" {
|
||||
#include <rthreads/rthreads.h>
|
||||
#include <queues/fifo_queue.h>
|
||||
|
||||
#include "libretro.h"
|
||||
#include <libretro.h>
|
||||
#ifdef RARCH_INTERNAL
|
||||
#include "internal_cores.h"
|
||||
#define CORE_PREFIX(s) libretro_ffmpeg_##s
|
||||
@@ -181,9 +181,14 @@ static struct
|
||||
#ifdef HAVE_SSA
|
||||
static void ass_msg_cb(int level, const char *fmt, va_list args, void *data)
|
||||
{
|
||||
char buffer[4096];
|
||||
(void)data;
|
||||
|
||||
if (level < 6)
|
||||
log_cb(RETRO_LOG_INFO, fmt);
|
||||
{
|
||||
vsnprintf(buffer, sizeof(buffer), fmt, args);
|
||||
log_cb(RETRO_LOG_INFO, "%s\n", buffer);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1247,7 +1252,7 @@ static void decode_thread(void *data)
|
||||
decoded_size = frame_size + sizeof(pts);
|
||||
slock_lock(fifo_lock);
|
||||
|
||||
while (!decode_thread_dead
|
||||
while (!decode_thread_dead && (video_decode_fifo != NULL)
|
||||
&& fifo_write_avail(video_decode_fifo) < decoded_size)
|
||||
{
|
||||
if (!main_sleeping)
|
||||
|
||||
@@ -0,0 +1,735 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <glsym/glsym.h>
|
||||
#include <libretro.h>
|
||||
|
||||
#include <retro_miscellaneous.h>
|
||||
#include <filters.h>
|
||||
#include <math/complex.h>
|
||||
|
||||
#define GLM_SWIZZLE
|
||||
#define GLM_FORCE_RADIANS
|
||||
#include <glm/glm.hpp>
|
||||
#include <glm/gtc/matrix_transform.hpp>
|
||||
#include <glm/gtc/type_ptr.hpp>
|
||||
using namespace glm;
|
||||
|
||||
#define GL_DEBUG 0
|
||||
#if GL_DEBUG
|
||||
#define GL_CHECK_ERROR() do { \
|
||||
if (glGetError() != GL_NO_ERROR) \
|
||||
{ \
|
||||
log_cb(RETRO_LOG_ERROR, "GL error at line: %d\n", __LINE__); \
|
||||
abort(); \
|
||||
} \
|
||||
} while(0)
|
||||
#else
|
||||
#define GL_CHECK_ERROR()
|
||||
#endif
|
||||
|
||||
#ifndef M_HALF_PI
|
||||
#define M_HALF_PI 1.57079632679489661923132169163975144
|
||||
#endif
|
||||
|
||||
extern retro_log_printf_t log_cb;
|
||||
|
||||
struct target
|
||||
{
|
||||
GLuint tex;
|
||||
GLuint fbo;
|
||||
};
|
||||
|
||||
struct Pass
|
||||
{
|
||||
struct target target;
|
||||
GLuint parameter_tex;
|
||||
};
|
||||
|
||||
typedef struct GLFFT
|
||||
{
|
||||
GLuint ms_rb_color;
|
||||
GLuint ms_rb_ds;
|
||||
GLuint ms_fbo;
|
||||
|
||||
Pass *passes;
|
||||
unsigned passes_size;
|
||||
|
||||
GLuint input_tex;
|
||||
GLuint window_tex;
|
||||
GLuint prog_real;
|
||||
GLuint prog_complex;
|
||||
GLuint prog_resolve;
|
||||
GLuint prog_blur;
|
||||
|
||||
GLuint quad;
|
||||
GLuint vao;
|
||||
|
||||
unsigned output_ptr;
|
||||
|
||||
struct target output, resolve, blur;
|
||||
|
||||
struct Block
|
||||
{
|
||||
GLuint prog;
|
||||
GLuint vao;
|
||||
GLuint vbo;
|
||||
GLuint ibo;
|
||||
unsigned elems;
|
||||
} block;
|
||||
|
||||
GLuint pbo;
|
||||
GLshort *sliding;
|
||||
unsigned sliding_size;
|
||||
|
||||
unsigned steps;
|
||||
unsigned size;
|
||||
unsigned block_size;
|
||||
unsigned depth;
|
||||
} glfft_t;
|
||||
|
||||
#include "gl_shaders/fft_heightmap.glsl.vert.h"
|
||||
#include "gl_shaders/fft_heightmap.glsl.frag.h"
|
||||
#include "gl_shaders/fft_vertex_program.glsl.vert.h"
|
||||
#include "gl_shaders/fft_fragment_program_resolve.glsl.frag.h"
|
||||
#include "gl_shaders/fft_fragment_program_real.glsl.frag.h"
|
||||
#include "gl_shaders/fft_fragment_program_complex.glsl.frag.h"
|
||||
#include "gl_shaders/fft_fragment_program_blur.glsl.frag.h"
|
||||
|
||||
static GLuint fft_compile_shader(glfft_t *fft, GLenum type, const char *source)
|
||||
{
|
||||
GLint status = 0;
|
||||
GLuint shader = glCreateShader(type);
|
||||
|
||||
glShaderSource(shader, 1, (const GLchar**)&source, NULL);
|
||||
glCompileShader(shader);
|
||||
|
||||
glGetShaderiv(shader, GL_COMPILE_STATUS, &status);
|
||||
|
||||
if (!status)
|
||||
{
|
||||
char log_info[8 * 1024];
|
||||
GLsizei log_len;
|
||||
|
||||
log_cb(RETRO_LOG_ERROR, "Failed to compile.\n");
|
||||
glGetShaderInfoLog(shader, sizeof(log_info), &log_len, log_info);
|
||||
log_cb(RETRO_LOG_ERROR, "ERROR: %s\n", log_info);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return shader;
|
||||
}
|
||||
|
||||
static GLuint fft_compile_program(glfft_t *fft,
|
||||
const char *vertex_source, const char *fragment_source)
|
||||
{
|
||||
GLint status = 0;
|
||||
GLuint prog = glCreateProgram();
|
||||
GLuint vert = fft_compile_shader(fft, GL_VERTEX_SHADER, vertex_source);
|
||||
GLuint frag = fft_compile_shader(fft, GL_FRAGMENT_SHADER, fragment_source);
|
||||
|
||||
glAttachShader(prog, vert);
|
||||
glAttachShader(prog, frag);
|
||||
glLinkProgram(prog);
|
||||
|
||||
glGetProgramiv(prog, GL_LINK_STATUS, &status);
|
||||
|
||||
if (!status)
|
||||
{
|
||||
char log_info[8 * 1024];
|
||||
GLsizei log_len;
|
||||
|
||||
log_cb(RETRO_LOG_ERROR, "Failed to link.\n");
|
||||
glGetProgramInfoLog(prog, sizeof(log_info), &log_len, log_info);
|
||||
log_cb(RETRO_LOG_ERROR, "ERROR: %s\n", log_info);
|
||||
}
|
||||
|
||||
glDeleteShader(vert);
|
||||
glDeleteShader(frag);
|
||||
return prog;
|
||||
}
|
||||
|
||||
static void fft_render(glfft_t *fft, GLuint backbuffer, unsigned width, unsigned height)
|
||||
{
|
||||
mat4 mvp;
|
||||
|
||||
/* Render scene. */
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, fft->ms_fbo ? fft->ms_fbo : backbuffer);
|
||||
glViewport(0, 0, width, height);
|
||||
glClearColor(0.1f, 0.15f, 0.1f, 1.0f);
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
|
||||
|
||||
vec3 eye(0, 80, -60);
|
||||
mvp = perspective((float)M_HALF_PI, (float)width / height, 1.0f, 500.0f) *
|
||||
lookAt(eye, eye + vec3(0.0f, 0.0f, 1.0f), vec3(0.0f, 1.0f, 0.0f));
|
||||
|
||||
glUseProgram(fft->block.prog);
|
||||
glUniformMatrix4fv(glGetUniformLocation(fft->block.prog, "uMVP"),
|
||||
1, GL_FALSE, value_ptr(mvp));
|
||||
glUniform2i(glGetUniformLocation(fft->block.prog, "uOffset"),
|
||||
(-int(fft->block_size) + 1) / 2, fft->output_ptr);
|
||||
glUniform4f(glGetUniformLocation(fft->block.prog, "uHeightmapParams"),
|
||||
-(fft->block_size - 1.0f) / 2.0f, 0.0f, 3.0f, 2.0f);
|
||||
glUniform1f(glGetUniformLocation(fft->block.prog, "uAngleScale"),
|
||||
M_PI / ((fft->block_size - 1) / 2));
|
||||
|
||||
glBindVertexArray(fft->block.vao);
|
||||
glBindTexture(GL_TEXTURE_2D, fft->blur.tex);
|
||||
glDrawElements(GL_TRIANGLE_STRIP, fft->block.elems, GL_UNSIGNED_INT, NULL);
|
||||
glBindVertexArray(0);
|
||||
glUseProgram(0);
|
||||
|
||||
if (fft->ms_fbo)
|
||||
{
|
||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, fft->ms_fbo);
|
||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, backbuffer);
|
||||
glBlitFramebuffer(0, 0, width, height, 0, 0, width, height,
|
||||
GL_COLOR_BUFFER_BIT, GL_NEAREST);
|
||||
|
||||
static const GLenum attachments[] = { GL_COLOR_ATTACHMENT0, GL_DEPTH_STENCIL_ATTACHMENT };
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, fft->ms_fbo);
|
||||
glInvalidateFramebuffer(GL_FRAMEBUFFER, 2, attachments);
|
||||
GL_CHECK_ERROR();
|
||||
}
|
||||
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
GL_CHECK_ERROR();
|
||||
}
|
||||
|
||||
static void fft_step(glfft_t *fft,
|
||||
const GLshort *audio_buffer, unsigned frames)
|
||||
{
|
||||
unsigned i;
|
||||
GLshort *buffer = NULL;
|
||||
GLshort *slide = (GLshort*)&fft->sliding[0];
|
||||
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glEnable(GL_CULL_FACE);
|
||||
glBindVertexArray(fft->vao);
|
||||
|
||||
glActiveTexture(GL_TEXTURE2);
|
||||
glBindTexture(GL_TEXTURE_2D, fft->window_tex);
|
||||
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
glBindTexture(GL_TEXTURE_2D, fft->input_tex);
|
||||
glUseProgram(fft->prog_real);
|
||||
|
||||
memmove(slide, slide + frames * 2,
|
||||
(fft->sliding_size - 2 * frames) * sizeof(GLshort));
|
||||
memcpy(slide + fft->sliding_size - frames * 2, audio_buffer,
|
||||
2 * frames * sizeof(GLshort));
|
||||
|
||||
/* Upload audio data to GPU. */
|
||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, fft->pbo);
|
||||
|
||||
buffer = (GLshort*)(glMapBufferRange(GL_PIXEL_UNPACK_BUFFER, 0,
|
||||
2 * fft->size * sizeof(GLshort),
|
||||
GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_BUFFER_BIT));
|
||||
|
||||
if (buffer)
|
||||
{
|
||||
memcpy(buffer, slide, fft->sliding_size * sizeof(GLshort));
|
||||
glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER);
|
||||
}
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, fft->size, 1,
|
||||
GL_RG_INTEGER, GL_SHORT, NULL);
|
||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
|
||||
|
||||
/* Perform FFT of new block. */
|
||||
glViewport(0, 0, fft->size, 1);
|
||||
|
||||
for (i = 0; i < fft->steps; i++)
|
||||
{
|
||||
if (i == fft->steps - 1)
|
||||
{
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, fft->output.fbo);
|
||||
glUniform1i(glGetUniformLocation(i == 0
|
||||
? fft->prog_real : fft->prog_complex, "uViewportOffset"),
|
||||
fft->output_ptr);
|
||||
glViewport(0, fft->output_ptr, fft->size, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
glUniform1i(glGetUniformLocation(i == 0
|
||||
? fft->prog_real : fft->prog_complex, "uViewportOffset"), 0);
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, fft->passes[i].target.fbo);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
}
|
||||
|
||||
glActiveTexture(GL_TEXTURE1);
|
||||
glBindTexture(GL_TEXTURE_2D, fft->passes[i].parameter_tex);
|
||||
|
||||
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
glBindTexture(GL_TEXTURE_2D, fft->passes[i].target.tex);
|
||||
|
||||
if (i == 0)
|
||||
glUseProgram(fft->prog_complex);
|
||||
}
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
|
||||
/* Resolve new chunk to heightmap. */
|
||||
glViewport(0, fft->output_ptr, fft->size, 1);
|
||||
glUseProgram(fft->prog_resolve);
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, fft->resolve.fbo);
|
||||
const GLfloat resolve_offset[] = { 0.0f, float(fft->output_ptr) / fft->depth,
|
||||
1.0f, 1.0f / fft->depth };
|
||||
glUniform4fv(glGetUniformLocation(fft->prog_resolve, "uOffsetScale"),
|
||||
1, resolve_offset);
|
||||
glBindTexture(GL_TEXTURE_2D, fft->output.tex);
|
||||
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||
|
||||
/* Re-blur damaged regions of heightmap. */
|
||||
glUseProgram(fft->prog_blur);
|
||||
glBindTexture(GL_TEXTURE_2D, fft->resolve.tex);
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, fft->blur.fbo);
|
||||
glUniform4fv(glGetUniformLocation(fft->prog_blur, "uOffsetScale"),
|
||||
1, resolve_offset);
|
||||
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||
|
||||
/* Mipmap the heightmap. */
|
||||
glBindTexture(GL_TEXTURE_2D, fft->blur.tex);
|
||||
glGenerateMipmap(GL_TEXTURE_2D);
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
|
||||
fft->output_ptr++;
|
||||
fft->output_ptr &= fft->depth - 1;
|
||||
|
||||
glBindVertexArray(0);
|
||||
glUseProgram(0);
|
||||
GL_CHECK_ERROR();
|
||||
}
|
||||
|
||||
static inline unsigned log2i(unsigned x)
|
||||
{
|
||||
if (x==0) return 0; // shouldn't happen
|
||||
|
||||
unsigned res;
|
||||
for (res = 0; x; x >>= 1)
|
||||
res++;
|
||||
return res - 1;
|
||||
}
|
||||
|
||||
static inline unsigned bitinverse(unsigned x, unsigned size)
|
||||
{
|
||||
unsigned i;
|
||||
unsigned size_log2 = log2i(size);
|
||||
unsigned ret = 0;
|
||||
|
||||
for (i = 0; i < size_log2; i++)
|
||||
ret |= ((x >> i) & 0x1) << (size_log2 - 1 - i);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static fft_complex_t exp_imag(float phase)
|
||||
{
|
||||
fft_complex_t out = { cosf(phase), sinf(phase) };
|
||||
return out;
|
||||
}
|
||||
|
||||
void fft_build_params(glfft_t *fft, GLuint *buffer,
|
||||
unsigned step, unsigned size)
|
||||
{
|
||||
unsigned i, j;
|
||||
unsigned step_size = 1 << step;
|
||||
|
||||
for (i = 0; i < size; i += step_size << 1)
|
||||
{
|
||||
for (j = i; j < i + step_size; j++)
|
||||
{
|
||||
int s = j - i;
|
||||
float phase = -1.0f * (float)s / step_size;
|
||||
unsigned a = j;
|
||||
unsigned b = j + step_size;
|
||||
fft_complex_t twiddle = exp_imag(M_PI * phase);
|
||||
|
||||
unsigned read_a = (step == 0) ? bitinverse(a, size) : a;
|
||||
unsigned read_b = (step == 0) ? bitinverse(b, size) : b;
|
||||
vec2 tmp = vec2(twiddle.real, twiddle.imag);
|
||||
|
||||
buffer[2 * a + 0] = (read_a << 16) | read_b;
|
||||
buffer[2 * a + 1] = packHalf2x16(tmp);
|
||||
buffer[2 * b + 0] = (read_a << 16) | read_b;
|
||||
buffer[2 * b + 1] = packHalf2x16(-tmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void fft_init_quad_vao(glfft_t *fft)
|
||||
{
|
||||
static const GLbyte quad_buffer[] = {
|
||||
-1, -1, 1, -1, -1, 1, 1, 1,
|
||||
0, 0, 1, 0, 0, 1, 1, 1,
|
||||
};
|
||||
glGenBuffers(1, &fft->quad);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, fft->quad);
|
||||
glBufferData(GL_ARRAY_BUFFER,
|
||||
sizeof(quad_buffer), quad_buffer, GL_STATIC_DRAW);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||
|
||||
glGenVertexArrays(1, &fft->vao);
|
||||
glBindVertexArray(fft->vao);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, fft->quad);
|
||||
glEnableVertexAttribArray(0);
|
||||
glEnableVertexAttribArray(1);
|
||||
glVertexAttribPointer(0, 2, GL_BYTE, GL_FALSE, 0, 0);
|
||||
glVertexAttribPointer(1, 2, GL_BYTE, GL_FALSE, 0,
|
||||
reinterpret_cast<const GLvoid*>(uintptr_t(8)));
|
||||
glBindVertexArray(0);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||
}
|
||||
|
||||
static void fft_init_texture(glfft_t *fft, GLuint *tex, GLenum format,
|
||||
unsigned width, unsigned height, unsigned levels, GLenum mag, GLenum min)
|
||||
{
|
||||
glGenTextures(1, tex);
|
||||
glBindTexture(GL_TEXTURE_2D, *tex);
|
||||
glTexStorage2D(GL_TEXTURE_2D, levels, format, width, height);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, mag);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, min);
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
}
|
||||
|
||||
static void fft_init_target(glfft_t *fft, struct target *target, GLenum format,
|
||||
unsigned width, unsigned height, unsigned levels, GLenum mag, GLenum min)
|
||||
{
|
||||
fft_init_texture(fft, &target->tex, format, width, height, levels, mag, min);
|
||||
glGenFramebuffers(1, &target->fbo);
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, target->fbo);
|
||||
|
||||
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D,
|
||||
target->tex, 0);
|
||||
|
||||
if (format == GL_RGBA8)
|
||||
{
|
||||
glClearColor(0, 0, 0, 0);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
}
|
||||
else if (format == GL_RG16I)
|
||||
{
|
||||
static const GLint v[] = { 0, 0, 0, 0 };
|
||||
glClearBufferiv(GL_COLOR, 0, v);
|
||||
}
|
||||
else
|
||||
{
|
||||
static const GLuint v[] = { 0, 0, 0, 0 };
|
||||
glClearBufferuiv(GL_COLOR, 0, v);
|
||||
}
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
}
|
||||
|
||||
#define KAISER_BETA 12.0
|
||||
|
||||
static void fft_init(glfft_t *fft)
|
||||
{
|
||||
unsigned i;
|
||||
double window_mod;
|
||||
GLushort *window;
|
||||
static const GLfloat unity[] = { 0.0f, 0.0f, 1.0f, 1.0f };
|
||||
|
||||
fft->prog_real = fft_compile_program(fft, fft_vertex_program, fft_fragment_program_real);
|
||||
fft->prog_complex = fft_compile_program(fft, fft_vertex_program, fft_fragment_program_complex);
|
||||
fft->prog_resolve = fft_compile_program(fft, fft_vertex_program, fft_fragment_program_resolve);
|
||||
fft->prog_blur = fft_compile_program(fft, fft_vertex_program, fft_fragment_program_blur);
|
||||
GL_CHECK_ERROR();
|
||||
|
||||
glUseProgram(fft->prog_real);
|
||||
glUniform1i(glGetUniformLocation(fft->prog_real, "sTexture"), 0);
|
||||
glUniform1i(glGetUniformLocation(fft->prog_real, "sParameterTexture"), 1);
|
||||
glUniform1i(glGetUniformLocation(fft->prog_real, "sWindow"), 2);
|
||||
glUniform4fv(glGetUniformLocation(fft->prog_real, "uOffsetScale"), 1, unity);
|
||||
|
||||
glUseProgram(fft->prog_complex);
|
||||
glUniform1i(glGetUniformLocation(fft->prog_complex, "sTexture"), 0);
|
||||
glUniform1i(glGetUniformLocation(fft->prog_complex, "sParameterTexture"), 1);
|
||||
glUniform4fv(glGetUniformLocation(fft->prog_complex, "uOffsetScale"), 1, unity);
|
||||
|
||||
glUseProgram(fft->prog_resolve);
|
||||
glUniform1i(glGetUniformLocation(fft->prog_resolve, "sFFT"), 0);
|
||||
glUniform4fv(glGetUniformLocation(fft->prog_resolve, "uOffsetScale"), 1, unity);
|
||||
|
||||
glUseProgram(fft->prog_blur);
|
||||
glUniform1i(glGetUniformLocation(fft->prog_blur, "sHeight"), 0);
|
||||
glUniform4fv(glGetUniformLocation(fft->prog_blur, "uOffsetScale"), 1, unity);
|
||||
|
||||
GL_CHECK_ERROR();
|
||||
|
||||
fft_init_texture(fft, &fft->window_tex, GL_R16UI,
|
||||
fft->size, 1, 1, GL_NEAREST, GL_NEAREST);
|
||||
GL_CHECK_ERROR();
|
||||
|
||||
window = (GLushort*)calloc(fft->size, sizeof(GLushort));
|
||||
|
||||
window_mod = 1.0 / kaiser_window_function(0.0, KAISER_BETA);
|
||||
|
||||
for (i = 0; i < fft->size; i++)
|
||||
{
|
||||
double phase = (double)(i - int(fft->size) / 2) / (int(fft->size) / 2);
|
||||
double w = kaiser_window_function(phase, KAISER_BETA);
|
||||
window[i] = round(0xffff * w * window_mod);
|
||||
}
|
||||
glBindTexture(GL_TEXTURE_2D, fft->window_tex);
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0,
|
||||
fft->size, 1, GL_RED_INTEGER, GL_UNSIGNED_SHORT, &window[0]);
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
|
||||
GL_CHECK_ERROR();
|
||||
fft_init_texture(fft, &fft->input_tex, GL_RG16I,
|
||||
fft->size, 1, 1, GL_NEAREST, GL_NEAREST);
|
||||
fft_init_target(fft, &fft->output, GL_RG32UI,
|
||||
fft->size, fft->depth, 1, GL_NEAREST, GL_NEAREST);
|
||||
fft_init_target(fft, &fft->resolve, GL_RGBA8,
|
||||
fft->size, fft->depth, 1, GL_NEAREST, GL_NEAREST);
|
||||
fft_init_target(fft, &fft->blur, GL_RGBA8,
|
||||
fft->size, fft->depth,
|
||||
log2i(MAX(fft->size, fft->depth)) + 1,
|
||||
GL_NEAREST, GL_LINEAR_MIPMAP_LINEAR);
|
||||
|
||||
GL_CHECK_ERROR();
|
||||
|
||||
for (i = 0; i < fft->steps; i++)
|
||||
{
|
||||
GLuint *param_buffer = NULL;
|
||||
fft_init_target(fft, &fft->passes[i].target,
|
||||
GL_RG32UI, fft->size, 1, 1, GL_NEAREST, GL_NEAREST);
|
||||
fft_init_texture(fft, &fft->passes[i].parameter_tex,
|
||||
GL_RG32UI, fft->size, 1, 1, GL_NEAREST, GL_NEAREST);
|
||||
|
||||
param_buffer = (GLuint*)calloc(2 * fft->size, sizeof(GLuint));
|
||||
|
||||
fft_build_params(fft, ¶m_buffer[0], i, fft->size);
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, fft->passes[i].parameter_tex);
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0,
|
||||
fft->size, 1, GL_RG_INTEGER, GL_UNSIGNED_INT, ¶m_buffer[0]);
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
|
||||
free(param_buffer);
|
||||
}
|
||||
|
||||
GL_CHECK_ERROR();
|
||||
glGenBuffers(1, &fft->pbo);
|
||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, fft->pbo);
|
||||
glBufferData(GL_PIXEL_UNPACK_BUFFER,
|
||||
fft->size * 2 * sizeof(GLshort), 0, GL_DYNAMIC_DRAW);
|
||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
|
||||
|
||||
free(window);
|
||||
}
|
||||
|
||||
static void fft_init_block(glfft_t *fft)
|
||||
{
|
||||
unsigned x, y;
|
||||
GLuint *bp;
|
||||
GLushort *block_vertices;
|
||||
GLuint *block_indices;
|
||||
unsigned block_vertices_size;
|
||||
unsigned block_indices_size;
|
||||
int pos = 0;
|
||||
|
||||
fft->block.prog = fft_compile_program(fft,
|
||||
fft_vertex_program_heightmap, fft_fragment_program_heightmap);
|
||||
glUseProgram(fft->block.prog);
|
||||
glUniform1i(glGetUniformLocation(fft->block.prog, "sHeight"), 0);
|
||||
|
||||
block_vertices_size = 2 * fft->block_size * fft->depth;
|
||||
block_vertices = (GLushort*)calloc(block_vertices_size, sizeof(GLushort));
|
||||
|
||||
for (y = 0; y < fft->depth; y++)
|
||||
{
|
||||
for (x = 0; x < fft->block_size; x++)
|
||||
{
|
||||
block_vertices[2 * (y * fft->block_size + x) + 0] = x;
|
||||
block_vertices[2 * (y * fft->block_size + x) + 1] = y;
|
||||
}
|
||||
}
|
||||
glGenBuffers(1, &fft->block.vbo);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, fft->block.vbo);
|
||||
glBufferData(GL_ARRAY_BUFFER,
|
||||
block_vertices_size * sizeof(GLushort),
|
||||
&block_vertices[0], GL_STATIC_DRAW);
|
||||
|
||||
fft->block.elems = (2 * fft->block_size - 1) * (fft->depth - 1) + 1;
|
||||
|
||||
block_indices_size = fft->block.elems;
|
||||
block_indices = (GLuint*)calloc(block_indices_size, sizeof(GLuint));
|
||||
|
||||
bp = &block_indices[0];
|
||||
|
||||
for (y = 0; y < fft->depth - 1; y++)
|
||||
{
|
||||
int x;
|
||||
int step_odd = -int(fft->block_size) + ((y & 1) ? -1 : 1);
|
||||
int step_even = fft->block_size;
|
||||
|
||||
for (x = 0; x < 2 * int(fft->block_size) - 1; x++)
|
||||
{
|
||||
*bp++ = pos;
|
||||
pos += (x & 1) ? step_odd : step_even;
|
||||
}
|
||||
}
|
||||
*bp++ = pos;
|
||||
|
||||
glGenVertexArrays(1, &fft->block.vao);
|
||||
glBindVertexArray(fft->block.vao);
|
||||
|
||||
glGenBuffers(1, &fft->block.ibo);
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, fft->block.ibo);
|
||||
glBufferData(GL_ELEMENT_ARRAY_BUFFER,
|
||||
block_indices_size * sizeof(GLuint),
|
||||
&block_indices[0], GL_STATIC_DRAW);
|
||||
|
||||
glEnableVertexAttribArray(0);
|
||||
glVertexAttribPointer(0, 2, GL_UNSIGNED_SHORT, GL_FALSE, 0, 0);
|
||||
glBindVertexArray(0);
|
||||
|
||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
|
||||
|
||||
free(block_vertices);
|
||||
free(block_indices);
|
||||
}
|
||||
|
||||
static bool fft_context_reset(glfft_t *fft, unsigned fft_steps,
|
||||
rglgen_proc_address_t proc, unsigned fft_depth)
|
||||
{
|
||||
rglgen_resolve_symbols(proc);
|
||||
|
||||
fft->steps = fft_steps;
|
||||
fft->depth = fft_depth;
|
||||
fft->size = 1 << fft_steps;
|
||||
fft->block_size = fft->size / 4 + 1;
|
||||
|
||||
fft->passes_size = fft_steps;
|
||||
fft->passes = (Pass*)calloc(fft->passes_size, sizeof(Pass));
|
||||
|
||||
if (!fft->passes)
|
||||
return false;
|
||||
|
||||
fft->sliding_size = 2 * fft->size;
|
||||
fft->sliding = (GLshort*)calloc(fft->sliding_size, sizeof(GLshort));
|
||||
|
||||
if (!fft->sliding)
|
||||
return false;
|
||||
|
||||
GL_CHECK_ERROR();
|
||||
fft_init_quad_vao(fft);
|
||||
GL_CHECK_ERROR();
|
||||
fft_init(fft);
|
||||
GL_CHECK_ERROR();
|
||||
fft_init_block(fft);
|
||||
GL_CHECK_ERROR();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* GLFFT requires either GLES3 or
|
||||
* desktop GL with ES3_compat (supported by MESA on Linux) extension. */
|
||||
extern "C" glfft_t *glfft_new(unsigned fft_steps, rglgen_proc_address_t proc)
|
||||
{
|
||||
#ifdef HAVE_OPENGLES3
|
||||
const char *ver = (const char*)(glGetString(GL_VERSION));
|
||||
if (ver)
|
||||
{
|
||||
unsigned major, minor;
|
||||
if (sscanf(ver, "OpenGL ES %u.%u", &major, &minor) != 2 || major < 3)
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
#else
|
||||
const char *exts = (const char*)(glGetString(GL_EXTENSIONS));
|
||||
if (!exts || !strstr(exts, "ARB_ES3_compatibility"))
|
||||
return NULL;
|
||||
#endif
|
||||
|
||||
glfft_t *fft = (glfft_t*)calloc(1, sizeof(*fft));
|
||||
if (!fft)
|
||||
return NULL;
|
||||
|
||||
if (!fft_context_reset(fft, fft_steps, proc, 256))
|
||||
goto error;
|
||||
|
||||
return fft;
|
||||
|
||||
error:
|
||||
if (fft)
|
||||
free(fft);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
extern "C" void glfft_init_multisample(glfft_t *fft,
|
||||
unsigned width, unsigned height, unsigned samples)
|
||||
{
|
||||
if (fft->ms_rb_color)
|
||||
glDeleteRenderbuffers(1, &fft->ms_rb_color);
|
||||
fft->ms_rb_color = 0;
|
||||
if (fft->ms_rb_ds)
|
||||
glDeleteRenderbuffers(1, &fft->ms_rb_ds);
|
||||
fft->ms_rb_ds = 0;
|
||||
if (fft->ms_fbo)
|
||||
glDeleteFramebuffers(1, &fft->ms_fbo);
|
||||
fft->ms_fbo = 0;
|
||||
|
||||
if (samples > 1)
|
||||
{
|
||||
glGenRenderbuffers(1, &fft->ms_rb_color);
|
||||
glGenRenderbuffers(1, &fft->ms_rb_ds);
|
||||
glGenFramebuffers (1, &fft->ms_fbo);
|
||||
|
||||
glBindRenderbuffer(GL_RENDERBUFFER, fft->ms_rb_color);
|
||||
glRenderbufferStorageMultisample(GL_RENDERBUFFER, samples,
|
||||
GL_RGBA8, width, height);
|
||||
glBindRenderbuffer(GL_RENDERBUFFER, fft->ms_rb_ds);
|
||||
glRenderbufferStorageMultisample(GL_RENDERBUFFER, samples,
|
||||
GL_DEPTH24_STENCIL8, width, height);
|
||||
glBindRenderbuffer(GL_RENDERBUFFER, 0);
|
||||
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, fft->ms_fbo);
|
||||
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
|
||||
GL_RENDERBUFFER, fft->ms_rb_color);
|
||||
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT,
|
||||
GL_RENDERBUFFER, fft->ms_rb_ds);
|
||||
if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE)
|
||||
glfft_init_multisample(fft, 0, 0, 0);
|
||||
}
|
||||
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
}
|
||||
|
||||
static void fft_context_destroy(glfft_t *fft)
|
||||
{
|
||||
glfft_init_multisample(fft, 0, 0, 0);
|
||||
if (fft->passes)
|
||||
free(fft->passes);
|
||||
fft->passes = NULL;
|
||||
if (fft->sliding)
|
||||
free(fft->sliding);
|
||||
fft->sliding = NULL;
|
||||
}
|
||||
|
||||
extern "C" void glfft_free(glfft_t *fft)
|
||||
{
|
||||
if (!fft)
|
||||
return;
|
||||
|
||||
fft_context_destroy(fft);
|
||||
if (fft)
|
||||
free(fft);
|
||||
fft = NULL;
|
||||
}
|
||||
|
||||
extern "C" void glfft_step_fft(glfft_t *fft,
|
||||
const GLshort *buffer, unsigned frames)
|
||||
{
|
||||
fft_step(fft, buffer, frames);
|
||||
}
|
||||
|
||||
extern "C" void glfft_render(glfft_t *fft, GLuint backbuffer,
|
||||
unsigned width, unsigned height)
|
||||
{
|
||||
fft_render(fft, backbuffer, width, height);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
#ifndef FFT_H__
|
||||
#define FFT_H__
|
||||
|
||||
#include <glsym/glsym.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct glfft glfft_t;
|
||||
|
||||
glfft_t *glfft_new(unsigned fft_steps, rglgen_proc_address_t proc);
|
||||
|
||||
void glfft_free(glfft_t *fft);
|
||||
|
||||
void glfft_init_multisample(glfft_t *fft, unsigned width, unsigned height, unsigned samples);
|
||||
|
||||
void glfft_step_fft(glfft_t *fft, const GLshort *buffer, unsigned frames);
|
||||
void glfft_render(glfft_t *fft, GLuint backbuffer, unsigned width, unsigned height);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
#include "shaders_common.h"
|
||||
|
||||
static const char *fft_fragment_program_blur = GLSL_300(
|
||||
precision mediump float;
|
||||
precision highp int;
|
||||
precision highp usampler2D;
|
||||
precision highp isampler2D;
|
||||
in vec2 vTex;
|
||||
out vec4 FragColor;
|
||||
uniform sampler2D sHeight;
|
||||
|
||||
void main() {
|
||||
float k = 0.0;
|
||||
float t;
|
||||
vec4 res = vec4(0.0);
|
||||
\n#define kernel(x, y) t = exp(-0.35 * float((x) * (x) + (y) * (y))); k += t; res += t * textureLodOffset(sHeight, vTex, 0.0, ivec2(x, y))\n
|
||||
kernel(-1, -2);
|
||||
kernel(-1, -1);
|
||||
kernel(-1, 0);
|
||||
kernel( 0, -2);
|
||||
kernel( 0, -1);
|
||||
kernel( 0, 0);
|
||||
kernel( 1, -2);
|
||||
kernel( 1, -1);
|
||||
kernel( 1, 0);
|
||||
FragColor = res / k;
|
||||
}
|
||||
);
|
||||
@@ -0,0 +1,33 @@
|
||||
#include "shaders_common.h"
|
||||
|
||||
static const char *fft_fragment_program_complex = GLSL_300(
|
||||
precision mediump float;
|
||||
precision highp int;
|
||||
precision highp usampler2D;
|
||||
precision highp isampler2D;
|
||||
|
||||
in vec2 vTex;
|
||||
uniform usampler2D sTexture;
|
||||
uniform usampler2D sParameterTexture;
|
||||
uniform int uViewportOffset;
|
||||
out uvec2 FragColor;
|
||||
|
||||
vec2 compMul(vec2 a, vec2 b) { return vec2(a.x * b.x - a.y * b.y, a.x * b.y + a.y * b.x); }
|
||||
|
||||
void main() {
|
||||
uvec2 params = texture(sParameterTexture, vec2(vTex.x, 0.5)).rg;
|
||||
uvec2 coord = uvec2((params.x >> 16u) & 0xffffu, params.x & 0xffffu);
|
||||
int ycoord = int(gl_FragCoord.y) - uViewportOffset;
|
||||
vec2 twiddle = unpackHalf2x16(params.y);
|
||||
|
||||
uvec2 x = texelFetch(sTexture, ivec2(int(coord.x), ycoord), 0).rg;
|
||||
uvec2 y = texelFetch(sTexture, ivec2(int(coord.y), ycoord), 0).rg;
|
||||
vec4 a = vec4(unpackHalf2x16(x.x), unpackHalf2x16(x.y));
|
||||
vec4 b = vec4(unpackHalf2x16(y.x), unpackHalf2x16(y.y));
|
||||
b.xy = compMul(b.xy, twiddle);
|
||||
b.zw = compMul(b.zw, twiddle);
|
||||
|
||||
vec4 res = a + b;
|
||||
FragColor = uvec2(packHalf2x16(res.xy), packHalf2x16(res.zw));
|
||||
}
|
||||
);
|
||||
@@ -0,0 +1,40 @@
|
||||
#include "shaders_common.h"
|
||||
|
||||
static const char *fft_fragment_program_real = GLSL_300(
|
||||
precision mediump float;
|
||||
precision highp int;
|
||||
precision highp usampler2D;
|
||||
precision highp isampler2D;
|
||||
|
||||
in vec2 vTex;
|
||||
uniform isampler2D sTexture;
|
||||
uniform usampler2D sParameterTexture;
|
||||
uniform usampler2D sWindow;
|
||||
uniform int uViewportOffset;
|
||||
out uvec2 FragColor;
|
||||
|
||||
vec2 compMul(vec2 a, vec2 b) { return vec2(a.x * b.x - a.y * b.y, a.x * b.y + a.y * b.x); }
|
||||
|
||||
void main() {
|
||||
uvec2 params = texture(sParameterTexture, vec2(vTex.x, 0.5)).rg;
|
||||
uvec2 coord = uvec2((params.x >> 16u) & 0xffffu, params.x & 0xffffu);
|
||||
int ycoord = int(gl_FragCoord.y) - uViewportOffset;
|
||||
vec2 twiddle = unpackHalf2x16(params.y);
|
||||
|
||||
float window_a = float(texelFetch(sWindow, ivec2(coord.x, 0), 0).r) / float(0x10000);
|
||||
float window_b = float(texelFetch(sWindow, ivec2(coord.y, 0), 0).r) / float(0x10000);
|
||||
|
||||
vec2 a = window_a * vec2(texelFetch(sTexture, ivec2(int(coord.x), ycoord), 0).rg) / vec2(0x8000);
|
||||
vec2 a_l = vec2(a.x, 0.0);
|
||||
vec2 a_r = vec2(a.y, 0.0);
|
||||
vec2 b = window_b * vec2(texelFetch(sTexture, ivec2(int(coord.y), ycoord), 0).rg) / vec2(0x8000);
|
||||
vec2 b_l = vec2(b.x, 0.0);
|
||||
vec2 b_r = vec2(b.y, 0.0);
|
||||
b_l = compMul(b_l, twiddle);
|
||||
b_r = compMul(b_r, twiddle);
|
||||
|
||||
vec2 res_l = a_l + b_l;
|
||||
vec2 res_r = a_r + b_r;
|
||||
FragColor = uvec2(packHalf2x16(res_l), packHalf2x16(res_r));
|
||||
}
|
||||
);
|
||||
@@ -0,0 +1,30 @@
|
||||
#include "shaders_common.h"
|
||||
|
||||
static const char *fft_fragment_program_resolve = GLSL_300(
|
||||
precision mediump float;
|
||||
precision highp int;
|
||||
precision highp usampler2D;
|
||||
precision highp isampler2D;
|
||||
in vec2 vTex;
|
||||
out vec4 FragColor;
|
||||
uniform usampler2D sFFT;
|
||||
|
||||
vec4 get_heights(highp uvec2 h) {
|
||||
vec2 l = unpackHalf2x16(h.x);
|
||||
vec2 r = unpackHalf2x16(h.y);
|
||||
vec2 channels[4] = vec2[4](
|
||||
l, 0.5 * (l + r), r, 0.5 * (l - r));
|
||||
vec4 amps;
|
||||
for (int i = 0; i < 4; i++)
|
||||
amps[i] = dot(channels[i], channels[i]);
|
||||
|
||||
return 9.0 * log(amps + 0.0001) - 22.0;
|
||||
}
|
||||
|
||||
void main() {
|
||||
uvec2 h = textureLod(sFFT, vTex, 0.0).rg;
|
||||
vec4 height = get_heights(h);
|
||||
height = (height + 40.0) / 80.0;
|
||||
FragColor = height;
|
||||
}
|
||||
);
|
||||
@@ -0,0 +1,18 @@
|
||||
#include "shaders_common.h"
|
||||
|
||||
static const char *fft_fragment_program_heightmap = GLSL_300(
|
||||
precision mediump float;
|
||||
out vec4 FragColor;
|
||||
in vec3 vWorldPos;
|
||||
in vec3 vHeight;
|
||||
|
||||
vec3 colormap(vec3 height) {
|
||||
return 1.0 / (1.0 + exp(-0.08 * height));
|
||||
}
|
||||
|
||||
void main() {
|
||||
vec3 color = mix(vec3(1.0, 0.7, 0.7) * colormap(vHeight), vec3(0.1, 0.15, 0.1), clamp(vWorldPos.z / 400.0, 0.0, 1.0));
|
||||
color = mix(color, vec3(0.1, 0.15, 0.1), clamp(1.0 - vWorldPos.z / 2.0, 0.0, 1.0));
|
||||
FragColor = vec4(color, 1.0);
|
||||
}
|
||||
);
|
||||
@@ -0,0 +1,43 @@
|
||||
#include "shaders_common.h"
|
||||
|
||||
static const char *fft_vertex_program_heightmap = GLSL_300(
|
||||
layout(location = 0) in vec2 aVertex;
|
||||
uniform sampler2D sHeight;
|
||||
uniform mat4 uMVP;
|
||||
uniform ivec2 uOffset;
|
||||
uniform vec4 uHeightmapParams;
|
||||
uniform float uAngleScale;
|
||||
out vec3 vWorldPos;
|
||||
out vec3 vHeight;
|
||||
|
||||
void main() {
|
||||
vec2 tex_coord = vec2(aVertex.x + float(uOffset.x) + 0.5, -aVertex.y + float(uOffset.y) + 0.5) / vec2(textureSize(sHeight, 0));
|
||||
|
||||
vec3 world_pos = vec3(aVertex.x, 0.0, aVertex.y);
|
||||
world_pos.xz += uHeightmapParams.xy;
|
||||
|
||||
float angle = world_pos.x * uAngleScale;
|
||||
world_pos.xz *= uHeightmapParams.zw;
|
||||
|
||||
float lod = log2(world_pos.z + 1.0) - 6.0;
|
||||
vec4 heights = textureLod(sHeight, tex_coord, lod);
|
||||
|
||||
float cangle = cos(angle);
|
||||
float sangle = sin(angle);
|
||||
|
||||
int c = int(-sign(world_pos.x) + 1.0);
|
||||
float height = mix(heights[c], heights[1], abs(angle) / 3.141592653);
|
||||
height = height * 80.0 - 40.0;
|
||||
|
||||
vec3 up = vec3(-sangle, cangle, 0.0);
|
||||
|
||||
float base_y = 80.0 - 80.0 * cangle;
|
||||
float base_x = 80.0 * sangle;
|
||||
world_pos.xy = vec2(base_x, base_y);
|
||||
world_pos += up * height;
|
||||
|
||||
vWorldPos = world_pos;
|
||||
vHeight = vec3(height, heights.yw * 80.0 - 40.0);
|
||||
gl_Position = uMVP * vec4(world_pos, 1.0);
|
||||
}
|
||||
);
|
||||
@@ -0,0 +1,13 @@
|
||||
#include "shaders_common.h"
|
||||
|
||||
static const char *fft_vertex_program = GLSL_300(
|
||||
precision mediump float;
|
||||
layout(location = 0) in vec2 aVertex;
|
||||
layout(location = 1) in vec2 aTexCoord;
|
||||
uniform vec4 uOffsetScale;
|
||||
out vec2 vTex;
|
||||
void main() {
|
||||
vTex = uOffsetScale.xy + aTexCoord * uOffsetScale.zw;
|
||||
gl_Position = vec4(aVertex, 0.0, 1.0);
|
||||
}
|
||||
);
|
||||
@@ -0,0 +1,14 @@
|
||||
#ifndef _SHADERS_COMMON
|
||||
#define _SHADERS_COMMON
|
||||
|
||||
#if defined(HAVE_OPENGLES)
|
||||
#define CG(src) "" #src
|
||||
#define GLSL(src) "precision mediump float;\n" #src
|
||||
#define GLSL_300(src) "#version 300 es\n" #src
|
||||
#else
|
||||
#define CG(src) "" #src
|
||||
#define GLSL(src) "" #src
|
||||
#define GLSL_300(src) "#version 300 es\n" #src
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1 +0,0 @@
|
||||
#include "../../libretro.h"
|
||||
@@ -9,25 +9,37 @@
|
||||
#include <file/file_path.h>
|
||||
#include <compat/strl.h>
|
||||
|
||||
#if 0
|
||||
#define HAVE_STB_IMAGE
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STB_IMAGE
|
||||
#define STB_IMAGE_IMPLEMENTATION
|
||||
|
||||
#ifdef RARCH_INTERNAL
|
||||
#if 0
|
||||
#define STBI_NO_PSD
|
||||
#define STBI_NO_GIF
|
||||
#define STBI_NO_HDR
|
||||
#define STBI_NO_PIC
|
||||
#define STBI_NO_PNM
|
||||
#endif
|
||||
#define STBI_SUPPORT_ZLIB
|
||||
|
||||
#ifdef RARCH_INTERNAL
|
||||
#include "../../deps/stb/stb_image.h"
|
||||
#else
|
||||
#include <stb_image.h>
|
||||
#endif
|
||||
#else
|
||||
#include <formats/image.h>
|
||||
#endif
|
||||
|
||||
#include "../../deps/stb/stb_image.h"
|
||||
#include <libretro.h>
|
||||
|
||||
#ifdef RARCH_INTERNAL
|
||||
#include "internal_cores.h"
|
||||
#include "../../libretro.h"
|
||||
#define IMAGE_CORE_PREFIX(s) libretro_imageviewer_##s
|
||||
#else
|
||||
#include "libretro.h"
|
||||
#define IMAGE_CORE_PREFIX(s) s
|
||||
#endif
|
||||
|
||||
@@ -40,6 +52,9 @@ static retro_environment_t IMAGE_CORE_PREFIX(environ_cb);
|
||||
|
||||
static bool process_new_image;
|
||||
static uint32_t* image_buffer;
|
||||
#ifndef HAVE_STB_IMAGE
|
||||
static struct texture_image image_texture;
|
||||
#endif
|
||||
static int image_width;
|
||||
static int image_height;
|
||||
static bool image_uploaded;
|
||||
@@ -50,10 +65,10 @@ struct string_list *file_list;
|
||||
#define DUPE_TEST
|
||||
#endif
|
||||
|
||||
#ifdef RARCH_INTERNAL
|
||||
static const char* IMAGE_CORE_PREFIX(valid_extensions) = "jpg|jpeg|png|bmp|tga";
|
||||
#else
|
||||
#ifdef HAVE_STB_IMAGE
|
||||
static const char* IMAGE_CORE_PREFIX(valid_extensions) = "jpg|jpeg|png|bmp|psd|tga|gif|hdr|pic|ppm|pgm";
|
||||
#else
|
||||
static const char* IMAGE_CORE_PREFIX(valid_extensions) = "jpg|jpeg|png|bmp|tga";
|
||||
#endif
|
||||
|
||||
void IMAGE_CORE_PREFIX(retro_get_system_info)(struct retro_system_info *info)
|
||||
@@ -76,6 +91,13 @@ void IMAGE_CORE_PREFIX(retro_get_system_av_info)(struct retro_system_av_info *in
|
||||
info->timing.sample_rate = 44100.0;
|
||||
}
|
||||
|
||||
static void imageviewer_reset(void)
|
||||
{
|
||||
image_buffer = NULL;
|
||||
image_width = 0;
|
||||
image_height = 0;
|
||||
}
|
||||
|
||||
void IMAGE_CORE_PREFIX(retro_init)(void)
|
||||
{
|
||||
struct retro_log_callback log;
|
||||
@@ -85,19 +107,25 @@ void IMAGE_CORE_PREFIX(retro_init)(void)
|
||||
else
|
||||
IMAGE_CORE_PREFIX(log_cb) = NULL;
|
||||
|
||||
image_buffer = NULL;
|
||||
image_width = 0;
|
||||
image_height = 0;
|
||||
imageviewer_reset();
|
||||
|
||||
}
|
||||
|
||||
static void imageviewer_free_image(void)
|
||||
{
|
||||
#ifdef HAVE_STB_IMAGE
|
||||
if (image_buffer)
|
||||
free(image_buffer);
|
||||
#else
|
||||
image_texture_free(&image_texture);
|
||||
#endif
|
||||
image_buffer = NULL;
|
||||
}
|
||||
|
||||
void IMAGE_CORE_PREFIX(retro_deinit)(void)
|
||||
{
|
||||
if (image_buffer)
|
||||
free(image_buffer);
|
||||
image_buffer = NULL;
|
||||
image_width = 0;
|
||||
image_height = 0;
|
||||
imageviewer_free_image();
|
||||
imageviewer_reset();
|
||||
}
|
||||
|
||||
void IMAGE_CORE_PREFIX(retro_set_environment)(retro_environment_t cb)
|
||||
@@ -174,16 +202,24 @@ void IMAGE_CORE_PREFIX(retro_cheat_set)(unsigned a, bool b, const char * c)
|
||||
static bool imageviewer_load(const char *path, int image_index)
|
||||
{
|
||||
int comp;
|
||||
if (image_buffer)
|
||||
free(image_buffer);
|
||||
|
||||
|
||||
imageviewer_free_image();
|
||||
|
||||
(void)comp;
|
||||
#ifdef HAVE_STB_IMAGE
|
||||
image_buffer = (uint32_t*)stbi_load(
|
||||
path,
|
||||
&image_width,
|
||||
&image_height,
|
||||
&comp,
|
||||
4);
|
||||
|
||||
#else
|
||||
if (!image_texture_load(&image_texture, path))
|
||||
return false;
|
||||
image_buffer = (uint32_t*)image_texture.pixels;
|
||||
image_width = image_texture.width;
|
||||
image_height = image_texture.height;
|
||||
#endif
|
||||
if (!image_buffer)
|
||||
return false;
|
||||
|
||||
@@ -226,11 +262,10 @@ bool IMAGE_CORE_PREFIX(retro_load_game_special)(unsigned a, const struct retro_g
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void IMAGE_CORE_PREFIX(retro_unload_game)(void)
|
||||
{
|
||||
if (image_buffer)
|
||||
free(image_buffer);
|
||||
image_buffer = NULL;
|
||||
imageviewer_free_image();
|
||||
image_width = 0;
|
||||
image_height = 0;
|
||||
}
|
||||
@@ -360,15 +395,36 @@ void IMAGE_CORE_PREFIX(retro_run)(void)
|
||||
{
|
||||
/* RGBA > XRGB8888 */
|
||||
struct retro_system_av_info info;
|
||||
uint32_t *buf = &image_buffer[0];
|
||||
uint32_t *end = buf + (image_width*image_height*sizeof(uint32_t))/4;
|
||||
|
||||
while(buf < end)
|
||||
#ifdef HAVE_STB_IMAGE
|
||||
int x, y;
|
||||
uint32_t *buf = &image_buffer[0];
|
||||
|
||||
for (y = 0; y < image_height; y++)
|
||||
{
|
||||
uint32_t pixel = *buf;
|
||||
*buf = (pixel & 0xff00ff00) | ((pixel << 16) & 0x00ff0000) | ((pixel >> 16) & 0xff);
|
||||
buf++;
|
||||
for (x = 0; x < image_width; x++, buf++)
|
||||
{
|
||||
uint32_t pixel = *buf;
|
||||
uint32_t a = pixel >> 24;
|
||||
|
||||
if (a == 255)
|
||||
*buf = (pixel & 0x0000ff00) | ((pixel << 16) & 0x00ff0000) | ((pixel >> 16) & 0x000000ff);
|
||||
else
|
||||
{
|
||||
uint32_t r = pixel & 0x0000ff;
|
||||
uint32_t g = (pixel & 0x00ff00) >> 8;
|
||||
uint32_t b = (pixel & 0xff0000) >> 16;
|
||||
uint32_t bg = ((x & 8) ^ (y & 8)) ? 0x66 : 0x99;
|
||||
|
||||
r = a * r / 255 + (255 - a) * bg / 255;
|
||||
g = a * g / 255 + (255 - a) * bg / 255;
|
||||
b = a * b / 255 + (255 - a) * bg / 255;
|
||||
|
||||
*buf = r << 16 | g << 8 | b;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
IMAGE_CORE_PREFIX(retro_get_system_av_info)(&info);
|
||||
|
||||
|
||||
@@ -116,7 +116,10 @@ else
|
||||
CFLAGS += -O3
|
||||
endif
|
||||
|
||||
OBJECTS := ../../libretro-common/net/net_compat.o ../../libretro-common/net/net_socket.o retropad.o
|
||||
OBJECTS := ../../libretro-common/net/net_compat.o \
|
||||
../../libretro-common/net/net_socket.o \
|
||||
net_retropad_core.o
|
||||
|
||||
CFLAGS += -I../../libretro-common/include -Wall -pedantic $(fpic)
|
||||
|
||||
ifneq (,$(findstring qnx,$(platform)))
|
||||
@@ -0,0 +1 @@
|
||||
#include "../internal_cores.h"
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,323 @@
|
||||
/*
|
||||
* To-do:
|
||||
* - Analog support
|
||||
* - Some sort of connection control, it only sends packets
|
||||
* but there is no acknoledgement of a connection o keepalives
|
||||
* - Send player name
|
||||
* - Render something on-screen maybe a gui to configure IP and port
|
||||
instead of the ridiculously long strings we're using now
|
||||
* - Allow changing IP address and port in runtime
|
||||
* - Support other platforms
|
||||
* - Input recording / Combos
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <net/net_compat.h>
|
||||
#include <net/net_socket.h>
|
||||
|
||||
#include <retro_miscellaneous.h>
|
||||
|
||||
#include <libretro.h>
|
||||
|
||||
#ifndef SOCKET_ERROR
|
||||
#define SOCKET_ERROR -1
|
||||
#endif
|
||||
|
||||
#ifdef RARCH_INTERNAL
|
||||
#include "internal_cores.h"
|
||||
#define NETRETROPAD_CORE_PREFIX(s) libretro_netretropad_##s
|
||||
#else
|
||||
#define NETRETROPAD_CORE_PREFIX(s) s
|
||||
#endif
|
||||
|
||||
static int s;
|
||||
static int port;
|
||||
static char server[64];
|
||||
static struct sockaddr_in si_other;
|
||||
|
||||
static struct retro_log_callback logger;
|
||||
|
||||
static retro_log_printf_t NETRETROPAD_CORE_PREFIX(log_cb);
|
||||
static retro_video_refresh_t NETRETROPAD_CORE_PREFIX(video_cb);
|
||||
static retro_audio_sample_t NETRETROPAD_CORE_PREFIX(audio_cb);
|
||||
static retro_audio_sample_batch_t NETRETROPAD_CORE_PREFIX(audio_batch_cb);
|
||||
static retro_environment_t NETRETROPAD_CORE_PREFIX(environ_cb);
|
||||
static retro_input_poll_t NETRETROPAD_CORE_PREFIX(input_poll_cb);
|
||||
static retro_input_state_t NETRETROPAD_CORE_PREFIX(input_state_cb);
|
||||
|
||||
static uint16_t *frame_buf;
|
||||
|
||||
void NETRETROPAD_CORE_PREFIX(retro_init)(void)
|
||||
{
|
||||
frame_buf = (uint16_t*)calloc(320 * 240, sizeof(uint16_t));
|
||||
|
||||
NETRETROPAD_CORE_PREFIX(log_cb)(RETRO_LOG_INFO, "Initialising sockets...\n");
|
||||
network_init();
|
||||
}
|
||||
|
||||
void NETRETROPAD_CORE_PREFIX(retro_deinit)(void)
|
||||
{
|
||||
if (frame_buf)
|
||||
free(frame_buf);
|
||||
frame_buf = NULL;
|
||||
}
|
||||
|
||||
unsigned NETRETROPAD_CORE_PREFIX(retro_api_version)(void)
|
||||
{
|
||||
return RETRO_API_VERSION;
|
||||
}
|
||||
|
||||
void NETRETROPAD_CORE_PREFIX(retro_set_controller_port_device)(
|
||||
unsigned port, unsigned device)
|
||||
{
|
||||
(void)port;
|
||||
(void)device;
|
||||
}
|
||||
|
||||
void NETRETROPAD_CORE_PREFIX(retro_get_system_info)(
|
||||
struct retro_system_info *info)
|
||||
{
|
||||
memset(info, 0, sizeof(*info));
|
||||
info->library_name = "RetroPad Remote";
|
||||
info->library_version = "0.01";
|
||||
info->need_fullpath = false;
|
||||
info->valid_extensions = ""; /* Nothing. */
|
||||
}
|
||||
|
||||
void NETRETROPAD_CORE_PREFIX(retro_get_system_av_info)(
|
||||
struct retro_system_av_info *info)
|
||||
{
|
||||
info->timing.fps = 60.0;
|
||||
info->timing.sample_rate = 30000.0;
|
||||
|
||||
info->geometry.base_width = 320;
|
||||
info->geometry.base_height = 240;
|
||||
info->geometry.max_width = 320;
|
||||
info->geometry.max_height = 240;
|
||||
info->geometry.aspect_ratio = 4.0 / 3.0;
|
||||
}
|
||||
|
||||
|
||||
static unsigned retropad_update_input(void)
|
||||
{
|
||||
unsigned value = 0;
|
||||
NETRETROPAD_CORE_PREFIX(input_poll_cb)();
|
||||
|
||||
if (NETRETROPAD_CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_B))
|
||||
value += 1;
|
||||
if (NETRETROPAD_CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_Y))
|
||||
value += 2;
|
||||
if (NETRETROPAD_CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_SELECT))
|
||||
value += pow(2, 2);
|
||||
if (NETRETROPAD_CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_START))
|
||||
value += pow(2, 3);
|
||||
if (NETRETROPAD_CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_UP))
|
||||
value += pow(2, 4);
|
||||
if (NETRETROPAD_CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_DOWN))
|
||||
value += pow(2, 5);
|
||||
if (NETRETROPAD_CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_LEFT))
|
||||
value += pow(2, 6);
|
||||
if (NETRETROPAD_CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_RIGHT))
|
||||
value += pow(2, 7);
|
||||
if (NETRETROPAD_CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_A))
|
||||
value += pow(2, 8);
|
||||
if (NETRETROPAD_CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_X))
|
||||
value += pow(2, 9);
|
||||
if (NETRETROPAD_CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_L))
|
||||
value += pow(2, 10);
|
||||
if (NETRETROPAD_CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_R))
|
||||
value += pow(2, 11);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
void NETRETROPAD_CORE_PREFIX(retro_set_environment)(retro_environment_t cb)
|
||||
{
|
||||
static const struct retro_variable vars[] = {
|
||||
{ "net_retropad_port", "Port; 55400|55401|55402|55403|55404|55405|55406|55407|55408|55409|55410|55411|55412|55413|55414|55415|55416|55417|55418|55419|55420" },
|
||||
{ "net_retropad_ip_octet1", "IP address part 1; 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124|125|126|127|128|129|130|131|132|133|134|135|136|137|138|139|140|141|142|143|144|145|146|147|148|149|150|151|152|153|154|155|156|157|158|159|160|161|162|163|164|165|166|167|168|169|170|171|172|173|174|175|176|177|178|179|180|181|182|183|184|185|186|187|188|189|190|191|192|193|194|195|196|197|198|199|200|201|202|203|204|205|206|207|208|209|210|211|212|213|214|215|216|217|218|219|220|221|222|223|224|225|226|227|228|229|230|231|232|233|234|235|236|237|238|239|240|241|242|243|244|245|246|247|248|249|250|251|252|253|254|255" },
|
||||
{ "net_retropad_ip_octet2", "IP address part 2; 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124|125|126|127|128|129|130|131|132|133|134|135|136|137|138|139|140|141|142|143|144|145|146|147|148|149|150|151|152|153|154|155|156|157|158|159|160|161|162|163|164|165|166|167|168|169|170|171|172|173|174|175|176|177|178|179|180|181|182|183|184|185|186|187|188|189|190|191|192|193|194|195|196|197|198|199|200|201|202|203|204|205|206|207|208|209|210|211|212|213|214|215|216|217|218|219|220|221|222|223|224|225|226|227|228|229|230|231|232|233|234|235|236|237|238|239|240|241|242|243|244|245|246|247|248|249|250|251|252|253|254|255" },
|
||||
{ "net_retropad_ip_octet3", "IP address part 3; 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124|125|126|127|128|129|130|131|132|133|134|135|136|137|138|139|140|141|142|143|144|145|146|147|148|149|150|151|152|153|154|155|156|157|158|159|160|161|162|163|164|165|166|167|168|169|170|171|172|173|174|175|176|177|178|179|180|181|182|183|184|185|186|187|188|189|190|191|192|193|194|195|196|197|198|199|200|201|202|203|204|205|206|207|208|209|210|211|212|213|214|215|216|217|218|219|220|221|222|223|224|225|226|227|228|229|230|231|232|233|234|235|236|237|238|239|240|241|242|243|244|245|246|247|248|249|250|251|252|253|254|255" },
|
||||
{ "net_retropad_ip_octet4", "IP address part 4; 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124|125|126|127|128|129|130|131|132|133|134|135|136|137|138|139|140|141|142|143|144|145|146|147|148|149|150|151|152|153|154|155|156|157|158|159|160|161|162|163|164|165|166|167|168|169|170|171|172|173|174|175|176|177|178|179|180|181|182|183|184|185|186|187|188|189|190|191|192|193|194|195|196|197|198|199|200|201|202|203|204|205|206|207|208|209|210|211|212|213|214|215|216|217|218|219|220|221|222|223|224|225|226|227|228|229|230|231|232|233|234|235|236|237|238|239|240|241|242|243|244|245|246|247|248|249|250|251|252|253|254|255" },
|
||||
|
||||
{ NULL, NULL },
|
||||
};
|
||||
enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_RGB565;
|
||||
cb(RETRO_ENVIRONMENT_SET_VARIABLES, (void*)vars);
|
||||
|
||||
|
||||
NETRETROPAD_CORE_PREFIX(environ_cb) = cb;
|
||||
bool no_content = true;
|
||||
cb(RETRO_ENVIRONMENT_SET_SUPPORT_NO_GAME, &no_content);
|
||||
|
||||
NETRETROPAD_CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt);
|
||||
|
||||
if (cb(RETRO_ENVIRONMENT_GET_LOG_INTERFACE, &logger))
|
||||
NETRETROPAD_CORE_PREFIX(log_cb) = logger.log;
|
||||
}
|
||||
|
||||
static void netretropad_check_variables(void)
|
||||
{
|
||||
struct retro_variable var, var2, var3, var4, port_var;
|
||||
var.key = "net_retropad_ip_octet1";
|
||||
var2.key = "net_retropad_ip_octet2";
|
||||
var3.key = "net_retropad_ip_octet3";
|
||||
var4.key = "net_retropad_ip_octet4";
|
||||
port_var.key = "net_retropad_port";
|
||||
|
||||
NETRETROPAD_CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_GET_VARIABLE, &var);
|
||||
NETRETROPAD_CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_GET_VARIABLE, &var2);
|
||||
NETRETROPAD_CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_GET_VARIABLE, &var3);
|
||||
NETRETROPAD_CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_GET_VARIABLE, &var4);
|
||||
NETRETROPAD_CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_GET_VARIABLE, &port_var);
|
||||
|
||||
snprintf(server, sizeof(server), "%s.%s.%s.%s", var.value, var2.value, var3.value, var4.value);
|
||||
port = atoi(port_var.value);
|
||||
}
|
||||
|
||||
void NETRETROPAD_CORE_PREFIX(retro_set_audio_sample)(retro_audio_sample_t cb)
|
||||
{
|
||||
NETRETROPAD_CORE_PREFIX(audio_cb) = cb;
|
||||
}
|
||||
|
||||
void NETRETROPAD_CORE_PREFIX(retro_set_audio_sample_batch)(
|
||||
retro_audio_sample_batch_t cb)
|
||||
{
|
||||
NETRETROPAD_CORE_PREFIX(audio_batch_cb) = cb;
|
||||
}
|
||||
|
||||
void NETRETROPAD_CORE_PREFIX(retro_set_input_poll)(retro_input_poll_t cb)
|
||||
{
|
||||
NETRETROPAD_CORE_PREFIX(input_poll_cb) = cb;
|
||||
}
|
||||
|
||||
void NETRETROPAD_CORE_PREFIX(retro_set_input_state)(retro_input_state_t cb)
|
||||
{
|
||||
NETRETROPAD_CORE_PREFIX(input_state_cb) = cb;
|
||||
}
|
||||
|
||||
void NETRETROPAD_CORE_PREFIX(retro_set_video_refresh)(retro_video_refresh_t cb)
|
||||
{
|
||||
NETRETROPAD_CORE_PREFIX(video_cb) = cb;
|
||||
}
|
||||
|
||||
void NETRETROPAD_CORE_PREFIX(retro_reset)(void)
|
||||
{}
|
||||
|
||||
void NETRETROPAD_CORE_PREFIX(retro_run)(void)
|
||||
{
|
||||
unsigned i;
|
||||
char message[64];
|
||||
unsigned input_state = retropad_update_input();
|
||||
|
||||
if (input_state > 0)
|
||||
{
|
||||
snprintf(message, sizeof(message), "%d", input_state);
|
||||
|
||||
/* send the message */
|
||||
if (sendto(s, message, strlen(message) , 0 , (struct sockaddr *) &si_other, sizeof(si_other))==-1)
|
||||
NETRETROPAD_CORE_PREFIX(log_cb)(RETRO_LOG_INFO, "Error sending data\n");
|
||||
}
|
||||
for (i = 0; i < 320 * 240; i++)
|
||||
frame_buf[i] = 4 << 5;
|
||||
NETRETROPAD_CORE_PREFIX(video_cb)(frame_buf, 320, 240, 640);
|
||||
|
||||
retro_sleep(4);
|
||||
}
|
||||
|
||||
bool NETRETROPAD_CORE_PREFIX(retro_load_game)(const struct retro_game_info *info)
|
||||
{
|
||||
socket_target_t in_target;
|
||||
|
||||
netretropad_check_variables();
|
||||
|
||||
s = socket_create(
|
||||
"retropad",
|
||||
SOCKET_DOMAIN_INET,
|
||||
SOCKET_TYPE_DATAGRAM,
|
||||
SOCKET_PROTOCOL_UDP);
|
||||
|
||||
if (s == SOCKET_ERROR)
|
||||
NETRETROPAD_CORE_PREFIX(log_cb)(RETRO_LOG_INFO, "socket failed");
|
||||
|
||||
/* setup address structure */
|
||||
memset((char *) &si_other, 0, sizeof(si_other));
|
||||
|
||||
in_target.port = port;
|
||||
in_target.server = server;
|
||||
in_target.domain = SOCKET_DOMAIN_INET;
|
||||
|
||||
socket_set_target(&si_other, &in_target);
|
||||
|
||||
NETRETROPAD_CORE_PREFIX(log_cb)(RETRO_LOG_INFO, "Server IP Address: %s\n" , server);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void NETRETROPAD_CORE_PREFIX(retro_unload_game)(void)
|
||||
{}
|
||||
|
||||
unsigned NETRETROPAD_CORE_PREFIX(retro_get_region)(void)
|
||||
{
|
||||
return RETRO_REGION_NTSC;
|
||||
}
|
||||
|
||||
bool NETRETROPAD_CORE_PREFIX(retro_load_game_special)(unsigned type,
|
||||
const struct retro_game_info *info, size_t num)
|
||||
{
|
||||
(void)type;
|
||||
(void)info;
|
||||
(void)num;
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t NETRETROPAD_CORE_PREFIX(retro_serialize_size)(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool NETRETROPAD_CORE_PREFIX(retro_serialize)(void *data, size_t size)
|
||||
{
|
||||
(void)data;
|
||||
(void)size;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool NETRETROPAD_CORE_PREFIX(retro_unserialize)(const void *data,
|
||||
size_t size)
|
||||
{
|
||||
(void)data;
|
||||
(void)size;
|
||||
return false;
|
||||
}
|
||||
|
||||
void *NETRETROPAD_CORE_PREFIX(retro_get_memory_data)(unsigned id)
|
||||
{
|
||||
(void)id;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
size_t NETRETROPAD_CORE_PREFIX(retro_get_memory_size)(unsigned id)
|
||||
{
|
||||
(void)id;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void NETRETROPAD_CORE_PREFIX(retro_cheat_reset)(void)
|
||||
{}
|
||||
|
||||
void NETRETROPAD_CORE_PREFIX(retro_cheat_set)(unsigned idx,
|
||||
bool enabled, const char *code)
|
||||
{
|
||||
(void)idx;
|
||||
(void)enabled;
|
||||
(void)code;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include <glsym/glsym.h>
|
||||
|
||||
#include "../../libretro.h"
|
||||
#include <libretro.h>
|
||||
|
||||
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
|
||||
static struct retro_hw_render_callback hw_render;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include <glsym/glsym.h>
|
||||
|
||||
#include "../../libretro.h"
|
||||
#include <libretro.h>
|
||||
|
||||
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
|
||||
static struct retro_hw_render_callback hw_render;
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
ifeq ($(platform),)
|
||||
platform = unix
|
||||
ifeq ($(shell uname -a),)
|
||||
platform = win
|
||||
else ifneq ($(findstring MINGW,$(shell uname -a)),)
|
||||
platform = win
|
||||
else ifneq ($(findstring Darwin,$(shell uname -a)),)
|
||||
platform = osx
|
||||
arch = intel
|
||||
ifeq ($(shell uname -p),powerpc)
|
||||
arch = ppc
|
||||
endif
|
||||
else ifneq ($(findstring win,$(shell uname -a)),)
|
||||
platform = win
|
||||
endif
|
||||
endif
|
||||
|
||||
# system platform
|
||||
system_platform = unix
|
||||
ifeq ($(shell uname -a),)
|
||||
EXE_EXT = .exe
|
||||
system_platform = win
|
||||
else ifneq ($(findstring MINGW,$(shell uname -a)),)
|
||||
system_platform = win
|
||||
endif
|
||||
|
||||
TARGET_NAME = testvulkan_async_compute
|
||||
|
||||
ifeq ($(platform), unix)
|
||||
TARGET := $(TARGET_NAME)_libretro.so
|
||||
fpic := -fPIC
|
||||
SHARED := -shared -Wl,--version-script=link.T -Wl,--no-undefined
|
||||
else
|
||||
CC = gcc
|
||||
TARGET := $(TARGET_NAME)_libretro.dll
|
||||
SHARED := -shared -static-libgcc -static-libstdc++ -s -Wl,--version-script=link.T -Wl,--no-undefined
|
||||
CFLAGS += -I..
|
||||
endif
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
CFLAGS += -O0 -g
|
||||
else
|
||||
CFLAGS += -O3
|
||||
endif
|
||||
|
||||
CFLAGS += -std=gnu99 -I../../gfx/include
|
||||
OBJECTS := libretro-test.o ../../libretro-common/vulkan/vulkan_symbol_wrapper.o
|
||||
CFLAGS += -Wall -pedantic $(fpic)
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
$(TARGET): $(OBJECTS)
|
||||
$(CC) $(fpic) $(SHARED) $(INCLUDES) -o $@ $(OBJECTS) $(LIBS) -lm
|
||||
|
||||
%.o: %.c
|
||||
$(CC) -I../../libretro-common/include $(CFLAGS) -c -o $@ $<
|
||||
|
||||
clean:
|
||||
rm -f $(OBJECTS) $(TARGET)
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
@@ -0,0 +1,805 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <vulkan/vulkan_symbol_wrapper.h>
|
||||
#include <libretro_vulkan.h>
|
||||
|
||||
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
|
||||
static struct retro_hw_render_callback hw_render;
|
||||
static const struct retro_hw_render_interface_vulkan *vulkan;
|
||||
static unsigned frame_count;
|
||||
static VkQueue async_queue;
|
||||
static uint32_t async_queue_index;
|
||||
|
||||
#define BASE_WIDTH 640
|
||||
#define BASE_HEIGHT 360
|
||||
#define MAX_SYNC 8
|
||||
|
||||
struct buffer
|
||||
{
|
||||
VkBuffer buffer;
|
||||
VkDeviceMemory memory;
|
||||
};
|
||||
|
||||
struct vulkan_data
|
||||
{
|
||||
unsigned index;
|
||||
unsigned num_swapchain_images;
|
||||
uint32_t swapchain_mask;
|
||||
|
||||
VkPhysicalDeviceMemoryProperties memory_properties;
|
||||
VkPhysicalDeviceProperties gpu_properties;
|
||||
|
||||
VkDescriptorSetLayout set_layout;
|
||||
VkDescriptorPool desc_pool;
|
||||
VkDescriptorSet desc_set[MAX_SYNC];
|
||||
|
||||
VkPipelineCache pipeline_cache;
|
||||
VkPipelineLayout pipeline_layout;
|
||||
VkPipeline pipeline;
|
||||
|
||||
struct retro_vulkan_image images[MAX_SYNC];
|
||||
VkDeviceMemory image_memory[MAX_SYNC];
|
||||
VkCommandPool cmd_pool[MAX_SYNC];
|
||||
VkCommandBuffer cmd[MAX_SYNC];
|
||||
VkSemaphore acquire_semaphores[MAX_SYNC];
|
||||
|
||||
bool need_acquire[MAX_SYNC];
|
||||
};
|
||||
static struct vulkan_data vk;
|
||||
|
||||
void retro_init(void)
|
||||
{}
|
||||
|
||||
void retro_deinit(void)
|
||||
{}
|
||||
|
||||
unsigned retro_api_version(void)
|
||||
{
|
||||
return RETRO_API_VERSION;
|
||||
}
|
||||
|
||||
void retro_set_controller_port_device(unsigned port, unsigned device)
|
||||
{
|
||||
(void)port;
|
||||
(void)device;
|
||||
}
|
||||
|
||||
void retro_get_system_info(struct retro_system_info *info)
|
||||
{
|
||||
memset(info, 0, sizeof(*info));
|
||||
info->library_name = "TestCore Async Compute Vulkan";
|
||||
info->library_version = "v1";
|
||||
info->need_fullpath = false;
|
||||
info->valid_extensions = NULL; // Anything is fine, we don't care.
|
||||
}
|
||||
|
||||
void retro_get_system_av_info(struct retro_system_av_info *info)
|
||||
{
|
||||
info->timing = (struct retro_system_timing) {
|
||||
.fps = 60.0,
|
||||
.sample_rate = 30000.0,
|
||||
};
|
||||
|
||||
info->geometry = (struct retro_game_geometry) {
|
||||
.base_width = BASE_WIDTH,
|
||||
.base_height = BASE_HEIGHT,
|
||||
.max_width = BASE_WIDTH,
|
||||
.max_height = BASE_HEIGHT,
|
||||
.aspect_ratio = (float)BASE_WIDTH / (float)BASE_HEIGHT,
|
||||
};
|
||||
}
|
||||
|
||||
static retro_video_refresh_t video_cb;
|
||||
static retro_audio_sample_t audio_cb;
|
||||
static retro_audio_sample_batch_t audio_batch_cb;
|
||||
static retro_environment_t environ_cb;
|
||||
static retro_input_poll_t input_poll_cb;
|
||||
static retro_input_state_t input_state_cb;
|
||||
|
||||
void retro_set_environment(retro_environment_t cb)
|
||||
{
|
||||
environ_cb = cb;
|
||||
|
||||
bool no_rom = true;
|
||||
cb(RETRO_ENVIRONMENT_SET_SUPPORT_NO_GAME, &no_rom);
|
||||
}
|
||||
|
||||
void retro_set_audio_sample(retro_audio_sample_t cb)
|
||||
{
|
||||
audio_cb = cb;
|
||||
}
|
||||
|
||||
void retro_set_audio_sample_batch(retro_audio_sample_batch_t cb)
|
||||
{
|
||||
audio_batch_cb = cb;
|
||||
}
|
||||
|
||||
void retro_set_input_poll(retro_input_poll_t cb)
|
||||
{
|
||||
input_poll_cb = cb;
|
||||
}
|
||||
|
||||
void retro_set_input_state(retro_input_state_t cb)
|
||||
{
|
||||
input_state_cb = cb;
|
||||
}
|
||||
|
||||
void retro_set_video_refresh(retro_video_refresh_t cb)
|
||||
{
|
||||
video_cb = cb;
|
||||
}
|
||||
|
||||
static uint32_t find_memory_type_from_requirements(
|
||||
uint32_t device_requirements, uint32_t host_requirements)
|
||||
{
|
||||
const VkPhysicalDeviceMemoryProperties *props = &vk.memory_properties;
|
||||
for (uint32_t i = 0; i < VK_MAX_MEMORY_TYPES; i++)
|
||||
{
|
||||
if (device_requirements & (1u << i))
|
||||
{
|
||||
if ((props->memoryTypes[i].propertyFlags & host_requirements) == host_requirements)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void vulkan_test_render(void)
|
||||
{
|
||||
VkCommandBuffer cmd = vk.cmd[vk.index];
|
||||
|
||||
VkCommandBufferBeginInfo begin_info = { VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO };
|
||||
begin_info.flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT;
|
||||
vkResetCommandBuffer(cmd, 0);
|
||||
vkBeginCommandBuffer(cmd, &begin_info);
|
||||
|
||||
VkImageMemoryBarrier prepare_rendering = { VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER };
|
||||
prepare_rendering.srcAccessMask = 0;
|
||||
prepare_rendering.dstAccessMask = VK_ACCESS_SHADER_WRITE_BIT;
|
||||
prepare_rendering.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED;
|
||||
prepare_rendering.newLayout = VK_IMAGE_LAYOUT_GENERAL;
|
||||
|
||||
if (vk.need_acquire[vk.index])
|
||||
{
|
||||
prepare_rendering.srcQueueFamilyIndex = vulkan->queue_index;
|
||||
prepare_rendering.dstQueueFamilyIndex = async_queue_index;
|
||||
}
|
||||
else
|
||||
{
|
||||
prepare_rendering.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
|
||||
prepare_rendering.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
|
||||
}
|
||||
prepare_rendering.image = vk.images[vk.index].create_info.image;
|
||||
prepare_rendering.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
|
||||
prepare_rendering.subresourceRange.levelCount = 1;
|
||||
prepare_rendering.subresourceRange.layerCount = 1;
|
||||
vkCmdPipelineBarrier(cmd,
|
||||
VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
|
||||
false,
|
||||
0, NULL,
|
||||
0, NULL,
|
||||
1, &prepare_rendering);
|
||||
|
||||
vkCmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_COMPUTE, vk.pipeline);
|
||||
vkCmdBindDescriptorSets(cmd, VK_PIPELINE_BIND_POINT_COMPUTE,
|
||||
vk.pipeline_layout, 0,
|
||||
1, &vk.desc_set[vk.index], 0, NULL);
|
||||
|
||||
const float constants[4] = {
|
||||
1.0f / BASE_WIDTH,
|
||||
1.0f / BASE_HEIGHT,
|
||||
(float)frame_count++,
|
||||
0.0f,
|
||||
};
|
||||
vkCmdPushConstants(cmd, vk.pipeline_layout,
|
||||
VK_SHADER_STAGE_COMPUTE_BIT,
|
||||
0, 16, constants);
|
||||
|
||||
vkCmdDispatch(cmd, BASE_WIDTH / 8, BASE_HEIGHT / 8, 1);
|
||||
|
||||
VkImageMemoryBarrier prepare_presentation = { VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER };
|
||||
prepare_presentation.srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT;
|
||||
prepare_presentation.dstAccessMask = 0;
|
||||
prepare_presentation.oldLayout = VK_IMAGE_LAYOUT_GENERAL;
|
||||
prepare_presentation.newLayout = VK_IMAGE_LAYOUT_GENERAL;
|
||||
|
||||
if (async_queue && vulkan->queue_index != async_queue_index)
|
||||
{
|
||||
prepare_presentation.srcQueueFamilyIndex = async_queue_index;
|
||||
prepare_presentation.dstQueueFamilyIndex = vulkan->queue_index;
|
||||
vk.need_acquire[vk.index] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
prepare_presentation.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
|
||||
prepare_presentation.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
|
||||
vk.need_acquire[vk.index] = false;
|
||||
}
|
||||
|
||||
prepare_presentation.image = vk.images[vk.index].create_info.image;
|
||||
prepare_presentation.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
|
||||
prepare_presentation.subresourceRange.levelCount = 1;
|
||||
prepare_presentation.subresourceRange.layerCount = 1;
|
||||
vkCmdPipelineBarrier(cmd, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
|
||||
VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT,
|
||||
false,
|
||||
0, NULL,
|
||||
0, NULL,
|
||||
1, &prepare_presentation);
|
||||
|
||||
vkEndCommandBuffer(cmd);
|
||||
|
||||
if (!async_queue)
|
||||
vulkan->lock_queue(vulkan->handle);
|
||||
|
||||
VkSubmitInfo submit = { VK_STRUCTURE_TYPE_SUBMIT_INFO };
|
||||
submit.commandBufferCount = 1;
|
||||
submit.pCommandBuffers = &cmd;
|
||||
submit.signalSemaphoreCount = 1;
|
||||
submit.pSignalSemaphores = &vk.acquire_semaphores[vk.index];
|
||||
vkQueueSubmit(async_queue != VK_NULL_HANDLE ? async_queue : vulkan->queue,
|
||||
1, &submit, VK_NULL_HANDLE);
|
||||
|
||||
if (!async_queue)
|
||||
vulkan->unlock_queue(vulkan->handle);
|
||||
}
|
||||
|
||||
static VkShaderModule create_shader_module(const uint32_t *data, size_t size)
|
||||
{
|
||||
VkShaderModuleCreateInfo module_info = { VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO };
|
||||
VkShaderModule module;
|
||||
module_info.codeSize = size;
|
||||
module_info.pCode = data;
|
||||
vkCreateShaderModule(vulkan->device, &module_info, NULL, &module);
|
||||
return module;
|
||||
}
|
||||
|
||||
static void init_descriptor(void)
|
||||
{
|
||||
VkDevice device = vulkan->device;
|
||||
|
||||
VkDescriptorSetLayoutBinding binding = {0};
|
||||
binding.binding = 0;
|
||||
binding.descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE;
|
||||
binding.descriptorCount = 1;
|
||||
binding.stageFlags = VK_SHADER_STAGE_COMPUTE_BIT;
|
||||
binding.pImmutableSamplers = NULL;
|
||||
|
||||
const VkDescriptorPoolSize pool_sizes[1] = {
|
||||
{ VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, vk.num_swapchain_images },
|
||||
};
|
||||
|
||||
const VkPushConstantRange range = {
|
||||
VK_SHADER_STAGE_COMPUTE_BIT,
|
||||
0, 16,
|
||||
};
|
||||
|
||||
VkDescriptorSetLayoutCreateInfo set_layout_info = { VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO };
|
||||
set_layout_info.bindingCount = 1;
|
||||
set_layout_info.pBindings = &binding;
|
||||
vkCreateDescriptorSetLayout(device, &set_layout_info, NULL, &vk.set_layout);
|
||||
|
||||
VkPipelineLayoutCreateInfo layout_info = { VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO };
|
||||
layout_info.setLayoutCount = 1;
|
||||
layout_info.pSetLayouts = &vk.set_layout;
|
||||
layout_info.pushConstantRangeCount = 1;
|
||||
layout_info.pPushConstantRanges = ⦥
|
||||
vkCreatePipelineLayout(device, &layout_info, NULL, &vk.pipeline_layout);
|
||||
|
||||
VkDescriptorPoolCreateInfo pool_info = { VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO };
|
||||
pool_info.maxSets = vk.num_swapchain_images;
|
||||
pool_info.poolSizeCount = 1;
|
||||
pool_info.pPoolSizes = pool_sizes;
|
||||
pool_info.flags = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT;
|
||||
vkCreateDescriptorPool(device, &pool_info, NULL, &vk.desc_pool);
|
||||
|
||||
VkDescriptorSetAllocateInfo alloc_info = { VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO };
|
||||
alloc_info.descriptorPool = vk.desc_pool;
|
||||
alloc_info.descriptorSetCount = 1;
|
||||
alloc_info.pSetLayouts = &vk.set_layout;
|
||||
|
||||
for (unsigned i = 0; i < vk.num_swapchain_images; i++)
|
||||
{
|
||||
vkAllocateDescriptorSets(device, &alloc_info, &vk.desc_set[i]);
|
||||
|
||||
VkWriteDescriptorSet write = { VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET };
|
||||
VkDescriptorImageInfo image_info;
|
||||
|
||||
write.dstSet = vk.desc_set[i];
|
||||
write.dstBinding = 0;
|
||||
write.descriptorCount = 1;
|
||||
write.descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE;
|
||||
write.pImageInfo = &image_info;
|
||||
|
||||
image_info.imageView = vk.images[i].image_view;
|
||||
image_info.imageLayout = VK_IMAGE_LAYOUT_GENERAL;
|
||||
image_info.sampler = VK_NULL_HANDLE;
|
||||
|
||||
vkUpdateDescriptorSets(device, 1, &write, 0, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static void init_pipeline(void)
|
||||
{
|
||||
VkDevice device = vulkan->device;
|
||||
|
||||
static const uint32_t raymarch_comp[] =
|
||||
#include "shaders/raymarch.comp.inc"
|
||||
;
|
||||
|
||||
VkComputePipelineCreateInfo pipe = { VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO };
|
||||
|
||||
pipe.stage.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO;
|
||||
pipe.stage.stage = VK_SHADER_STAGE_COMPUTE_BIT;
|
||||
pipe.stage.module = create_shader_module(raymarch_comp, sizeof(raymarch_comp));
|
||||
pipe.stage.pName = "main";
|
||||
pipe.layout = vk.pipeline_layout;
|
||||
|
||||
vkCreateComputePipelines(vulkan->device, vk.pipeline_cache, 1, &pipe, NULL, &vk.pipeline);
|
||||
vkDestroyShaderModule(device, pipe.stage.module, NULL);
|
||||
}
|
||||
|
||||
static void init_swapchain(void)
|
||||
{
|
||||
VkDevice device = vulkan->device;
|
||||
|
||||
for (unsigned i = 0; i < vk.num_swapchain_images; i++)
|
||||
{
|
||||
VkImageCreateInfo image = { VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO };
|
||||
|
||||
image.imageType = VK_IMAGE_TYPE_2D;
|
||||
image.flags |= VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT;
|
||||
image.format = VK_FORMAT_R8G8B8A8_UNORM;
|
||||
image.extent.width = BASE_WIDTH;
|
||||
image.extent.height = BASE_HEIGHT;
|
||||
image.extent.depth = 1;
|
||||
image.samples = VK_SAMPLE_COUNT_1_BIT;
|
||||
image.tiling = VK_IMAGE_TILING_OPTIMAL;
|
||||
image.usage =
|
||||
VK_IMAGE_USAGE_STORAGE_BIT |
|
||||
VK_IMAGE_USAGE_SAMPLED_BIT |
|
||||
VK_IMAGE_USAGE_TRANSFER_SRC_BIT;
|
||||
image.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
|
||||
image.mipLevels = 1;
|
||||
image.arrayLayers = 1;
|
||||
|
||||
uint32_t share_queues[] = { async_queue_index, vulkan->queue_index };
|
||||
if (async_queue && async_queue_index != vulkan->queue_index)
|
||||
{
|
||||
image.queueFamilyIndexCount = 2;
|
||||
image.pQueueFamilyIndices = share_queues;
|
||||
}
|
||||
|
||||
vkCreateImage(device, &image, NULL, &vk.images[i].create_info.image);
|
||||
|
||||
VkMemoryAllocateInfo alloc = { VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO };
|
||||
VkMemoryRequirements mem_reqs;
|
||||
|
||||
vkGetImageMemoryRequirements(device, vk.images[i].create_info.image, &mem_reqs);
|
||||
alloc.allocationSize = mem_reqs.size;
|
||||
alloc.memoryTypeIndex = find_memory_type_from_requirements(
|
||||
mem_reqs.memoryTypeBits, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT);
|
||||
vkAllocateMemory(device, &alloc, NULL, &vk.image_memory[i]);
|
||||
vkBindImageMemory(device, vk.images[i].create_info.image, vk.image_memory[i], 0);
|
||||
|
||||
vk.images[i].create_info.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO;
|
||||
vk.images[i].create_info.viewType = VK_IMAGE_VIEW_TYPE_2D;
|
||||
vk.images[i].create_info.format = VK_FORMAT_R8G8B8A8_UNORM;
|
||||
vk.images[i].create_info.subresourceRange.baseMipLevel = 0;
|
||||
vk.images[i].create_info.subresourceRange.baseArrayLayer = 0;
|
||||
vk.images[i].create_info.subresourceRange.levelCount = 1;
|
||||
vk.images[i].create_info.subresourceRange.layerCount = 1;
|
||||
vk.images[i].create_info.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
|
||||
vk.images[i].create_info.components.r = VK_COMPONENT_SWIZZLE_R;
|
||||
vk.images[i].create_info.components.g = VK_COMPONENT_SWIZZLE_G;
|
||||
vk.images[i].create_info.components.b = VK_COMPONENT_SWIZZLE_B;
|
||||
vk.images[i].create_info.components.a = VK_COMPONENT_SWIZZLE_A;
|
||||
|
||||
vkCreateImageView(device, &vk.images[i].create_info,
|
||||
NULL, &vk.images[i].image_view);
|
||||
vk.images[i].image_layout = VK_IMAGE_LAYOUT_GENERAL;
|
||||
|
||||
VkSemaphoreCreateInfo sem_info = { VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO };
|
||||
vkCreateSemaphore(device, &sem_info, NULL, &vk.acquire_semaphores[i]);
|
||||
}
|
||||
}
|
||||
|
||||
static void init_command(void)
|
||||
{
|
||||
VkCommandPoolCreateInfo pool_info = { VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO };
|
||||
VkCommandBufferAllocateInfo info = { VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO };
|
||||
|
||||
pool_info.queueFamilyIndex = async_queue != VK_NULL_HANDLE ?
|
||||
async_queue_index : vulkan->queue_index;
|
||||
pool_info.flags = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT;
|
||||
|
||||
for (unsigned i = 0; i < vk.num_swapchain_images; i++)
|
||||
{
|
||||
vkCreateCommandPool(vulkan->device, &pool_info, NULL, &vk.cmd_pool[i]);
|
||||
info.commandPool = vk.cmd_pool[i];
|
||||
info.level = VK_COMMAND_BUFFER_LEVEL_PRIMARY;
|
||||
info.commandBufferCount = 1;
|
||||
vkAllocateCommandBuffers(vulkan->device, &info, &vk.cmd[i]);
|
||||
}
|
||||
}
|
||||
|
||||
static void vulkan_test_init(void)
|
||||
{
|
||||
vkGetPhysicalDeviceProperties(vulkan->gpu, &vk.gpu_properties);
|
||||
vkGetPhysicalDeviceMemoryProperties(vulkan->gpu, &vk.memory_properties);
|
||||
|
||||
unsigned num_images = 0;
|
||||
uint32_t mask = vulkan->get_sync_index_mask(vulkan->handle);
|
||||
for (unsigned i = 0; i < 32; i++)
|
||||
if (mask & (1u << i))
|
||||
num_images = i + 1;
|
||||
vk.num_swapchain_images = num_images;
|
||||
vk.swapchain_mask = mask;
|
||||
|
||||
init_command();
|
||||
init_swapchain();
|
||||
init_descriptor();
|
||||
|
||||
VkPipelineCacheCreateInfo pipeline_cache_info = { VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO };
|
||||
vkCreatePipelineCache(vulkan->device, &pipeline_cache_info,
|
||||
NULL, &vk.pipeline_cache);
|
||||
|
||||
init_pipeline();
|
||||
}
|
||||
|
||||
static void vulkan_test_deinit(void)
|
||||
{
|
||||
if (!vulkan)
|
||||
return;
|
||||
|
||||
VkDevice device = vulkan->device;
|
||||
vkDeviceWaitIdle(device);
|
||||
|
||||
for (unsigned i = 0; i < vk.num_swapchain_images; i++)
|
||||
{
|
||||
vkDestroyImageView(device, vk.images[i].image_view, NULL);
|
||||
vkFreeMemory(device, vk.image_memory[i], NULL);
|
||||
vkDestroyImage(device, vk.images[i].create_info.image, NULL);
|
||||
vkDestroySemaphore(device, vk.acquire_semaphores[i], NULL);
|
||||
}
|
||||
|
||||
vkFreeDescriptorSets(device, vk.desc_pool, vk.num_swapchain_images, vk.desc_set);
|
||||
vkDestroyDescriptorPool(device, vk.desc_pool, NULL);
|
||||
|
||||
vkDestroyPipeline(device, vk.pipeline, NULL);
|
||||
vkDestroyDescriptorSetLayout(device, vk.set_layout, NULL);
|
||||
vkDestroyPipelineLayout(device, vk.pipeline_layout, NULL);
|
||||
vkDestroyPipelineCache(device, vk.pipeline_cache, NULL);
|
||||
|
||||
for (unsigned i = 0; i < vk.num_swapchain_images; i++)
|
||||
{
|
||||
vkFreeCommandBuffers(device, vk.cmd_pool[i], 1, &vk.cmd[i]);
|
||||
vkDestroyCommandPool(device, vk.cmd_pool[i], NULL);
|
||||
}
|
||||
|
||||
memset(&vk, 0, sizeof(vk));
|
||||
}
|
||||
|
||||
void retro_run(void)
|
||||
{
|
||||
input_poll_cb();
|
||||
|
||||
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_UP))
|
||||
{
|
||||
}
|
||||
|
||||
/* Very lazy way to do this. */
|
||||
if (vulkan->get_sync_index_mask(vulkan->handle) != vk.swapchain_mask)
|
||||
{
|
||||
vulkan_test_deinit();
|
||||
vulkan_test_init();
|
||||
}
|
||||
|
||||
vulkan->wait_sync_index(vulkan->handle);
|
||||
|
||||
vk.index = vulkan->get_sync_index(vulkan->handle);
|
||||
vulkan_test_render();
|
||||
vulkan->set_image(vulkan->handle, &vk.images[vk.index],
|
||||
1, &vk.acquire_semaphores[vk.index],
|
||||
async_queue && async_queue_index != vulkan->queue_index ?
|
||||
async_queue_index : VK_QUEUE_FAMILY_IGNORED);
|
||||
video_cb(RETRO_HW_FRAME_BUFFER_VALID, BASE_WIDTH, BASE_HEIGHT, 0);
|
||||
}
|
||||
|
||||
static void context_reset(void)
|
||||
{
|
||||
fprintf(stderr, "Context reset!\n");
|
||||
if (!environ_cb(RETRO_ENVIRONMENT_GET_HW_RENDER_INTERFACE, (void**)&vulkan) || !vulkan)
|
||||
{
|
||||
fprintf(stderr, "Failed to get HW rendering interface!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (vulkan->interface_version != RETRO_HW_RENDER_INTERFACE_VULKAN_VERSION)
|
||||
{
|
||||
fprintf(stderr, "HW render interface mismatch, expected %u, got %u!\n",
|
||||
RETRO_HW_RENDER_INTERFACE_VULKAN_VERSION, vulkan->interface_version);
|
||||
vulkan = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
vulkan_symbol_wrapper_init(vulkan->get_instance_proc_addr);
|
||||
vulkan_symbol_wrapper_load_core_instance_symbols(vulkan->instance);
|
||||
vulkan_symbol_wrapper_load_core_device_symbols(vulkan->device);
|
||||
vulkan_test_init();
|
||||
}
|
||||
|
||||
static void context_destroy(void)
|
||||
{
|
||||
fprintf(stderr, "Context destroy!\n");
|
||||
vulkan_test_deinit();
|
||||
vulkan = NULL;
|
||||
memset(&vk, 0, sizeof(vk));
|
||||
}
|
||||
|
||||
static const VkApplicationInfo *get_application_info(void)
|
||||
{
|
||||
static const VkApplicationInfo info = {
|
||||
VK_STRUCTURE_TYPE_APPLICATION_INFO,
|
||||
NULL,
|
||||
"libretro-test-vulkan-async-compute",
|
||||
0,
|
||||
"libretro-test-vulkan-async-compute",
|
||||
0,
|
||||
VK_MAKE_VERSION(1, 0, 18),
|
||||
};
|
||||
return &info;
|
||||
}
|
||||
|
||||
static bool create_device(struct retro_vulkan_context *context,
|
||||
VkInstance instance,
|
||||
VkPhysicalDevice gpu,
|
||||
VkSurfaceKHR surface,
|
||||
PFN_vkGetInstanceProcAddr get_instance_proc_addr,
|
||||
const char **required_device_extensions,
|
||||
unsigned num_required_device_extensions,
|
||||
const char **required_device_layers,
|
||||
unsigned num_required_device_layers,
|
||||
const VkPhysicalDeviceFeatures *required_features)
|
||||
{
|
||||
async_queue = VK_NULL_HANDLE;
|
||||
vulkan_symbol_wrapper_init(get_instance_proc_addr);
|
||||
vulkan_symbol_wrapper_load_core_symbols(instance);
|
||||
|
||||
if (gpu == VK_NULL_HANDLE)
|
||||
{
|
||||
uint32_t gpu_count;
|
||||
vkEnumeratePhysicalDevices(instance, &gpu_count, NULL);
|
||||
if (!gpu_count)
|
||||
return false;
|
||||
VkPhysicalDevice *gpus = calloc(gpu_count, sizeof(*gpus));
|
||||
if (!gpus)
|
||||
return false;
|
||||
|
||||
vkEnumeratePhysicalDevices(instance, &gpu_count, gpus);
|
||||
gpu = gpus[0];
|
||||
free(gpus);
|
||||
}
|
||||
|
||||
context->gpu = gpu;
|
||||
|
||||
uint32_t queue_count;
|
||||
VkQueueFamilyProperties *queue_properties = NULL;
|
||||
vkGetPhysicalDeviceQueueFamilyProperties(gpu, &queue_count, NULL);
|
||||
if (queue_count < 1)
|
||||
return false;
|
||||
queue_properties = calloc(queue_count, sizeof(*queue_properties));
|
||||
if (!queue_properties)
|
||||
return false;
|
||||
vkGetPhysicalDeviceQueueFamilyProperties(gpu, &queue_count, queue_properties);
|
||||
|
||||
if (surface != VK_NULL_HANDLE)
|
||||
{
|
||||
VULKAN_SYMBOL_WRAPPER_LOAD_INSTANCE_EXTENSION_SYMBOL(instance,
|
||||
vkGetPhysicalDeviceSurfaceSupportKHR);
|
||||
}
|
||||
|
||||
bool found_queue = false;
|
||||
for (uint32_t i = 0; i < queue_count; i++)
|
||||
{
|
||||
VkBool32 supported = surface == VK_NULL_HANDLE;
|
||||
|
||||
if (surface != VK_NULL_HANDLE)
|
||||
{
|
||||
vkGetPhysicalDeviceSurfaceSupportKHR(
|
||||
gpu, i, surface, &supported);
|
||||
}
|
||||
|
||||
VkQueueFlags required = VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT;
|
||||
if (supported && ((queue_properties[i].queueFlags & required) == required))
|
||||
{
|
||||
context->queue_family_index = i;
|
||||
found_queue = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found_queue)
|
||||
{
|
||||
free(queue_properties);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool same_queue_async = false;
|
||||
if (queue_properties[context->queue_family_index].queueCount >= 2)
|
||||
same_queue_async = true;
|
||||
|
||||
if (!same_queue_async)
|
||||
{
|
||||
found_queue = false;
|
||||
for (uint32_t i = 0; i < queue_count; i++)
|
||||
{
|
||||
if (i == context->queue_family_index)
|
||||
continue;
|
||||
|
||||
VkQueueFlags required = VK_QUEUE_COMPUTE_BIT;
|
||||
if ((queue_properties[i].queueFlags & required) == required)
|
||||
{
|
||||
async_queue_index = i;
|
||||
found_queue = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
async_queue_index = context->queue_family_index;
|
||||
|
||||
free(queue_properties);
|
||||
if (!found_queue)
|
||||
return false;
|
||||
|
||||
const float prios[] = { 0.5f, 0.5f };
|
||||
VkDeviceQueueCreateInfo queues[2] = {
|
||||
{ VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO },
|
||||
{ VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO },
|
||||
};
|
||||
|
||||
if (same_queue_async)
|
||||
{
|
||||
queues[0].queueFamilyIndex = context->queue_family_index;
|
||||
queues[0].queueCount = 2;
|
||||
queues[0].pQueuePriorities = prios;
|
||||
}
|
||||
else
|
||||
{
|
||||
queues[0].queueFamilyIndex = context->queue_family_index;
|
||||
queues[0].queueCount = 1;
|
||||
queues[0].pQueuePriorities = &prios[0];
|
||||
queues[1].queueFamilyIndex = async_queue_index;
|
||||
queues[1].queueCount = 1;
|
||||
queues[1].pQueuePriorities = &prios[1];
|
||||
}
|
||||
|
||||
VkDeviceCreateInfo device_info = { VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO };
|
||||
device_info.enabledExtensionCount = num_required_device_extensions;
|
||||
device_info.ppEnabledExtensionNames = required_device_extensions;
|
||||
device_info.enabledLayerCount = num_required_device_layers;
|
||||
device_info.ppEnabledLayerNames = required_device_layers;
|
||||
device_info.queueCreateInfoCount = same_queue_async ? 1 : 2;
|
||||
device_info.pQueueCreateInfos = queues;
|
||||
|
||||
if (vkCreateDevice(gpu, &device_info, NULL, &context->device) != VK_SUCCESS)
|
||||
return false;
|
||||
|
||||
vkGetDeviceQueue(context->device, context->queue_family_index, 0, &context->queue);
|
||||
if (same_queue_async)
|
||||
vkGetDeviceQueue(context->device, context->queue_family_index, 1, &async_queue);
|
||||
else
|
||||
vkGetDeviceQueue(context->device, async_queue_index, 0, &async_queue);
|
||||
|
||||
context->presentation_queue = context->queue;
|
||||
context->presentation_queue_family_index = context->queue_family_index;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool retro_init_hw_context(void)
|
||||
{
|
||||
hw_render.context_type = RETRO_HW_CONTEXT_VULKAN;
|
||||
hw_render.version_major = VK_MAKE_VERSION(1, 0, 18);
|
||||
hw_render.version_minor = 0;
|
||||
hw_render.context_reset = context_reset;
|
||||
hw_render.context_destroy = context_destroy;
|
||||
hw_render.cache_context = false;
|
||||
if (!environ_cb(RETRO_ENVIRONMENT_SET_HW_RENDER, &hw_render))
|
||||
return false;
|
||||
|
||||
static const struct retro_hw_render_context_negotiation_interface_vulkan iface = {
|
||||
RETRO_HW_RENDER_CONTEXT_NEGOTIATION_INTERFACE_VULKAN,
|
||||
RETRO_HW_RENDER_CONTEXT_NEGOTIATION_INTERFACE_VULKAN_VERSION,
|
||||
|
||||
get_application_info,
|
||||
create_device,
|
||||
};
|
||||
|
||||
environ_cb(RETRO_ENVIRONMENT_SET_HW_RENDER_CONTEXT_NEGOTIATION_INTERFACE, (void*)&iface);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool retro_load_game(const struct retro_game_info *info)
|
||||
{
|
||||
if (!retro_init_hw_context())
|
||||
{
|
||||
fprintf(stderr, "HW Context could not be initialized, exiting...\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
fprintf(stderr, "Loaded game!\n");
|
||||
(void)info;
|
||||
|
||||
frame_count = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
void retro_unload_game(void)
|
||||
{}
|
||||
|
||||
unsigned retro_get_region(void)
|
||||
{
|
||||
return RETRO_REGION_NTSC;
|
||||
}
|
||||
|
||||
bool retro_load_game_special(unsigned type, const struct retro_game_info *info, size_t num)
|
||||
{
|
||||
(void)type;
|
||||
(void)info;
|
||||
(void)num;
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t retro_serialize_size(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool retro_serialize(void *data, size_t size)
|
||||
{
|
||||
(void)data;
|
||||
(void)size;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool retro_unserialize(const void *data, size_t size)
|
||||
{
|
||||
(void)data;
|
||||
(void)size;
|
||||
return false;
|
||||
}
|
||||
|
||||
void *retro_get_memory_data(unsigned id)
|
||||
{
|
||||
(void)id;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
size_t retro_get_memory_size(unsigned id)
|
||||
{
|
||||
(void)id;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void retro_reset(void)
|
||||
{}
|
||||
|
||||
void retro_cheat_reset(void)
|
||||
{}
|
||||
|
||||
void retro_cheat_set(unsigned index, bool enabled, const char *code)
|
||||
{
|
||||
(void)index;
|
||||
(void)enabled;
|
||||
(void)code;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
global: retro_*;
|
||||
local: *;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
COMP_SHADERS := $(wildcard *.comp)
|
||||
SPIRV := $(COMP_SHADERS:.comp=.comp.inc)
|
||||
|
||||
GLSLANG := glslc
|
||||
GLSLFLAGS := -mfmt=c
|
||||
|
||||
all: $(SPIRV)
|
||||
|
||||
%.comp.inc: %.comp
|
||||
$(GLSLANG) $(GLSLFLAGS) -o $@ $<
|
||||
|
||||
clean:
|
||||
rm -f $(SPIRV)
|
||||
|
||||
.PHONY: clean
|
||||
@@ -0,0 +1,18 @@
|
||||
#version 310 es
|
||||
layout(local_size_x = 8, local_size_y = 8) in;
|
||||
|
||||
layout(rgba8, set = 0, binding = 0) uniform writeonly mediump image2D uImage;
|
||||
|
||||
layout(push_constant, std430) uniform PushConstants
|
||||
{
|
||||
vec2 inv_resolution;
|
||||
float frame;
|
||||
float dummy;
|
||||
} constants;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec2 uv = (vec2(gl_GlobalInvocationID.xy) + 0.5) * constants.inv_resolution;
|
||||
vec4 color = vec4(sin(uv.x * 50.0 + constants.frame * 0.1) + 0.5, cos(uv.y * 55.0 + constants.frame * 0.2), 0.2, 1.0);
|
||||
imageStore(uImage, ivec2(gl_GlobalInvocationID.xy), color);
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
{0x07230203,0x00010000,0x00080001,0x00000048,
|
||||
0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,
|
||||
0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x0006000f,0x00000005,0x00000004,0x6e69616d,
|
||||
0x00000000,0x0000000d,0x00060010,0x00000004,
|
||||
0x00000011,0x00000008,0x00000008,0x00000001,
|
||||
0x00030003,0x00000001,0x00000136,0x000a0004,
|
||||
0x475f4c47,0x4c474f4f,0x70635f45,0x74735f70,
|
||||
0x5f656c79,0x656e696c,0x7269645f,0x69746365,
|
||||
0x00006576,0x00080004,0x475f4c47,0x4c474f4f,
|
||||
0x6e695f45,0x64756c63,0x69645f65,0x74636572,
|
||||
0x00657669,0x00040005,0x00000004,0x6e69616d,
|
||||
0x00000000,0x00030005,0x00000009,0x00007675,
|
||||
0x00080005,0x0000000d,0x475f6c67,0x61626f6c,
|
||||
0x766e496c,0x7461636f,0x496e6f69,0x00000044,
|
||||
0x00060005,0x00000015,0x68737550,0x736e6f43,
|
||||
0x746e6174,0x00000073,0x00070006,0x00000015,
|
||||
0x00000000,0x5f766e69,0x6f736572,0x6974756c,
|
||||
0x00006e6f,0x00050006,0x00000015,0x00000001,
|
||||
0x6d617266,0x00000065,0x00050006,0x00000015,
|
||||
0x00000002,0x6d6d7564,0x00000079,0x00050005,
|
||||
0x00000017,0x736e6f63,0x746e6174,0x00000073,
|
||||
0x00040005,0x00000020,0x6f6c6f63,0x00000072,
|
||||
0x00040005,0x0000003f,0x616d4975,0x00006567,
|
||||
0x00040047,0x0000000d,0x0000000b,0x0000001c,
|
||||
0x00050048,0x00000015,0x00000000,0x00000023,
|
||||
0x00000000,0x00050048,0x00000015,0x00000001,
|
||||
0x00000023,0x00000008,0x00050048,0x00000015,
|
||||
0x00000002,0x00000023,0x0000000c,0x00030047,
|
||||
0x00000015,0x00000002,0x00030047,0x0000003f,
|
||||
0x00000000,0x00040047,0x0000003f,0x00000022,
|
||||
0x00000000,0x00040047,0x0000003f,0x00000021,
|
||||
0x00000000,0x00030047,0x0000003f,0x00000019,
|
||||
0x00030047,0x00000040,0x00000000,0x00040047,
|
||||
0x00000047,0x0000000b,0x00000019,0x00020013,
|
||||
0x00000002,0x00030021,0x00000003,0x00000002,
|
||||
0x00030016,0x00000006,0x00000020,0x00040017,
|
||||
0x00000007,0x00000006,0x00000002,0x00040020,
|
||||
0x00000008,0x00000007,0x00000007,0x00040015,
|
||||
0x0000000a,0x00000020,0x00000000,0x00040017,
|
||||
0x0000000b,0x0000000a,0x00000003,0x00040020,
|
||||
0x0000000c,0x00000001,0x0000000b,0x0004003b,
|
||||
0x0000000c,0x0000000d,0x00000001,0x00040017,
|
||||
0x0000000e,0x0000000a,0x00000002,0x0004002b,
|
||||
0x00000006,0x00000012,0x3f000000,0x0005001e,
|
||||
0x00000015,0x00000007,0x00000006,0x00000006,
|
||||
0x00040020,0x00000016,0x00000009,0x00000015,
|
||||
0x0004003b,0x00000016,0x00000017,0x00000009,
|
||||
0x00040015,0x00000018,0x00000020,0x00000001,
|
||||
0x0004002b,0x00000018,0x00000019,0x00000000,
|
||||
0x00040020,0x0000001a,0x00000009,0x00000007,
|
||||
0x00040017,0x0000001e,0x00000006,0x00000004,
|
||||
0x00040020,0x0000001f,0x00000007,0x0000001e,
|
||||
0x0004002b,0x0000000a,0x00000021,0x00000000,
|
||||
0x00040020,0x00000022,0x00000007,0x00000006,
|
||||
0x0004002b,0x00000006,0x00000025,0x42480000,
|
||||
0x0004002b,0x00000018,0x00000027,0x00000001,
|
||||
0x00040020,0x00000028,0x00000009,0x00000006,
|
||||
0x0004002b,0x00000006,0x0000002b,0x3dcccccd,
|
||||
0x0004002b,0x0000000a,0x00000030,0x00000001,
|
||||
0x0004002b,0x00000006,0x00000033,0x425c0000,
|
||||
0x0004002b,0x00000006,0x00000037,0x3e4ccccd,
|
||||
0x0004002b,0x00000006,0x0000003b,0x3f800000,
|
||||
0x00090019,0x0000003d,0x00000006,0x00000001,
|
||||
0x00000000,0x00000000,0x00000000,0x00000002,
|
||||
0x00000004,0x00040020,0x0000003e,0x00000000,
|
||||
0x0000003d,0x0004003b,0x0000003e,0x0000003f,
|
||||
0x00000000,0x00040017,0x00000043,0x00000018,
|
||||
0x00000002,0x0004002b,0x0000000a,0x00000046,
|
||||
0x00000008,0x0006002c,0x0000000b,0x00000047,
|
||||
0x00000046,0x00000046,0x00000030,0x00050036,
|
||||
0x00000002,0x00000004,0x00000000,0x00000003,
|
||||
0x000200f8,0x00000005,0x0004003b,0x00000008,
|
||||
0x00000009,0x00000007,0x0004003b,0x0000001f,
|
||||
0x00000020,0x00000007,0x0004003d,0x0000000b,
|
||||
0x0000000f,0x0000000d,0x0007004f,0x0000000e,
|
||||
0x00000010,0x0000000f,0x0000000f,0x00000000,
|
||||
0x00000001,0x00040070,0x00000007,0x00000011,
|
||||
0x00000010,0x00050050,0x00000007,0x00000013,
|
||||
0x00000012,0x00000012,0x00050081,0x00000007,
|
||||
0x00000014,0x00000011,0x00000013,0x00050041,
|
||||
0x0000001a,0x0000001b,0x00000017,0x00000019,
|
||||
0x0004003d,0x00000007,0x0000001c,0x0000001b,
|
||||
0x00050085,0x00000007,0x0000001d,0x00000014,
|
||||
0x0000001c,0x0003003e,0x00000009,0x0000001d,
|
||||
0x00050041,0x00000022,0x00000023,0x00000009,
|
||||
0x00000021,0x0004003d,0x00000006,0x00000024,
|
||||
0x00000023,0x00050085,0x00000006,0x00000026,
|
||||
0x00000024,0x00000025,0x00050041,0x00000028,
|
||||
0x00000029,0x00000017,0x00000027,0x0004003d,
|
||||
0x00000006,0x0000002a,0x00000029,0x00050085,
|
||||
0x00000006,0x0000002c,0x0000002a,0x0000002b,
|
||||
0x00050081,0x00000006,0x0000002d,0x00000026,
|
||||
0x0000002c,0x0006000c,0x00000006,0x0000002e,
|
||||
0x00000001,0x0000000d,0x0000002d,0x00050081,
|
||||
0x00000006,0x0000002f,0x0000002e,0x00000012,
|
||||
0x00050041,0x00000022,0x00000031,0x00000009,
|
||||
0x00000030,0x0004003d,0x00000006,0x00000032,
|
||||
0x00000031,0x00050085,0x00000006,0x00000034,
|
||||
0x00000032,0x00000033,0x00050041,0x00000028,
|
||||
0x00000035,0x00000017,0x00000027,0x0004003d,
|
||||
0x00000006,0x00000036,0x00000035,0x00050085,
|
||||
0x00000006,0x00000038,0x00000036,0x00000037,
|
||||
0x00050081,0x00000006,0x00000039,0x00000034,
|
||||
0x00000038,0x0006000c,0x00000006,0x0000003a,
|
||||
0x00000001,0x0000000e,0x00000039,0x00070050,
|
||||
0x0000001e,0x0000003c,0x0000002f,0x0000003a,
|
||||
0x00000037,0x0000003b,0x0003003e,0x00000020,
|
||||
0x0000003c,0x0004003d,0x0000003d,0x00000040,
|
||||
0x0000003f,0x0004003d,0x0000000b,0x00000041,
|
||||
0x0000000d,0x0007004f,0x0000000e,0x00000042,
|
||||
0x00000041,0x00000041,0x00000000,0x00000001,
|
||||
0x0004007c,0x00000043,0x00000044,0x00000042,
|
||||
0x0004003d,0x0000001e,0x00000045,0x00000020,
|
||||
0x00040063,0x00000040,0x00000044,0x00000045,
|
||||
0x000100fd,0x00010038}
|
||||
@@ -43,8 +43,8 @@ else
|
||||
CFLAGS += -O3
|
||||
endif
|
||||
|
||||
CFLAGS += -std=gnu99
|
||||
OBJECTS := libretro-test.o
|
||||
CFLAGS += -std=gnu99 -I../../gfx/include
|
||||
OBJECTS := libretro-test.o ../../libretro-common/vulkan/vulkan_symbol_wrapper.o
|
||||
CFLAGS += -Wall -pedantic $(fpic)
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
@@ -4,9 +4,8 @@
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "../../libretro_vulkan.h"
|
||||
#include "shaders/triangle.vert.inc"
|
||||
#include "shaders/triangle.frag.inc"
|
||||
#include "vulkan/vulkan_symbol_wrapper.h"
|
||||
#include <libretro_vulkan.h>
|
||||
|
||||
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
|
||||
static struct retro_hw_render_callback hw_render;
|
||||
@@ -16,294 +15,6 @@ static const struct retro_hw_render_interface_vulkan *vulkan;
|
||||
#define BASE_HEIGHT 240
|
||||
#define MAX_SYNC 8
|
||||
|
||||
/* We'll probably want a libretro common solution for this, but this will do for now. */
|
||||
#define VK_GET_DEVICE_PROC_ADDR(entrypoint) do { \
|
||||
vkcfp.vk##entrypoint = (PFN_vk##entrypoint) vulkan->get_device_proc_addr(vulkan->device, \
|
||||
"vk" #entrypoint); \
|
||||
} while(0)
|
||||
|
||||
#define VK_GET_INSTANCE_PROC_ADDR(entrypoint) do { \
|
||||
vkcfp.vk##entrypoint = (PFN_vk##entrypoint) vulkan->get_instance_proc_addr(vulkan->instance, \
|
||||
"vk" #entrypoint); \
|
||||
} while(0)
|
||||
|
||||
typedef struct vulkan_context_fp
|
||||
{
|
||||
/* Device */
|
||||
PFN_vkDeviceWaitIdle vkDeviceWaitIdle;
|
||||
|
||||
/* Device Memory */
|
||||
PFN_vkAllocateMemory vkAllocateMemory;
|
||||
PFN_vkFreeMemory vkFreeMemory;
|
||||
|
||||
/* Command Function Pointers */
|
||||
PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr;
|
||||
PFN_vkGetDeviceProcAddr vkGetDeviceProcAddr;
|
||||
|
||||
/* Buffers */
|
||||
PFN_vkCreateBuffer vkCreateBuffer;
|
||||
PFN_vkDestroyBuffer vkDestroyBuffer;
|
||||
|
||||
/* Fences */
|
||||
PFN_vkCreateFence vkCreateFence;
|
||||
PFN_vkDestroyFence vkDestroyFence;
|
||||
PFN_vkResetFences vkResetFences;
|
||||
PFN_vkWaitForFences vkWaitForFences;
|
||||
|
||||
/* Semaphores */
|
||||
PFN_vkCreateSemaphore vkCreateSemaphore;
|
||||
PFN_vkDestroySemaphore vkDestroySemaphore;
|
||||
|
||||
/* Images */
|
||||
PFN_vkCreateImage vkCreateImage;
|
||||
PFN_vkDestroyImage vkDestroyImage;
|
||||
PFN_vkGetImageSubresourceLayout vkGetImageSubresourceLayout;
|
||||
|
||||
/* Images (Resource Memory Association) */
|
||||
PFN_vkGetBufferMemoryRequirements vkGetBufferMemoryRequirements;
|
||||
PFN_vkBindBufferMemory vkBindBufferMemory;
|
||||
PFN_vkBindImageMemory vkBindImageMemory;
|
||||
|
||||
/* Image Views */
|
||||
PFN_vkCreateImageView vkCreateImageView;
|
||||
PFN_vkDestroyImageView vkDestroyImageView;
|
||||
|
||||
/* Image Views (Resource Memory Association) */
|
||||
PFN_vkGetImageMemoryRequirements vkGetImageMemoryRequirements;
|
||||
|
||||
/* Queues */
|
||||
PFN_vkGetDeviceQueue vkGetDeviceQueue;
|
||||
PFN_vkQueueWaitIdle vkQueueWaitIdle;
|
||||
|
||||
/* Pipelines */
|
||||
PFN_vkDestroyPipeline vkDestroyPipeline;
|
||||
PFN_vkCreateGraphicsPipelines vkCreateGraphicsPipelines;
|
||||
|
||||
/* Pipeline Layouts */
|
||||
PFN_vkCreatePipelineLayout vkCreatePipelineLayout;
|
||||
PFN_vkDestroyPipelineLayout vkDestroyPipelineLayout;
|
||||
|
||||
/* Pipeline Cache */
|
||||
PFN_vkCreatePipelineCache vkCreatePipelineCache;
|
||||
PFN_vkDestroyPipelineCache vkDestroyPipelineCache;
|
||||
|
||||
/* Pipeline Barriers */
|
||||
PFN_vkCmdPipelineBarrier vkCmdPipelineBarrier;
|
||||
|
||||
/* Descriptor pools */
|
||||
PFN_vkCreateDescriptorPool vkCreateDescriptorPool;
|
||||
PFN_vkDestroyDescriptorPool vkDestroyDescriptorPool;
|
||||
|
||||
/* Descriptor sets */
|
||||
PFN_vkAllocateDescriptorSets vkAllocateDescriptorSets;
|
||||
PFN_vkFreeDescriptorSets vkFreeDescriptorSets;
|
||||
PFN_vkCmdBindDescriptorSets vkCmdBindDescriptorSets;
|
||||
PFN_vkUpdateDescriptorSets vkUpdateDescriptorSets;
|
||||
|
||||
/* Descriptor Set Layout */
|
||||
PFN_vkCreateDescriptorSetLayout vkCreateDescriptorSetLayout;
|
||||
PFN_vkDestroyDescriptorSetLayout vkDestroyDescriptorSetLayout;
|
||||
|
||||
/* Command Buffers */
|
||||
PFN_vkCreateCommandPool vkCreateCommandPool;
|
||||
PFN_vkDestroyCommandPool vkDestroyCommandPool;
|
||||
PFN_vkBeginCommandBuffer vkBeginCommandBuffer;
|
||||
PFN_vkEndCommandBuffer vkEndCommandBuffer;
|
||||
PFN_vkResetCommandBuffer vkResetCommandBuffer;
|
||||
PFN_vkFreeCommandBuffers vkFreeCommandBuffers;
|
||||
PFN_vkAllocateCommandBuffers vkAllocateCommandBuffers;
|
||||
|
||||
/* Command Buffer Submission */
|
||||
PFN_vkQueueSubmit vkQueueSubmit;
|
||||
|
||||
/* Framebuffers */
|
||||
PFN_vkCreateFramebuffer vkCreateFramebuffer;
|
||||
PFN_vkDestroyFramebuffer vkDestroyFramebuffer;
|
||||
|
||||
/* Memory allocation */
|
||||
PFN_vkMapMemory vkMapMemory;
|
||||
PFN_vkUnmapMemory vkUnmapMemory;
|
||||
|
||||
/* Samplers */
|
||||
PFN_vkCreateSampler vkCreateSampler;
|
||||
PFN_vkDestroySampler vkDestroySampler;
|
||||
|
||||
/* Render Passes */
|
||||
PFN_vkCreateRenderPass vkCreateRenderPass;
|
||||
PFN_vkDestroyRenderPass vkDestroyRenderPass;
|
||||
|
||||
/* Image commands */
|
||||
PFN_vkCmdCopyImage vkCmdCopyImage;
|
||||
PFN_vkCmdClearColorImage vkCmdClearColorImage;
|
||||
|
||||
/* Pipeline commands */
|
||||
PFN_vkCmdBindPipeline vkCmdBindPipeline;
|
||||
|
||||
/* Vertex input descriptions */
|
||||
PFN_vkCmdBindVertexBuffers vkCmdBindVertexBuffers;
|
||||
|
||||
/* Render Pass commands */
|
||||
PFN_vkCmdBeginRenderPass vkCmdBeginRenderPass;
|
||||
PFN_vkCmdEndRenderPass vkCmdEndRenderPass;
|
||||
|
||||
/* Clear commands */
|
||||
PFN_vkCmdClearAttachments vkCmdClearAttachments;
|
||||
|
||||
/* Drawing commands */
|
||||
PFN_vkCmdDraw vkCmdDraw;
|
||||
|
||||
/* Fragment operations */
|
||||
PFN_vkCmdSetScissor vkCmdSetScissor;
|
||||
|
||||
/* Fixed-function vertex postprocessing */
|
||||
PFN_vkCmdSetViewport vkCmdSetViewport;
|
||||
|
||||
/* Shaders */
|
||||
PFN_vkCreateShaderModule vkCreateShaderModule;
|
||||
PFN_vkDestroyShaderModule vkDestroyShaderModule;
|
||||
|
||||
PFN_vkGetPhysicalDeviceProperties vkGetPhysicalDeviceProperties;
|
||||
PFN_vkGetPhysicalDeviceMemoryProperties vkGetPhysicalDeviceMemoryProperties;
|
||||
} vulkan_context_fp_t;
|
||||
|
||||
static vulkan_context_fp_t vkcfp;
|
||||
#define VKFUNC(sym) (vkcfp.sym)
|
||||
|
||||
static void load_device_symbols(void)
|
||||
{
|
||||
VK_GET_INSTANCE_PROC_ADDR(GetPhysicalDeviceProperties);
|
||||
VK_GET_INSTANCE_PROC_ADDR(GetPhysicalDeviceMemoryProperties);
|
||||
|
||||
/* Memory */
|
||||
VK_GET_DEVICE_PROC_ADDR(AllocateMemory);
|
||||
VK_GET_DEVICE_PROC_ADDR(FreeMemory);
|
||||
|
||||
/* Waiting */
|
||||
VK_GET_DEVICE_PROC_ADDR(DeviceWaitIdle);
|
||||
|
||||
/* Queues */
|
||||
VK_GET_DEVICE_PROC_ADDR(GetDeviceQueue);
|
||||
VK_GET_DEVICE_PROC_ADDR(QueueWaitIdle);
|
||||
VK_GET_DEVICE_PROC_ADDR(QueueSubmit);
|
||||
|
||||
/* Semaphores */
|
||||
VK_GET_DEVICE_PROC_ADDR(CreateSemaphore);
|
||||
VK_GET_DEVICE_PROC_ADDR(DestroySemaphore);
|
||||
|
||||
/* Buffers */
|
||||
VK_GET_DEVICE_PROC_ADDR(CreateBuffer);
|
||||
VK_GET_DEVICE_PROC_ADDR(DestroyBuffer);
|
||||
|
||||
/* Fences */
|
||||
VK_GET_DEVICE_PROC_ADDR(CreateFence);
|
||||
VK_GET_DEVICE_PROC_ADDR(DestroyFence);
|
||||
VK_GET_DEVICE_PROC_ADDR(ResetFences);
|
||||
VK_GET_DEVICE_PROC_ADDR(WaitForFences);
|
||||
|
||||
/* Images */
|
||||
VK_GET_DEVICE_PROC_ADDR(CreateImage);
|
||||
VK_GET_DEVICE_PROC_ADDR(DestroyImage);
|
||||
VK_GET_DEVICE_PROC_ADDR(GetImageSubresourceLayout);
|
||||
|
||||
/* Images (Resource Memory Association) */
|
||||
VK_GET_DEVICE_PROC_ADDR(GetBufferMemoryRequirements);
|
||||
VK_GET_DEVICE_PROC_ADDR(BindBufferMemory);
|
||||
VK_GET_DEVICE_PROC_ADDR(BindImageMemory);
|
||||
|
||||
/* Image Views */
|
||||
VK_GET_DEVICE_PROC_ADDR(CreateImageView);
|
||||
VK_GET_DEVICE_PROC_ADDR(DestroyImageView);
|
||||
|
||||
/* Resource Memory Associations */
|
||||
VK_GET_DEVICE_PROC_ADDR(GetImageMemoryRequirements);
|
||||
|
||||
/* Descriptor pools */
|
||||
VK_GET_DEVICE_PROC_ADDR(CreateDescriptorPool);
|
||||
VK_GET_DEVICE_PROC_ADDR(DestroyDescriptorPool);
|
||||
|
||||
/* Descriptor sets */
|
||||
VK_GET_DEVICE_PROC_ADDR(AllocateDescriptorSets);
|
||||
VK_GET_DEVICE_PROC_ADDR(FreeDescriptorSets);
|
||||
VK_GET_DEVICE_PROC_ADDR(UpdateDescriptorSets);
|
||||
|
||||
/* Descriptor Set Layout */
|
||||
VK_GET_DEVICE_PROC_ADDR(CreateDescriptorSetLayout);
|
||||
VK_GET_DEVICE_PROC_ADDR(DestroyDescriptorSetLayout);
|
||||
|
||||
/* Framebuffers */
|
||||
VK_GET_DEVICE_PROC_ADDR(CreateFramebuffer);
|
||||
VK_GET_DEVICE_PROC_ADDR(DestroyFramebuffer);
|
||||
VK_GET_DEVICE_PROC_ADDR(AllocateCommandBuffers);
|
||||
VK_GET_DEVICE_PROC_ADDR(FreeCommandBuffers);
|
||||
|
||||
/* Memory allocation */
|
||||
VK_GET_DEVICE_PROC_ADDR(MapMemory);
|
||||
VK_GET_DEVICE_PROC_ADDR(UnmapMemory);
|
||||
|
||||
/* Render Passes */
|
||||
VK_GET_DEVICE_PROC_ADDR(CreateRenderPass);
|
||||
VK_GET_DEVICE_PROC_ADDR(DestroyRenderPass);
|
||||
|
||||
/* Pipelines */
|
||||
VK_GET_DEVICE_PROC_ADDR(DestroyPipeline);
|
||||
VK_GET_DEVICE_PROC_ADDR(CreateGraphicsPipelines);
|
||||
|
||||
/* Shaders */
|
||||
VK_GET_DEVICE_PROC_ADDR(CreateShaderModule);
|
||||
VK_GET_DEVICE_PROC_ADDR(DestroyShaderModule);
|
||||
|
||||
/* Pipeline Layouts */
|
||||
VK_GET_DEVICE_PROC_ADDR(CreatePipelineLayout);
|
||||
VK_GET_DEVICE_PROC_ADDR(DestroyPipelineLayout);
|
||||
|
||||
/* Pipeline Cache */
|
||||
VK_GET_DEVICE_PROC_ADDR(CreatePipelineCache);
|
||||
VK_GET_DEVICE_PROC_ADDR(DestroyPipelineCache);
|
||||
|
||||
/* Command buffers */
|
||||
VK_GET_DEVICE_PROC_ADDR(CreateCommandPool);
|
||||
VK_GET_DEVICE_PROC_ADDR(DestroyCommandPool);
|
||||
VK_GET_DEVICE_PROC_ADDR(BeginCommandBuffer);
|
||||
VK_GET_DEVICE_PROC_ADDR(ResetCommandBuffer);
|
||||
VK_GET_DEVICE_PROC_ADDR(EndCommandBuffer);
|
||||
|
||||
/* Image commands */
|
||||
VK_GET_DEVICE_PROC_ADDR(CmdCopyImage);
|
||||
VK_GET_DEVICE_PROC_ADDR(CmdClearColorImage);
|
||||
|
||||
/* Vertex input descriptions */
|
||||
VK_GET_DEVICE_PROC_ADDR(CmdBindVertexBuffers);
|
||||
|
||||
/* Descriptor Set commands */
|
||||
VK_GET_DEVICE_PROC_ADDR(CmdBindDescriptorSets);
|
||||
|
||||
/* Fragment operations */
|
||||
VK_GET_DEVICE_PROC_ADDR(CmdSetScissor);
|
||||
|
||||
/* Render Pass commands */
|
||||
VK_GET_DEVICE_PROC_ADDR(CmdBeginRenderPass);
|
||||
VK_GET_DEVICE_PROC_ADDR(CmdEndRenderPass);
|
||||
|
||||
/* Samplers */
|
||||
VK_GET_DEVICE_PROC_ADDR(CreateSampler);
|
||||
VK_GET_DEVICE_PROC_ADDR(DestroySampler);
|
||||
|
||||
/* Fixed-function vertex postprocessing */
|
||||
VK_GET_DEVICE_PROC_ADDR(CmdSetViewport);
|
||||
|
||||
/* Clear commands */
|
||||
VK_GET_DEVICE_PROC_ADDR(CmdClearAttachments);
|
||||
|
||||
/* Pipeline */
|
||||
VK_GET_DEVICE_PROC_ADDR(CmdBindPipeline);
|
||||
|
||||
/* Pipeline Barriers */
|
||||
VK_GET_DEVICE_PROC_ADDR(CmdPipelineBarrier);
|
||||
|
||||
/* Drawing commands */
|
||||
VK_GET_DEVICE_PROC_ADDR(CmdDraw);
|
||||
}
|
||||
|
||||
struct buffer
|
||||
{
|
||||
VkBuffer buffer;
|
||||
@@ -454,10 +165,10 @@ static void update_ubo(void)
|
||||
tmp[15] = 1.0f;
|
||||
|
||||
float *mvp = NULL;
|
||||
VKFUNC(vkMapMemory)(vulkan->device, vk.ubo[vk.index].memory,
|
||||
vkMapMemory(vulkan->device, vk.ubo[vk.index].memory,
|
||||
0, 16 * sizeof(float), 0, (void**)&mvp);
|
||||
memcpy(mvp, tmp, sizeof(tmp));
|
||||
VKFUNC(vkUnmapMemory)(vulkan->device, vk.ubo[vk.index].memory);
|
||||
vkUnmapMemory(vulkan->device, vk.ubo[vk.index].memory);
|
||||
}
|
||||
|
||||
static void vulkan_test_render(void)
|
||||
@@ -468,8 +179,8 @@ static void vulkan_test_render(void)
|
||||
|
||||
VkCommandBufferBeginInfo begin_info = { VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO };
|
||||
begin_info.flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT;
|
||||
VKFUNC(vkResetCommandBuffer)(cmd, 0);
|
||||
VKFUNC(vkBeginCommandBuffer)(cmd, &begin_info);
|
||||
vkResetCommandBuffer(cmd, 0);
|
||||
vkBeginCommandBuffer(cmd, &begin_info);
|
||||
|
||||
VkImageMemoryBarrier prepare_rendering = { VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER };
|
||||
prepare_rendering.srcAccessMask = 0;
|
||||
@@ -482,7 +193,7 @@ static void vulkan_test_render(void)
|
||||
prepare_rendering.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
|
||||
prepare_rendering.subresourceRange.levelCount = 1;
|
||||
prepare_rendering.subresourceRange.layerCount = 1;
|
||||
VKFUNC(vkCmdPipelineBarrier)(cmd,
|
||||
vkCmdPipelineBarrier(cmd,
|
||||
VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
|
||||
false,
|
||||
0, NULL,
|
||||
@@ -502,10 +213,10 @@ static void vulkan_test_render(void)
|
||||
rp_begin.renderArea.extent.height = BASE_HEIGHT;
|
||||
rp_begin.clearValueCount = 1;
|
||||
rp_begin.pClearValues = &clear_value;
|
||||
VKFUNC(vkCmdBeginRenderPass)(cmd, &rp_begin, VK_SUBPASS_CONTENTS_INLINE);
|
||||
vkCmdBeginRenderPass(cmd, &rp_begin, VK_SUBPASS_CONTENTS_INLINE);
|
||||
|
||||
VKFUNC(vkCmdBindPipeline)(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, vk.pipeline);
|
||||
VKFUNC(vkCmdBindDescriptorSets)(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS,
|
||||
vkCmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, vk.pipeline);
|
||||
vkCmdBindDescriptorSets(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS,
|
||||
vk.pipeline_layout, 0,
|
||||
1, &vk.desc_set[vk.index], 0, NULL);
|
||||
|
||||
@@ -516,20 +227,20 @@ static void vulkan_test_render(void)
|
||||
vp.height = BASE_HEIGHT;
|
||||
vp.minDepth = 0.0f;
|
||||
vp.maxDepth = 1.0f;
|
||||
VKFUNC(vkCmdSetViewport)(cmd, 0, 1, &vp);
|
||||
vkCmdSetViewport(cmd, 0, 1, &vp);
|
||||
|
||||
VkRect2D scissor;
|
||||
memset(&scissor, 0, sizeof(scissor));
|
||||
scissor.extent.width = BASE_WIDTH;
|
||||
scissor.extent.height = BASE_HEIGHT;
|
||||
VKFUNC(vkCmdSetScissor)(cmd, 0, 1, &scissor);
|
||||
vkCmdSetScissor(cmd, 0, 1, &scissor);
|
||||
|
||||
VkDeviceSize offset = 0;
|
||||
VKFUNC(vkCmdBindVertexBuffers)(cmd, 0, 1, &vk.vbo.buffer, &offset);
|
||||
vkCmdBindVertexBuffers(cmd, 0, 1, &vk.vbo.buffer, &offset);
|
||||
|
||||
VKFUNC(vkCmdDraw)(cmd, 3, 1, 0, 0);
|
||||
vkCmdDraw(cmd, 3, 1, 0, 0);
|
||||
|
||||
VKFUNC(vkCmdEndRenderPass)(cmd);
|
||||
vkCmdEndRenderPass(cmd);
|
||||
|
||||
VkImageMemoryBarrier prepare_presentation = { VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER };
|
||||
prepare_presentation.srcAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
|
||||
@@ -543,14 +254,14 @@ static void vulkan_test_render(void)
|
||||
prepare_presentation.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
|
||||
prepare_presentation.subresourceRange.levelCount = 1;
|
||||
prepare_presentation.subresourceRange.layerCount = 1;
|
||||
VKFUNC(vkCmdPipelineBarrier)(cmd, VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT,
|
||||
vkCmdPipelineBarrier(cmd, VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT,
|
||||
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
|
||||
false,
|
||||
0, NULL,
|
||||
0, NULL,
|
||||
1, &prepare_presentation);
|
||||
|
||||
VKFUNC(vkEndCommandBuffer)(cmd);
|
||||
vkEndCommandBuffer(cmd);
|
||||
}
|
||||
|
||||
static struct buffer create_buffer(const void *initial, size_t size, VkBufferUsageFlags usage)
|
||||
@@ -562,10 +273,10 @@ static struct buffer create_buffer(const void *initial, size_t size, VkBufferUsa
|
||||
info.usage = usage;
|
||||
info.size = size;
|
||||
|
||||
VKFUNC(vkCreateBuffer)(device, &info, NULL, &buffer.buffer);
|
||||
vkCreateBuffer(device, &info, NULL, &buffer.buffer);
|
||||
|
||||
VkMemoryRequirements mem_reqs;
|
||||
VKFUNC(vkGetBufferMemoryRequirements)(device, buffer.buffer, &mem_reqs);
|
||||
vkGetBufferMemoryRequirements(device, buffer.buffer, &mem_reqs);
|
||||
|
||||
VkMemoryAllocateInfo alloc = { VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO };
|
||||
alloc.allocationSize = mem_reqs.size;
|
||||
@@ -573,15 +284,15 @@ static struct buffer create_buffer(const void *initial, size_t size, VkBufferUsa
|
||||
alloc.memoryTypeIndex = find_memory_type_from_requirements(mem_reqs.memoryTypeBits,
|
||||
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT);
|
||||
|
||||
VKFUNC(vkAllocateMemory)(device, &alloc, NULL, &buffer.memory);
|
||||
VKFUNC(vkBindBufferMemory)(device, buffer.buffer, buffer.memory, 0);
|
||||
vkAllocateMemory(device, &alloc, NULL, &buffer.memory);
|
||||
vkBindBufferMemory(device, buffer.buffer, buffer.memory, 0);
|
||||
|
||||
if (initial)
|
||||
{
|
||||
void *ptr;
|
||||
VKFUNC(vkMapMemory)(device, buffer.memory, 0, size, 0, &ptr);
|
||||
vkMapMemory(device, buffer.memory, 0, size, 0, &ptr);
|
||||
memcpy(ptr, initial, size);
|
||||
VKFUNC(vkUnmapMemory)(device, buffer.memory);
|
||||
vkUnmapMemory(device, buffer.memory);
|
||||
}
|
||||
|
||||
return buffer;
|
||||
@@ -607,13 +318,13 @@ static void init_uniform_buffer(void)
|
||||
}
|
||||
}
|
||||
|
||||
static VkShaderModule create_shader_module(const uint8_t *data, size_t size)
|
||||
static VkShaderModule create_shader_module(const uint32_t *data, size_t size)
|
||||
{
|
||||
VkShaderModuleCreateInfo module_info = { VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO };
|
||||
VkShaderModule module;
|
||||
module_info.codeSize = size;
|
||||
module_info.pCode = (const uint32_t*)data;
|
||||
VKFUNC(vkCreateShaderModule)(vulkan->device, &module_info, NULL, &module);
|
||||
module_info.pCode = data;
|
||||
vkCreateShaderModule(vulkan->device, &module_info, NULL, &module);
|
||||
return module;
|
||||
}
|
||||
|
||||
@@ -635,19 +346,19 @@ static void init_descriptor(void)
|
||||
VkDescriptorSetLayoutCreateInfo set_layout_info = { VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO };
|
||||
set_layout_info.bindingCount = 1;
|
||||
set_layout_info.pBindings = &binding;
|
||||
VKFUNC(vkCreateDescriptorSetLayout)(device, &set_layout_info, NULL, &vk.set_layout);
|
||||
vkCreateDescriptorSetLayout(device, &set_layout_info, NULL, &vk.set_layout);
|
||||
|
||||
VkPipelineLayoutCreateInfo layout_info = { VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO };
|
||||
layout_info.setLayoutCount = 1;
|
||||
layout_info.pSetLayouts = &vk.set_layout;
|
||||
VKFUNC(vkCreatePipelineLayout)(device, &layout_info, NULL, &vk.pipeline_layout);
|
||||
vkCreatePipelineLayout(device, &layout_info, NULL, &vk.pipeline_layout);
|
||||
|
||||
VkDescriptorPoolCreateInfo pool_info = { VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO };
|
||||
pool_info.maxSets = vk.num_swapchain_images;
|
||||
pool_info.poolSizeCount = 1;
|
||||
pool_info.pPoolSizes = pool_sizes;
|
||||
pool_info.flags = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT;
|
||||
VKFUNC(vkCreateDescriptorPool)(device, &pool_info, NULL, &vk.desc_pool);
|
||||
vkCreateDescriptorPool(device, &pool_info, NULL, &vk.desc_pool);
|
||||
|
||||
VkDescriptorSetAllocateInfo alloc_info = { VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO };
|
||||
alloc_info.descriptorPool = vk.desc_pool;
|
||||
@@ -655,7 +366,7 @@ static void init_descriptor(void)
|
||||
alloc_info.pSetLayouts = &vk.set_layout;
|
||||
for (unsigned i = 0; i < vk.num_swapchain_images; i++)
|
||||
{
|
||||
VKFUNC(vkAllocateDescriptorSets)(device, &alloc_info, &vk.desc_set[i]);
|
||||
vkAllocateDescriptorSets(device, &alloc_info, &vk.desc_set[i]);
|
||||
|
||||
VkWriteDescriptorSet write = { VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET };
|
||||
VkDescriptorBufferInfo buffer_info;
|
||||
@@ -670,7 +381,7 @@ static void init_descriptor(void)
|
||||
buffer_info.offset = 0;
|
||||
buffer_info.range = 16 * sizeof(float);
|
||||
|
||||
VKFUNC(vkUpdateDescriptorSets)(device, 1, &write, 0, NULL);
|
||||
vkUpdateDescriptorSets(device, 1, &write, 0, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -745,11 +456,19 @@ static void init_pipeline(void)
|
||||
{ VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO },
|
||||
};
|
||||
|
||||
static const uint32_t triangle_vert[] =
|
||||
#include "shaders/triangle.vert.inc"
|
||||
;
|
||||
|
||||
static const uint32_t triangle_frag[] =
|
||||
#include "shaders/triangle.frag.inc"
|
||||
;
|
||||
|
||||
shader_stages[0].stage = VK_SHADER_STAGE_VERTEX_BIT;
|
||||
shader_stages[0].module = create_shader_module(triangle_vert_spv, triangle_vert_spv_len);
|
||||
shader_stages[0].module = create_shader_module(triangle_vert, sizeof(triangle_vert));
|
||||
shader_stages[0].pName = "main";
|
||||
shader_stages[1].stage = VK_SHADER_STAGE_FRAGMENT_BIT;
|
||||
shader_stages[1].module = create_shader_module(triangle_frag_spv, triangle_frag_spv_len);
|
||||
shader_stages[1].module = create_shader_module(triangle_frag, sizeof(triangle_frag));
|
||||
shader_stages[1].pName = "main";
|
||||
|
||||
VkGraphicsPipelineCreateInfo pipe = { VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO };
|
||||
@@ -766,10 +485,10 @@ static void init_pipeline(void)
|
||||
pipe.renderPass = vk.render_pass;
|
||||
pipe.layout = vk.pipeline_layout;
|
||||
|
||||
VKFUNC(vkCreateGraphicsPipelines)(vulkan->device, vk.pipeline_cache, 1, &pipe, NULL, &vk.pipeline);
|
||||
vkCreateGraphicsPipelines(vulkan->device, vk.pipeline_cache, 1, &pipe, NULL, &vk.pipeline);
|
||||
|
||||
VKFUNC(vkDestroyShaderModule)(device, shader_stages[0].module, NULL);
|
||||
VKFUNC(vkDestroyShaderModule)(device, shader_stages[1].module, NULL);
|
||||
vkDestroyShaderModule(device, shader_stages[0].module, NULL);
|
||||
vkDestroyShaderModule(device, shader_stages[1].module, NULL);
|
||||
}
|
||||
|
||||
static void init_render_pass(VkFormat format)
|
||||
@@ -796,7 +515,7 @@ static void init_render_pass(VkFormat format)
|
||||
rp_info.pAttachments = &attachment;
|
||||
rp_info.subpassCount = 1;
|
||||
rp_info.pSubpasses = &subpass;
|
||||
VKFUNC(vkCreateRenderPass)(vulkan->device, &rp_info, NULL, &vk.render_pass);
|
||||
vkCreateRenderPass(vulkan->device, &rp_info, NULL, &vk.render_pass);
|
||||
}
|
||||
|
||||
static void init_swapchain(void)
|
||||
@@ -823,17 +542,17 @@ static void init_swapchain(void)
|
||||
image.mipLevels = 1;
|
||||
image.arrayLayers = 1;
|
||||
|
||||
VKFUNC(vkCreateImage)(device, &image, NULL, &vk.images[i].create_info.image);
|
||||
vkCreateImage(device, &image, NULL, &vk.images[i].create_info.image);
|
||||
|
||||
VkMemoryAllocateInfo alloc = { VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO };
|
||||
VkMemoryRequirements mem_reqs;
|
||||
|
||||
VKFUNC(vkGetImageMemoryRequirements)(device, vk.images[i].create_info.image, &mem_reqs);
|
||||
vkGetImageMemoryRequirements(device, vk.images[i].create_info.image, &mem_reqs);
|
||||
alloc.allocationSize = mem_reqs.size;
|
||||
alloc.memoryTypeIndex = find_memory_type_from_requirements(
|
||||
mem_reqs.memoryTypeBits, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT);
|
||||
VKFUNC(vkAllocateMemory)(device, &alloc, NULL, &vk.image_memory[i]);
|
||||
VKFUNC(vkBindImageMemory)(device, vk.images[i].create_info.image, vk.image_memory[i], 0);
|
||||
vkAllocateMemory(device, &alloc, NULL, &vk.image_memory[i]);
|
||||
vkBindImageMemory(device, vk.images[i].create_info.image, vk.image_memory[i], 0);
|
||||
|
||||
vk.images[i].create_info.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO;
|
||||
vk.images[i].create_info.viewType = VK_IMAGE_VIEW_TYPE_2D;
|
||||
@@ -848,7 +567,7 @@ static void init_swapchain(void)
|
||||
vk.images[i].create_info.components.b = VK_COMPONENT_SWIZZLE_B;
|
||||
vk.images[i].create_info.components.a = VK_COMPONENT_SWIZZLE_A;
|
||||
|
||||
VKFUNC(vkCreateImageView)(device, &vk.images[i].create_info,
|
||||
vkCreateImageView(device, &vk.images[i].create_info,
|
||||
NULL, &vk.images[i].image_view);
|
||||
vk.images[i].image_layout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
|
||||
|
||||
@@ -860,7 +579,7 @@ static void init_swapchain(void)
|
||||
fb_info.height = BASE_HEIGHT;
|
||||
fb_info.layers = 1;
|
||||
|
||||
VKFUNC(vkCreateFramebuffer)(device, &fb_info, NULL, &vk.framebuffers[i]);
|
||||
vkCreateFramebuffer(device, &fb_info, NULL, &vk.framebuffers[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -874,18 +593,18 @@ static void init_command(void)
|
||||
|
||||
for (unsigned i = 0; i < vk.num_swapchain_images; i++)
|
||||
{
|
||||
VKFUNC(vkCreateCommandPool)(vulkan->device, &pool_info, NULL, &vk.cmd_pool[i]);
|
||||
vkCreateCommandPool(vulkan->device, &pool_info, NULL, &vk.cmd_pool[i]);
|
||||
info.commandPool = vk.cmd_pool[i];
|
||||
info.level = VK_COMMAND_BUFFER_LEVEL_PRIMARY;
|
||||
info.commandBufferCount = 1;
|
||||
VKFUNC(vkAllocateCommandBuffers)(vulkan->device, &info, &vk.cmd[i]);
|
||||
vkAllocateCommandBuffers(vulkan->device, &info, &vk.cmd[i]);
|
||||
}
|
||||
}
|
||||
|
||||
static void vulkan_test_init(void)
|
||||
{
|
||||
VKFUNC(vkGetPhysicalDeviceProperties)(vulkan->gpu, &vk.gpu_properties);
|
||||
VKFUNC(vkGetPhysicalDeviceMemoryProperties)(vulkan->gpu, &vk.memory_properties);
|
||||
vkGetPhysicalDeviceProperties(vulkan->gpu, &vk.gpu_properties);
|
||||
vkGetPhysicalDeviceMemoryProperties(vulkan->gpu, &vk.memory_properties);
|
||||
|
||||
unsigned num_images = 0;
|
||||
uint32_t mask = vulkan->get_sync_index_mask(vulkan->handle);
|
||||
@@ -901,7 +620,7 @@ static void vulkan_test_init(void)
|
||||
init_descriptor();
|
||||
|
||||
VkPipelineCacheCreateInfo pipeline_cache_info = { VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO };
|
||||
VKFUNC(vkCreatePipelineCache)(vulkan->device, &pipeline_cache_info,
|
||||
vkCreatePipelineCache(vulkan->device, &pipeline_cache_info,
|
||||
NULL, &vk.pipeline_cache);
|
||||
|
||||
init_render_pass(VK_FORMAT_R8G8B8A8_UNORM);
|
||||
@@ -915,34 +634,35 @@ static void vulkan_test_deinit(void)
|
||||
return;
|
||||
|
||||
VkDevice device = vulkan->device;
|
||||
VKFUNC(vkDeviceWaitIdle)(device);
|
||||
vkDeviceWaitIdle(device);
|
||||
|
||||
for (unsigned i = 0; i < vk.num_swapchain_images; i++)
|
||||
{
|
||||
VKFUNC(vkDestroyFramebuffer)(device, vk.framebuffers[i], NULL);
|
||||
VKFUNC(vkDestroyImageView)(device, vk.images[i].image_view, NULL);
|
||||
VKFUNC(vkFreeMemory)(device, vk.image_memory[i], NULL);
|
||||
VKFUNC(vkDestroyImage)(device, vk.images[i].create_info.image, NULL);
|
||||
vkDestroyFramebuffer(device, vk.framebuffers[i], NULL);
|
||||
vkDestroyImageView(device, vk.images[i].image_view, NULL);
|
||||
vkFreeMemory(device, vk.image_memory[i], NULL);
|
||||
vkDestroyImage(device, vk.images[i].create_info.image, NULL);
|
||||
|
||||
VKFUNC(vkFreeMemory)(device, vk.ubo[i].memory, NULL);
|
||||
VKFUNC(vkDestroyBuffer)(device, vk.ubo[i].buffer, NULL);
|
||||
vkFreeMemory(device, vk.ubo[i].memory, NULL);
|
||||
vkDestroyBuffer(device, vk.ubo[i].buffer, NULL);
|
||||
}
|
||||
|
||||
VKFUNC(vkFreeDescriptorSets)(device, vk.desc_pool, vk.num_swapchain_images, vk.desc_set);
|
||||
VKFUNC(vkDestroyDescriptorPool)(device, vk.desc_pool, NULL);
|
||||
vkFreeDescriptorSets(device, vk.desc_pool, vk.num_swapchain_images, vk.desc_set);
|
||||
vkDestroyDescriptorPool(device, vk.desc_pool, NULL);
|
||||
|
||||
VKFUNC(vkDestroyRenderPass)(device, vk.render_pass, NULL);
|
||||
VKFUNC(vkDestroyPipeline)(device, vk.pipeline, NULL);
|
||||
VKFUNC(vkDestroyPipelineLayout)(device, vk.pipeline_layout, NULL);
|
||||
vkDestroyRenderPass(device, vk.render_pass, NULL);
|
||||
vkDestroyPipeline(device, vk.pipeline, NULL);
|
||||
vkDestroyDescriptorSetLayout(device, vk.set_layout, NULL);
|
||||
vkDestroyPipelineLayout(device, vk.pipeline_layout, NULL);
|
||||
|
||||
VKFUNC(vkFreeMemory)(device, vk.vbo.memory, NULL);
|
||||
VKFUNC(vkDestroyBuffer)(device, vk.vbo.buffer, NULL);
|
||||
VKFUNC(vkDestroyPipelineCache)(device, vk.pipeline_cache, NULL);
|
||||
vkFreeMemory(device, vk.vbo.memory, NULL);
|
||||
vkDestroyBuffer(device, vk.vbo.buffer, NULL);
|
||||
vkDestroyPipelineCache(device, vk.pipeline_cache, NULL);
|
||||
|
||||
for (unsigned i = 0; i < vk.num_swapchain_images; i++)
|
||||
{
|
||||
VKFUNC(vkFreeCommandBuffers)(device, vk.cmd_pool[i], 1, &vk.cmd[i]);
|
||||
VKFUNC(vkDestroyCommandPool)(device, vk.cmd_pool[i], NULL);
|
||||
vkFreeCommandBuffers(device, vk.cmd_pool[i], 1, &vk.cmd[i]);
|
||||
vkDestroyCommandPool(device, vk.cmd_pool[i], NULL);
|
||||
}
|
||||
|
||||
memset(&vk, 0, sizeof(vk));
|
||||
@@ -967,7 +687,7 @@ void retro_run(void)
|
||||
|
||||
vk.index = vulkan->get_sync_index(vulkan->handle);
|
||||
vulkan_test_render();
|
||||
vulkan->set_image(vulkan->handle, &vk.images[vk.index], 0, NULL);
|
||||
vulkan->set_image(vulkan->handle, &vk.images[vk.index], 0, NULL, VK_QUEUE_FAMILY_IGNORED);
|
||||
vulkan->set_command_buffers(vulkan->handle, 1, &vk.cmd[vk.index]);
|
||||
video_cb(RETRO_HW_FRAME_BUFFER_VALID, BASE_WIDTH, BASE_HEIGHT, 0);
|
||||
}
|
||||
@@ -989,7 +709,9 @@ static void context_reset(void)
|
||||
return;
|
||||
}
|
||||
|
||||
load_device_symbols();
|
||||
vulkan_symbol_wrapper_init(vulkan->get_instance_proc_addr);
|
||||
vulkan_symbol_wrapper_load_core_instance_symbols(vulkan->instance);
|
||||
vulkan_symbol_wrapper_load_core_device_symbols(vulkan->device);
|
||||
vulkan_test_init();
|
||||
}
|
||||
|
||||
@@ -1001,10 +723,24 @@ static void context_destroy(void)
|
||||
memset(&vk, 0, sizeof(vk));
|
||||
}
|
||||
|
||||
static const VkApplicationInfo *get_application_info(void)
|
||||
{
|
||||
static const VkApplicationInfo info = {
|
||||
VK_STRUCTURE_TYPE_APPLICATION_INFO,
|
||||
NULL,
|
||||
"libretro-test-vulkan",
|
||||
0,
|
||||
"libretro-test-vulkan",
|
||||
0,
|
||||
VK_MAKE_VERSION(1, 0, 18),
|
||||
};
|
||||
return &info;
|
||||
}
|
||||
|
||||
static bool retro_init_hw_context(void)
|
||||
{
|
||||
hw_render.context_type = RETRO_HW_CONTEXT_VULKAN;
|
||||
hw_render.version_major = VK_MAKE_VERSION(1, 0, 6);
|
||||
hw_render.version_major = VK_MAKE_VERSION(1, 0, 18);
|
||||
hw_render.version_minor = 0;
|
||||
hw_render.context_reset = context_reset;
|
||||
hw_render.context_destroy = context_destroy;
|
||||
@@ -1012,6 +748,16 @@ static bool retro_init_hw_context(void)
|
||||
if (!environ_cb(RETRO_ENVIRONMENT_SET_HW_RENDER, &hw_render))
|
||||
return false;
|
||||
|
||||
static const struct retro_hw_render_context_negotiation_interface_vulkan iface = {
|
||||
RETRO_HW_RENDER_CONTEXT_NEGOTIATION_INTERFACE_VULKAN,
|
||||
RETRO_HW_RENDER_CONTEXT_NEGOTIATION_INTERFACE_VULKAN_VERSION,
|
||||
|
||||
get_application_info,
|
||||
NULL,
|
||||
};
|
||||
|
||||
environ_cb(RETRO_ENVIRONMENT_SET_HW_RENDER_CONTEXT_NEGOTIATION_INTERFACE, (void*)&iface);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,23 +1,19 @@
|
||||
VERT_SHADERS := $(wildcard *.vert)
|
||||
FRAG_SHADERS := $(wildcard *.frag)
|
||||
SPIRV := $(VERT_SHADERS:.vert=.vert.spv) $(FRAG_SHADERS:.frag=.frag.spv)
|
||||
INCLUDES := $(SPIRV:.spv=.inc)
|
||||
SPIRV := $(VERT_SHADERS:.vert=.vert.inc) $(FRAG_SHADERS:.frag=.frag.inc)
|
||||
|
||||
GLSLANG := glslangValidator
|
||||
GLSLANG := glslc
|
||||
GLSLFLAGS := -mfmt=c
|
||||
|
||||
all: $(INCLUDES)
|
||||
all: $(SPIRV)
|
||||
|
||||
%.frag.spv: %.frag
|
||||
$(GLSLANG) -V -o $@ $<
|
||||
%.frag.inc: %.frag
|
||||
$(GLSLANG) $(GLSLFLAGS) -o $@ $<
|
||||
|
||||
%.vert.spv: %.vert
|
||||
$(GLSLANG) -V -o $@ $<
|
||||
|
||||
%.inc: %.spv
|
||||
xxd -i $< $@
|
||||
%.vert.inc: %.vert
|
||||
$(GLSLANG) $(GLSLFLAGS) -o $@ $<
|
||||
|
||||
clean:
|
||||
rm -f $(INCLUDES)
|
||||
rm -f $(SPIRV)
|
||||
|
||||
.PHONY: clean
|
||||
@@ -1,38 +1,31 @@
|
||||
unsigned char triangle_frag_spv[] = {
|
||||
0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x08, 0x00,
|
||||
0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30,
|
||||
0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00,
|
||||
0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00,
|
||||
0x09, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00,
|
||||
0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x36, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00,
|
||||
0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00,
|
||||
0x05, 0x00, 0x05, 0x00, 0x09, 0x00, 0x00, 0x00, 0x46, 0x72, 0x61, 0x67,
|
||||
0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00,
|
||||
0x0b, 0x00, 0x00, 0x00, 0x76, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x00,
|
||||
0x47, 0x00, 0x03, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x47, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x0b, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00,
|
||||
0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00,
|
||||
0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00,
|
||||
0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00,
|
||||
0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
|
||||
0x08, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
|
||||
0x3b, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x0a, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00,
|
||||
0x0a, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00,
|
||||
0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00,
|
||||
0x0c, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00,
|
||||
0x09, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00,
|
||||
0x38, 0x00, 0x01, 0x00
|
||||
};
|
||||
unsigned int triangle_frag_spv_len = 412;
|
||||
{0x07230203,0x00010000,0x00080001,0x0000000d,
|
||||
0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,
|
||||
0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x0007000f,0x00000004,0x00000004,0x6e69616d,
|
||||
0x00000000,0x00000009,0x0000000b,0x00030010,
|
||||
0x00000004,0x00000007,0x00030003,0x00000001,
|
||||
0x00000136,0x000a0004,0x475f4c47,0x4c474f4f,
|
||||
0x70635f45,0x74735f70,0x5f656c79,0x656e696c,
|
||||
0x7269645f,0x69746365,0x00006576,0x00080004,
|
||||
0x475f4c47,0x4c474f4f,0x6e695f45,0x64756c63,
|
||||
0x69645f65,0x74636572,0x00657669,0x00040005,
|
||||
0x00000004,0x6e69616d,0x00000000,0x00050005,
|
||||
0x00000009,0x67617246,0x6f6c6f43,0x00000072,
|
||||
0x00040005,0x0000000b,0x6c6f4376,0x0000726f,
|
||||
0x00030047,0x00000009,0x00000000,0x00040047,
|
||||
0x00000009,0x0000001e,0x00000000,0x00030047,
|
||||
0x0000000b,0x00000000,0x00040047,0x0000000b,
|
||||
0x0000001e,0x00000000,0x00030047,0x0000000c,
|
||||
0x00000000,0x00020013,0x00000002,0x00030021,
|
||||
0x00000003,0x00000002,0x00030016,0x00000006,
|
||||
0x00000020,0x00040017,0x00000007,0x00000006,
|
||||
0x00000004,0x00040020,0x00000008,0x00000003,
|
||||
0x00000007,0x0004003b,0x00000008,0x00000009,
|
||||
0x00000003,0x00040020,0x0000000a,0x00000001,
|
||||
0x00000007,0x0004003b,0x0000000a,0x0000000b,
|
||||
0x00000001,0x00050036,0x00000002,0x00000004,
|
||||
0x00000000,0x00000003,0x000200f8,0x00000005,
|
||||
0x0004003d,0x00000007,0x0000000c,0x0000000b,
|
||||
0x0003003e,0x00000009,0x0000000c,0x000100fd,
|
||||
0x00010038}
|
||||
@@ -1,83 +1,65 @@
|
||||
unsigned char triangle_vert_spv[] = {
|
||||
0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x08, 0x00,
|
||||
0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30,
|
||||
0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00,
|
||||
0x0a, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00,
|
||||
0x1b, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x36, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00,
|
||||
0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00,
|
||||
0x08, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x50, 0x65, 0x72, 0x56, 0x65,
|
||||
0x72, 0x74, 0x65, 0x78, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00,
|
||||
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x50,
|
||||
0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x06, 0x00, 0x07, 0x00,
|
||||
0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x50,
|
||||
0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x00, 0x00, 0x00, 0x00,
|
||||
0x05, 0x00, 0x03, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x05, 0x00, 0x03, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x55, 0x42, 0x4f, 0x00,
|
||||
0x06, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x4d, 0x56, 0x50, 0x00, 0x05, 0x00, 0x03, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x15, 0x00, 0x00, 0x00,
|
||||
0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x00, 0x00, 0x00,
|
||||
0x05, 0x00, 0x04, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x76, 0x43, 0x6f, 0x6c,
|
||||
0x6f, 0x72, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x1b, 0x00, 0x00, 0x00,
|
||||
0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00,
|
||||
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x47, 0x00, 0x03, 0x00, 0x08, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x48, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x05, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x0e, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x48, 0x00, 0x05, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x07, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00,
|
||||
0x0e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
|
||||
0x10, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x47, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00,
|
||||
0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
|
||||
0x1a, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x47, 0x00, 0x04, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
|
||||
0x17, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
|
||||
0x04, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00,
|
||||
0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
|
||||
0x09, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
|
||||
0x3b, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00,
|
||||
0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00,
|
||||
0x0b, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x18, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
|
||||
0x04, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x03, 0x00, 0x0e, 0x00, 0x00, 0x00,
|
||||
0x0d, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x0f, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00,
|
||||
0x0f, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x20, 0x00, 0x04, 0x00, 0x11, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x0d, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x14, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00,
|
||||
0x14, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x20, 0x00, 0x04, 0x00, 0x18, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
|
||||
0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x18, 0x00, 0x00, 0x00,
|
||||
0x1a, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00,
|
||||
0x14, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00,
|
||||
0x05, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x11, 0x00, 0x00, 0x00,
|
||||
0x12, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
|
||||
0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00,
|
||||
0x12, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00,
|
||||
0x16, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x91, 0x00, 0x05, 0x00,
|
||||
0x07, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00,
|
||||
0x16, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x18, 0x00, 0x00, 0x00,
|
||||
0x19, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
|
||||
0x3e, 0x00, 0x03, 0x00, 0x19, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00,
|
||||
0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00,
|
||||
0x1b, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x1a, 0x00, 0x00, 0x00,
|
||||
0x1c, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00
|
||||
};
|
||||
unsigned int triangle_vert_spv_len = 960;
|
||||
{0x07230203,0x00010000,0x00080001,0x0000001d,
|
||||
0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,
|
||||
0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x0009000f,0x00000000,0x00000004,0x6e69616d,
|
||||
0x00000000,0x0000000a,0x00000015,0x0000001a,
|
||||
0x0000001b,0x00030003,0x00000001,0x00000136,
|
||||
0x000a0004,0x475f4c47,0x4c474f4f,0x70635f45,
|
||||
0x74735f70,0x5f656c79,0x656e696c,0x7269645f,
|
||||
0x69746365,0x00006576,0x00080004,0x475f4c47,
|
||||
0x4c474f4f,0x6e695f45,0x64756c63,0x69645f65,
|
||||
0x74636572,0x00657669,0x00040005,0x00000004,
|
||||
0x6e69616d,0x00000000,0x00060005,0x00000008,
|
||||
0x505f6c67,0x65567265,0x78657472,0x00000000,
|
||||
0x00060006,0x00000008,0x00000000,0x505f6c67,
|
||||
0x7469736f,0x006e6f69,0x00070006,0x00000008,
|
||||
0x00000001,0x505f6c67,0x746e696f,0x657a6953,
|
||||
0x00000000,0x00030005,0x0000000a,0x00000000,
|
||||
0x00030005,0x0000000e,0x004f4255,0x00040006,
|
||||
0x0000000e,0x00000000,0x0050564d,0x00030005,
|
||||
0x00000010,0x00000000,0x00050005,0x00000015,
|
||||
0x69736f50,0x6e6f6974,0x00000000,0x00040005,
|
||||
0x0000001a,0x6c6f4376,0x0000726f,0x00040005,
|
||||
0x0000001b,0x6f6c6f43,0x00000072,0x00050048,
|
||||
0x00000008,0x00000000,0x0000000b,0x00000000,
|
||||
0x00050048,0x00000008,0x00000001,0x0000000b,
|
||||
0x00000001,0x00030047,0x00000008,0x00000002,
|
||||
0x00040048,0x0000000e,0x00000000,0x00000005,
|
||||
0x00050048,0x0000000e,0x00000000,0x00000023,
|
||||
0x00000000,0x00050048,0x0000000e,0x00000000,
|
||||
0x00000007,0x00000010,0x00030047,0x0000000e,
|
||||
0x00000002,0x00040047,0x00000010,0x00000022,
|
||||
0x00000000,0x00040047,0x00000010,0x00000021,
|
||||
0x00000000,0x00040047,0x00000015,0x0000001e,
|
||||
0x00000000,0x00040047,0x0000001a,0x0000001e,
|
||||
0x00000000,0x00040047,0x0000001b,0x0000001e,
|
||||
0x00000001,0x00020013,0x00000002,0x00030021,
|
||||
0x00000003,0x00000002,0x00030016,0x00000006,
|
||||
0x00000020,0x00040017,0x00000007,0x00000006,
|
||||
0x00000004,0x0004001e,0x00000008,0x00000007,
|
||||
0x00000006,0x00040020,0x00000009,0x00000003,
|
||||
0x00000008,0x0004003b,0x00000009,0x0000000a,
|
||||
0x00000003,0x00040015,0x0000000b,0x00000020,
|
||||
0x00000001,0x0004002b,0x0000000b,0x0000000c,
|
||||
0x00000000,0x00040018,0x0000000d,0x00000007,
|
||||
0x00000004,0x0003001e,0x0000000e,0x0000000d,
|
||||
0x00040020,0x0000000f,0x00000002,0x0000000e,
|
||||
0x0004003b,0x0000000f,0x00000010,0x00000002,
|
||||
0x00040020,0x00000011,0x00000002,0x0000000d,
|
||||
0x00040020,0x00000014,0x00000001,0x00000007,
|
||||
0x0004003b,0x00000014,0x00000015,0x00000001,
|
||||
0x00040020,0x00000018,0x00000003,0x00000007,
|
||||
0x0004003b,0x00000018,0x0000001a,0x00000003,
|
||||
0x0004003b,0x00000014,0x0000001b,0x00000001,
|
||||
0x00050036,0x00000002,0x00000004,0x00000000,
|
||||
0x00000003,0x000200f8,0x00000005,0x00050041,
|
||||
0x00000011,0x00000012,0x00000010,0x0000000c,
|
||||
0x0004003d,0x0000000d,0x00000013,0x00000012,
|
||||
0x0004003d,0x00000007,0x00000016,0x00000015,
|
||||
0x00050091,0x00000007,0x00000017,0x00000013,
|
||||
0x00000016,0x00050041,0x00000018,0x00000019,
|
||||
0x0000000a,0x0000000c,0x0003003e,0x00000019,
|
||||
0x00000017,0x0004003d,0x00000007,0x0000001c,
|
||||
0x0000001b,0x0003003e,0x0000001a,0x0000001c,
|
||||
0x000100fd,0x00010038}
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <retro_miscellaneous.h>
|
||||
|
||||
#include "../../libretro.h"
|
||||
#include <libretro.h>
|
||||
|
||||
static uint32_t *frame_buf;
|
||||
static struct retro_log_callback logging;
|
||||
|
||||
@@ -1,327 +0,0 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2015 - Daniel De Matteis
|
||||
* Copyright (C) 2016 - Andrés Suárez
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
* To-do:
|
||||
* - Analog support
|
||||
* - Some sort of connection control, it only sends packets
|
||||
* but there is no acknoledgement of a connection o keepalives
|
||||
* - Send player name
|
||||
* - Render something on-screen maybe a gui to configure IP and port
|
||||
instead of the ridiculously long strings we're using now
|
||||
* - Allow changing IP address and port in runtime
|
||||
* - Support other platforms
|
||||
* - Input recording / Combos
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <net/net_compat.h>
|
||||
#include <net/net_socket.h>
|
||||
|
||||
#include <retro_miscellaneous.h>
|
||||
|
||||
#include "../../libretro.h"
|
||||
|
||||
#ifndef SOCKET_ERROR
|
||||
#define SOCKET_ERROR -1
|
||||
#endif
|
||||
|
||||
|
||||
struct retro_log_callback logger;
|
||||
retro_log_printf_t log_cb;
|
||||
static uint16_t *frame_buf;
|
||||
struct sockaddr_in si_other;
|
||||
int s, slen=sizeof(si_other);
|
||||
char message[64];
|
||||
char server[64];
|
||||
int port;
|
||||
int input_state = 0;
|
||||
|
||||
void retro_init(void)
|
||||
{
|
||||
frame_buf = (uint16_t*)calloc(320 * 240, sizeof(uint16_t));
|
||||
|
||||
log_cb(RETRO_LOG_INFO, "Initialising sockets...\n");
|
||||
network_init();
|
||||
}
|
||||
|
||||
void retro_deinit(void)
|
||||
{
|
||||
if (frame_buf)
|
||||
free(frame_buf);
|
||||
frame_buf = NULL;
|
||||
}
|
||||
|
||||
unsigned retro_api_version(void)
|
||||
{
|
||||
return RETRO_API_VERSION;
|
||||
}
|
||||
|
||||
void retro_set_controller_port_device(
|
||||
unsigned port, unsigned device)
|
||||
{
|
||||
(void)port;
|
||||
(void)device;
|
||||
}
|
||||
|
||||
void retro_get_system_info(
|
||||
struct retro_system_info *info)
|
||||
{
|
||||
memset(info, 0, sizeof(*info));
|
||||
info->library_name = "RetroPad Remote";
|
||||
info->library_version = "0.01";
|
||||
info->need_fullpath = false;
|
||||
info->valid_extensions = ""; /* Nothing. */
|
||||
}
|
||||
|
||||
void retro_get_system_av_info(
|
||||
struct retro_system_av_info *info)
|
||||
{
|
||||
info->timing.fps = 60.0;
|
||||
info->timing.sample_rate = 30000.0;
|
||||
|
||||
info->geometry.base_width = 320;
|
||||
info->geometry.base_height = 240;
|
||||
info->geometry.max_width = 320;
|
||||
info->geometry.max_height = 240;
|
||||
info->geometry.aspect_ratio = 4.0 / 3.0;
|
||||
}
|
||||
|
||||
static retro_video_refresh_t video_cb;
|
||||
static retro_audio_sample_t audio_cb;
|
||||
static retro_audio_sample_batch_t audio_batch_cb;
|
||||
static retro_environment_t environ_cb;
|
||||
static retro_input_poll_t input_poll_cb;
|
||||
static retro_input_state_t input_state_cb;
|
||||
|
||||
void update_input()
|
||||
{
|
||||
input_state = 0;
|
||||
input_poll_cb();
|
||||
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_B))
|
||||
input_state += 1;
|
||||
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_A))
|
||||
input_state += 2;
|
||||
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_SELECT))
|
||||
input_state += pow(2, 2);
|
||||
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_START))
|
||||
input_state += pow(2, 3);
|
||||
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_UP))
|
||||
input_state += pow(2, 4);
|
||||
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_DOWN))
|
||||
input_state += pow(2, 5);
|
||||
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_LEFT))
|
||||
input_state += pow(2, 6);
|
||||
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_RIGHT))
|
||||
input_state += pow(2, 7);
|
||||
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_Y))
|
||||
input_state += pow(2, 8);
|
||||
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_X))
|
||||
input_state += pow(2, 9);
|
||||
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_L))
|
||||
input_state += pow(2, 10);
|
||||
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_R))
|
||||
input_state += pow(2, 11);
|
||||
}
|
||||
|
||||
void retro_set_environment(retro_environment_t cb)
|
||||
{
|
||||
static const struct retro_variable vars[] = {
|
||||
{ "port", "Port; 55400|55401|55402|55403|55404|55405|55406|55407|55408|55409|55410|55411|55412|55413|55414|55415|55416|55417|55418|55419|55420" },
|
||||
{ "ip_octet1", "IP address part 1; 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|35|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124|125|126|127|128|129|130|131|132|133|135|135|136|137|138|139|140|141|142|143|144|145|146|147|148|149|150|151|152|153|154|155|156|157|158|159|160|161|162|163|164|165|166|167|168|169|170|171|172|173|174|175|176|177|178|179|180|181|182|183|184|185|186|187|188|189|190|191|192|193|194|195|196|197|198|199|200|201|202|203|204|205|206|207|208|209|210|211|212|213|214|215|216|217|218|219|220|221|222|223|224|225|226|227|228|229|230|231|232|233|235|235|236|237|238|239|240|241|242|243|244|245|246|247|248|249|250|251|252|253|254|255" },
|
||||
{ "ip_octet2", "IP address part 2; 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|35|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124|125|126|127|128|129|130|131|132|133|135|135|136|137|138|139|140|141|142|143|144|145|146|147|148|149|150|151|152|153|154|155|156|157|158|159|160|161|162|163|164|165|166|167|168|169|170|171|172|173|174|175|176|177|178|179|180|181|182|183|184|185|186|187|188|189|190|191|192|193|194|195|196|197|198|199|200|201|202|203|204|205|206|207|208|209|210|211|212|213|214|215|216|217|218|219|220|221|222|223|224|225|226|227|228|229|230|231|232|233|235|235|236|237|238|239|240|241|242|243|244|245|246|247|248|249|250|251|252|253|254|255" },
|
||||
{ "ip_octet3", "IP address part 3; 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|35|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124|125|126|127|128|129|130|131|132|133|135|135|136|137|138|139|140|141|142|143|144|145|146|147|148|149|150|151|152|153|154|155|156|157|158|159|160|161|162|163|164|165|166|167|168|169|170|171|172|173|174|175|176|177|178|179|180|181|182|183|184|185|186|187|188|189|190|191|192|193|194|195|196|197|198|199|200|201|202|203|204|205|206|207|208|209|210|211|212|213|214|215|216|217|218|219|220|221|222|223|224|225|226|227|228|229|230|231|232|233|235|235|236|237|238|239|240|241|242|243|244|245|246|247|248|249|250|251|252|253|254|255" },
|
||||
{ "ip_octet4", "IP address part 4; 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|35|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124|125|126|127|128|129|130|131|132|133|135|135|136|137|138|139|140|141|142|143|144|145|146|147|148|149|150|151|152|153|154|155|156|157|158|159|160|161|162|163|164|165|166|167|168|169|170|171|172|173|174|175|176|177|178|179|180|181|182|183|184|185|186|187|188|189|190|191|192|193|194|195|196|197|198|199|200|201|202|203|204|205|206|207|208|209|210|211|212|213|214|215|216|217|218|219|220|221|222|223|224|225|226|227|228|229|230|231|232|233|235|235|236|237|238|239|240|241|242|243|244|245|246|247|248|249|250|251|252|253|254|255" },
|
||||
|
||||
{ NULL, NULL },
|
||||
};
|
||||
cb(RETRO_ENVIRONMENT_SET_VARIABLES, (void*)vars);
|
||||
|
||||
enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_RGB565;
|
||||
|
||||
environ_cb = cb;
|
||||
bool no_content = true;
|
||||
cb(RETRO_ENVIRONMENT_SET_SUPPORT_NO_GAME, &no_content);
|
||||
|
||||
environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt);
|
||||
|
||||
if (cb(RETRO_ENVIRONMENT_GET_LOG_INTERFACE, &logger))
|
||||
log_cb = logger.log;
|
||||
}
|
||||
|
||||
static void check_variables(void)
|
||||
{
|
||||
struct retro_variable var, var2, var3, var4, port_var;
|
||||
var.key = "ip_octet1";
|
||||
var2.key = "ip_octet2";
|
||||
var3.key = "ip_octet3";
|
||||
var4.key = "ip_octet4";
|
||||
port_var.key = "port";
|
||||
|
||||
environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var);
|
||||
environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var2);
|
||||
environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var3);
|
||||
environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var4);
|
||||
environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &port_var);
|
||||
|
||||
snprintf(server, sizeof(server), "%s.%s.%s.%s", var.value, var2.value, var3.value, var4.value);
|
||||
port = atoi(port_var.value);
|
||||
}
|
||||
|
||||
void retro_set_audio_sample(retro_audio_sample_t cb)
|
||||
{
|
||||
audio_cb = cb;
|
||||
}
|
||||
|
||||
void retro_set_audio_sample_batch(
|
||||
retro_audio_sample_batch_t cb)
|
||||
{
|
||||
audio_batch_cb = cb;
|
||||
}
|
||||
|
||||
void retro_set_input_poll(retro_input_poll_t cb)
|
||||
{
|
||||
input_poll_cb = cb;
|
||||
}
|
||||
|
||||
void retro_set_input_state(retro_input_state_t cb)
|
||||
{
|
||||
input_state_cb = cb;
|
||||
}
|
||||
|
||||
void retro_set_video_refresh(retro_video_refresh_t cb)
|
||||
{
|
||||
video_cb = cb;
|
||||
}
|
||||
|
||||
void retro_reset(void)
|
||||
{}
|
||||
|
||||
void retro_run(void)
|
||||
{
|
||||
unsigned i;
|
||||
update_input();
|
||||
snprintf(message, sizeof(message), "%d", input_state);
|
||||
|
||||
/* send the message */
|
||||
if (sendto(s, message, strlen(message) , 0 , (struct sockaddr *) &si_other, slen)==-1)
|
||||
log_cb(RETRO_LOG_INFO, "Error sending data\n");
|
||||
|
||||
for (i = 0; i < 320 * 240; i++)
|
||||
frame_buf[i] = 4 << 5;
|
||||
video_cb(frame_buf, 320, 240, 640);
|
||||
}
|
||||
|
||||
bool retro_load_game(const struct retro_game_info *info)
|
||||
{
|
||||
(void)info;
|
||||
check_variables();
|
||||
|
||||
s = socket_create(
|
||||
"retropad",
|
||||
SOCKET_DOMAIN_INET,
|
||||
SOCKET_TYPE_DATAGRAM,
|
||||
SOCKET_PROTOCOL_UDP);
|
||||
|
||||
if (s == SOCKET_ERROR)
|
||||
log_cb(RETRO_LOG_INFO, "socket failed");
|
||||
|
||||
/* setup address structure */
|
||||
memset((char *) &si_other, 0, sizeof(si_other));
|
||||
|
||||
si_other.sin_family = AF_INET;
|
||||
si_other.sin_port = htons(port);
|
||||
#if defined(_WIN32) || defined(HAVE_SOCKET_LEGACY)
|
||||
si_other.sin_addr.S_un.S_addr = inet_addr(server);
|
||||
#else
|
||||
si_other.sin_addr.s_addr = inet_addr(server);
|
||||
|
||||
inet_aton(server , &si_other.sin_addr);
|
||||
#endif
|
||||
|
||||
log_cb(RETRO_LOG_INFO, "Server IP Address: %s\n" , server);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void retro_unload_game(void)
|
||||
{}
|
||||
|
||||
unsigned retro_get_region(void)
|
||||
{
|
||||
return RETRO_REGION_NTSC;
|
||||
}
|
||||
|
||||
bool retro_load_game_special(unsigned type,
|
||||
const struct retro_game_info *info, size_t num)
|
||||
{
|
||||
(void)type;
|
||||
(void)info;
|
||||
(void)num;
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t retro_serialize_size(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool retro_serialize(void *data, size_t size)
|
||||
{
|
||||
(void)data;
|
||||
(void)size;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool retro_unserialize(const void *data,
|
||||
size_t size)
|
||||
{
|
||||
(void)data;
|
||||
(void)size;
|
||||
return false;
|
||||
}
|
||||
|
||||
void *retro_get_memory_data(unsigned id)
|
||||
{
|
||||
(void)id;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
size_t retro_get_memory_size(unsigned id)
|
||||
{
|
||||
(void)id;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void retro_cheat_reset(void)
|
||||
{}
|
||||
|
||||
void retro_cheat_set(unsigned idx,
|
||||
bool enabled, const char *code)
|
||||
{
|
||||
(void)idx;
|
||||
(void)enabled;
|
||||
(void)code;
|
||||
}
|
||||
|
||||
|
||||
+5
-8
@@ -501,9 +501,6 @@ database_info_list_t *database_info_list_new(
|
||||
database_info = new_ptr;
|
||||
db_ptr = &database_info[k];
|
||||
|
||||
if (!db_ptr)
|
||||
continue;
|
||||
|
||||
memcpy(db_ptr, &db_info, sizeof(*db_ptr));
|
||||
|
||||
k++;
|
||||
@@ -514,10 +511,11 @@ database_info_list_t *database_info_list_new(
|
||||
database_info_list->count = k;
|
||||
|
||||
end:
|
||||
database_cursor_close(db, cur);
|
||||
|
||||
if (db)
|
||||
{
|
||||
database_cursor_close(db, cur);
|
||||
libretrodb_free(db);
|
||||
}
|
||||
if (cur)
|
||||
libretrodb_cursor_free(cur);
|
||||
|
||||
@@ -535,15 +533,14 @@ void database_info_list_free(database_info_list_t *database_info_list)
|
||||
{
|
||||
database_info_t *info = &database_info_list->list[i];
|
||||
|
||||
if (!info)
|
||||
continue;
|
||||
|
||||
if (info->name)
|
||||
free(info->name);
|
||||
if (info->rom_name)
|
||||
free(info->rom_name);
|
||||
if (info->serial)
|
||||
free(info->serial);
|
||||
if (info->genre)
|
||||
free(info->genre);
|
||||
if (info->description)
|
||||
free(info->description);
|
||||
if (info->publisher)
|
||||
|
||||
+4
-6
@@ -22,12 +22,11 @@
|
||||
#include <stddef.h>
|
||||
|
||||
#include <file/archive_file.h>
|
||||
#include <retro_common_api.h>
|
||||
|
||||
#include "libretro-db/libretrodb.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
enum database_status
|
||||
{
|
||||
@@ -44,6 +43,7 @@ enum database_type
|
||||
DATABASE_TYPE_NONE = 0,
|
||||
DATABASE_TYPE_ITERATE,
|
||||
DATABASE_TYPE_ITERATE_ZIP,
|
||||
DATABASE_TYPE_ITERATE_LUTRO,
|
||||
DATABASE_TYPE_SERIAL_LOOKUP,
|
||||
DATABASE_TYPE_CRC_LOOKUP
|
||||
};
|
||||
@@ -120,8 +120,6 @@ int database_info_build_query(
|
||||
* memory after it is no longer required. */
|
||||
char *bin_to_hex_alloc(const uint8_t *data, size_t len);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif /* CORE_INFO_H_ */
|
||||
+1
-1
@@ -72,7 +72,7 @@ struct defaults
|
||||
} settings;
|
||||
|
||||
#ifndef IS_SALAMANDER
|
||||
content_playlist_t *history;
|
||||
playlist_t *history;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
+14
-14
@@ -32,7 +32,7 @@
|
||||
#if defined(SN_TARGET_PSP2) || defined(VITA)
|
||||
|
||||
#ifdef VITA
|
||||
#define PSP_DISPLAY_PIXEL_FORMAT_8888 (PSP2_DISPLAY_PIXELFORMAT_A8B8G8R8)
|
||||
#define PSP_DISPLAY_PIXEL_FORMAT_8888 (SCE_DISPLAY_PIXELFORMAT_A8B8G8R8)
|
||||
#else
|
||||
#define PSP_DISPLAY_PIXEL_FORMAT_8888 (SCE_DISPLAY_PIXELFORMAT_A8B8G8R8)
|
||||
#endif
|
||||
@@ -67,20 +67,20 @@
|
||||
#define STATE_ANALOGRY(state) ((state).ry)
|
||||
|
||||
#if defined(VITA)
|
||||
#define DEFAULT_SAMPLING_MODE (PSP2_CTRL_MODE_ANALOG)
|
||||
#define DEFAULT_SAMPLING_MODE (SCE_CTRL_MODE_ANALOG)
|
||||
|
||||
#define PSP_CTRL_LEFT PSP2_CTRL_LEFT
|
||||
#define PSP_CTRL_DOWN PSP2_CTRL_DOWN
|
||||
#define PSP_CTRL_RIGHT PSP2_CTRL_RIGHT
|
||||
#define PSP_CTRL_UP PSP2_CTRL_UP
|
||||
#define PSP_CTRL_START PSP2_CTRL_START
|
||||
#define PSP_CTRL_SELECT PSP2_CTRL_SELECT
|
||||
#define PSP_CTRL_TRIANGLE PSP2_CTRL_TRIANGLE
|
||||
#define PSP_CTRL_SQUARE PSP2_CTRL_SQUARE
|
||||
#define PSP_CTRL_CROSS PSP2_CTRL_CROSS
|
||||
#define PSP_CTRL_CIRCLE PSP2_CTRL_CIRCLE
|
||||
#define PSP_CTRL_L PSP2_CTRL_LTRIGGER
|
||||
#define PSP_CTRL_R PSP2_CTRL_RTRIGGER
|
||||
#define PSP_CTRL_LEFT SCE_CTRL_LEFT
|
||||
#define PSP_CTRL_DOWN SCE_CTRL_DOWN
|
||||
#define PSP_CTRL_RIGHT SCE_CTRL_RIGHT
|
||||
#define PSP_CTRL_UP SCE_CTRL_UP
|
||||
#define PSP_CTRL_START SCE_CTRL_START
|
||||
#define PSP_CTRL_SELECT SCE_CTRL_SELECT
|
||||
#define PSP_CTRL_TRIANGLE SCE_CTRL_TRIANGLE
|
||||
#define PSP_CTRL_SQUARE SCE_CTRL_SQUARE
|
||||
#define PSP_CTRL_CROSS SCE_CTRL_CROSS
|
||||
#define PSP_CTRL_CIRCLE SCE_CTRL_CIRCLE
|
||||
#define PSP_CTRL_L SCE_CTRL_LTRIGGER
|
||||
#define PSP_CTRL_R SCE_CTRL_RTRIGGER
|
||||
#else
|
||||
#define DEFAULT_SAMPLING_MODE (SCE_CTRL_MODE_DIGITALANALOG)
|
||||
|
||||
|
||||
Loaded 100 of 851 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user