Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
28c7ae5007 | ||
|
|
0a613c04a6 | ||
|
|
f12092a09f | ||
|
|
21aa1cdbe6 | ||
|
|
5e18a5513c | ||
|
|
1188650a3f | ||
|
|
f64a01c5d4 | ||
|
|
42e803435f | ||
|
|
5e1486d92a | ||
|
|
f03a0cedca | ||
|
|
75a134a578 | ||
|
|
a9b9435e0b | ||
|
|
b674457671 | ||
|
|
7752c73abc | ||
|
|
7f1c4fa2ff | ||
|
|
55bb739996 | ||
|
|
2ce76ff147 | ||
|
|
1a978b0f3c | ||
|
|
29bc5b1d50 | ||
|
|
d8ebcde5ec | ||
|
|
2e080967b0 | ||
|
|
3f3983c19d | ||
|
|
1a5273a73b | ||
|
|
91361f26de | ||
|
|
8f867427db | ||
|
|
36117750af | ||
|
|
97b60b1e20 | ||
|
|
4d3f187db0 | ||
|
|
b5f35ec39b | ||
|
|
aea164f3c8 | ||
|
|
bb6fe9cceb | ||
|
|
69998b0d6c | ||
|
|
3d19ec2e9e | ||
|
|
8467ce114c | ||
|
|
432d7a358a | ||
|
|
48d61f33ab | ||
|
|
c5ed4f1f65 | ||
|
|
0863a8eb84 | ||
|
|
0e4a8dfd97 | ||
|
|
d62d80c1ce | ||
|
|
ca480ef459 | ||
|
|
761ece0f3c | ||
|
|
82084205d8 | ||
|
|
53be91af9e | ||
|
|
6a17168739 | ||
|
|
7f8c6f50e3 | ||
|
|
b6c1b9f7a0 | ||
|
|
a16ce4a146 | ||
|
|
809398b740 | ||
|
|
1d69f55b37 | ||
|
|
b12367c781 | ||
|
|
341d0f9998 | ||
|
|
f79418459f | ||
|
|
08ed4d0e57 | ||
|
|
0de724d066 | ||
|
|
26e171cfbc | ||
|
|
58ef1541c2 | ||
|
|
4e4c69a3dc | ||
|
|
bdb8edb708 | ||
|
|
34d618238b | ||
|
|
f41280e82c | ||
|
|
787924fc8f | ||
|
|
f02faeea27 | ||
|
|
c00d32f30f | ||
|
|
6cde59a8ad | ||
|
|
e6fb3c3a1c | ||
|
|
9954d03f2a | ||
|
|
ebdb7168ed | ||
|
|
cc250f755b | ||
|
|
1ee45f2162 | ||
|
|
f73d086abd | ||
|
|
992c66ffc8 | ||
|
|
0eba3fe791 | ||
|
|
a0eb17200b | ||
|
|
5e87fd5ecc | ||
|
|
d860642c75 | ||
|
|
c2e4eb772d | ||
|
|
2809074ccd | ||
|
|
e5ce152b95 | ||
|
|
15c9e0ae7e | ||
|
|
5e99d163de | ||
|
|
f4ea4bfdda | ||
|
|
74629ab4b5 | ||
|
|
644de4ae9e | ||
|
|
3a658172f8 | ||
|
|
e0d7c25ea0 | ||
|
|
a73cbb6114 | ||
|
|
1742b96ec0 | ||
|
|
72303888c8 | ||
|
|
eebcde721b | ||
|
|
d647c1b215 | ||
|
|
145979ddcb | ||
|
|
052730bbf1 | ||
|
|
94ec0fc94d | ||
|
|
1c6d58e6c6 | ||
|
|
d56bde43e8 | ||
|
|
508d849fa5 | ||
|
|
50e70bf707 | ||
|
|
9f50ab2534 | ||
|
|
009329969a | ||
|
|
b7d3f3b01c | ||
|
|
f3a9a38987 | ||
|
|
3d6e6efe49 | ||
|
|
0ce76cbf5b | ||
|
|
64a77af881 | ||
|
|
a9d29041a3 | ||
|
|
6066ab3ecc | ||
|
|
c717ebdfda | ||
|
|
acdf0eb74e | ||
|
|
0140f989c3 | ||
|
|
e9a0aba85b | ||
|
|
90fbc6330c | ||
|
|
2d158b809c | ||
|
|
05ce32efe4 | ||
|
|
fe9ad4825d | ||
|
|
f9ef8d4cc7 | ||
|
|
a9038e3b0a | ||
|
|
e34943194c | ||
|
|
9ba753993b | ||
|
|
81e13aa2c1 | ||
|
|
95314700f9 | ||
|
|
ed54600b41 | ||
|
|
b03487dc4f | ||
|
|
0c517434f3 | ||
|
|
9fdbde1b4c | ||
|
|
3d8e1e0f6c | ||
|
|
280431114e | ||
|
|
418c5cbb76 | ||
|
|
6d4212ca06 | ||
|
|
f86097aefb | ||
|
|
f687fec624 | ||
|
|
f828de24db | ||
|
|
297abae623 | ||
|
|
be95858b16 | ||
|
|
93de657952 | ||
|
|
5b11e290dd | ||
|
|
d9bc760b46 | ||
|
|
041af7cdb8 | ||
|
|
dfefefb416 | ||
|
|
5a1d8a96d0 | ||
|
|
242b511387 | ||
|
|
d15eb9a570 | ||
|
|
e663a69c0b | ||
|
|
869cb8a1be | ||
|
|
ec0d9f0a70 | ||
|
|
fe3c279f73 | ||
|
|
5cef419209 | ||
|
|
97eea9e71f | ||
|
|
4617f792c5 | ||
|
|
4d630189a2 | ||
|
|
966f267285 | ||
|
|
dfa315f0d5 | ||
|
|
5b4ba2a449 | ||
|
|
e99a97d9b7 | ||
|
|
4fce2e74ac | ||
|
|
88b3b9a08d | ||
|
|
c9e6a91137 | ||
|
|
a3234f3f17 | ||
|
|
c2bd46e3cb | ||
|
|
d5bc3c4d5b | ||
|
|
b7ef5271ea | ||
|
|
7de6a0f005 | ||
|
|
61faa0a04b | ||
|
|
191b233334 | ||
|
|
cbc8bab8e2 | ||
|
|
d805845e29 | ||
|
|
1cea6cd7be | ||
|
|
e9ce64e854 | ||
|
|
414c63b59a | ||
|
|
6a2449bd1e | ||
|
|
2d0c02d21e | ||
|
|
55530dcbc3 | ||
|
|
7853815d45 | ||
|
|
89cccb111b | ||
|
|
1645ae54be | ||
|
|
30fa73dc8d | ||
|
|
7df467422b | ||
|
|
885966c16b | ||
|
|
138e4bc78b | ||
|
|
4ba487df99 | ||
|
|
0f8e31cad3 | ||
|
|
1d0beeb665 | ||
|
|
4eb6f26d92 | ||
|
|
780974ef32 | ||
|
|
8c86c6a47c | ||
|
|
272563f3ca | ||
|
|
8d89b1fa86 | ||
|
|
75c05a5d7f | ||
|
|
50f0e19263 | ||
|
|
2807f94a14 | ||
|
|
5dfc3f31db | ||
|
|
1b1b59692b | ||
|
|
0b78b07573 | ||
|
|
b038b4ae41 | ||
|
|
d2d4312128 | ||
|
|
7d0205deac | ||
|
|
0b9ea0943b | ||
|
|
fa1662412b | ||
|
|
130f0749d4 | ||
|
|
6f80e09ce1 | ||
|
|
784df92f8d | ||
|
|
702d4f9e3a | ||
|
|
d2a798e9cf | ||
|
|
efb1c88215 | ||
|
|
f3cc1a9b59 | ||
|
|
ac584330bb | ||
|
|
1b0a9d0b1d | ||
|
|
d2645e9087 | ||
|
|
800d54a7fb | ||
|
|
77001a5577 | ||
|
|
86a8899b0f | ||
|
|
c44107949d | ||
|
|
5f125bc1f6 | ||
|
|
eaa0b08bc2 | ||
|
|
b8c1e31c13 | ||
|
|
cbc575eec0 | ||
|
|
81690601c0 | ||
|
|
89bcdeaf0b | ||
|
|
bce0d55a43 | ||
|
|
b57b5f3624 | ||
|
|
dc12f07a55 | ||
|
|
59ed4b939f | ||
|
|
47fddf28e5 | ||
|
|
32c4f13761 | ||
|
|
e938be3747 | ||
|
|
ae6302ede2 | ||
|
|
00741d06fb | ||
|
|
c5667d8253 | ||
|
|
2480181469 | ||
|
|
481196c55c | ||
|
|
f8f2f7d03c | ||
|
|
0ec1c5ade5 | ||
|
|
dff5aa35d6 | ||
|
|
de27720044 | ||
|
|
b0834a0f17 | ||
|
|
b79edb6095 | ||
|
|
937230564d | ||
|
|
a6048b4218 | ||
|
|
7a907a97a7 | ||
|
|
9a10ef5591 | ||
|
|
860b7fde62 | ||
|
|
1d9220d9d1 | ||
|
|
c8b9bb609f | ||
|
|
30eac5b778 | ||
|
|
6023a5f06e | ||
|
|
4a1a623099 | ||
|
|
0e60d20705 | ||
|
|
67ea4e1d6b | ||
|
|
1fbac78e35 | ||
|
|
a7df7be64b | ||
|
|
a53e7a5437 | ||
|
|
bd96ab3585 | ||
|
|
1b85ee442f | ||
|
|
83dc7db6c7 | ||
|
|
caed6c61cb | ||
|
|
1e407079e4 | ||
|
|
a6eb40b3d2 | ||
|
|
4771c45ed3 | ||
|
|
7f5d0f2763 | ||
|
|
860ffff3c9 | ||
|
|
a1c8a47665 | ||
|
|
c62971042d | ||
|
|
eae652d6a5 | ||
|
|
8232135922 | ||
|
|
e669f92399 | ||
|
|
3b9552bd36 | ||
|
|
8a06e27c22 | ||
|
|
59ad8fcfde | ||
|
|
f0458495f4 | ||
|
|
d45f0e0946 | ||
|
|
670eede306 | ||
|
|
b09a19d9a0 | ||
|
|
ae5d7849af | ||
|
|
fc7a972466 | ||
|
|
28d5ca6a86 | ||
|
|
b660fb8878 | ||
|
|
0e91bb6852 | ||
|
|
dfde6f833a | ||
|
|
1d96e80b05 | ||
|
|
fbf527eac2 | ||
|
|
ef93f92ea2 | ||
|
|
a8ccf2531d | ||
|
|
e6da374bb5 | ||
|
|
a4c9d02953 | ||
|
|
874b5b7e17 | ||
|
|
8fd280967b | ||
|
|
5863996d83 | ||
|
|
8f69470c25 | ||
|
|
d6005c224c | ||
|
|
6836b5f868 | ||
|
|
3677144d18 | ||
|
|
6c9e8041c6 | ||
|
|
6dce80ea07 | ||
|
|
778b50fc28 | ||
|
|
361cce328d | ||
|
|
277e2977ff | ||
|
|
4248e244a8 | ||
|
|
01f5a7ad84 | ||
|
|
89ee08214d | ||
|
|
be5333371b | ||
|
|
bfd38e171b | ||
|
|
3f22d5cb33 | ||
|
|
3abea50cbf | ||
|
|
7e1e330463 | ||
|
|
2a621a8424 | ||
|
|
cf03851cc8 | ||
|
|
a6f015623a | ||
|
|
5e970637d4 | ||
|
|
25d741e26a | ||
|
|
82f5d917f0 | ||
|
|
a8185f0b81 | ||
|
|
042e4b0ba7 | ||
|
|
070f25131a | ||
|
|
e5e11ae716 | ||
|
|
28a02da5bf | ||
|
|
91d19a15ec | ||
|
|
28bb5295f7 | ||
|
|
b4e872476b | ||
|
|
4f1ab1f9c3 | ||
|
|
65b628cf20 | ||
|
|
09f2b64c1f | ||
|
|
34f3963e4e | ||
|
|
6fbad68561 | ||
|
|
7d346d627f | ||
|
|
d9750591d2 | ||
|
|
86a94a5d95 | ||
|
|
6f9b7a4c87 | ||
|
|
ea94d33de5 | ||
|
|
ca497533db | ||
|
|
edf296a06c | ||
|
|
76ef4bd44a | ||
|
|
5104e05a89 | ||
|
|
cec6701c0d | ||
|
|
f13b630d57 | ||
|
|
841a647d0c | ||
|
|
b19f12ec66 | ||
|
|
96c21eeb0d | ||
|
|
b4acda26a2 | ||
|
|
ae66fc95cc | ||
|
|
6726b64d0d | ||
|
|
49d751e6c3 | ||
|
|
5c18dc8a04 | ||
|
|
004ca19fe4 | ||
|
|
77cec284f4 | ||
|
|
a669039523 | ||
|
|
11423ac52e | ||
|
|
87c2f16ca7 | ||
|
|
a4720acf22 | ||
|
|
88dfabf92f | ||
|
|
5f00e6ee56 | ||
|
|
5e4e30abe9 | ||
|
|
12d6d56199 | ||
|
|
16fb6d5f07 | ||
|
|
1bac8c8649 | ||
|
|
75200b8e11 | ||
|
|
7ef56a2e46 | ||
|
|
ae5640fa25 | ||
|
|
f34288781e | ||
|
|
58073b937f | ||
|
|
7beff1adaa | ||
|
|
c14e281544 | ||
|
|
0f8f980c8f | ||
|
|
2c69bc7d79 | ||
|
|
a82cc0d31f | ||
|
|
d443ac53ef | ||
|
|
13a3bfeee7 | ||
|
|
6aa2fbea47 | ||
|
|
a3aba22c6e | ||
|
|
d40af3143f | ||
|
|
678ec1b662 | ||
|
|
fe60a7d813 | ||
|
|
4bda039f62 | ||
|
|
c83c242e3a | ||
|
|
02b456f3a1 | ||
|
|
59db6de385 | ||
|
|
0f83f48cb4 | ||
|
|
4a097af3e4 | ||
|
|
c31ef24412 | ||
|
|
583d4fd283 | ||
|
|
faee785aaa | ||
|
|
ac3cb48302 | ||
|
|
d9b86c4f6b | ||
|
|
2746bf0cb1 | ||
|
|
94b8e8820e | ||
|
|
eaf08ad88c | ||
|
|
55abe2e38f | ||
|
|
ea2094126b | ||
|
|
2de97c9176 | ||
|
|
77373e9ba4 | ||
|
|
7e641b7274 | ||
|
|
33356f2df6 | ||
|
|
353072c9cd | ||
|
|
4dfed7e930 | ||
|
|
dcefb740f2 | ||
|
|
93e17b46bd | ||
|
|
61a4d47feb | ||
|
|
4939a9ea22 | ||
|
|
0a74bcc080 | ||
|
|
b4425d4524 | ||
|
|
ce51396fb4 | ||
|
|
e303b62635 | ||
|
|
e9682c1122 | ||
|
|
46c48fa4b8 | ||
|
|
a8b834f2c8 | ||
|
|
ee8c5bfa98 | ||
|
|
ac084a5175 | ||
|
|
b171be802e | ||
|
|
fa7ea1d20a | ||
|
|
198ecd263d | ||
|
|
1516ee8e76 | ||
|
|
4b9143430c | ||
|
|
4c7ae72c62 | ||
|
|
7da6797112 | ||
|
|
68cd176d63 | ||
|
|
eb9971703b | ||
|
|
5ca0085e22 | ||
|
|
d44aa37be0 | ||
|
|
4e5d66547a | ||
|
|
816539f9df | ||
|
|
c6dc2b6c3e | ||
|
|
42600fa74b | ||
|
|
7d61fbb780 | ||
|
|
f15effe68b | ||
|
|
63c4b7c772 | ||
|
|
bc6e9ee3bf | ||
|
|
0eb3feff64 | ||
|
|
c3f3207b0d | ||
|
|
05f2a2d18c | ||
|
|
255ee8766f | ||
|
|
a2d4d832f6 | ||
|
|
37d895d77b | ||
|
|
00a958edc2 | ||
|
|
b870aaf2fa | ||
|
|
27b5617cd9 | ||
|
|
a9fc111ea2 | ||
|
|
22f6d1ce1d | ||
|
|
60c551fe75 | ||
|
|
b1a3d5bb25 | ||
|
|
6b0e0adf27 | ||
|
|
1d84894e09 | ||
|
|
c32e828c6f | ||
|
|
afcb3f1e5d | ||
|
|
835e5e751b | ||
|
|
b5f4332e74 | ||
|
|
5dbca80ed8 | ||
|
|
e424d432a2 | ||
|
|
f6f306903c | ||
|
|
bd0347f1ae | ||
|
|
ee6a0e40b0 | ||
|
|
1e74f02b94 | ||
|
|
777be51eb6 | ||
|
|
433155c95f | ||
|
|
c834b7825e | ||
|
|
090a68f9cf | ||
|
|
3c9b39f4bd | ||
|
|
6c69cdb93c | ||
|
|
2c18bf12f5 | ||
|
|
353795b25e | ||
|
|
9b35965ce1 | ||
|
|
75b91e3ddc | ||
|
|
c0cd5256a2 | ||
|
|
9587efde67 | ||
|
|
f8aefd0030 | ||
|
|
f14624370d | ||
|
|
77c583ae47 | ||
|
|
ba43724fec | ||
|
|
e8eaa54218 | ||
|
|
7968914453 | ||
|
|
4c738b9645 | ||
|
|
e8a5f6194e | ||
|
|
1c06843811 | ||
|
|
1dcd6856db | ||
|
|
8a6c2568de | ||
|
|
4158248b77 | ||
|
|
2f98073fc1 | ||
|
|
3f52b9e246 | ||
|
|
b398a0c185 | ||
|
|
a5a666071b | ||
|
|
51db7e695e | ||
|
|
cb9976a125 | ||
|
|
60a303e144 | ||
|
|
d98c7a1c34 | ||
|
|
67e1c82575 | ||
|
|
eb62d5f4a4 | ||
|
|
c4b80e0e44 | ||
|
|
949cbcac07 | ||
|
|
eeccb63c4e | ||
|
|
7a6463a300 | ||
|
|
04ac09f579 | ||
|
|
f8452e23c8 | ||
|
|
c7b5d41151 | ||
|
|
1ed54b8683 | ||
|
|
4f48e61b98 | ||
|
|
6f6ba98576 | ||
|
|
ffd94d3ac0 | ||
|
|
32353b10bb | ||
|
|
8aa429bd67 | ||
|
|
6429bb6a40 | ||
|
|
e688770e64 | ||
|
|
f8a2014b7e | ||
|
|
aa4015837f | ||
|
|
d537b6ee9f | ||
|
|
1a5d2ce85c | ||
|
|
85804838ad | ||
|
|
09fba6016b | ||
|
|
034f1769c9 | ||
|
|
cc622b6905 | ||
|
|
a2a4a365a3 | ||
|
|
ef1feca097 | ||
|
|
47b34b38d2 | ||
|
|
7da0739b61 | ||
|
|
22a677b3a8 | ||
|
|
fd7a62f5ca | ||
|
|
a8a871bd4e | ||
|
|
e4935d490c | ||
|
|
3bebc2284f | ||
|
|
b421bdf687 | ||
|
|
eceadcde2b | ||
|
|
cedc6506b5 | ||
|
|
902026ec86 | ||
|
|
c4104ae37c | ||
|
|
44688b1424 | ||
|
|
52a515f0d3 | ||
|
|
765e229c35 | ||
|
|
8cab56e806 | ||
|
|
cfe06ce730 | ||
|
|
66a8e08252 | ||
|
|
7acd82e189 | ||
|
|
90850799b7 | ||
|
|
d5429f00e1 | ||
|
|
e93e75321f | ||
|
|
1638df4ae7 | ||
|
|
7cc72520f7 | ||
|
|
5f3b27417b | ||
|
|
d0e1802436 | ||
|
|
cece4e5ae2 | ||
|
|
1b4318d89b | ||
|
|
f09338b1b8 | ||
|
|
7bb5b749a0 | ||
|
|
b87106e61a | ||
|
|
0bbac8da97 | ||
|
|
6e7f1371dd | ||
|
|
9e060bf088 | ||
|
|
0dddd671f8 | ||
|
|
4259ea3d06 | ||
|
|
36eb07e067 | ||
|
|
6512e5ff6e | ||
|
|
254e0bbd90 | ||
|
|
f462954609 | ||
|
|
8ce2665383 | ||
|
|
b57dbd5028 | ||
|
|
a5d39ba38d | ||
|
|
5beb71711b | ||
|
|
5f50034514 | ||
|
|
fbc7eaf287 | ||
|
|
1426cf7fb2 | ||
|
|
25c1c6202f | ||
|
|
9aeceadee6 | ||
|
|
4bb3f35a02 | ||
|
|
f41ee75a82 | ||
|
|
8550c16f86 | ||
|
|
b61c05e10f | ||
|
|
111c37832a | ||
|
|
74f1b3aa34 | ||
|
|
fa449646e9 | ||
|
|
bcac4a204f | ||
|
|
720a519987 | ||
|
|
5542427246 | ||
|
|
452898c0f8 | ||
|
|
459c55989a | ||
|
|
9108ee773f | ||
|
|
9c21c9ea1f | ||
|
|
dbe6bc5cfb | ||
|
|
481fa56f2c | ||
|
|
fde9f1ce2c | ||
|
|
9bc889b908 | ||
|
|
11c1535fe3 | ||
|
|
b1c614f1ca | ||
|
|
4540369fcb | ||
|
|
0bcdf6ebe0 | ||
|
|
88ec0f522b | ||
|
|
1b5cc1ca9c | ||
|
|
4e510247f5 | ||
|
|
d6906ee7df | ||
|
|
575cd4e3be | ||
|
|
11831a8b47 | ||
|
|
5cb0aa51c0 | ||
|
|
e1a1843edc | ||
|
|
2d5e10e840 | ||
|
|
140d65b994 | ||
|
|
7ec1a6836c | ||
|
|
50efe142b9 | ||
|
|
eb1fe0476d | ||
|
|
14d39be698 | ||
|
|
72fed0d871 | ||
|
|
cebefa6ae1 | ||
|
|
db074e1c1a | ||
|
|
353c421a5c | ||
|
|
6fcd097e4c | ||
|
|
1c412eea5a | ||
|
|
96c9687a8a | ||
|
|
98990d6afc | ||
|
|
7205d76ab0 | ||
|
|
c105fb22f3 | ||
|
|
a61536ffdc | ||
|
|
6be1453d9c | ||
|
|
50a605e9db | ||
|
|
1165d1c0b7 | ||
|
|
02e3d6eba7 | ||
|
|
acf4931ad1 | ||
|
|
7e9f66ad39 | ||
|
|
c74c7ae053 | ||
|
|
a1ae86a808 | ||
|
|
0b85951abe | ||
|
|
a21444fc9a | ||
|
|
f5c5c82729 | ||
|
|
bd672b8b72 | ||
|
|
620fbe8976 | ||
|
|
eeada0c458 | ||
|
|
56a14ffc3c | ||
|
|
51a94d6ac7 | ||
|
|
17e5e57bed | ||
|
|
a84ebda75c | ||
|
|
207c87e551 | ||
|
|
d4daf25c2a | ||
|
|
b6a9f5c239 | ||
|
|
a539a6512b | ||
|
|
263efc965b | ||
|
|
d78787d70e | ||
|
|
0058e1ba51 | ||
|
|
2e853b3f04 | ||
|
|
22452f6cb2 | ||
|
|
8f73779acb | ||
|
|
adbf9fed16 | ||
|
|
0d3c30978d | ||
|
|
46cc21029b | ||
|
|
bebf9abfb2 | ||
|
|
ee24cfce31 | ||
|
|
9097727452 | ||
|
|
25787c2ce6 | ||
|
|
8f41174fca | ||
|
|
7ef5bd5534 | ||
|
|
a3ce07b5af | ||
|
|
e97de06f24 | ||
|
|
17f616e3dc | ||
|
|
d14f9e6f08 | ||
|
|
f71611251f | ||
|
|
620dac1abd | ||
|
|
f8b866c8c1 | ||
|
|
d4f59c2a0e | ||
|
|
0b8efb7736 | ||
|
|
4aa36501fb | ||
|
|
d3a9b04223 | ||
|
|
d7ebb49fd0 | ||
|
|
bdbd3098dd | ||
|
|
b2fa47ef43 | ||
|
|
cd9f567fc2 | ||
|
|
1f951656a3 | ||
|
|
7f1f345066 | ||
|
|
d4846b9021 | ||
|
|
b4b50d1972 | ||
|
|
97f2a2dfb1 | ||
|
|
f00f09a549 | ||
|
|
dfbe4cc049 | ||
|
|
e189f35caf | ||
|
|
96f1cb4175 | ||
|
|
80284d760f | ||
|
|
9109ea3dde | ||
|
|
f621165adf | ||
|
|
8d4bb1326c | ||
|
|
300aac33cf | ||
|
|
a10fae4e8b | ||
|
|
a236c559f0 | ||
|
|
0784608604 | ||
|
|
954ac39b91 | ||
|
|
5a2816c6da | ||
|
|
4fbb08210c | ||
|
|
e790b503d9 | ||
|
|
debb5dd0ce | ||
|
|
e5feaacf2c | ||
|
|
38034abce6 | ||
|
|
0cbdd4f3a6 | ||
|
|
46b963619a | ||
|
|
172cdc1f49 | ||
|
|
3376799768 | ||
|
|
031fc859ce | ||
|
|
dbfc9ff370 | ||
|
|
76dc51faeb | ||
|
|
50929c9809 | ||
|
|
1e31f06200 | ||
|
|
bd74390cde | ||
|
|
b4dcbb235f | ||
|
|
37c2b47915 | ||
|
|
02ec7830d9 | ||
|
|
cdd6684bb9 | ||
|
|
47cf62cdbd | ||
|
|
6c1b96f50d | ||
|
|
20441299e1 | ||
|
|
fab6903522 | ||
|
|
8c867394a0 | ||
|
|
678cabc48c | ||
|
|
7c4b372208 | ||
|
|
fe3c3f5203 | ||
|
|
f906e828ba | ||
|
|
8b714895a8 | ||
|
|
f9824dd53e | ||
|
|
bb0b6a6b68 | ||
|
|
3f265360db | ||
|
|
6957f57111 | ||
|
|
349892debf | ||
|
|
35ea059f82 | ||
|
|
5e1f289cd4 | ||
|
|
57c4db4338 | ||
|
|
cbf84b8d6e | ||
|
|
64e891124c | ||
|
|
b0995e6eee | ||
|
|
e842ebbfc4 | ||
|
|
602c40c228 | ||
|
|
5b581e70ba | ||
|
|
c2d7b330aa | ||
|
|
89f0c4211c | ||
|
|
76f7114b47 | ||
|
|
f1a572822b | ||
|
|
d078682a3c | ||
|
|
4fcb1469cc | ||
|
|
ead20f9ba5 | ||
|
|
4941cd7dbd | ||
|
|
9f26e3bc69 | ||
|
|
68969d1363 | ||
|
|
bcaf08ad2d | ||
|
|
5516ff05b5 | ||
|
|
637ee33ab6 | ||
|
|
6413449944 | ||
|
|
1d7fdc64ba | ||
|
|
154f85c6fa | ||
|
|
f6afe72a1e | ||
|
|
0a9787ec49 | ||
|
|
098fc0a860 | ||
|
|
82dcd2cd94 | ||
|
|
75d73ab658 | ||
|
|
3a924231a6 | ||
|
|
3140e5f980 | ||
|
|
ce41c5bbca | ||
|
|
f94e9c532e | ||
|
|
39bc6c1e9e | ||
|
|
254d2d1fff | ||
|
|
9e186b4587 | ||
|
|
46c9ff36ef | ||
|
|
b9a5c326cd | ||
|
|
46d210e977 | ||
|
|
7c28ddbfc5 | ||
|
|
ef6ef13143 | ||
|
|
00e4793bed | ||
|
|
b7c41c9fcd | ||
|
|
8721c857e9 | ||
|
|
6a697ef2e1 | ||
|
|
425a290ced | ||
|
|
ef1b0b0965 | ||
|
|
f079ca29e4 | ||
|
|
752e9abd4e | ||
|
|
0a7c481ff0 | ||
|
|
fab6c9b8c4 | ||
|
|
753fd86c2e | ||
|
|
e3b2abed9e | ||
|
|
6d8ee1f8d4 | ||
|
|
016ee293cd | ||
|
|
24bafd7ab9 | ||
|
|
ac31eeb360 | ||
|
|
3393a32547 | ||
|
|
fcac9a8401 | ||
|
|
954c5a86f6 | ||
|
|
ff9f433243 | ||
|
|
e8e0917c9c | ||
|
|
3fab9843fd | ||
|
|
6c06ffbf1d | ||
|
|
fc6d22d47b | ||
|
|
a36382b938 | ||
|
|
d255d6609b | ||
|
|
4517d18fc0 | ||
|
|
f75f0beb08 | ||
|
|
8c8ea6c167 | ||
|
|
f1ea400456 | ||
|
|
45a663c100 | ||
|
|
af1e698b05 | ||
|
|
fed8570ec3 | ||
|
|
0f35e0639e | ||
|
|
14227c101b | ||
|
|
a2851ab70b | ||
|
|
03e9577686 | ||
|
|
28ddefc467 | ||
|
|
410e750d24 | ||
|
|
b9fde7bb24 | ||
|
|
cf4d31cd80 | ||
|
|
37875fb242 | ||
|
|
63d216ad1f | ||
|
|
44e309e7c8 | ||
|
|
267c9f8225 | ||
|
|
314d683228 | ||
|
|
485750c8ba | ||
|
|
b4fdab79fe | ||
|
|
cfe884f0b7 | ||
|
|
c6220a9e66 | ||
|
|
e26c88b4bb | ||
|
|
ab3591df73 | ||
|
|
7d00f945b8 | ||
|
|
ce93da7cbf | ||
|
|
9b521d665d | ||
|
|
49e7347f3d | ||
|
|
99804e2427 | ||
|
|
c1fbccfc06 | ||
|
|
bd008748da | ||
|
|
74547ca990 | ||
|
|
d09ea1bb57 | ||
|
|
36b420ec17 | ||
|
|
8a043a9c6d | ||
|
|
a6c2e2981d | ||
|
|
e2e1471946 | ||
|
|
db77e1e6ec | ||
|
|
b881908c91 | ||
|
|
2585145b10 | ||
|
|
14aac016a9 | ||
|
|
774ec5b7ca | ||
|
|
3a6484d0ad | ||
|
|
c75557d204 | ||
|
|
712a38083b | ||
|
|
4364ce92c3 | ||
|
|
b3944a21d5 | ||
|
|
48e67d5546 | ||
|
|
9e69551408 | ||
|
|
ddf5283ecd | ||
|
|
f17f786234 | ||
|
|
da590b00a8 | ||
|
|
71507808c9 | ||
|
|
84d64c4042 | ||
|
|
46750ff3e6 | ||
|
|
8620b4c33b | ||
|
|
96a6f8ec77 | ||
|
|
859a04e6ee | ||
|
|
c9ec688a7e | ||
|
|
35ff9c35b3 | ||
|
|
f77722a213 | ||
|
|
b5e28cda58 | ||
|
|
9db5d45361 | ||
|
|
86e8c7a9f8 | ||
|
|
e9e6fd7b80 | ||
|
|
c447f6d1bd | ||
|
|
2df631a36f | ||
|
|
2f787604e5 | ||
|
|
dd8d01a1cb | ||
|
|
c9c4c77d38 | ||
|
|
21c4a07cf0 | ||
|
|
9b0034ccb2 | ||
|
|
9bb1127727 | ||
|
|
1e05027785 | ||
|
|
55927d5957 | ||
|
|
b077113aff | ||
|
|
99d21fd701 | ||
|
|
23e48f1821 | ||
|
|
b48c900129 | ||
|
|
f2952c530c | ||
|
|
259ac2ddbd | ||
|
|
1721a23d54 | ||
|
|
80845f1cd6 | ||
|
|
788951958c | ||
|
|
85e0ab9a8e | ||
|
|
5164b8a058 | ||
|
|
33f0f72adc | ||
|
|
0e017ea925 | ||
|
|
65742d250b | ||
|
|
0541a9866e | ||
|
|
bbe7221d95 | ||
|
|
3763c6d4c0 | ||
|
|
bb1fa17718 | ||
|
|
efc580c071 | ||
|
|
e0a29599f4 | ||
|
|
8c910b73dc | ||
|
|
dd0136e2d5 | ||
|
|
9af5b44453 | ||
|
|
d9de92f48b | ||
|
|
5b6d310abd | ||
|
|
8b9c7a47e4 | ||
|
|
31112e937b | ||
|
|
8d47203ad1 | ||
|
|
e4d983646d | ||
|
|
4210ee197b | ||
|
|
6e9bc55dd6 | ||
|
|
08eb091610 | ||
|
|
0378463130 | ||
|
|
a12e307039 | ||
|
|
76770321b4 | ||
|
|
ce2869b4d8 | ||
|
|
c60c9fbd86 | ||
|
|
f604afeede | ||
|
|
5cd66a19b2 | ||
|
|
a306d3acc7 | ||
|
|
88c68f479a | ||
|
|
2026401cc0 | ||
|
|
c6cc006223 | ||
|
|
159ebcc8a2 | ||
|
|
1c3d8c5740 | ||
|
|
e86bd1b021 | ||
|
|
07632702fb | ||
|
|
e7798ed511 | ||
|
|
a0f35e56fa | ||
|
|
da1a5ad2cc | ||
|
|
0bfaf26993 | ||
|
|
41088165f5 | ||
|
|
7c7b170ceb | ||
|
|
2b86b9dbe6 | ||
|
|
2dba1aaef4 | ||
|
|
82991afb36 | ||
|
|
9f2e61cddd | ||
|
|
a3fd1868c1 | ||
|
|
ad4e633e11 | ||
|
|
38a341e6b5 | ||
|
|
cdf272665e | ||
|
|
c3c408f9d6 | ||
|
|
690c5c2bc8 | ||
|
|
c6e0a38906 | ||
|
|
dd106ee8d2 | ||
|
|
28f3ea355a | ||
|
|
e743f4377e | ||
|
|
d0e9881f46 | ||
|
|
3e0d3cbd55 | ||
|
|
9f2bc8d55e | ||
|
|
486184d1eb | ||
|
|
5e9f8b276b | ||
|
|
a8b5c4f3b1 | ||
|
|
bd1291dd71 | ||
|
|
67a68c0595 | ||
|
|
459c18f5de | ||
|
|
2f13fe0ece | ||
|
|
88a8ac5370 | ||
|
|
c1e4a852cc | ||
|
|
d092e20b5a | ||
|
|
72ce7e8fd2 | ||
|
|
94d227863f | ||
|
|
2fca1cccd3 | ||
|
|
cfa01e930d | ||
|
|
5c4ab83d98 | ||
|
|
14cd4af752 | ||
|
|
ce1b86993b | ||
|
|
fc821fc5b4 | ||
|
|
1924b8396b | ||
|
|
84b6b505ad | ||
|
|
bdb9471d13 | ||
|
|
f8051d846f | ||
|
|
b3e72f6f42 | ||
|
|
c30a2ec990 | ||
|
|
95deab8f1d | ||
|
|
29d1326c4f | ||
|
|
cd578521e4 | ||
|
|
b578ffb056 | ||
|
|
a2b2869ca6 | ||
|
|
0584b3c072 | ||
|
|
d8bfa7ab7d | ||
|
|
702d9d4728 | ||
|
|
3e69eb5a8e | ||
|
|
772aa6ef0c | ||
|
|
76b726d154 | ||
|
|
81c4160a5a | ||
|
|
eb33197a9b | ||
|
|
c7b9625460 | ||
|
|
f7d47bb956 | ||
|
|
d384cb351f | ||
|
|
a1ee49bf1d | ||
|
|
496a69c796 | ||
|
|
fac18641cd | ||
|
|
d3b9356958 | ||
|
|
e566665885 | ||
|
|
b600e6e032 | ||
|
|
b647e8186d | ||
|
|
452df47c14 | ||
|
|
9d96e9e452 | ||
|
|
71bc817e99 | ||
|
|
c78c542aea | ||
|
|
a67082865c | ||
|
|
26737dbf49 | ||
|
|
3fe210bb41 | ||
|
|
534a838472 | ||
|
|
0b1b56214e | ||
|
|
04591cfc5c | ||
|
|
1b2cf74e12 | ||
|
|
ff90a13a5e | ||
|
|
418fb62cfc | ||
|
|
6576348198 | ||
|
|
bd56e0c02e | ||
|
|
487b295182 | ||
|
|
9e9723e721 | ||
|
|
490c023fe3 | ||
|
|
7a01fb1616 | ||
|
|
e1bd5ca335 | ||
|
|
4448145532 | ||
|
|
f1ca9604b7 | ||
|
|
0e89523fa8 | ||
|
|
d9b3412922 | ||
|
|
c4c4ee4eee | ||
|
|
fbcad4e117 | ||
|
|
71a8098037 | ||
|
|
ac09b7eb29 | ||
|
|
3c2f7fadcc | ||
|
|
694ef7570e | ||
|
|
506645dd8d | ||
|
|
fccb635f19 | ||
|
|
b8b7ee530c | ||
|
|
ca2c38cd9f | ||
|
|
7e8ea3f6fb | ||
|
|
05d9827830 | ||
|
|
788ded0138 | ||
|
|
b208ce443c | ||
|
|
bb0b8764c5 | ||
|
|
8b20409d32 | ||
|
|
609fa8394e | ||
|
|
24354f477e | ||
|
|
f29c61bacc | ||
|
|
c67771fab6 | ||
|
|
8c2ed9f750 | ||
|
|
6a64ab1137 | ||
|
|
6130f20d47 | ||
|
|
17f885d158 | ||
|
|
9e497c1b11 | ||
|
|
d59ffbdd2c | ||
|
|
5f3ae10f20 | ||
|
|
d9113b8bc4 | ||
|
|
feb744fafe | ||
|
|
0ed22af4f5 | ||
|
|
02ab043ff5 | ||
|
|
d3aaa7ac88 | ||
|
|
341e8f8f15 | ||
|
|
6b55a5f20b | ||
|
|
ce200823b8 | ||
|
|
8e2818bbeb | ||
|
|
36c36aa558 | ||
|
|
8fc2a05a70 | ||
|
|
188029373f | ||
|
|
0643b83f7d | ||
|
|
ab64daf5aa | ||
|
|
2fa46bcef8 | ||
|
|
ca3f352ed1 | ||
|
|
32ee695f9d | ||
|
|
24f5275001 | ||
|
|
407d85f604 | ||
|
|
a90c5a9861 | ||
|
|
bca4ccb155 | ||
|
|
6623bdc054 | ||
|
|
deb3c73ae0 | ||
|
|
9a75893cff | ||
|
|
f747196e21 | ||
|
|
3a5ddf15cf | ||
|
|
050cf545bf | ||
|
|
7bde72a8ec | ||
|
|
03199b564f | ||
|
|
2e8f015de3 | ||
|
|
3d56dd1ef8 | ||
|
|
dbef4d9b2b | ||
|
|
878c4e3833 | ||
|
|
958860dea7 | ||
|
|
da34967857 | ||
|
|
d773dd8d45 | ||
|
|
a120ab1084 | ||
|
|
2901c3c737 | ||
|
|
9c9fdcfa58 | ||
|
|
543e680961 | ||
|
|
c039e4c6ab | ||
|
|
667e33e82b | ||
|
|
73684cb361 | ||
|
|
12d1de4232 | ||
|
|
12e453c29a | ||
|
|
5b74105add | ||
|
|
58219f897a | ||
|
|
be94309808 | ||
|
|
77d6eb560c | ||
|
|
7a5db5a73a | ||
|
|
332f48f2df | ||
|
|
84c3b5a546 | ||
|
|
c3c14c162e | ||
|
|
b8a418d6f5 | ||
|
|
957f58a033 | ||
|
|
cb2a7b59f3 | ||
|
|
94d10f9d4b | ||
|
|
9d9c6827f5 | ||
|
|
05dd8eb6b4 | ||
|
|
4e674e15ab | ||
|
|
b1f22127b2 | ||
|
|
24a04ce201 | ||
|
|
b646b548ff | ||
|
|
8709657d4d | ||
|
|
cad629a36b | ||
|
|
4d8e579779 | ||
|
|
f6bcc209ab | ||
|
|
ab413672a9 | ||
|
|
dad456afd9 | ||
|
|
ea28f992ac | ||
|
|
8574315f52 | ||
|
|
18a8b0f29d | ||
|
|
a332643003 | ||
|
|
5d27033b2e | ||
|
|
6896e85f01 | ||
|
|
0c03ee0afa | ||
|
|
9c547ab541 | ||
|
|
2251517774 | ||
|
|
16ba94b531 | ||
|
|
24adcc8e68 | ||
|
|
e6d04b2fb4 | ||
|
|
7803b0d925 | ||
|
|
c57995b3eb | ||
|
|
0f46d42c26 | ||
|
|
52a5ff73fa | ||
|
|
ad323a159d | ||
|
|
32b9303a79 | ||
|
|
03ddb7baa2 | ||
|
|
d764c51eae | ||
|
|
482740b5fa | ||
|
|
66f9295253 | ||
|
|
9b9efc745c | ||
|
|
f70a082626 | ||
|
|
aeb5a8e32f | ||
|
|
f77f66450e | ||
|
|
3ea92115bf | ||
|
|
45b806aed8 | ||
|
|
f9f0d4abb6 | ||
|
|
cca999ecc7 | ||
|
|
d1957789bc | ||
|
|
4a3263986b | ||
|
|
674f17485d | ||
|
|
d1097ed967 | ||
|
|
5f3ddb4bfc | ||
|
|
7e4f17ef8d | ||
|
|
2f6f7d9308 | ||
|
|
48e83ba02a | ||
|
|
47fc8fe3c0 | ||
|
|
f080cfe74f | ||
|
|
321690b416 | ||
|
|
18cf2f3f88 | ||
|
|
0e7729c660 | ||
|
|
7d6ad7435f | ||
|
|
9a5ce5fdb3 | ||
|
|
fbf6b01209 | ||
|
|
2cbb18b4e4 | ||
|
|
668373f9f8 | ||
|
|
3de0718e3f | ||
|
|
d720bba510 | ||
|
|
8bc4a69729 | ||
|
|
2ce3ed1319 | ||
|
|
ed7323ea88 | ||
|
|
f64e3e528d | ||
|
|
659a3ef5d8 | ||
|
|
f5b7add383 | ||
|
|
8670c2e405 | ||
|
|
aa0f0a2738 | ||
|
|
eb5986d332 | ||
|
|
a7a8ff387a | ||
|
|
f1819b8c13 | ||
|
|
9ab31824f8 | ||
|
|
9371d3ae48 | ||
|
|
04c17f1f9a | ||
|
|
7decd1e230 | ||
|
|
101ec57936 | ||
|
|
b0ec812de6 | ||
|
|
bd39fd252f | ||
|
|
2bade2c933 | ||
|
|
1674dafe79 | ||
|
|
cc45f5c447 | ||
|
|
8cf1acb7c6 | ||
|
|
a267bdfbe3 | ||
|
|
e91b325d9d | ||
|
|
8e435a66eb | ||
|
|
92251dcecb | ||
|
|
cb2288ebe6 | ||
|
|
b47caeb58b | ||
|
|
912b62dca9 | ||
|
|
4456cb85f6 | ||
|
|
195520fcb6 | ||
|
|
4f94e2b5d8 | ||
|
|
c8d57e98d2 | ||
|
|
29ae063003 | ||
|
|
58f619dc22 | ||
|
|
d81d6058cd | ||
|
|
9f21a813bd | ||
|
|
673aab5282 | ||
|
|
d86bda1ebd | ||
|
|
219dd6c5d5 | ||
|
|
9e0aad9d5d | ||
|
|
ae1e9acbaf | ||
|
|
6b1441340c | ||
|
|
c53702e768 | ||
|
|
d61eb7a8db | ||
|
|
a5e8615091 | ||
|
|
b008750f18 | ||
|
|
7a5fbc6948 | ||
|
|
b807b89837 | ||
|
|
0764b65dc4 | ||
|
|
ebcae85452 | ||
|
|
dbff4e52bc | ||
|
|
9046626256 | ||
|
|
d9d0c0f842 | ||
|
|
13c54381e4 | ||
|
|
6d45804257 | ||
|
|
adbaab9794 | ||
|
|
b8212ec196 | ||
|
|
3eb71faf64 | ||
|
|
aad3ddc7a5 | ||
|
|
49ac60767a | ||
|
|
92a1de2e77 | ||
|
|
277f08022d | ||
|
|
0d81f669e0 | ||
|
|
857618d672 | ||
|
|
ab221f96f1 | ||
|
|
1cc5bfbc12 | ||
|
|
eb9be6409f | ||
|
|
7f81d7a4a8 | ||
|
|
eb503e0464 | ||
|
|
6e3041e33c | ||
|
|
2542e4a04e | ||
|
|
957bf3f60c | ||
|
|
8da2f273a4 | ||
|
|
93651ae340 | ||
|
|
737fd4268c | ||
|
|
6f0c4e03d5 | ||
|
|
1d47300f0f | ||
|
|
4e8ad770e6 | ||
|
|
d1b53a14a1 | ||
|
|
8fe012afe4 | ||
|
|
3728240162 | ||
|
|
3b38e2fe4c | ||
|
|
7a896596a1 | ||
|
|
f6fcb95dea | ||
|
|
87176df22a | ||
|
|
f63429601e | ||
|
|
ae2cf510cd | ||
|
|
e516a64a0c | ||
|
|
5e3e0bcbe4 | ||
|
|
fef5ecd97b | ||
|
|
a9e71b12e1 | ||
|
|
9ad2e6fa1f | ||
|
|
d658c1e09b | ||
|
|
2c3cb61ca8 | ||
|
|
1e044f38ad | ||
|
|
6a7b2aed5c | ||
|
|
392fee9023 | ||
|
|
76f068f852 | ||
|
|
1c3bf435e5 | ||
|
|
fb3b0bd809 | ||
|
|
c89f10d312 | ||
|
|
24d438ccc1 | ||
|
|
dad9b4abf8 | ||
|
|
57d19b21b5 | ||
|
|
a4bfd9046c | ||
|
|
6750d74e46 | ||
|
|
6958a23b96 | ||
|
|
cb78c1c610 | ||
|
|
0434c907c4 | ||
|
|
6151e1c425 | ||
|
|
4165c89385 | ||
|
|
5016ebd344 | ||
|
|
adcff5b6ec | ||
|
|
489b578bf8 | ||
|
|
d1ffd1f9cc | ||
|
|
4843e76491 | ||
|
|
ca00274204 | ||
|
|
1a9479ed04 | ||
|
|
348b14f64f | ||
|
|
e132115185 | ||
|
|
d1ac905248 | ||
|
|
34876ef432 | ||
|
|
326d5d319a | ||
|
|
11a82481c4 | ||
|
|
e2b322040f | ||
|
|
6fd1a98f97 | ||
|
|
370f2c087f | ||
|
|
9ad50f91e8 | ||
|
|
cce5d3e900 | ||
|
|
b80b5c7be3 | ||
|
|
23b7bdfea6 | ||
|
|
5b2a9ef0b3 | ||
|
|
40e2994fb6 | ||
|
|
2af0708047 | ||
|
|
68ea128cb5 | ||
|
|
f533a986c5 | ||
|
|
6962c6bb11 | ||
|
|
f15e03816b | ||
|
|
8d7290b300 | ||
|
|
ff15d708f6 | ||
|
|
8527742b73 | ||
|
|
15946c21f9 | ||
|
|
5cf576e2da | ||
|
|
d7e75c9192 | ||
|
|
ffec5bf83d | ||
|
|
7baa166adc | ||
|
|
767822bb46 | ||
|
|
beb985dbaa | ||
|
|
158a520edb | ||
|
|
b73832ce2e | ||
|
|
173c9fd5ca | ||
|
|
fbc3667f86 | ||
|
|
754bf4043d | ||
|
|
b333775611 | ||
|
|
e05f04824c | ||
|
|
77e22e9a79 | ||
|
|
b4f2ff0c42 | ||
|
|
a4cb739fc7 | ||
|
|
c5597d3c9d | ||
|
|
d1d127728d | ||
|
|
41deaa4af8 | ||
|
|
9c4b927b17 | ||
|
|
d8fef4df6e | ||
|
|
317dda00ea | ||
|
|
f6ca836e25 | ||
|
|
77a21ba283 | ||
|
|
302e7d0944 | ||
|
|
d4d6788381 | ||
|
|
425406537c | ||
|
|
35e54b9777 | ||
|
|
6cba7d8d91 | ||
|
|
2716d9da3e | ||
|
|
24e577750b | ||
|
|
390b209cba | ||
|
|
657565f430 | ||
|
|
2a9b2d7759 | ||
|
|
04616522b9 | ||
|
|
8d1aaa4905 | ||
|
|
46dc864258 | ||
|
|
ec16640e55 | ||
|
|
f89467ccbf | ||
|
|
e386bc4963 | ||
|
|
5aca126ffe | ||
|
|
d8f0df794d | ||
|
|
07d65c34ad | ||
|
|
0c235f336b | ||
|
|
c78d3e0fd7 | ||
|
|
e141b17bf4 | ||
|
|
e5c1d0d8b5 | ||
|
|
f31a6a76bd | ||
|
|
5f3b583452 | ||
|
|
bb36ad2772 | ||
|
|
9022724bd5 | ||
|
|
2c9daee624 | ||
|
|
65a5c0c32f | ||
|
|
67fea1076a | ||
|
|
dede617727 | ||
|
|
6596d15d81 | ||
|
|
37acfe06ee | ||
|
|
0edda872fe | ||
|
|
c003f63622 | ||
|
|
e7e0187c8a | ||
|
|
ce31c2b02a | ||
|
|
d3338c5d72 | ||
|
|
8cc3eb3193 | ||
|
|
7a0daf2cef | ||
|
|
fd94cbdefe | ||
|
|
854937483d | ||
|
|
4630d625f1 | ||
|
|
58b6499cca | ||
|
|
7627a6635a | ||
|
|
4381370f35 | ||
|
|
22bf74ff37 | ||
|
|
9a6cfe9084 | ||
|
|
e92ee4fba7 | ||
|
|
78395c449b | ||
|
|
a0d2272e88 | ||
|
|
24216cb54c | ||
|
|
d71c782459 | ||
|
|
b7434c6564 | ||
|
|
5c1bde0d20 | ||
|
|
4561a2a43c | ||
|
|
545501afa0 | ||
|
|
0c87b100ea | ||
|
|
7bc6a0a333 | ||
|
|
5e8b075c15 | ||
|
|
1edfd798d9 | ||
|
|
61f0a03ead | ||
|
|
863b5306f8 | ||
|
|
9459cf6445 | ||
|
|
44ec82362e | ||
|
|
6878aa0844 | ||
|
|
aae1faf76f | ||
|
|
d53a0c5994 | ||
|
|
6580c817c2 | ||
|
|
2bc75715f7 | ||
|
|
1a04bb4532 | ||
|
|
fe1cbe6a5a | ||
|
|
c1364648e7 | ||
|
|
7130f0c8d8 | ||
|
|
7d29929819 | ||
|
|
fa00f51e80 | ||
|
|
d1ef6f032e | ||
|
|
f264d3d29b | ||
|
|
064c5ffc3a | ||
|
|
9a23d95846 | ||
|
|
021d8e6af8 | ||
|
|
6f3adc900d | ||
|
|
c4fa71ecc3 | ||
|
|
3e3b57200a | ||
|
|
14e389bccf | ||
|
|
b4b686fdff | ||
|
|
5c2acea38c | ||
|
|
cc69cfe6a7 | ||
|
|
cf94c0b6c0 | ||
|
|
5b343c2a32 | ||
|
|
c0047e643e | ||
|
|
44b4ba9a07 | ||
|
|
3c2a45d923 | ||
|
|
552e78c9bc | ||
|
|
5cfc9c1830 | ||
|
|
e0ceccc2b2 | ||
|
|
da48d9d95a | ||
|
|
09e5dc9c50 | ||
|
|
5c615f18e1 | ||
|
|
280e10195c | ||
|
|
c6f7afbd9a | ||
|
|
a0e9a4c68e | ||
|
|
8a254d0480 | ||
|
|
78feccd0a3 | ||
|
|
9561332295 | ||
|
|
032e67bedf | ||
|
|
f2267db324 | ||
|
|
458e3a0fad | ||
|
|
f4dfde8c47 | ||
|
|
220b42332d | ||
|
|
20cf52a316 | ||
|
|
6a7674dca1 | ||
|
|
fd42722c78 | ||
|
|
7d7c29f0f8 | ||
|
|
7fb86f47de | ||
|
|
6da1be9bc9 | ||
|
|
a6b616e6d1 | ||
|
|
a56f4ba298 | ||
|
|
1745e71088 | ||
|
|
5cd12a106e | ||
|
|
23d99495a4 | ||
|
|
77ebc96f37 | ||
|
|
d085dae5bb | ||
|
|
6f221fb425 | ||
|
|
48317e66b9 | ||
|
|
ec15a43cf1 | ||
|
|
4696d5675f | ||
|
|
08f6c9c367 | ||
|
|
9256cd2fbc | ||
|
|
a3ae0e9a90 | ||
|
|
2a8d984d89 | ||
|
|
87e4e5ecfe | ||
|
|
b4956ac7c1 | ||
|
|
9c131dfaad | ||
|
|
365b27caac | ||
|
|
e86f77692d | ||
|
|
0b74956abe | ||
|
|
f4b22f9fdd | ||
|
|
97e5d5c61b | ||
|
|
91f7120604 | ||
|
|
894da665ad | ||
|
|
2d6142a01e | ||
|
|
473e6ff7b8 | ||
|
|
3de1e58592 | ||
|
|
328ec2cdca | ||
|
|
a2118e3938 | ||
|
|
46156cf372 | ||
|
|
10026822fe | ||
|
|
f7c8304dc3 | ||
|
|
8f8b123d06 | ||
|
|
c95205dbd3 | ||
|
|
a15f2519a5 | ||
|
|
df972d0fd5 | ||
|
|
1fe10855e9 | ||
|
|
964f0f7926 | ||
|
|
3f66270fcb | ||
|
|
f8273ba5ba | ||
|
|
86907fb3b7 | ||
|
|
8207ab56c1 | ||
|
|
3133b67da5 | ||
|
|
7e4def44fd | ||
|
|
55798b0a58 | ||
|
|
9acf3e2309 | ||
|
|
bb679fa9ca | ||
|
|
058c3acbdc | ||
|
|
11f7735965 | ||
|
|
87bdb34599 | ||
|
|
372d673a26 | ||
|
|
34eccf3d61 | ||
|
|
107cb53b5a | ||
|
|
287fc9dd2c | ||
|
|
c855e0f3d4 | ||
|
|
4dd08e6382 | ||
|
|
9b47e538c6 | ||
|
|
c5b13de208 | ||
|
|
346074ee38 | ||
|
|
eb43efb8e7 | ||
|
|
86741a4eca | ||
|
|
ad6f98dc15 | ||
|
|
3aca34d3fb | ||
|
|
495ee3aaa5 | ||
|
|
8c15834c87 | ||
|
|
076e55a945 | ||
|
|
df43c1f99b | ||
|
|
c66e721782 | ||
|
|
c4e821c3a1 | ||
|
|
652d94e9ee | ||
|
|
7924823b32 | ||
|
|
4995490588 | ||
|
|
bbb7d1ad52 | ||
|
|
2af842401b | ||
|
|
191ff2e6d0 | ||
|
|
23d3af9c5a | ||
|
|
71df617bee | ||
|
|
126a492fd5 | ||
|
|
6f49139eba | ||
|
|
ee74f697cd | ||
|
|
112f564a8f | ||
|
|
99fe70a189 | ||
|
|
f4d3f47a0a | ||
|
|
42d0c1f213 | ||
|
|
2e6f71ee6b | ||
|
|
ae2f6f06a0 | ||
|
|
a187382ecf | ||
|
|
89481d6d2e | ||
|
|
1f039b53f3 | ||
|
|
e8d86ef013 | ||
|
|
c9fc8cd7d3 | ||
|
|
f9e389ac56 | ||
|
|
fbd2e9aa84 | ||
|
|
89b7fb5380 | ||
|
|
33c47f3d39 | ||
|
|
9095399aa8 | ||
|
|
25d63c3167 | ||
|
|
6bf373a7c7 | ||
|
|
0d77ac3977 | ||
|
|
1229ee0f1b | ||
|
|
79b3794b93 | ||
|
|
c48dee0d7b | ||
|
|
79edafc3aa | ||
|
|
82dc569497 | ||
|
|
447468a39d | ||
|
|
9e2be63b75 | ||
|
|
89d9336b08 | ||
|
|
c32a5c8003 | ||
|
|
63e2d13b8f | ||
|
|
de513211dc | ||
|
|
09f06613ee | ||
|
|
644649853f | ||
|
|
157eb71606 | ||
|
|
b638b9bee8 | ||
|
|
d45fd36a0b | ||
|
|
da124969fa | ||
|
|
6cb55231d9 | ||
|
|
16c48fdc86 | ||
|
|
528a03f6f4 | ||
|
|
64e43a9935 | ||
|
|
a767031651 | ||
|
|
454abdee48 | ||
|
|
da2ce48fb2 | ||
|
|
e1ab34d884 | ||
|
|
9017fe8c50 | ||
|
|
3abbe15637 | ||
|
|
6c5b2ff0b5 | ||
|
|
3190d8aba2 | ||
|
|
d3d4bc3dda | ||
|
|
b1b8f2645f | ||
|
|
bcf5d3150e | ||
|
|
2b8520f7ab | ||
|
|
1eac61e9a0 | ||
|
|
01d58f8681 | ||
|
|
5643b7d3d8 | ||
|
|
a5af9b653a | ||
|
|
748959c8fc | ||
|
|
b2426f30a6 | ||
|
|
7b848483c9 | ||
|
|
f3312d191e | ||
|
|
4726e3cb4f | ||
|
|
40beb7092a | ||
|
|
4df0fb4e07 | ||
|
|
ae704048bc | ||
|
|
2836c9755a | ||
|
|
8702689aaa | ||
|
|
30c7494122 | ||
|
|
e048cfe016 | ||
|
|
c4fabd65a1 | ||
|
|
2df84f2887 | ||
|
|
310b2674f5 | ||
|
|
dbf162db4e | ||
|
|
1603ac1783 | ||
|
|
33b41e9aea | ||
|
|
480519a6e0 | ||
|
|
d4102f2816 | ||
|
|
839bf31c2a | ||
|
|
85e6ba128f | ||
|
|
e8e58d841f | ||
|
|
7405535f03 | ||
|
|
73e97d119d | ||
|
|
ddc3959e42 | ||
|
|
86906cf5e3 | ||
|
|
78d3bc5015 | ||
|
|
d7375b88e7 | ||
|
|
b5591726c3 | ||
|
|
eecd14086b | ||
|
|
b284749016 | ||
|
|
ffffc50401 | ||
|
|
a8ee8ec0cd | ||
|
|
e859c70a24 | ||
|
|
29ad7620aa | ||
|
|
a79a2d6e1c | ||
|
|
c50e303116 | ||
|
|
25187a52fb | ||
|
|
dd30dd84c3 | ||
|
|
9fce8e0b72 | ||
|
|
6b12059c6e | ||
|
|
2b7cef4fd6 | ||
|
|
2ffe03f732 | ||
|
|
b9b1f16d0f | ||
|
|
3f3a305396 | ||
|
|
0e1d00a85c | ||
|
|
91de59c7ff | ||
|
|
cebea56412 | ||
|
|
7de7c98b27 | ||
|
|
2ff854177c | ||
|
|
2679ba55e1 | ||
|
|
ee8e05050a | ||
|
|
32d47d7bd2 | ||
|
|
c68e824eb9 | ||
|
|
0703aed61d | ||
|
|
6ca58a4d6e | ||
|
|
4de1726bf6 |
No files matched your search
@@ -62,6 +62,9 @@ menu/driverspzarch.c
|
||||
/media/shaders_glsl/
|
||||
/obj-w32/
|
||||
|
||||
# Ctags
|
||||
/tags
|
||||
|
||||
# Android
|
||||
/pkg/android/phoenix/obj/
|
||||
/pkg/android/phoenix/assets/
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
[submodule "deps/glslang/glslang"]
|
||||
path = deps/glslang/glslang
|
||||
url = git://github.com/KhronosGroup/glslang.git
|
||||
@@ -60,7 +60,9 @@ endif
|
||||
endif
|
||||
|
||||
CFLAGS += -Wall $(OPTIMIZE_FLAG) $(INCLUDE_DIRS) $(DEBUG_FLAG) -I.
|
||||
CXXFLAGS := $(CFLAGS) -std=c++98 -D__STDC_CONSTANT_MACROS
|
||||
|
||||
APPEND_CFLAGS := $(CFLAGS)
|
||||
CXXFLAGS += $(APPEND_CFLAGS) -std=c++11 -D__STDC_CONSTANT_MACROS
|
||||
OBJCFLAGS := $(CFLAGS) -D__STDC_CONSTANT_MACROS
|
||||
|
||||
ifeq ($(CXX_BUILD), 1)
|
||||
@@ -127,7 +129,7 @@ $(OBJDIR)/%.o: %.c config.h config.mk
|
||||
@$(if $(Q), $(shell echo echo CC $<),)
|
||||
$(Q)$(CC) $(CFLAGS) $(DEFINES) -MMD -c -o $@ $<
|
||||
|
||||
$(OBJDIR)/%.o: %.cpp
|
||||
$(OBJDIR)/%.o: %.cpp config.h config.mk
|
||||
@mkdir -p $(dir $@)
|
||||
@$(if $(Q), $(shell echo echo CXX $<),)
|
||||
$(Q)$(CXX) $(CXXFLAGS) $(DEFINES) -MMD -c -o $@ $<
|
||||
|
||||
@@ -19,7 +19,7 @@ ifeq ($(HAVE_LIBRETRODB),)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_LIBRETRODB), 1)
|
||||
DEFINES += -DHAVE_LIBRETRODB
|
||||
DEFINES += -DHAVE_LIBRETRODB
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_FBO), 1)
|
||||
@@ -77,12 +77,13 @@ endif
|
||||
ifneq ($(findstring Linux,$(OS)),)
|
||||
LIBS += -lrt
|
||||
OBJ += input/drivers/linuxraw_input.o \
|
||||
input/common/linux_common.o \
|
||||
input/common/epoll_common.o \
|
||||
input/common/linux_common.o \
|
||||
input/common/epoll_common.o \
|
||||
input/drivers_joypad/linuxraw_joypad.o \
|
||||
frontend/drivers/platform_linux.o
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(findstring Haiku,$(OS)),)
|
||||
LIBS += -lm
|
||||
DEBUG_FLAG = -g
|
||||
@@ -109,7 +110,7 @@ OBJ += frontend/frontend.o \
|
||||
ui/drivers/ui_null.o \
|
||||
libretro_version_1.o \
|
||||
retroarch.o \
|
||||
input/input_keyboard.o \
|
||||
input/input_keyboard.o \
|
||||
command_event.o \
|
||||
msg_hash.o \
|
||||
intl/msg_hash_de.o \
|
||||
@@ -122,10 +123,12 @@ OBJ += frontend/frontend.o \
|
||||
intl/msg_hash_pt.o \
|
||||
intl/msg_hash_us.o \
|
||||
runloop.o \
|
||||
tasks/tasks.o \
|
||||
libretro-common/queues/task_queue.o \
|
||||
tasks/tasks_internal.o \
|
||||
tasks/task_content.o \
|
||||
tasks/task_file_transfer.o \
|
||||
content.o \
|
||||
libretro-common/encodings/encoding_utf.o \
|
||||
libretro-common/encodings/encoding_utf.o \
|
||||
libretro-common/file/file_list.o \
|
||||
libretro-common/file/dir_list.o \
|
||||
libretro-common/file/retro_dirent.o \
|
||||
@@ -136,7 +139,6 @@ OBJ += frontend/frontend.o \
|
||||
libretro-common/memmap/memalign.o \
|
||||
dir_list_special.o \
|
||||
string_list_special.o \
|
||||
file_ops.o \
|
||||
libretro-common/file/nbio/nbio_stdio.o \
|
||||
libretro-common/file/file_path.o \
|
||||
file_path_special.o \
|
||||
@@ -144,7 +146,7 @@ OBJ += frontend/frontend.o \
|
||||
audio/audio_driver.o \
|
||||
input/input_driver.o \
|
||||
input/input_hid_driver.o \
|
||||
gfx/video_common.o \
|
||||
gfx/video_coord_array.o \
|
||||
gfx/video_driver.o \
|
||||
camera/camera_driver.o \
|
||||
location/location_driver.o \
|
||||
@@ -167,7 +169,7 @@ OBJ += frontend/frontend.o \
|
||||
libretro-common/queues/fifo_buffer.o \
|
||||
core_options.o \
|
||||
libretro-common/compat/compat_fnmatch.o \
|
||||
libretro-common/compat/compat_posix_string.o \
|
||||
libretro-common/compat/compat_posix_string.o \
|
||||
cheats.o \
|
||||
core_info.o \
|
||||
libretro-common/file/config_file.o \
|
||||
@@ -184,8 +186,9 @@ OBJ += frontend/frontend.o \
|
||||
gfx/video_filter.o \
|
||||
audio/audio_resampler_driver.o \
|
||||
audio/audio_dsp_filter.o \
|
||||
audio/drivers_resampler/sinc.o \
|
||||
audio/drivers_resampler/nearest.o \
|
||||
audio/drivers_resampler/sinc_resampler.o \
|
||||
audio/drivers_resampler/nearest_resampler.o \
|
||||
audio/drivers_resampler/null_resampler.o \
|
||||
audio/drivers_resampler/cc_resampler.o \
|
||||
location/drivers/nulllocation.o \
|
||||
camera/drivers/nullcamera.o \
|
||||
@@ -200,7 +203,7 @@ OBJ += frontend/frontend.o \
|
||||
record/record_driver.o \
|
||||
record/drivers/record_null.o \
|
||||
performance.o \
|
||||
verbosity.o
|
||||
verbosity.o
|
||||
|
||||
ifneq ($(HAVE_GETOPT_LONG), 1)
|
||||
OBJ += libretro-common/compat/compat_getopt.o
|
||||
@@ -214,11 +217,11 @@ ifneq ($(HAVE_STRL), 1)
|
||||
OBJ += libretro-common/compat/compat_strl.o
|
||||
endif
|
||||
|
||||
OBJ += gfx/image/image.o
|
||||
OBJ += gfx/video_texture_image.o
|
||||
|
||||
ifeq ($(HAVE_IMAGEVIEWER), 1)
|
||||
DEFINES += -DHAVE_IMAGEVIEWER
|
||||
OBJ += cores/image_core.o
|
||||
OBJ += cores/libretro-imageviewer/image_core.o
|
||||
endif
|
||||
|
||||
# Qt
|
||||
@@ -229,6 +232,10 @@ OBJ += ui/drivers/ui_qt.o
|
||||
LIBS += -lQt5Quick -lQt5Widgets -lQt5Gui -lQt5Qml -lQt5Network -lQt5Core -lglu32 -lopengl32 -L./ui/drivers/qt/wrapper/build/release -lwrapper
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_SSA),1)
|
||||
LIBS += -lass
|
||||
endif
|
||||
|
||||
# LibretroDB
|
||||
|
||||
ifeq ($(HAVE_LIBRETRODB), 1)
|
||||
@@ -282,7 +289,7 @@ endif
|
||||
|
||||
ifeq ($(HAVE_ALSA), 1)
|
||||
OBJ += audio/drivers/alsa.o \
|
||||
audio/drivers/alsathread.o
|
||||
audio/drivers/alsathread.o
|
||||
LIBS += $(ALSA_LIBS)
|
||||
DEFINES += $(ALSA_CFLAGS)
|
||||
endif
|
||||
@@ -329,6 +336,7 @@ ifeq ($(HAVE_RSOUND), 1)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_DSOUND), 1)
|
||||
HAVE_DIRECTX=1
|
||||
OBJ += audio/drivers/dsound.o
|
||||
DEFINES += -DHAVE_DSOUND
|
||||
LIBS += -ldxguid -ldsound
|
||||
@@ -343,14 +351,14 @@ endif
|
||||
# Audio Resamplers
|
||||
|
||||
ifeq ($(HAVE_NEON),1)
|
||||
OBJ += audio/drivers_resampler/sinc_neon.o \
|
||||
OBJ += audio/drivers_resampler/sinc_resampler_neon.o \
|
||||
audio/drivers_resampler/cc_resampler_neon.o
|
||||
# When compiled without this, tries to attempt to compile sinc lerp,
|
||||
# which will error out
|
||||
#
|
||||
# TODO - we need to make quality levels of sinc
|
||||
# runtime toggleable instead of going by compile-time
|
||||
# defines
|
||||
#
|
||||
# TODO - we need to make quality levels of sinc
|
||||
# runtime toggleable instead of going by compile-time
|
||||
# defines
|
||||
DEFINES += -DSINC_LOWER_QUALITY
|
||||
endif
|
||||
|
||||
@@ -359,8 +367,19 @@ ifeq ($(HAVE_NEON),1)
|
||||
OBJ += audio/audio_utils_neon.o
|
||||
endif
|
||||
|
||||
HW_CONTEXT_MENU_DRIVERS=$(HAVE_RGUI)
|
||||
|
||||
ifeq ($(HW_CONTEXT_MENU_DRIVERS),0)
|
||||
ifeq ($(HAVE_GL_CONTEXT),1)
|
||||
HW_CONTEXT_MENU_DRIVERS=1
|
||||
endif
|
||||
ifeq ($(HAVE_VULKAN),1)
|
||||
HW_CONTEXT_MENU_DRIVERS=1
|
||||
endif
|
||||
endif
|
||||
|
||||
# XMB and MaterialUI are always enabled if supported and not explicitly disabled
|
||||
ifeq ($(HAVE_RGUI)$(HAVE_GL_CONTEXT), 11)
|
||||
ifeq ($(HW_CONTEXT_MENU_DRIVERS), 1)
|
||||
ifeq ($(HAVE_ZARCH),)
|
||||
HAVE_ZARCH = 1
|
||||
endif
|
||||
@@ -369,12 +388,17 @@ ifeq ($(HAVE_RGUI)$(HAVE_GL_CONTEXT), 11)
|
||||
HAVE_MATERIALUI = 1
|
||||
endif
|
||||
|
||||
#ifeq ($(HAVE_ZAHNRAD),)
|
||||
#HAVE_ZAHNRAD = 1
|
||||
#endif
|
||||
|
||||
ifeq ($(HAVE_XMB),)
|
||||
HAVE_XMB = 1
|
||||
endif
|
||||
else
|
||||
HAVE_ZARCH = 0
|
||||
HAVE_MATERIALUI = 0
|
||||
#HAVE_ZAHNRAD = 0
|
||||
HAVE_XMB = 0
|
||||
endif
|
||||
|
||||
@@ -386,6 +410,13 @@ ifeq ($(HAVE_MATERIALUI), 1)
|
||||
OBJ += menu/drivers/materialui.o
|
||||
DEFINES += -DHAVE_MATERIALUI
|
||||
endif
|
||||
ifeq ($(HAVE_ZAHNRAD), 1)
|
||||
OBJ += deps/zahnrad/zahnrad.o
|
||||
OBJ += menu/drivers/zr_common.o
|
||||
OBJ += menu/drivers/zr_menu.o
|
||||
OBJ += menu/drivers/zr.o
|
||||
DEFINES += -DHAVE_ZAHNRAD
|
||||
endif
|
||||
ifeq ($(HAVE_ZARCH), 1)
|
||||
OBJ += menu/drivers/zarch.o
|
||||
DEFINES += -DHAVE_ZARCH
|
||||
@@ -407,7 +438,8 @@ ifeq ($(HAVE_MENU_COMMON), 1)
|
||||
PSEUDO_NS :=
|
||||
endif
|
||||
OBJ += menu/menu_hash.o \
|
||||
menu/menu_driver.o \
|
||||
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 \
|
||||
@@ -449,6 +481,8 @@ endif
|
||||
|
||||
ifeq ($(UTF8), 1)
|
||||
DEFINES += -DHAVE_UTF8
|
||||
OBJ += intl/msg_hash_ru.o
|
||||
DEFINES += -finput-charset=UTF-8
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_STB_FONT), 1)
|
||||
@@ -463,11 +497,11 @@ endif
|
||||
|
||||
ifeq ($(HAVE_THREADS), 1)
|
||||
OBJ += autosave.o \
|
||||
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
|
||||
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
|
||||
ifeq ($(findstring Haiku,$(OS)),)
|
||||
LIBS += -lpthread
|
||||
@@ -478,20 +512,17 @@ ifeq ($(HAVE_COMMAND), 1)
|
||||
OBJ += command.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_NETWORK_GAMEPAD), 1)
|
||||
OBJ += remote.o
|
||||
endif
|
||||
|
||||
#Input
|
||||
|
||||
ifeq ($(HAVE_WAYLAND), 1)
|
||||
#OBJ += input/drivers/wayland.o
|
||||
OBJ += gfx/drivers_context/wayland_ctx.o
|
||||
DEFINES += $(WAYLAND_CFLAGS)
|
||||
LIBS += $(WAYLAND_LIBS)
|
||||
endif
|
||||
|
||||
#Input
|
||||
|
||||
ifeq ($(HAVE_DINPUT), 1)
|
||||
LIBS += -ldinput8 -ldxguid -lole32
|
||||
HAVE_DIRECTX=1
|
||||
DEFINES += -DHAVE_DINPUT
|
||||
OBJ += input/drivers/dinput.o \
|
||||
input/drivers_joypad/dinput_joypad.o
|
||||
@@ -503,19 +534,36 @@ ifeq ($(HAVE_XINPUT), 1)
|
||||
input/autoconf/builtin_win.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_OPENDINGUX_FBDEV), 1)
|
||||
OBJ += gfx/drivers_context/opendingux_fbdev_ctx.o
|
||||
DEFINES += $(EGL_CFLAGS)
|
||||
LIBS += $(EGL_LIBS)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_X11), 1)
|
||||
OBJ += input/common/input_x11_common.o \
|
||||
input/drivers/x11_input.o \
|
||||
input/drivers/x11_input.o \
|
||||
gfx/common/x11_common.o \
|
||||
input/drivers_keyboard/keyboard_event_x11.o
|
||||
|
||||
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
|
||||
endif
|
||||
ifneq ($(HAVE_GLES), 1)
|
||||
OBJ += gfx/drivers_context/x_ctx.o
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_XCB),1)
|
||||
DEFINES += $(XCB_CFLAGS)
|
||||
LIBS += $(XCB_LIBS)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_XKBCOMMON), 1)
|
||||
DEFINES += $(XKBCOMMON_CFLAGS)
|
||||
OBJ += input/drivers_keyboard/keyboard_event_xkb.o
|
||||
OBJ += input/drivers_keyboard/keyboard_event_xkb.o
|
||||
LIBS += $(XKBCOMMON_LIBS)
|
||||
endif
|
||||
|
||||
@@ -523,37 +571,39 @@ ifeq ($(HAVE_UDEV), 1)
|
||||
DEFINES += $(UDEV_CFLAGS)
|
||||
LIBS += $(UDEV_LIBS)
|
||||
OBJ += input/drivers/udev_input.o \
|
||||
input/common/udev_common.o \
|
||||
input/drivers_keyboard/keyboard_event_udev.o \
|
||||
input/drivers_keyboard/keyboard_event_udev.o \
|
||||
input/drivers_joypad/udev_joypad.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_LIBUSB), 1)
|
||||
DEFINES += -DHAVE_LIBUSB
|
||||
OBJ += input/drivers_hid/libusb_hid.o
|
||||
LIBS += -lusb-1.0
|
||||
HAVE_HID = 1
|
||||
DEFINES += -DHAVE_LIBUSB
|
||||
OBJ += input/drivers_hid/libusb_hid.o
|
||||
LIBS += -lusb-1.0
|
||||
HAVE_HID = 1
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_IOHIDMANAGER), 1)
|
||||
DEFINES += -DHAVE_IOHIDMANAGER
|
||||
OBJ += input/drivers_hid/iohidmanager_hid.o
|
||||
HAVE_HID = 1
|
||||
LIBS += -framework IOKit
|
||||
DEFINES += -DHAVE_IOHIDMANAGER
|
||||
OBJ += input/drivers_hid/iohidmanager_hid.o
|
||||
HAVE_HID = 1
|
||||
LIBS += -framework IOKit
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_CORELOCATION), 1)
|
||||
DEFINES += -DHAVE_CORELOCATION
|
||||
LIBS += -framework CoreLocation
|
||||
DEFINES += -DHAVE_CORELOCATION
|
||||
LIBS += -framework CoreLocation
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_HID), 1)
|
||||
DEFINES += -DHAVE_HID
|
||||
OBJ += input/connect/joypad_connection.o \
|
||||
DEFINES += -DHAVE_HID
|
||||
OBJ += input/connect/joypad_connection.o \
|
||||
input/connect/connect_ps3.o \
|
||||
input/connect/connect_ps4.o \
|
||||
input/connect/connect_wii.o \
|
||||
input/connect/connect_wiiupro.o
|
||||
input/connect/connect_nesusb.o \
|
||||
input/connect/connect_snesusb.o \
|
||||
input/connect/connect_wiiupro.o \
|
||||
input/connect/connect_wiiugca.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_PARPORT), 1)
|
||||
@@ -571,8 +621,15 @@ endif
|
||||
OBJ += gfx/video_context_driver.o \
|
||||
gfx/drivers_context/gfx_null_ctx.o \
|
||||
gfx/video_state_tracker.o \
|
||||
libretro-common/gfx/math/matrix_4x4.o \
|
||||
libretro-common/gfx/math/matrix_3x3.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)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_GL_CONTEXT), 1)
|
||||
DEFINES += -DHAVE_OPENGL -DHAVE_GLSL
|
||||
@@ -580,16 +637,9 @@ ifeq ($(HAVE_GL_CONTEXT), 1)
|
||||
gfx/common/gl_common.o \
|
||||
gfx/drivers_font/gl_raster_font.o \
|
||||
libretro-common/glsym/rglgen.o
|
||||
|
||||
ifeq ($(HAVE_MENU_COMMON), 1)
|
||||
OBJ += menu/drivers_display/menu_display_gl.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_KMS), 1)
|
||||
HAVE_AND_WILL_USE_DRM = 1
|
||||
OBJ += gfx/drivers_context/drm_egl_ctx.o
|
||||
DEFINES += $(GBM_CFLAGS) $(DRM_CFLAGS) $(EGL_CFLAGS)
|
||||
LIBS += $(GBM_LIBS) $(DRM_LIBS) $(EGL_LIBS)
|
||||
ifeq ($(HAVE_MENU_COMMON), 1)
|
||||
OBJ += menu/drivers_display/menu_display_gl.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_VIDEOCORE), 1)
|
||||
@@ -620,16 +670,8 @@ ifeq ($(HAVE_GL_CONTEXT), 1)
|
||||
DEFINES += $(EGL_CFLAGS)
|
||||
LIBS += $(EGL_LIBS)
|
||||
endif
|
||||
ifneq ($(HAVE_GLES), 1)
|
||||
OBJ += gfx/drivers_context/glx_ctx.o
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_WAYLAND), 1)
|
||||
ifeq ($(HAVE_EGL), 1)
|
||||
OBJ += gfx/drivers_context/wayland_ctx.o
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_GLES), 1)
|
||||
LIBS += $(GLES_LIBS)
|
||||
@@ -641,7 +683,7 @@ ifeq ($(HAVE_GL_CONTEXT), 1)
|
||||
else
|
||||
DEFINES += -DHAVE_GL_SYNC
|
||||
OBJ += libretro-common/glsym/glsym_gl.o
|
||||
GL_LIBS := -lGL
|
||||
GL_LIBS := -lGL
|
||||
ifeq ($(OSX), 1)
|
||||
GL_LIBS := -framework OpenGL
|
||||
OBJ += gfx/drivers_context/cgl_ctx.o
|
||||
@@ -649,7 +691,7 @@ ifeq ($(HAVE_GL_CONTEXT), 1)
|
||||
GL_LIBS := -lopengl32 -lgdi32 -lcomdlg32 -lcomctl32
|
||||
OBJ += gfx/drivers_context/wgl_ctx.o
|
||||
endif
|
||||
LIBS += $(GL_LIBS)
|
||||
LIBS += $(GL_LIBS)
|
||||
endif
|
||||
|
||||
OBJ += gfx/drivers_shader/shader_glsl.o
|
||||
@@ -657,7 +699,7 @@ ifeq ($(HAVE_GL_CONTEXT), 1)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_EGL), 1)
|
||||
OBJ += gfx/common/egl_common.o
|
||||
OBJ += gfx/common/egl_common.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_SDL2), 1)
|
||||
@@ -693,6 +735,46 @@ ifeq ($(HAVE_SDL2), 1)
|
||||
HAVE_SDL = 0
|
||||
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)
|
||||
|
||||
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
|
||||
|
||||
CXXFLAGS += -Wno-switch -Wno-sign-compare -fno-strict-aliasing -Wno-maybe-uninitialized -Wno-reorder -I./gfx/include/vulkan
|
||||
CFLAGS += -I./gfx/include/vulkan
|
||||
|
||||
GLSLANG_OBJ := $(GLSLANG_SOURCES:.cpp=.o)
|
||||
|
||||
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 \
|
||||
$(GLSLANG_OBJ)
|
||||
ifeq ($(HAVE_MENU_COMMON), 1)
|
||||
OBJ += menu/drivers_display/menu_display_vulkan.o
|
||||
endif
|
||||
LIBS += -lstdc++
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_OMAP), 1)
|
||||
OBJ += gfx/drivers/omap_gfx.o
|
||||
endif
|
||||
@@ -702,16 +784,16 @@ ifeq ($(HAVE_EXYNOS), 1)
|
||||
memory/neon/memcpy-neon.o
|
||||
LIBS += $(DRM_LIBS) $(EXYNOS_LIBS)
|
||||
DEFINES += $(DRM_CFLAGS) $(EXYNOS_CFLAGS)
|
||||
HAVE_AND_WILL_USE_DRM = 1
|
||||
HAVE_AND_WILL_USE_DRM = 1
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_AND_WILL_USE_DRM), 1)
|
||||
OBJ += gfx/common/drm_common.o
|
||||
OBJ += gfx/common/drm_common.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_DISPMANX), 1)
|
||||
OBJ += gfx/drivers/dispmanx_gfx.o
|
||||
HAVE_VIDEOCORE = 1
|
||||
HAVE_VIDEOCORE = 1
|
||||
LIBS += $(DISPMANX_LIBS)
|
||||
DEFINES += $(DISPMANX_CFLAGS)
|
||||
endif
|
||||
@@ -733,14 +815,8 @@ ifeq ($(HAVE_XVIDEO), 1)
|
||||
DEFINES += $(XVIDEO_CFLAGS)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_XSHM), 1)
|
||||
OBJ += gfx/drivers/xshm.o
|
||||
LIBS += $(XSHM_LIBS)
|
||||
DEFINES += $(XSHM_CFLAGS)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_CG), 1)
|
||||
DEFINES += -DHAVE_CG
|
||||
DEFINES += -DHAVE_CG
|
||||
OBJ += gfx/drivers_shader/shader_gl_cg.o
|
||||
LIBS += $(CG_LIBS)
|
||||
endif
|
||||
@@ -752,12 +828,13 @@ ifeq ($(HAVE_D3D9), 1)
|
||||
gfx/common/d3d_common.o \
|
||||
gfx/drivers_font/d3d_w32_font.o \
|
||||
gfx/drivers_context/d3d_ctx.o
|
||||
HAVE_DIRECTX=1
|
||||
DEFINES += -DHAVE_D3D -DHAVE_D3D9
|
||||
LIBS += -ld3d9 -ld3dx9 -ldxguid
|
||||
|
||||
ifeq ($(HAVE_MENU_COMMON), 1)
|
||||
OBJ += menu/drivers_display/menu_display_d3d.o
|
||||
endif
|
||||
OBJ += menu/drivers_display/menu_display_d3d.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_CG), 1)
|
||||
LIBS += -lcgD3D9
|
||||
@@ -797,22 +874,23 @@ endif
|
||||
|
||||
|
||||
ifeq ($(HAVE_ZLIB), 1)
|
||||
OBJ += libretro-common/file/file_extract.o \
|
||||
OBJ += libretro-common/file/file_archive.o \
|
||||
libretro-common/file/file_archive_zlib.o \
|
||||
tasks/task_decompress.o
|
||||
OBJ += $(ZLIB_OBJS)
|
||||
DEFINES += -DHAVE_ZLIB
|
||||
HAVE_RPNG = 1
|
||||
HAVE_RPNG = 1
|
||||
HAVE_COMPRESSION = 1
|
||||
ifeq ($(WANT_ZLIB), 1)
|
||||
DEFINES += -DWANT_ZLIB
|
||||
else
|
||||
LIBS += -lz
|
||||
HAVE_ZLIB_DEFLATE = 1
|
||||
HAVE_ZLIB_DEFLATE = 1
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef HAVE_RPNG
|
||||
DEFINES += -DHAVE_RPNG
|
||||
DEFINES += -DHAVE_RPNG
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_RPNG), 1)
|
||||
@@ -841,13 +919,9 @@ ifeq ($(WANT_ZLIB),1)
|
||||
deps/zlib/inftrees.o \
|
||||
deps/zlib/trees.o \
|
||||
deps/zlib/uncompr.o \
|
||||
deps/zlib/zutil.o \
|
||||
deps/zlib/ioapi.o \
|
||||
deps/zlib/unzip.o
|
||||
deps/zlib/zutil.o
|
||||
else
|
||||
ifeq ($(HAVE_ZLIB),1)
|
||||
ZLIB_OBJS = deps/zlib/unzip.o \
|
||||
deps/zlib/ioapi.o
|
||||
OBJ += $(ZLIB_OBJS)
|
||||
HAVE_ZLIB_DEFLATE = 1
|
||||
endif
|
||||
@@ -869,12 +943,21 @@ endif
|
||||
ifeq ($(HAVE_NETWORKING), 1)
|
||||
DEFINES += -DHAVE_NETWORKING
|
||||
OBJ += libretro-common/net/net_compat.o \
|
||||
libretro-common/net/net_http.o \
|
||||
net_http_special.o \
|
||||
tasks/task_http.o
|
||||
libretro-common/net/net_http.o \
|
||||
net_http_special.o \
|
||||
tasks/task_http.o
|
||||
|
||||
ifneq ($(HAVE_SOCKET_LEGACY),1)
|
||||
OBJ += libretro-common/net/net_ifinfo.o
|
||||
endif
|
||||
|
||||
ifeq ($(WANT_IFADDRS), 1)
|
||||
DEFINES += -DWANT_IFADDRS
|
||||
OBJ += libretro-common/compat/compat_ifaddrs.o
|
||||
endif
|
||||
|
||||
ifneq ($(findstring Win32,$(OS)),)
|
||||
LIBS += -lws2_32
|
||||
LIBS += -lws2_32 -liphlpapi
|
||||
endif
|
||||
|
||||
# Netplay
|
||||
@@ -885,13 +968,17 @@ ifeq ($(HAVE_NETWORKING), 1)
|
||||
endif
|
||||
|
||||
# Retro Achievements (also depends on threads)
|
||||
|
||||
|
||||
ifeq ($(HAVE_CHEEVOS), 1)
|
||||
ifeq ($(HAVE_THREADS), 1)
|
||||
DEFINES += -DHAVE_CHEEVOS
|
||||
OBJ += cheevos.o libretro-common/utils/md5.o
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_NETWORK_GAMEPAD), 1)
|
||||
OBJ += remote.o
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(findstring Win32,$(OS)),)
|
||||
@@ -917,16 +1004,20 @@ ifeq ($(HAVE_FFMPEG), 1)
|
||||
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 += -DHAVE_FFMPEG -Iffmpeg
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_COMPRESSION), 1)
|
||||
DEFINES += -DHAVE_COMPRESSION
|
||||
endif
|
||||
|
||||
#ifeq ($(HAVE_DIRECTX), 1)
|
||||
#$DEFINES += -I"$(DXSDK_DIR)/Include"
|
||||
#endif
|
||||
|
||||
ifeq ($(HAVE_COCOA),1)
|
||||
DEFINES += -DHAVE_MAIN
|
||||
OBJ += input/drivers/cocoa_input.o \
|
||||
DEFINES += -DHAVE_MAIN
|
||||
OBJ += input/drivers/cocoa_input.o \
|
||||
input/drivers_keyboard/keyboard_event_apple.o \
|
||||
ui/drivers/ui_cocoa.o \
|
||||
ui/drivers/cocoa/cocoa_common.o \
|
||||
|
||||
@@ -281,8 +281,6 @@ 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
|
||||
#-DHAVE_LIBRETRO_MANAGEMENT -DWANT_RPNG -DHAVE_7ZIP
|
||||
|
||||
|
||||
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11
|
||||
|
||||
|
||||
@@ -137,7 +137,6 @@ ifeq ($(platform), wii)
|
||||
HAVE_WIIUSB_HID := 1
|
||||
HAVE_RARCH_EXEC := 1
|
||||
HAVE_RSOUND := 1
|
||||
HAVE_LIBRETRO_MANAGEMENT := 1
|
||||
|
||||
APP_BOOTER_DIR = wii/app_booter
|
||||
PLATOBJS := $(APP_BOOTER_DIR)/app_booter.binobj
|
||||
@@ -185,7 +184,6 @@ else ifeq ($(platform), psp1)
|
||||
LDFLAGS += -Wl,-q
|
||||
|
||||
BUILD_PRX = 1
|
||||
HAVE_LIBRETRO_MANAGEMENT := 1
|
||||
HAVE_RPNG := 1
|
||||
HAVE_KERNEL_PRX := 1
|
||||
RARCH_CONSOLE = 1
|
||||
@@ -207,14 +205,13 @@ 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_neon.o \
|
||||
PLATOBJS += audio/audio_utils_neon.o audio/drivers_resampler/sinc_resampler_neon.o \
|
||||
audio/drivers_resampler/cc_resampler_neon.o
|
||||
|
||||
LIBDIRS += -L.
|
||||
LDFLAGS += -Wl,-q
|
||||
|
||||
HAVE_FILTERS_BUILTIN := 1
|
||||
HAVE_LIBRETRO_MANAGEMENT := 1
|
||||
HAVE_BUILTIN_AUTOCONFIG := 1
|
||||
HAVE_RPNG := 1
|
||||
HAVE_ZLIB := 1
|
||||
@@ -245,10 +242,6 @@ ifeq ($(platform), vita)
|
||||
CFLAGS += -DHAVE_SOCKET_LEGACY
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_LIBRETRO_MANAGEMENT), 1)
|
||||
CFLAGS += -DHAVE_LIBRETRO_MANAGEMENT
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_KERNEL_PRX), 1)
|
||||
CFLAGS += -DHAVE_KERNEL_PRX
|
||||
endif
|
||||
|
||||
@@ -10,7 +10,7 @@ TARGET := retroarch-pandora
|
||||
LDDIRS = -L. -L$(PNDSDK)/usr/lib
|
||||
INCDIRS = -I. -I$(PNDSDK)/usr/include
|
||||
|
||||
OBJ = griffin/griffin.o audio/resamplers/sinc_neon.o audio/audio_utils_neon.o
|
||||
OBJ = griffin/griffin.o audio/resamplers/sinc_resampler_neon.o audio/audio_utils_neon.o
|
||||
LDFLAGS = -L$(PNDSDK)/usr/lib -Wl,-rpath,$(PNDSDK)/usr/lib
|
||||
|
||||
LIBS = -lGLESv2 -lEGL -ldl -lm -lpthread -lrt -lasound
|
||||
|
||||
@@ -68,7 +68,7 @@ ifeq ($(HAVE_RLAUNCH), 1)
|
||||
DEFINES += -DHAVE_RLAUNCH
|
||||
endif
|
||||
|
||||
DEFINES += -DHAVE_MENU -DHAVE_RGUI -DHAVE_MATERIALUI -DHAVE_XMB -DRARCH_INTERNAL -DMSB_FIRST -DHAVE_OVERLAY -DHAVE_STB_FONT
|
||||
DEFINES += -DHAVE_MENU -DHAVE_RGUI -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_LIBRETRODB -DHAVE_OPENGLES -DHAVE_OPENGLES1 -DHAVE_PSGL -DHAVE_CG -DHAVE_CG_RUNTIME_COMPILER -DHAVE_FBO -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_LIBRETRO_MANAGEMENT -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_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
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
PPU_OPTIMIZE_LV := -O0 -g
|
||||
|
||||
@@ -104,7 +104,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_OVERLAY -DHAVE_HEADSET -DHAVE_OPENGLES -DHAVE_OPENGLES1 -DHAVE_PSGL -DHAVE_CG -DHAVE_CG_RUNTIME_COMPILER -DHAVE_FBO -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_LIBRETRO_MANAGEMENT -DHAVE_RSOUND -DHAVE_ZLIB -DHAVE_RPNG -DWANT_ZLIB -DSINC_LOWER_QUALITY -D__CELLOS_LV2__ -DHAVE_NETPLAY=1 -DHAVE_SOCKET_LEGACY=1 -DHAVE_MOUSE -DHAVE_GRIFFIN=1 -DHAVE_MULTIMAN=0 -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT)
|
||||
DEFINES += -DHAVE_THREADS -DRARCH_CONSOLE -DHAVE_OPENGL -DHAVE_OVERLAY -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 -DWANT_ZLIB -DSINC_LOWER_QUALITY -D__CELLOS_LV2__ -DHAVE_NETPLAY=1 -DHAVE_SOCKET_LEGACY=1 -DHAVE_MOUSE -DHAVE_GRIFFIN=1 -DHAVE_MULTIMAN=0 -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT)
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
PPU_OPTIMIZE_LV := -O0 -g
|
||||
|
||||
@@ -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_LIBRETRO_MANAGEMENT -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_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
|
||||
|
||||
LIBDIR =
|
||||
LDFLAGS =
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
TARGET = retroarch.exe
|
||||
JTARGET = tools/retroarch-joyconfig.exe
|
||||
|
||||
HAVE_DINPUT = 1
|
||||
HAVE_XAUDIO = 1
|
||||
@@ -84,9 +83,7 @@ OBJDIR := obj-w32
|
||||
|
||||
OS := Win32
|
||||
OBJ :=
|
||||
JOYCONFIG_OBJ :=
|
||||
LIBS := -lm
|
||||
JOYCONFIG_LIBS :=
|
||||
DEFINES := -I. -Ilibretro-common/include -DRARCH_INTERNAL -DHAVE_OVERLAY
|
||||
LDFLAGS := -L. -static-libgcc
|
||||
|
||||
@@ -137,11 +134,10 @@ else
|
||||
endif
|
||||
|
||||
RARCH_OBJ := $(addprefix $(OBJDIR)/,$(OBJ))
|
||||
RARCH_JOYCONFIG_OBJ := $(addprefix $(OBJDIR)/,$(JOYCONFIG_OBJ))
|
||||
|
||||
all: $(TARGET) $(JTARGET)
|
||||
all: $(TARGET)
|
||||
|
||||
-include $(RARCH_OBJ:.o=.d) $(RARCH_JOYCONFIG_OBJ:.o=.d)
|
||||
-include $(RARCH_OBJ:.o=.d)
|
||||
|
||||
$(TARGET): $(RARCH_OBJ)
|
||||
@$(if $(Q), $(shell echo echo LD $@),)
|
||||
@@ -170,37 +166,10 @@ $(OBJDIR)/%.o: %.rc $(HEADERS)
|
||||
@$(if $(Q), $(shell echo echo WINDRES $<),)
|
||||
$(Q)$(WINDRES) -o $@ $<
|
||||
|
||||
$(JTARGET): $(RARCH_JOYCONFIG_OBJ)
|
||||
@$(if $(Q), $(shell echo echo LD $@),)
|
||||
ifeq ($(CXX_BUILD), 1)
|
||||
$(Q)$(CXX) -o $@ $(RARCH_JOYCONFIG_OBJ) -ldxguid -ldinput8 -lole32 $(LDFLAGS) $(JOYCONFIG_LIBS)
|
||||
else
|
||||
$(Q)$(CC) -o $@ $(RARCH_JOYCONFIG_OBJ) -ldxguid -ldinput8 -lole32 $(LDFLAGS) $(JOYCONFIG_LIBS)
|
||||
endif
|
||||
|
||||
clean:
|
||||
rm -rf $(OBJDIR)
|
||||
rm -f $(TARGET)
|
||||
rm -f *.d
|
||||
rm -f tools/retroarch-joyconfig.exe
|
||||
|
||||
dist_x86: all
|
||||
zip -r retroarch-win32-1.0.zip $(TARGET) $(JTARGET) retroarch.cfg
|
||||
|
||||
dist_x86_64: all
|
||||
zip -r retroarch-win64-1.0.zip $(TARGET) $(JTARGET) retroarch.cfg
|
||||
|
||||
libs_x86:
|
||||
wget http://themaister.net/retroarch-dl/RetroArch-win32-libs.zip
|
||||
unzip RetroArch-win32-libs.zip
|
||||
wget http://themaister.net/retroarch-dl/RetroArch-win32-headers.zip
|
||||
unzip RetroArch-win32-headers.zip
|
||||
|
||||
libs_x86_64:
|
||||
wget http://themaister.net/retroarch-dl/RetroArch-win64-libs.zip
|
||||
unzip RetroArch-win64-libs.zip
|
||||
wget http://themaister.net/retroarch-dl/RetroArch-win64-headers.zip
|
||||
unzip RetroArch-win64-headers.zip
|
||||
|
||||
.PHONY: all install uninstall clean dist_x86 dist_x86_64 libs_x86 libs_x86_64
|
||||
.PHONY: all install uninstall clean
|
||||
|
||||
@@ -55,6 +55,7 @@ RetroArch has been ported to the following platforms outside PC:
|
||||
- Xbox 360 (Libxenon/XeXDK)
|
||||
- Xbox 1
|
||||
- Wii, Gamecube (Libogc)
|
||||
- Nintendo 3DS
|
||||
- Raspberry Pi
|
||||
- Android
|
||||
- iOS
|
||||
@@ -62,9 +63,14 @@ RetroArch has been ported to the following platforms outside PC:
|
||||
|
||||
## Dependencies (PC)
|
||||
|
||||
On Windows, RetroArch can run with only Win32 as dependency. On Linux, you need:
|
||||
There are no true hard dependencies per se.
|
||||
|
||||
- GL headers
|
||||
On Windows, RetroArch can run with only Win32 as dependency.
|
||||
|
||||
On Linux, there are no true dependencies. For optimal usage, the
|
||||
following dependencies come as recommended:
|
||||
|
||||
- GL headers / Vulkan headers
|
||||
- X11 headers and libs, or EGL/KMS/GBM
|
||||
|
||||
OSX port of RetroArch requires latest versions of XCode to build.
|
||||
|
||||
@@ -31,6 +31,10 @@
|
||||
#include "../verbosity.h"
|
||||
#include "../string_list_special.h"
|
||||
|
||||
#ifdef HAVE_NETPLAY
|
||||
#include "../netplay/netplay.h"
|
||||
#endif
|
||||
|
||||
#ifndef AUDIO_BUFFER_FREE_SAMPLES_COUNT
|
||||
#define AUDIO_BUFFER_FREE_SAMPLES_COUNT (8 * 1024)
|
||||
#endif
|
||||
@@ -40,33 +44,51 @@ typedef struct audio_driver_input_data
|
||||
float *data;
|
||||
|
||||
size_t data_ptr;
|
||||
size_t chunk_size;
|
||||
size_t nonblock_chunk_size;
|
||||
size_t block_chunk_size;
|
||||
struct
|
||||
{
|
||||
size_t size;
|
||||
size_t nonblock_size;
|
||||
size_t block_size;
|
||||
} chunk;
|
||||
|
||||
double src_ratio;
|
||||
float in_rate;
|
||||
|
||||
struct
|
||||
{
|
||||
float input;
|
||||
bool control;
|
||||
struct
|
||||
{
|
||||
double original;
|
||||
double current;
|
||||
} source_ratio;
|
||||
} audio_rate;
|
||||
|
||||
bool use_float;
|
||||
|
||||
float *outsamples;
|
||||
int16_t *conv_outsamples;
|
||||
|
||||
int16_t *rewind_buf;
|
||||
size_t rewind_ptr;
|
||||
size_t rewind_size;
|
||||
struct
|
||||
{
|
||||
int16_t *buf;
|
||||
size_t ptr;
|
||||
size_t size;
|
||||
} rewind;
|
||||
|
||||
rarch_dsp_filter_t *dsp;
|
||||
|
||||
bool rate_control;
|
||||
double orig_src_ratio;
|
||||
size_t driver_buffer_size;
|
||||
|
||||
float volume_gain;
|
||||
struct retro_audio_callback audio_callback;
|
||||
|
||||
unsigned buffer_free_samples[AUDIO_BUFFER_FREE_SAMPLES_COUNT];
|
||||
uint64_t buffer_free_samples_count;
|
||||
struct
|
||||
{
|
||||
float *buf;
|
||||
int16_t *conv_buf;
|
||||
} output_samples;
|
||||
|
||||
struct
|
||||
{
|
||||
unsigned buf[AUDIO_BUFFER_FREE_SAMPLES_COUNT];
|
||||
uint64_t count;
|
||||
} free_samples;
|
||||
} audio_driver_input_data_t;
|
||||
|
||||
static const audio_driver_t *audio_drivers[] = {
|
||||
@@ -131,12 +153,10 @@ static const audio_driver_t *audio_drivers[] = {
|
||||
&audio_null,
|
||||
NULL,
|
||||
};
|
||||
static const rarch_resampler_t *audio_driver_resampler;
|
||||
static void *audio_driver_resampler_data;
|
||||
static const audio_driver_t *current_audio;
|
||||
static void *audio_driver_context_audio_data;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* compute_audio_buffer_statistics:
|
||||
@@ -148,22 +168,25 @@ static void compute_audio_buffer_statistics(void)
|
||||
{
|
||||
unsigned i, low_water_size, high_water_size, avg, stddev;
|
||||
float avg_filled, deviation;
|
||||
uint64_t accum = 0, accum_var = 0;
|
||||
unsigned low_water_count = 0, high_water_count = 0;
|
||||
unsigned samples = min(audio_driver_data.buffer_free_samples_count,
|
||||
uint64_t accum = 0;
|
||||
uint64_t accum_var = 0;
|
||||
unsigned low_water_count = 0;
|
||||
unsigned high_water_count = 0;
|
||||
unsigned samples = MIN(
|
||||
audio_driver_data.free_samples.count,
|
||||
AUDIO_BUFFER_FREE_SAMPLES_COUNT);
|
||||
|
||||
if (samples < 3)
|
||||
return;
|
||||
|
||||
for (i = 1; i < samples; i++)
|
||||
accum += audio_driver_data.buffer_free_samples[i];
|
||||
accum += audio_driver_data.free_samples.buf[i];
|
||||
|
||||
avg = accum / (samples - 1);
|
||||
|
||||
for (i = 1; i < samples; i++)
|
||||
{
|
||||
int diff = avg - audio_driver_data.buffer_free_samples[i];
|
||||
int diff = avg - audio_driver_data.free_samples.buf[i];
|
||||
accum_var += diff * diff;
|
||||
}
|
||||
|
||||
@@ -176,9 +199,9 @@ static void compute_audio_buffer_statistics(void)
|
||||
|
||||
for (i = 1; i < samples; i++)
|
||||
{
|
||||
if (audio_driver_data.buffer_free_samples[i] >= low_water_size)
|
||||
if (audio_driver_data.free_samples.buf[i] >= low_water_size)
|
||||
low_water_count++;
|
||||
else if (audio_driver_data.buffer_free_samples[i] <= high_water_size)
|
||||
else if (audio_driver_data.free_samples.buf[i] <= high_water_size)
|
||||
high_water_count++;
|
||||
}
|
||||
|
||||
@@ -243,14 +266,15 @@ static bool uninit_audio(void)
|
||||
audio_driver_context_audio_data = NULL;
|
||||
}
|
||||
|
||||
if (audio_driver_data.conv_outsamples)
|
||||
free(audio_driver_data.conv_outsamples);
|
||||
audio_driver_data.conv_outsamples = NULL;
|
||||
audio_driver_data.data_ptr = 0;
|
||||
if (audio_driver_data.output_samples.conv_buf)
|
||||
free(audio_driver_data.output_samples.conv_buf);
|
||||
audio_driver_data.output_samples.conv_buf = NULL;
|
||||
audio_driver_data.data_ptr = 0;
|
||||
|
||||
if (audio_driver_data.rewind_buf)
|
||||
free(audio_driver_data.rewind_buf);
|
||||
audio_driver_data.rewind_buf = NULL;
|
||||
if (audio_driver_data.rewind.buf)
|
||||
free(audio_driver_data.rewind.buf);
|
||||
audio_driver_data.rewind.buf = NULL;
|
||||
audio_driver_data.rewind.size = 0;
|
||||
|
||||
if (!settings->audio.enable)
|
||||
{
|
||||
@@ -258,25 +282,24 @@ static bool uninit_audio(void)
|
||||
return false;
|
||||
}
|
||||
|
||||
rarch_resampler_freep(&audio_driver_resampler,
|
||||
&audio_driver_resampler_data);
|
||||
audio_driver_ctl(RARCH_AUDIO_CTL_RESAMPLER_DEINIT, NULL);
|
||||
|
||||
if (audio_driver_data.data)
|
||||
free(audio_driver_data.data);
|
||||
audio_driver_data.data = NULL;
|
||||
|
||||
if (audio_driver_data.outsamples)
|
||||
free(audio_driver_data.outsamples);
|
||||
audio_driver_data.outsamples = NULL;
|
||||
if (audio_driver_data.output_samples.buf)
|
||||
free(audio_driver_data.output_samples.buf);
|
||||
audio_driver_data.output_samples.buf = NULL;
|
||||
|
||||
event_command(EVENT_CMD_DSP_FILTER_DEINIT);
|
||||
event_cmd_ctl(EVENT_CMD_DSP_FILTER_DEINIT, NULL);
|
||||
|
||||
compute_audio_buffer_statistics();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool init_audio(void)
|
||||
static bool init_audio(bool audio_cb_inited)
|
||||
{
|
||||
size_t outsamples_max, max_bufsamples = AUDIO_CHUNK_SIZE_NONBLOCKING * 2;
|
||||
settings_t *settings = config_get_ptr();
|
||||
@@ -288,25 +311,25 @@ static bool init_audio(void)
|
||||
settings->slowmotion_ratio;
|
||||
|
||||
/* Used for recording even if audio isn't enabled. */
|
||||
retro_assert(audio_driver_data.conv_outsamples =
|
||||
retro_assert(audio_driver_data.output_samples.conv_buf =
|
||||
(int16_t*)malloc(outsamples_max * sizeof(int16_t)));
|
||||
|
||||
if (!audio_driver_data.conv_outsamples)
|
||||
if (!audio_driver_data.output_samples.conv_buf)
|
||||
goto error;
|
||||
|
||||
audio_driver_data.block_chunk_size = AUDIO_CHUNK_SIZE_BLOCKING;
|
||||
audio_driver_data.nonblock_chunk_size = AUDIO_CHUNK_SIZE_NONBLOCKING;
|
||||
audio_driver_data.chunk_size = audio_driver_data.block_chunk_size;
|
||||
audio_driver_data.chunk.block_size = AUDIO_CHUNK_SIZE_BLOCKING;
|
||||
audio_driver_data.chunk.nonblock_size = AUDIO_CHUNK_SIZE_NONBLOCKING;
|
||||
audio_driver_data.chunk.size = audio_driver_data.chunk.block_size;
|
||||
|
||||
/* 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*)
|
||||
retro_assert(audio_driver_data.rewind.buf = (int16_t*)
|
||||
malloc(max_bufsamples * sizeof(int16_t)));
|
||||
|
||||
if (!audio_driver_data.rewind_buf)
|
||||
if (!audio_driver_data.rewind.buf)
|
||||
goto error;
|
||||
|
||||
audio_driver_data.rewind_size = max_bufsamples;
|
||||
audio_driver_data.rewind.size = max_bufsamples;
|
||||
|
||||
if (!settings->audio.enable)
|
||||
{
|
||||
@@ -316,10 +339,12 @@ static bool init_audio(void)
|
||||
|
||||
audio_driver_ctl(RARCH_AUDIO_CTL_FIND_DRIVER, NULL);
|
||||
#ifdef HAVE_THREADS
|
||||
if (audio_driver_data.audio_callback.callback)
|
||||
if (audio_cb_inited)
|
||||
{
|
||||
RARCH_LOG("Starting threaded audio driver ...\n");
|
||||
if (!rarch_threaded_audio_init(¤t_audio, &audio_driver_context_audio_data,
|
||||
if (!rarch_threaded_audio_init(
|
||||
¤t_audio,
|
||||
&audio_driver_context_audio_data,
|
||||
*settings->audio.device ? settings->audio.device : NULL,
|
||||
settings->audio.out_rate, settings->audio.latency,
|
||||
current_audio))
|
||||
@@ -331,9 +356,10 @@ static bool init_audio(void)
|
||||
else
|
||||
#endif
|
||||
{
|
||||
audio_driver_context_audio_data = current_audio->init(*settings->audio.device ?
|
||||
settings->audio.device : NULL,
|
||||
settings->audio.out_rate, settings->audio.latency);
|
||||
audio_driver_context_audio_data =
|
||||
current_audio->init(*settings->audio.device ?
|
||||
settings->audio.device : NULL,
|
||||
settings->audio.out_rate, settings->audio.latency);
|
||||
}
|
||||
|
||||
if (!audio_driver_context_audio_data)
|
||||
@@ -343,29 +369,29 @@ static bool init_audio(void)
|
||||
}
|
||||
|
||||
audio_driver_data.use_float = false;
|
||||
if (audio_driver_ctl(RARCH_AUDIO_CTL_IS_ACTIVE, NULL) && current_audio->use_float(audio_driver_context_audio_data))
|
||||
if ( audio_driver_ctl(RARCH_AUDIO_CTL_IS_ACTIVE, NULL)
|
||||
&& 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))
|
||||
{
|
||||
event_command(EVENT_CMD_AUDIO_SET_NONBLOCKING_STATE);
|
||||
audio_driver_data.chunk_size = audio_driver_data.nonblock_chunk_size;
|
||||
event_cmd_ctl(EVENT_CMD_AUDIO_SET_NONBLOCKING_STATE, NULL);
|
||||
audio_driver_data.chunk.size = audio_driver_data.chunk.nonblock_size;
|
||||
}
|
||||
|
||||
if (audio_driver_data.in_rate <= 0.0f)
|
||||
if (audio_driver_data.audio_rate.input <= 0.0f)
|
||||
{
|
||||
/* Should never happen. */
|
||||
RARCH_WARN("Input rate is invalid (%.3f Hz). Using output rate (%u Hz).\n",
|
||||
audio_driver_data.in_rate, settings->audio.out_rate);
|
||||
audio_driver_data.in_rate = settings->audio.out_rate;
|
||||
audio_driver_data.audio_rate.input, settings->audio.out_rate);
|
||||
audio_driver_data.audio_rate.input = settings->audio.out_rate;
|
||||
}
|
||||
|
||||
audio_driver_data.orig_src_ratio = audio_driver_data.src_ratio =
|
||||
(double)settings->audio.out_rate / audio_driver_data.in_rate;
|
||||
audio_driver_data.audio_rate.source_ratio.original =
|
||||
audio_driver_data.audio_rate.source_ratio.current =
|
||||
(double)settings->audio.out_rate / audio_driver_data.audio_rate.input;
|
||||
|
||||
if (!rarch_resampler_realloc(&audio_driver_resampler_data,
|
||||
&audio_driver_resampler,
|
||||
settings->audio.resampler, audio_driver_data.orig_src_ratio))
|
||||
if (!audio_driver_ctl(RARCH_AUDIO_CTL_RESAMPLER_INIT, NULL))
|
||||
{
|
||||
RARCH_ERR("Failed to initialize resampler \"%s\".\n",
|
||||
settings->audio.resampler);
|
||||
@@ -381,16 +407,16 @@ static bool init_audio(void)
|
||||
audio_driver_data.data_ptr = 0;
|
||||
|
||||
retro_assert(settings->audio.out_rate <
|
||||
audio_driver_data.in_rate * AUDIO_MAX_RATIO);
|
||||
retro_assert(audio_driver_data.outsamples = (float*)
|
||||
audio_driver_data.audio_rate.input * AUDIO_MAX_RATIO);
|
||||
retro_assert(audio_driver_data.output_samples.buf = (float*)
|
||||
malloc(outsamples_max * sizeof(float)));
|
||||
|
||||
if (!audio_driver_data.outsamples)
|
||||
if (!audio_driver_data.output_samples.buf)
|
||||
goto error;
|
||||
|
||||
audio_driver_data.rate_control = false;
|
||||
audio_driver_data.audio_rate.control = false;
|
||||
if (
|
||||
!audio_driver_data.audio_callback.callback
|
||||
!audio_cb_inited
|
||||
&& audio_driver_ctl(RARCH_AUDIO_CTL_IS_ACTIVE, NULL)
|
||||
&& settings->audio.rate_control
|
||||
)
|
||||
@@ -401,21 +427,21 @@ static bool init_audio(void)
|
||||
{
|
||||
audio_driver_data.driver_buffer_size =
|
||||
current_audio->buffer_size(audio_driver_context_audio_data);
|
||||
audio_driver_data.rate_control = true;
|
||||
audio_driver_data.audio_rate.control = true;
|
||||
}
|
||||
else
|
||||
RARCH_WARN("Audio rate control was desired, but driver does not support needed features.\n");
|
||||
}
|
||||
|
||||
event_command(EVENT_CMD_DSP_FILTER_INIT);
|
||||
event_cmd_ctl(EVENT_CMD_DSP_FILTER_INIT, NULL);
|
||||
|
||||
audio_driver_data.buffer_free_samples_count = 0;
|
||||
audio_driver_data.free_samples.count = 0;
|
||||
|
||||
/* Threaded driver is initially stopped. */
|
||||
if (
|
||||
audio_driver_ctl(RARCH_AUDIO_CTL_IS_ACTIVE, NULL)
|
||||
&& !settings->audio.mute_enable
|
||||
&& audio_driver_data.audio_callback.callback
|
||||
&& audio_cb_inited
|
||||
)
|
||||
audio_driver_ctl(RARCH_AUDIO_CTL_START, NULL);
|
||||
|
||||
@@ -433,10 +459,11 @@ error:
|
||||
static void audio_driver_readjust_input_rate(void)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
unsigned write_idx = audio_driver_data.buffer_free_samples_count++ &
|
||||
unsigned write_idx = audio_driver_data.free_samples.count++ &
|
||||
(AUDIO_BUFFER_FREE_SAMPLES_COUNT - 1);
|
||||
int half_size = audio_driver_data.driver_buffer_size / 2;
|
||||
int avail = current_audio->write_avail(audio_driver_context_audio_data);
|
||||
int avail =
|
||||
current_audio->write_avail(audio_driver_context_audio_data);
|
||||
int delta_mid = avail - half_size;
|
||||
double direction = (double)delta_mid / half_size;
|
||||
double adjust = 1.0 + settings->audio.rate_control_delta * direction;
|
||||
@@ -446,12 +473,14 @@ static void audio_driver_readjust_input_rate(void)
|
||||
(unsigned)(100 - (avail * 100) / audio_driver_data.driver_buffer_size));
|
||||
#endif
|
||||
|
||||
audio_driver_data.buffer_free_samples[write_idx] = avail;
|
||||
audio_driver_data.src_ratio = audio_driver_data.orig_src_ratio * adjust;
|
||||
audio_driver_data.free_samples.buf[write_idx] = avail;
|
||||
audio_driver_data.audio_rate.source_ratio.current =
|
||||
audio_driver_data.audio_rate.source_ratio.original * adjust;
|
||||
|
||||
#if 0
|
||||
RARCH_LOG_OUTPUT("New rate: %lf, Orig rate: %lf\n",
|
||||
audio_driver_data.src_ratio, audio_driver_data.orig_src_ratio);
|
||||
audio_driver_data.audio_rate.source_ratio.current,
|
||||
audio_driver_data.audio_rate.source_ratio.original);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -465,8 +494,9 @@ void audio_driver_set_nonblocking_state(bool enable)
|
||||
current_audio->set_nonblock_state(audio_driver_context_audio_data,
|
||||
settings->audio.sync ? enable : true);
|
||||
|
||||
audio_driver_data.chunk_size = enable ? audio_driver_data.nonblock_chunk_size :
|
||||
audio_driver_data.block_chunk_size;
|
||||
audio_driver_data.chunk.size = enable ?
|
||||
audio_driver_data.chunk.nonblock_size :
|
||||
audio_driver_data.chunk.block_size;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -482,11 +512,9 @@ void audio_driver_set_nonblocking_state(bool enable)
|
||||
**/
|
||||
static bool audio_driver_flush(const int16_t *data, size_t samples)
|
||||
{
|
||||
bool is_slowmotion;
|
||||
static struct retro_perf_counter audio_convert_s16 = {0};
|
||||
static struct retro_perf_counter audio_convert_float = {0};
|
||||
static struct retro_perf_counter audio_dsp = {0};
|
||||
static struct retro_perf_counter resampler_proc = {0};
|
||||
struct resampler_data src_data = {0};
|
||||
struct rarch_dsp_data dsp_data = {0};
|
||||
const void *output_data = NULL;
|
||||
@@ -498,7 +526,9 @@ 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) || !audio_driver_data.data)
|
||||
if (!audio_driver_ctl(RARCH_AUDIO_CTL_IS_ACTIVE, NULL))
|
||||
return false;
|
||||
if (!audio_driver_data.data)
|
||||
return false;
|
||||
|
||||
rarch_perf_init(&audio_convert_s16, "audio_convert_s16");
|
||||
@@ -527,35 +557,30 @@ static bool audio_driver_flush(const int16_t *data, size_t samples)
|
||||
}
|
||||
}
|
||||
|
||||
src_data.data_out = audio_driver_data.outsamples;
|
||||
src_data.data_out = audio_driver_data.output_samples.buf;
|
||||
|
||||
if (audio_driver_data.rate_control)
|
||||
if (audio_driver_data.audio_rate.control)
|
||||
audio_driver_readjust_input_rate();
|
||||
|
||||
src_data.ratio = audio_driver_data.src_ratio;
|
||||
src_data.ratio = audio_driver_data.audio_rate.source_ratio.current;
|
||||
|
||||
runloop_ctl(RUNLOOP_CTL_IS_SLOWMOTION, &is_slowmotion);
|
||||
|
||||
if (is_slowmotion)
|
||||
if (runloop_ctl(RUNLOOP_CTL_IS_SLOWMOTION, NULL))
|
||||
src_data.ratio *= settings->slowmotion_ratio;
|
||||
|
||||
rarch_perf_init(&resampler_proc, "resampler_proc");
|
||||
retro_perf_start(&resampler_proc);
|
||||
rarch_resampler_process(audio_driver_resampler, audio_driver_resampler_data, &src_data);
|
||||
retro_perf_stop(&resampler_proc);
|
||||
audio_driver_ctl(RARCH_AUDIO_CTL_RESAMPLER_PROCESS, &src_data);
|
||||
|
||||
output_data = audio_driver_data.outsamples;
|
||||
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.conv_outsamples,
|
||||
audio_convert_float_to_s16(audio_driver_data.output_samples.conv_buf,
|
||||
(const float*)output_data, output_frames * 2);
|
||||
retro_perf_stop(&audio_convert_float);
|
||||
|
||||
output_data = audio_driver_data.conv_outsamples;
|
||||
output_data = audio_driver_data.output_samples.conv_buf;
|
||||
output_size = sizeof(int16_t);
|
||||
}
|
||||
|
||||
@@ -578,13 +603,14 @@ static bool audio_driver_flush(const int16_t *data, size_t samples)
|
||||
**/
|
||||
void audio_driver_sample(int16_t left, int16_t right)
|
||||
{
|
||||
audio_driver_data.conv_outsamples[audio_driver_data.data_ptr++] = left;
|
||||
audio_driver_data.conv_outsamples[audio_driver_data.data_ptr++] = right;
|
||||
audio_driver_data.output_samples.conv_buf[audio_driver_data.data_ptr++] = left;
|
||||
audio_driver_data.output_samples.conv_buf[audio_driver_data.data_ptr++] = right;
|
||||
|
||||
if (audio_driver_data.data_ptr < audio_driver_data.chunk_size)
|
||||
if (audio_driver_data.data_ptr < audio_driver_data.chunk.size)
|
||||
return;
|
||||
|
||||
audio_driver_flush(audio_driver_data.conv_outsamples, audio_driver_data.data_ptr);
|
||||
audio_driver_flush(audio_driver_data.output_samples.conv_buf,
|
||||
audio_driver_data.data_ptr);
|
||||
|
||||
audio_driver_data.data_ptr = 0;
|
||||
}
|
||||
@@ -614,13 +640,14 @@ size_t audio_driver_sample_batch(const int16_t *data, size_t frames)
|
||||
* @left : value of the left audio channel.
|
||||
* @right : value of the right audio channel.
|
||||
*
|
||||
* Audio sample render callback function (rewind version). This callback
|
||||
* function will be used instead of audio_driver_sample when rewinding is activated.
|
||||
* Audio sample render callback function (rewind version).
|
||||
* This callback function will be used instead of
|
||||
* audio_driver_sample when rewinding is activated.
|
||||
**/
|
||||
void audio_driver_sample_rewind(int16_t left, int16_t right)
|
||||
{
|
||||
audio_driver_data.rewind_buf[--audio_driver_data.rewind_ptr] = right;
|
||||
audio_driver_data.rewind_buf[--audio_driver_data.rewind_ptr] = left;
|
||||
audio_driver_data.rewind.buf[--audio_driver_data.rewind.ptr] = right;
|
||||
audio_driver_data.rewind.buf[--audio_driver_data.rewind.ptr] = left;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -628,8 +655,10 @@ void audio_driver_sample_rewind(int16_t left, int16_t right)
|
||||
* @data : pointer to audio buffer.
|
||||
* @frames : amount of audio frames to push.
|
||||
*
|
||||
* Batched audio sample render callback function (rewind version). This callback
|
||||
* function will be used instead of audio_driver_sample_batch when rewinding is activated.
|
||||
* Batched audio sample render callback function (rewind version).
|
||||
*
|
||||
* This callback function will be used instead of
|
||||
* audio_driver_sample_batch when rewinding is activated.
|
||||
*
|
||||
* Returns: amount of frames sampled. Will be equal to @frames
|
||||
* unless @frames exceeds (AUDIO_CHUNK_SIZE_NONBLOCKING / 2).
|
||||
@@ -640,7 +669,7 @@ size_t audio_driver_sample_batch_rewind(const int16_t *data, size_t frames)
|
||||
size_t samples = frames << 1;
|
||||
|
||||
for (i = 0; i < samples; i++)
|
||||
audio_driver_data.rewind_buf[--audio_driver_data.rewind_ptr] = data[i];
|
||||
audio_driver_data.rewind.buf[--audio_driver_data.rewind.ptr] = data[i];
|
||||
|
||||
return frames;
|
||||
}
|
||||
@@ -659,7 +688,9 @@ void audio_driver_dsp_filter_free(void)
|
||||
|
||||
void audio_driver_dsp_filter_init(const char *device)
|
||||
{
|
||||
audio_driver_data.dsp = rarch_dsp_filter_new(device, audio_driver_data.in_rate);
|
||||
audio_driver_data.dsp = rarch_dsp_filter_new(
|
||||
device, audio_driver_data.audio_rate.input);
|
||||
|
||||
if (!audio_driver_data.dsp)
|
||||
RARCH_ERR("[DSP]: Failed to initialize DSP filter \"%s\".\n", device);
|
||||
}
|
||||
@@ -669,29 +700,6 @@ void audio_driver_set_buffer_size(size_t bufsize)
|
||||
audio_driver_data.driver_buffer_size = bufsize;
|
||||
}
|
||||
|
||||
void audio_driver_unset_callback(void)
|
||||
{
|
||||
audio_driver_data.audio_callback.callback = NULL;
|
||||
audio_driver_data.audio_callback.set_state = NULL;
|
||||
}
|
||||
|
||||
void audio_driver_set_callback(const void *data)
|
||||
{
|
||||
const struct retro_audio_callback *cb =
|
||||
(const struct retro_audio_callback*)data;
|
||||
|
||||
if (cb)
|
||||
audio_driver_data.audio_callback = *cb;
|
||||
}
|
||||
|
||||
void audio_driver_callback_set_state(bool state)
|
||||
{
|
||||
if (!audio_driver_ctl(RARCH_AUDIO_CTL_HAS_CALLBACK, NULL))
|
||||
return;
|
||||
|
||||
if (audio_driver_data.audio_callback.set_state)
|
||||
audio_driver_data.audio_callback.set_state(state);
|
||||
}
|
||||
|
||||
static void audio_monitor_adjust_system_rates(void)
|
||||
{
|
||||
@@ -707,13 +715,13 @@ static void audio_monitor_adjust_system_rates(void)
|
||||
return;
|
||||
|
||||
timing_skew = fabs(1.0f - info->fps / settings->video.refresh_rate);
|
||||
audio_driver_data.in_rate = info->sample_rate;
|
||||
audio_driver_data.audio_rate.input = info->sample_rate;
|
||||
|
||||
if (timing_skew <= settings->audio.max_timing_skew)
|
||||
audio_driver_data.in_rate *= (settings->video.refresh_rate / info->fps);
|
||||
audio_driver_data.audio_rate.input *= (settings->video.refresh_rate / info->fps);
|
||||
|
||||
RARCH_LOG("Set audio input rate to: %.2f Hz.\n",
|
||||
audio_driver_data.in_rate);
|
||||
audio_driver_data.audio_rate.input);
|
||||
}
|
||||
|
||||
static void audio_driver_setup_rewind(void)
|
||||
@@ -721,15 +729,15 @@ static void audio_driver_setup_rewind(void)
|
||||
unsigned i;
|
||||
|
||||
/* Push audio ready to be played. */
|
||||
audio_driver_data.rewind_ptr = audio_driver_data.rewind_size;
|
||||
audio_driver_data.rewind.ptr = audio_driver_data.rewind.size;
|
||||
|
||||
for (i = 0; i < audio_driver_data.data_ptr; i += 2)
|
||||
{
|
||||
audio_driver_data.rewind_buf[--audio_driver_data.rewind_ptr] =
|
||||
audio_driver_data.conv_outsamples[i + 1];
|
||||
audio_driver_data.rewind.buf[--audio_driver_data.rewind.ptr] =
|
||||
audio_driver_data.output_samples.conv_buf[i + 1];
|
||||
|
||||
audio_driver_data.rewind_buf[--audio_driver_data.rewind_ptr] =
|
||||
audio_driver_data.conv_outsamples[i + 0];
|
||||
audio_driver_data.rewind.buf[--audio_driver_data.rewind.ptr] =
|
||||
audio_driver_data.output_samples.conv_buf[i + 0];
|
||||
}
|
||||
|
||||
audio_driver_data.data_ptr = 0;
|
||||
@@ -737,9 +745,16 @@ static void audio_driver_setup_rewind(void)
|
||||
|
||||
static bool find_audio_driver(void)
|
||||
{
|
||||
int i;
|
||||
driver_ctx_info_t drv;
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
int i = find_driver_index("audio_driver", settings->audio.driver);
|
||||
drv.label = "audio_driver";
|
||||
drv.s = settings->audio.driver;
|
||||
|
||||
driver_ctl(RARCH_DRIVER_CTL_FIND_INDEX, &drv);
|
||||
|
||||
i = drv.len;
|
||||
|
||||
if (i >= 0)
|
||||
current_audio = (const audio_driver_t*)audio_driver_find_handle(i);
|
||||
@@ -764,16 +779,36 @@ static bool find_audio_driver(void)
|
||||
|
||||
bool audio_driver_ctl(enum rarch_audio_ctl_state state, void *data)
|
||||
{
|
||||
static bool audio_driver_active = false;
|
||||
static bool audio_driver_data_own = false;
|
||||
settings_t *settings = config_get_ptr();
|
||||
static struct retro_audio_callback audio_callback;
|
||||
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();
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case RARCH_AUDIO_CTL_NONE:
|
||||
case RARCH_AUDIO_CTL_RESAMPLER_DEINIT:
|
||||
rarch_resampler_freep(&audio_driver_resampler,
|
||||
&audio_driver_resampler_data);
|
||||
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();
|
||||
return init_audio(audio_callback.callback != NULL);
|
||||
case RARCH_AUDIO_CTL_DESTROY:
|
||||
audio_driver_active = false;
|
||||
audio_driver_data_own = false;
|
||||
@@ -783,57 +818,95 @@ bool audio_driver_ctl(enum rarch_audio_ctl_state state, void *data)
|
||||
audio_driver_context_audio_data = NULL;
|
||||
break;
|
||||
case RARCH_AUDIO_CTL_DEINIT:
|
||||
if (uninit_audio())
|
||||
return true;
|
||||
if (!uninit_audio())
|
||||
return false;
|
||||
break;
|
||||
case RARCH_AUDIO_CTL_SETUP_REWIND:
|
||||
audio_driver_setup_rewind();
|
||||
return true;
|
||||
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;
|
||||
|
||||
if (audio_callback.set_state)
|
||||
audio_callback.set_state(false);
|
||||
break;
|
||||
case RARCH_AUDIO_CTL_HAS_CALLBACK:
|
||||
return audio_driver_data.audio_callback.callback;
|
||||
return audio_callback.callback;
|
||||
case RARCH_AUDIO_CTL_CALLBACK:
|
||||
if (!audio_driver_ctl(RARCH_AUDIO_CTL_HAS_CALLBACK, NULL))
|
||||
return false;
|
||||
|
||||
if (audio_driver_data.audio_callback.callback)
|
||||
audio_driver_data.audio_callback.callback();
|
||||
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;
|
||||
|
||||
if (recording_driver_get_data_ptr()) /* A/V sync is a must. */
|
||||
return false;
|
||||
|
||||
#ifdef HAVE_NETPLAY
|
||||
if (netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_ENABLED, NULL))
|
||||
return false;
|
||||
#endif
|
||||
if (cb)
|
||||
audio_callback = *cb;
|
||||
}
|
||||
break;
|
||||
case RARCH_AUDIO_CTL_MONITOR_ADJUST_SYSTEM_RATES:
|
||||
audio_monitor_adjust_system_rates();
|
||||
return true;
|
||||
break;
|
||||
case RARCH_AUDIO_CTL_MONITOR_SET_REFRESH_RATE:
|
||||
{
|
||||
double new_src_ratio = (double)settings->audio.out_rate /
|
||||
audio_driver_data.in_rate;
|
||||
audio_driver_data.audio_rate.input;
|
||||
|
||||
audio_driver_data.orig_src_ratio = new_src_ratio;
|
||||
audio_driver_data.src_ratio = new_src_ratio;
|
||||
audio_driver_data.audio_rate.source_ratio.original = new_src_ratio;
|
||||
audio_driver_data.audio_rate.source_ratio.current = new_src_ratio;
|
||||
}
|
||||
return true;
|
||||
break;
|
||||
case RARCH_AUDIO_CTL_MUTE_TOGGLE:
|
||||
if (!audio_driver_context_audio_data || !audio_driver_ctl(RARCH_AUDIO_CTL_IS_ACTIVE, NULL))
|
||||
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_command(EVENT_CMD_AUDIO_STOP);
|
||||
else if (!event_command(EVENT_CMD_AUDIO_START))
|
||||
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;
|
||||
}
|
||||
return true;
|
||||
break;
|
||||
case RARCH_AUDIO_CTL_ALIVE:
|
||||
if (!current_audio || !current_audio->alive || !audio_driver_context_audio_data)
|
||||
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)
|
||||
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)
|
||||
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:
|
||||
@@ -856,10 +929,14 @@ bool audio_driver_ctl(enum rarch_audio_ctl_state state, void *data)
|
||||
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);
|
||||
return true;
|
||||
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;
|
||||
}
|
||||
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -42,6 +42,10 @@ enum rarch_audio_ctl_state
|
||||
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,
|
||||
@@ -51,7 +55,10 @@ enum rarch_audio_ctl_state
|
||||
RARCH_AUDIO_CTL_OWNS_DRIVER,
|
||||
RARCH_AUDIO_CTL_SET_ACTIVE,
|
||||
RARCH_AUDIO_CTL_UNSET_ACTIVE,
|
||||
RARCH_AUDIO_CTL_IS_ACTIVE
|
||||
RARCH_AUDIO_CTL_IS_ACTIVE,
|
||||
RARCH_AUDIO_CTL_RESAMPLER_DEINIT,
|
||||
RARCH_AUDIO_CTL_RESAMPLER_INIT,
|
||||
RARCH_AUDIO_CTL_RESAMPLER_PROCESS
|
||||
};
|
||||
|
||||
typedef struct audio_driver
|
||||
@@ -147,12 +154,6 @@ void audio_driver_dsp_filter_init(const char *device);
|
||||
|
||||
void audio_driver_set_buffer_size(size_t bufsize);
|
||||
|
||||
void audio_driver_set_callback(const void *info);
|
||||
void audio_driver_unset_callback(void);
|
||||
|
||||
void audio_driver_callback_set_state(bool state);
|
||||
|
||||
|
||||
extern audio_driver_t audio_rsound;
|
||||
extern audio_driver_t audio_oss;
|
||||
extern audio_driver_t audio_alsa;
|
||||
|
||||
@@ -25,13 +25,12 @@
|
||||
#include <file/config_file_userdata.h>
|
||||
#include <file/dir_list.h>
|
||||
|
||||
#include "../performance.h"
|
||||
|
||||
#include "audio_dsp_filter.h"
|
||||
#include "../dynamic.h"
|
||||
#include "audio_filters/dspfilter.h"
|
||||
#include "../file_ext.h"
|
||||
|
||||
#include "../frontend/frontend_driver.h"
|
||||
#include "../performance.h"
|
||||
#include "../dynamic.h"
|
||||
|
||||
struct rarch_dsp_plug
|
||||
{
|
||||
@@ -226,12 +225,13 @@ static bool append_plugs(rarch_dsp_filter_t *dsp, struct string_list *list)
|
||||
rarch_dsp_filter_t *rarch_dsp_filter_new(
|
||||
const char *filter_config, float sample_rate)
|
||||
{
|
||||
char basedir[PATH_MAX_LENGTH] = {0};
|
||||
#if !defined(HAVE_FILTERS_BUILTIN) && defined(HAVE_DYLIB)
|
||||
char basedir[PATH_MAX_LENGTH];
|
||||
char ext_name[PATH_MAX_LENGTH];
|
||||
#endif
|
||||
struct string_list *plugs = NULL;
|
||||
rarch_dsp_filter_t *dsp = NULL;
|
||||
|
||||
(void)basedir;
|
||||
|
||||
dsp = (rarch_dsp_filter_t*)calloc(1, sizeof(*dsp));
|
||||
if (!dsp)
|
||||
return NULL;
|
||||
@@ -243,7 +243,10 @@ rarch_dsp_filter_t *rarch_dsp_filter_new(
|
||||
#if !defined(HAVE_FILTERS_BUILTIN) && defined(HAVE_DYLIB)
|
||||
fill_pathname_basedir(basedir, filter_config, sizeof(basedir));
|
||||
|
||||
plugs = dir_list_new(basedir, EXT_EXECUTABLES, false, false);
|
||||
if (!frontend_driver_get_core_extension(ext_name, sizeof(ext_name)))
|
||||
goto error;
|
||||
|
||||
plugs = dir_list_new(basedir, ext_name, false, false);
|
||||
if (!plugs)
|
||||
goto error;
|
||||
#endif
|
||||
|
||||
@@ -107,7 +107,7 @@ static void *echo_init(const struct dspfilter_info *info,
|
||||
config->get_float_array(userdata, "feedback", &feedback, &num_feedback, default_feedback, 1);
|
||||
config->get_float(userdata, "amp", &echo->amp, 0.2f);
|
||||
|
||||
channels = num_feedback = num_delay = min(num_delay, num_feedback);
|
||||
channels = num_feedback = num_delay = MIN(num_delay, num_feedback);
|
||||
|
||||
echo->channels = (struct echo_channel*)calloc(channels, sizeof(*echo->channels));
|
||||
if (!echo->channels)
|
||||
|
||||
@@ -276,7 +276,7 @@ static void *eq_init(const struct dspfilter_info *info,
|
||||
filter_path = NULL;
|
||||
}
|
||||
|
||||
num_gain = num_freq = min(num_gain, num_freq);
|
||||
num_gain = num_freq = MIN(num_gain, num_freq);
|
||||
|
||||
gains = (struct eq_gain*)calloc(num_gain, sizeof(*gains));
|
||||
if (!gains)
|
||||
|
||||
@@ -14,12 +14,15 @@
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <file/config_file_userdata.h>
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include "audio_resampler_driver.h"
|
||||
#ifdef RARCH_INTERNAL
|
||||
#include "../performance.h"
|
||||
#endif
|
||||
#include <file/config_file_userdata.h>
|
||||
#include <string.h>
|
||||
#ifndef DONT_HAVE_STRING_LIST
|
||||
#include "../string_list_special.h"
|
||||
#endif
|
||||
@@ -28,6 +31,7 @@ static const rarch_resampler_t *resampler_drivers[] = {
|
||||
&sinc_resampler,
|
||||
&CC_resampler,
|
||||
&nearest_resampler,
|
||||
&null_resampler,
|
||||
NULL,
|
||||
};
|
||||
|
||||
@@ -54,7 +58,7 @@ static int find_resampler_driver_index(const char *ident)
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; resampler_drivers[i]; i++)
|
||||
if (strcasecmp(ident, resampler_drivers[i]->ident) == 0)
|
||||
if (string_is_equal_noncase(ident, resampler_drivers[i]->ident))
|
||||
return i;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -140,6 +140,7 @@ typedef struct audio_frame_float
|
||||
extern rarch_resampler_t sinc_resampler;
|
||||
extern rarch_resampler_t CC_resampler;
|
||||
extern rarch_resampler_t nearest_resampler;
|
||||
extern rarch_resampler_t null_resampler;
|
||||
|
||||
#ifndef DONT_HAVE_STRING_LIST
|
||||
/**
|
||||
|
||||
@@ -34,6 +34,7 @@ typedef struct audio_thread
|
||||
scond_t *cond;
|
||||
bool alive;
|
||||
bool stopped;
|
||||
bool stopped_ack;
|
||||
bool is_paused;
|
||||
bool use_float;
|
||||
|
||||
@@ -81,6 +82,7 @@ static void audio_thread_loop(void *data)
|
||||
{
|
||||
scond_signal(thr->cond);
|
||||
slock_unlock(thr->lock);
|
||||
thr->stopped_ack = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -88,7 +90,14 @@ static void audio_thread_loop(void *data)
|
||||
{
|
||||
thr->driver->stop(thr->driver_data);
|
||||
while (thr->stopped)
|
||||
{
|
||||
/* If we stop right after start, we might not be able to properly ack.
|
||||
* Signal in the loop instead. */
|
||||
thr->stopped_ack = true;
|
||||
scond_signal(thr->cond);
|
||||
|
||||
scond_wait(thr->cond, thr->lock);
|
||||
}
|
||||
thr->driver->start(thr->driver_data);
|
||||
}
|
||||
|
||||
@@ -105,9 +114,18 @@ static void audio_thread_block(audio_thread_t *thr)
|
||||
if (!thr)
|
||||
return;
|
||||
|
||||
if (thr->stopped)
|
||||
return;
|
||||
|
||||
slock_lock(thr->lock);
|
||||
thr->stopped_ack = false;
|
||||
thr->stopped = true;
|
||||
scond_signal(thr->cond);
|
||||
|
||||
/* Wait until audio driver actually goes to sleep. */
|
||||
while (!thr->stopped_ack)
|
||||
scond_wait(thr->cond, thr->lock);
|
||||
|
||||
slock_unlock(thr->lock);
|
||||
}
|
||||
|
||||
@@ -167,11 +185,12 @@ static bool audio_thread_stop(void *data)
|
||||
audio_thread_t *thr = (audio_thread_t*)data;
|
||||
|
||||
if (!thr)
|
||||
return false;
|
||||
return false;
|
||||
|
||||
audio_thread_block(thr);
|
||||
thr->is_paused = true;
|
||||
audio_driver_callback_set_state(false);
|
||||
|
||||
audio_driver_ctl(RARCH_AUDIO_CTL_SET_CALLBACK_DISABLE, NULL);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -183,7 +202,8 @@ static bool audio_thread_start(void *data)
|
||||
if (!thr)
|
||||
return false;
|
||||
|
||||
audio_driver_callback_set_state(true);
|
||||
audio_driver_ctl(RARCH_AUDIO_CTL_SET_CALLBACK_ENABLE, NULL);
|
||||
|
||||
thr->is_paused = false;
|
||||
audio_thread_unblock(thr);
|
||||
|
||||
|
||||
@@ -227,7 +227,8 @@ static ssize_t alsa_qsa_write(void *data, const void *buf, size_t size)
|
||||
|
||||
while (size)
|
||||
{
|
||||
size_t avail_write = min(alsa->buf_size - alsa->buffer_ptr, size);
|
||||
size_t avail_write = MIN(alsa->buf_size - alsa->buffer_ptr, size);
|
||||
|
||||
if (avail_write)
|
||||
{
|
||||
memcpy(alsa->buffer[alsa->buffer_index] +
|
||||
|
||||
@@ -66,7 +66,7 @@ static void alsa_worker_thread(void *data)
|
||||
snd_pcm_sframes_t frames;
|
||||
slock_lock(alsa->fifo_lock);
|
||||
avail = fifo_read_avail(alsa->buffer);
|
||||
fifo_size = min(alsa->period_size, avail);
|
||||
fifo_size = MIN(alsa->period_size, avail);
|
||||
fifo_read(alsa->buffer, buf, fifo_size);
|
||||
scond_signal(alsa->cond);
|
||||
slock_unlock(alsa->fifo_lock);
|
||||
@@ -252,11 +252,14 @@ static ssize_t alsa_thread_write(void *data, const void *buf, size_t size)
|
||||
{
|
||||
size_t avail;
|
||||
size_t write_amt;
|
||||
|
||||
slock_lock(alsa->fifo_lock);
|
||||
avail = fifo_write_avail(alsa->buffer);
|
||||
write_amt = min(avail, size);
|
||||
avail = fifo_write_avail(alsa->buffer);
|
||||
write_amt = MIN(avail, size);
|
||||
|
||||
fifo_write(alsa->buffer, buf, write_amt);
|
||||
slock_unlock(alsa->fifo_lock);
|
||||
|
||||
return write_amt;
|
||||
}
|
||||
else
|
||||
@@ -278,7 +281,7 @@ static ssize_t alsa_thread_write(void *data, const void *buf, size_t size)
|
||||
}
|
||||
else
|
||||
{
|
||||
size_t write_amt = min(size - written, avail);
|
||||
size_t write_amt = MIN(size - written, avail);
|
||||
fifo_write(alsa->buffer, (const char*)buf + written, write_amt);
|
||||
slock_unlock(alsa->fifo_lock);
|
||||
written += write_amt;
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <queues/fifo_buffer.h>
|
||||
#include <rthreads/rthreads.h>
|
||||
#include <retro_endianness.h>
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include "../audio_driver.h"
|
||||
#include "../../configuration.h"
|
||||
@@ -174,7 +175,7 @@ static void choose_output_device(coreaudio_t *dev, const char* device)
|
||||
|
||||
if (AudioObjectGetPropertyData(devices[i],
|
||||
&propaddr, 0, 0, &size, device_name) == noErr
|
||||
&& !strcmp(device_name, device))
|
||||
&& string_is_equal(device_name, device))
|
||||
{
|
||||
AudioUnitSetProperty(dev->dev, kAudioOutputUnitProperty_CurrentDevice,
|
||||
kAudioUnitScope_Global, 0, &devices[i], sizeof(AudioDeviceID));
|
||||
|
||||
@@ -31,19 +31,6 @@
|
||||
#include "../../configuration.h"
|
||||
#include "../../defines/gx_defines.h"
|
||||
|
||||
#define CHUNK_FRAMES 64
|
||||
#define CHUNK_SIZE (CHUNK_FRAMES * sizeof(uint32_t))
|
||||
#define BLOCKS 16
|
||||
|
||||
#ifdef GEKKO
|
||||
#define AIInit AUDIO_Init
|
||||
#define AIInitDMA AUDIO_InitDMA
|
||||
#define AIStartDMA AUDIO_StartDMA
|
||||
#define AIStopDMA AUDIO_StopDMA
|
||||
#define AIRegisterDMACallback AUDIO_RegisterDMACallback
|
||||
#define AISetDSPSampleRate AUDIO_SetDSPSampleRate
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t data[BLOCKS][CHUNK_FRAMES];
|
||||
@@ -218,7 +205,7 @@ static void gx_audio_free(void *data)
|
||||
AIRegisterDMACallback(NULL);
|
||||
|
||||
if (wa->cond)
|
||||
LWP_CloseQueue(wa->cond);
|
||||
OSCloseThreadQueue(wa->cond);
|
||||
wa->cond = 0;
|
||||
|
||||
free(data);
|
||||
|
||||
@@ -162,7 +162,7 @@ static bool al_get_buffer(al_t *al, ALuint *buffer)
|
||||
|
||||
static size_t al_fill_internal_buf(al_t *al, const void *buf, size_t size)
|
||||
{
|
||||
size_t read_size = min(BUFSIZE - al->tmpbuf_ptr, size);
|
||||
size_t read_size = MIN(BUFSIZE - al->tmpbuf_ptr, size);
|
||||
memcpy(al->tmpbuf + al->tmpbuf_ptr, buf, read_size);
|
||||
al->tmpbuf_ptr += read_size;
|
||||
return read_size;
|
||||
|
||||
@@ -255,7 +255,7 @@ static ssize_t sl_write(void *data, const void *buf_, size_t size)
|
||||
slock_unlock(sl->lock);
|
||||
}
|
||||
|
||||
avail_write = min(sl->buf_size - sl->buffer_ptr, size);
|
||||
avail_write = MIN(sl->buf_size - sl->buffer_ptr, size);
|
||||
|
||||
if (avail_write)
|
||||
{
|
||||
|
||||
@@ -238,9 +238,7 @@ static ssize_t pulse_write(void *data, const void *buf_, size_t size)
|
||||
pa_threaded_mainloop_lock(pa->mainloop);
|
||||
while (size)
|
||||
{
|
||||
size_t writable = pa_stream_writable_size(pa->stream);
|
||||
|
||||
writable = min(size, writable);
|
||||
size_t writable = MIN(size, pa_stream_writable_size(pa->stream));
|
||||
|
||||
if (writable)
|
||||
{
|
||||
|
||||
@@ -194,7 +194,7 @@ static size_t xaudio2_write(xaudio2_t *handle, const void *buf, size_t bytes_)
|
||||
|
||||
while (bytes)
|
||||
{
|
||||
unsigned need = min(bytes, handle->bufsize - handle->bufptr);
|
||||
unsigned need = MIN(bytes, handle->bufsize - handle->bufptr);
|
||||
|
||||
memcpy(handle->buf + handle->write_buffer * handle->bufsize + handle->bufptr,
|
||||
buffer, need);
|
||||
|
||||
@@ -271,7 +271,7 @@ static void resampler_CC_upsample(void *re_, struct resampler_data *data)
|
||||
audio_frame_float_t *inp = (audio_frame_float_t*)data->data_in;
|
||||
audio_frame_float_t *inp_max = (audio_frame_float_t*)(inp + data->input_frames);
|
||||
audio_frame_float_t *outp = (audio_frame_float_t*)data->data_out;
|
||||
float b = min(data->ratio, 1.00); /* cutoff frequency. */
|
||||
float b = MIN(data->ratio, 1.00); /* cutoff frequency. */
|
||||
float ratio = 1.0 / data->ratio;
|
||||
__m128 vec_previous = _mm_loadu_ps((float*)&re->buffer[0]);
|
||||
__m128 vec_current = _mm_loadu_ps((float*)&re->buffer[2]);
|
||||
@@ -446,7 +446,7 @@ static void resampler_CC_upsample(void *re_, struct resampler_data *data)
|
||||
audio_frame_float_t *inp_max = (audio_frame_float_t*)
|
||||
(inp + data->input_frames);
|
||||
audio_frame_float_t *outp = (audio_frame_float_t*)data->data_out;
|
||||
float b = min(data->ratio, 1.00); /* cutoff frequency. */
|
||||
float b = MIN(data->ratio, 1.00); /* cutoff frequency. */
|
||||
float ratio = 1.0 / data->ratio;
|
||||
|
||||
while (inp != inp_max)
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* 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 <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "../audio_resampler_driver.h"
|
||||
typedef struct rarch_null_resampler
|
||||
{
|
||||
void *empty;
|
||||
} rarch_null_resampler_t;
|
||||
|
||||
static void resampler_null_process(
|
||||
void *re_, struct resampler_data *data)
|
||||
{
|
||||
}
|
||||
|
||||
static void resampler_null_free(void *re_)
|
||||
{
|
||||
}
|
||||
|
||||
static void *resampler_null_init(const struct resampler_config *config,
|
||||
double bandwidth_mod, resampler_simd_mask_t mask)
|
||||
{
|
||||
return (void*)0;
|
||||
}
|
||||
|
||||
rarch_resampler_t null_resampler = {
|
||||
resampler_null_init,
|
||||
resampler_null_process,
|
||||
resampler_null_free,
|
||||
RESAMPLER_API_VERSION,
|
||||
"null",
|
||||
"null"
|
||||
};
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "configuration.h"
|
||||
#include "msg_hash.h"
|
||||
#include "runloop.h"
|
||||
#include "libretro_version_1.h"
|
||||
#include "verbosity.h"
|
||||
|
||||
/* Autosave support. */
|
||||
@@ -251,15 +252,20 @@ void autosave_event_init(void)
|
||||
|
||||
for (i = 0; i < global->savefiles->size; i++)
|
||||
{
|
||||
retro_ctx_memory_info_t mem_info;
|
||||
const char *path = global->savefiles->elems[i].data;
|
||||
unsigned type = global->savefiles->elems[i].attr.i;
|
||||
|
||||
if (core.retro_get_memory_size(type) <= 0)
|
||||
mem_info.id = type;
|
||||
|
||||
core_ctl(CORE_CTL_RETRO_GET_MEMORY, &mem_info);
|
||||
|
||||
if (mem_info.size <= 0)
|
||||
continue;
|
||||
|
||||
autosave_state.list[i] = autosave_new(path,
|
||||
core.retro_get_memory_data(type),
|
||||
core.retro_get_memory_size(type),
|
||||
mem_info.data,
|
||||
mem_info.size,
|
||||
settings->autosave_interval);
|
||||
|
||||
if (!autosave_state.list[i])
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "camera_driver.h"
|
||||
|
||||
#include "../general.h"
|
||||
#include "../string_list_special.h"
|
||||
#include "../system.h"
|
||||
#include "../verbosity.h"
|
||||
|
||||
static const camera_driver_t *camera_drivers[] = {
|
||||
@@ -41,9 +41,6 @@ static const camera_driver_t *camera_drivers[] = {
|
||||
NULL,
|
||||
};
|
||||
|
||||
static const camera_driver_t *camera_driver;
|
||||
static void *camera_data;
|
||||
|
||||
/**
|
||||
* camera_driver_find_handle:
|
||||
* @idx : index of driver to get handle to.
|
||||
@@ -88,138 +85,22 @@ const char* config_get_camera_driver_options(void)
|
||||
return char_list_new_special(STRING_LIST_CAMERA_DRIVERS, NULL);
|
||||
}
|
||||
|
||||
void find_camera_driver(void)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
int i = find_driver_index("camera_driver", settings->camera.driver);
|
||||
|
||||
if (i >= 0)
|
||||
camera_driver = (const camera_driver_t*)camera_driver_find_handle(i);
|
||||
else
|
||||
{
|
||||
unsigned d;
|
||||
RARCH_ERR("Couldn't find any camera driver named \"%s\"\n",
|
||||
settings->camera.driver);
|
||||
RARCH_LOG_OUTPUT("Available camera drivers are:\n");
|
||||
for (d = 0; camera_driver_find_handle(d); d++)
|
||||
RARCH_LOG_OUTPUT("\t%s\n", camera_driver_find_ident(d));
|
||||
|
||||
RARCH_WARN("Going to default to first camera driver...\n");
|
||||
|
||||
camera_driver = (const camera_driver_t*)camera_driver_find_handle(0);
|
||||
|
||||
if (!camera_driver)
|
||||
retro_fail(1, "find_camera_driver()");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* driver_camera_start:
|
||||
*
|
||||
* Starts camera driver interface.
|
||||
* Used by RETRO_ENVIRONMENT_GET_CAMERA_INTERFACE.
|
||||
*
|
||||
* Returns: true (1) if successful, otherwise false (0).
|
||||
**/
|
||||
bool driver_camera_start(void)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
if (camera_driver && camera_data && camera_driver->start)
|
||||
{
|
||||
if (settings->camera.allow)
|
||||
return camera_driver->start(camera_data);
|
||||
|
||||
runloop_msg_queue_push(
|
||||
"Camera is explicitly disabled.\n", 1, 180, false);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* driver_camera_stop:
|
||||
*
|
||||
* Stops camera driver.
|
||||
* Used by RETRO_ENVIRONMENT_GET_CAMERA_INTERFACE.
|
||||
*
|
||||
* Returns: true (1) if successful, otherwise false (0).
|
||||
**/
|
||||
void driver_camera_stop(void)
|
||||
{
|
||||
if (camera_driver && camera_driver->stop && camera_data)
|
||||
camera_driver->stop(camera_data);
|
||||
camera_driver_ctl(RARCH_CAMERA_CTL_START, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* driver_camera_poll:
|
||||
*
|
||||
* Call camera driver's poll function.
|
||||
* Used by RETRO_ENVIRONMENT_GET_CAMERA_INTERFACE.
|
||||
*
|
||||
* Returns: true (1) if successful, otherwise false (0).
|
||||
**/
|
||||
void driver_camera_poll(void)
|
||||
bool driver_camera_start(void)
|
||||
{
|
||||
rarch_system_info_t *system = NULL;
|
||||
|
||||
runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &system);
|
||||
|
||||
if (camera_driver && camera_driver->poll && camera_data)
|
||||
camera_driver->poll(camera_data,
|
||||
system->camera_callback.frame_raw_framebuffer,
|
||||
system->camera_callback.frame_opengl_texture);
|
||||
}
|
||||
|
||||
void init_camera(void)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
rarch_system_info_t *system = NULL;
|
||||
|
||||
runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &system);
|
||||
|
||||
/* Resource leaks will follow if camera is initialized twice. */
|
||||
if (camera_data)
|
||||
return;
|
||||
|
||||
find_camera_driver();
|
||||
|
||||
camera_data = camera_driver->init(
|
||||
*settings->camera.device ? settings->camera.device : NULL,
|
||||
system->camera_callback.caps,
|
||||
settings->camera.width ?
|
||||
settings->camera.width : system->camera_callback.width,
|
||||
settings->camera.height ?
|
||||
settings->camera.height : system->camera_callback.height);
|
||||
|
||||
if (!camera_data)
|
||||
{
|
||||
RARCH_ERR("Failed to initialize camera driver. Will continue without camera.\n");
|
||||
camera_driver_ctl(RARCH_CAMERA_CTL_UNSET_ACTIVE, NULL);
|
||||
}
|
||||
|
||||
if (system->camera_callback.initialized)
|
||||
system->camera_callback.initialized();
|
||||
}
|
||||
|
||||
static void uninit_camera(void)
|
||||
{
|
||||
rarch_system_info_t *system = NULL;
|
||||
runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &system);
|
||||
|
||||
if (camera_data && camera_driver)
|
||||
{
|
||||
if (system->camera_callback.deinitialized)
|
||||
system->camera_callback.deinitialized();
|
||||
|
||||
if (camera_driver->free)
|
||||
camera_driver->free(camera_data);
|
||||
}
|
||||
|
||||
camera_data = NULL;
|
||||
return camera_driver_ctl(RARCH_CAMERA_CTL_START, NULL);
|
||||
}
|
||||
|
||||
bool camera_driver_ctl(enum rarch_camera_ctl_state state, void *data)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
static struct retro_camera_callback camera_cb;
|
||||
static const camera_driver_t *camera_driver = NULL;
|
||||
static void *camera_data = NULL;
|
||||
static bool camera_driver_active = false;
|
||||
static bool camera_driver_data_own = false;
|
||||
|
||||
@@ -229,6 +110,7 @@ bool camera_driver_ctl(enum rarch_camera_ctl_state state, void *data)
|
||||
camera_driver_active = false;
|
||||
camera_driver_data_own = false;
|
||||
camera_driver = NULL;
|
||||
camera_data = NULL;
|
||||
break;
|
||||
case RARCH_CAMERA_CTL_SET_OWN_DRIVER:
|
||||
camera_driver_data_own = true;
|
||||
@@ -241,13 +123,110 @@ bool camera_driver_ctl(enum rarch_camera_ctl_state state, void *data)
|
||||
case RARCH_CAMERA_CTL_SET_ACTIVE:
|
||||
camera_driver_active = true;
|
||||
break;
|
||||
case RARCH_CAMERA_CTL_FIND_DRIVER:
|
||||
{
|
||||
int i;
|
||||
driver_ctx_info_t drv;
|
||||
|
||||
drv.label = "camera_driver";
|
||||
drv.s = settings->camera.driver;
|
||||
|
||||
driver_ctl(RARCH_DRIVER_CTL_FIND_INDEX, &drv);
|
||||
|
||||
i = drv.len;
|
||||
|
||||
if (i >= 0)
|
||||
camera_driver = (const camera_driver_t*)camera_driver_find_handle(i);
|
||||
else
|
||||
{
|
||||
unsigned d;
|
||||
RARCH_ERR("Couldn't find any camera driver named \"%s\"\n",
|
||||
settings->camera.driver);
|
||||
RARCH_LOG_OUTPUT("Available camera drivers are:\n");
|
||||
for (d = 0; camera_driver_find_handle(d); d++)
|
||||
RARCH_LOG_OUTPUT("\t%s\n", camera_driver_find_ident(d));
|
||||
|
||||
RARCH_WARN("Going to default to first camera driver...\n");
|
||||
|
||||
camera_driver = (const camera_driver_t*)camera_driver_find_handle(0);
|
||||
|
||||
if (!camera_driver)
|
||||
retro_fail(1, "find_camera_driver()");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case RARCH_CAMERA_CTL_UNSET_ACTIVE:
|
||||
camera_driver_active = false;
|
||||
break;
|
||||
case RARCH_CAMERA_CTL_IS_ACTIVE:
|
||||
return camera_driver_active;
|
||||
case RARCH_CAMERA_CTL_DEINIT:
|
||||
uninit_camera();
|
||||
if (camera_data && camera_driver)
|
||||
{
|
||||
if (camera_cb.deinitialized)
|
||||
camera_cb.deinitialized();
|
||||
|
||||
if (camera_driver->free)
|
||||
camera_driver->free(camera_data);
|
||||
}
|
||||
|
||||
camera_data = NULL;
|
||||
break;
|
||||
case RARCH_CAMERA_CTL_STOP:
|
||||
if ( camera_driver
|
||||
&& camera_driver->stop
|
||||
&& camera_data)
|
||||
camera_driver->stop(camera_data);
|
||||
break;
|
||||
case RARCH_CAMERA_CTL_START:
|
||||
if (camera_driver && camera_data && camera_driver->start)
|
||||
{
|
||||
if (settings->camera.allow)
|
||||
return camera_driver->start(camera_data);
|
||||
|
||||
runloop_msg_queue_push(
|
||||
"Camera is explicitly disabled.\n", 1, 180, false);
|
||||
}
|
||||
return false;
|
||||
case RARCH_CAMERA_CTL_POLL:
|
||||
if (!camera_cb.caps)
|
||||
return false;
|
||||
if (!camera_driver || !camera_driver->poll || !camera_data)
|
||||
return false;
|
||||
camera_driver->poll(camera_data,
|
||||
camera_cb.frame_raw_framebuffer,
|
||||
camera_cb.frame_opengl_texture);
|
||||
break;
|
||||
case RARCH_CAMERA_CTL_SET_CB:
|
||||
{
|
||||
struct retro_camera_callback *cb =
|
||||
(struct retro_camera_callback*)data;
|
||||
camera_cb = *cb;
|
||||
}
|
||||
break;
|
||||
case RARCH_CAMERA_CTL_INIT:
|
||||
/* Resource leaks will follow if camera is initialized twice. */
|
||||
if (camera_data)
|
||||
return false;
|
||||
|
||||
camera_driver_ctl(RARCH_CAMERA_CTL_FIND_DRIVER, NULL);
|
||||
|
||||
camera_data = camera_driver->init(
|
||||
*settings->camera.device ? settings->camera.device : NULL,
|
||||
camera_cb.caps,
|
||||
settings->camera.width ?
|
||||
settings->camera.width : camera_cb.width,
|
||||
settings->camera.height ?
|
||||
settings->camera.height : camera_cb.height);
|
||||
|
||||
if (!camera_data)
|
||||
{
|
||||
RARCH_ERR("Failed to initialize camera driver. Will continue without camera.\n");
|
||||
camera_driver_ctl(RARCH_CAMERA_CTL_UNSET_ACTIVE, NULL);
|
||||
}
|
||||
|
||||
if (camera_cb.initialized)
|
||||
camera_cb.initialized();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -35,7 +35,13 @@ enum rarch_camera_ctl_state
|
||||
RARCH_CAMERA_CTL_OWNS_DRIVER,
|
||||
RARCH_CAMERA_CTL_SET_ACTIVE,
|
||||
RARCH_CAMERA_CTL_UNSET_ACTIVE,
|
||||
RARCH_CAMERA_CTL_IS_ACTIVE
|
||||
RARCH_CAMERA_CTL_IS_ACTIVE,
|
||||
RARCH_CAMERA_CTL_FIND_DRIVER,
|
||||
RARCH_CAMERA_CTL_POLL,
|
||||
RARCH_CAMERA_CTL_SET_CB,
|
||||
RARCH_CAMERA_CTL_STOP,
|
||||
RARCH_CAMERA_CTL_START,
|
||||
RARCH_CAMERA_CTL_INIT
|
||||
};
|
||||
|
||||
typedef struct camera_driver
|
||||
@@ -66,36 +72,6 @@ extern camera_driver_t camera_rwebcam;
|
||||
extern camera_driver_t camera_avfoundation;
|
||||
extern camera_driver_t camera_null;
|
||||
|
||||
/**
|
||||
* driver_camera_start:
|
||||
*
|
||||
* Starts camera driver.
|
||||
* Used by RETRO_ENVIRONMENT_GET_CAMERA_INTERFACE.
|
||||
*
|
||||
* Returns: true (1) if successful, otherwise false (0).
|
||||
**/
|
||||
bool driver_camera_start(void);
|
||||
|
||||
/**
|
||||
* driver_camera_stop:
|
||||
*
|
||||
* Stops camera driver.
|
||||
* Used by RETRO_ENVIRONMENT_GET_CAMERA_INTERFACE.
|
||||
*
|
||||
* Returns: true (1) if successful, otherwise false (0).
|
||||
**/
|
||||
void driver_camera_stop(void);
|
||||
|
||||
/**
|
||||
* driver_camera_poll:
|
||||
*
|
||||
* Call camera driver's poll function.
|
||||
* Used by RETRO_ENVIRONMENT_GET_CAMERA_INTERFACE.
|
||||
*
|
||||
* Returns: true (1) if successful, otherwise false (0).
|
||||
**/
|
||||
void driver_camera_poll(void);
|
||||
|
||||
/**
|
||||
* config_get_camera_driver_options:
|
||||
*
|
||||
@@ -125,9 +101,9 @@ const void *camera_driver_find_handle(int index);
|
||||
**/
|
||||
const char *camera_driver_find_ident(int index);
|
||||
|
||||
void find_camera_driver(void);
|
||||
void driver_camera_stop(void);
|
||||
|
||||
void init_camera(void);
|
||||
bool driver_camera_start(void);
|
||||
|
||||
bool camera_driver_ctl(enum rarch_camera_ctl_state state, void *data);
|
||||
|
||||
|
||||
@@ -210,9 +210,9 @@ static bool init_device(void *data)
|
||||
}
|
||||
|
||||
/* VIDIOC_S_FMT may change width, height and pitch. */
|
||||
v4l->width = fmt.fmt.pix.width;
|
||||
v4l->width = fmt.fmt.pix.width;
|
||||
v4l->height = fmt.fmt.pix.height;
|
||||
v4l->pitch = max(fmt.fmt.pix.bytesperline, v4l->width * 2);
|
||||
v4l->pitch = MAX(fmt.fmt.pix.bytesperline, v4l->width * 2);
|
||||
|
||||
/* Sanity check to see if our assumptions are met.
|
||||
* It is possible to support whatever the device gives us,
|
||||
|
||||
@@ -24,9 +24,9 @@
|
||||
#include <compat/posix_string.h>
|
||||
|
||||
#include "cheats.h"
|
||||
#include "general.h"
|
||||
#include "runloop.h"
|
||||
#include "dynamic.h"
|
||||
#include "libretro_version_1.h"
|
||||
#include "verbosity.h"
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@@ -72,22 +72,34 @@ unsigned cheat_manager_get_size(void)
|
||||
|
||||
void cheat_manager_apply_cheats(void)
|
||||
{
|
||||
#ifdef HAVE_CHEEVOS
|
||||
bool data_bool = false;
|
||||
#endif
|
||||
unsigned i, idx = 0;
|
||||
cheat_manager_t *handle = cheat_manager_state;
|
||||
|
||||
if (!handle)
|
||||
return;
|
||||
|
||||
core.retro_cheat_reset();
|
||||
core_ctl(CORE_CTL_RETRO_CHEAT_RESET, NULL);
|
||||
|
||||
for (i = 0; i < handle->size; i++)
|
||||
{
|
||||
if (handle->cheats[i].state)
|
||||
core.retro_cheat_set(idx++, true, handle->cheats[i].code);
|
||||
{
|
||||
retro_ctx_cheat_info_t cheat_info;
|
||||
|
||||
cheat_info.index = idx++;
|
||||
cheat_info.enabled = true;
|
||||
cheat_info.code = handle->cheats[i].code;
|
||||
|
||||
core_ctl(CORE_CTL_RETRO_CHEAT_SET, &cheat_info);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_CHEEVOS
|
||||
cheevos_apply_cheats(idx != 0);
|
||||
data_bool = idx != 0;
|
||||
cheevos_ctl(CHEEVOS_CTL_APPLY_CHEATS, &data_bool);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -19,20 +19,36 @@
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int cheevos_load(const void *data);
|
||||
enum cheevos_ctl_state
|
||||
{
|
||||
CHEEVOS_CTL_NONE = 0,
|
||||
CHEEVOS_CTL_TEST,
|
||||
CHEEVOS_CTL_LOAD,
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
void cheevos_populate_menu(void *data);
|
||||
#endif
|
||||
CHEEVOS_CTL_APPLY_CHEATS,
|
||||
|
||||
void cheevos_get_description(unsigned cheevo_ndx, char *str, size_t len);
|
||||
/* Unload the achievements from memory. */
|
||||
CHEEVOS_CTL_UNLOAD,
|
||||
|
||||
void cheevos_set_cheats(void);
|
||||
/* Toggle Hardcore Mode */
|
||||
CHEEVOS_CTL_TOGGLE_HARDCORE_MODE,
|
||||
|
||||
void cheevos_apply_cheats(bool enable);
|
||||
/* Load the achievements into memory if
|
||||
* the game has content. */
|
||||
CHEEVOS_CTL_SET_CHEATS,
|
||||
|
||||
void cheevos_test(void);
|
||||
CHEEVOS_CTL_GET_DESCRIPTION,
|
||||
|
||||
void cheevos_unload(void);
|
||||
CHEEVOS_CTL_POPULATE_MENU
|
||||
};
|
||||
|
||||
typedef struct cheevos_ctx_desc
|
||||
{
|
||||
unsigned idx;
|
||||
char *s;
|
||||
size_t len;
|
||||
} cheevos_ctx_desc_t;
|
||||
|
||||
bool cheevos_ctl(enum cheevos_ctl_state state, void *data);
|
||||
|
||||
#endif /* __RARCH_CHEEVOS_H */
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <compat/posix_string.h>
|
||||
#include <file/file_path.h>
|
||||
#include <net/net_compat.h>
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include "msg_hash.h"
|
||||
|
||||
@@ -35,7 +36,14 @@
|
||||
#include "verbosity.h"
|
||||
|
||||
#define DEFAULT_NETWORK_CMD_PORT 55355
|
||||
#define STDIN_BUF_SIZE 4096
|
||||
#define STDIN_BUF_SIZE 4096
|
||||
|
||||
#define COMMAND_EXT_GLSL 0x7c976537U
|
||||
#define COMMAND_EXT_GLSLP 0x0f840c87U
|
||||
#define COMMAND_EXT_CG 0x0059776fU
|
||||
#define COMMAND_EXT_CGP 0x0b8865bfU
|
||||
#define COMMAND_EXT_SLANG 0x105ce63aU
|
||||
#define COMMAND_EXT_SLANGP 0x1bf9adeaU
|
||||
|
||||
struct rarch_cmd
|
||||
{
|
||||
@@ -52,6 +60,65 @@ struct rarch_cmd
|
||||
bool state[RARCH_BIND_LIST_END];
|
||||
};
|
||||
|
||||
struct cmd_map
|
||||
{
|
||||
const char *str;
|
||||
unsigned id;
|
||||
};
|
||||
|
||||
struct cmd_action_map
|
||||
{
|
||||
const char *str;
|
||||
bool (*action)(const char *arg);
|
||||
const char *arg_desc;
|
||||
};
|
||||
|
||||
static bool cmd_set_shader(const char *arg);
|
||||
|
||||
static const struct cmd_action_map action_map[] = {
|
||||
{ "SET_SHADER", cmd_set_shader, "<shader path>" },
|
||||
};
|
||||
|
||||
static const struct cmd_map map[] = {
|
||||
{ "FAST_FORWARD", RARCH_FAST_FORWARD_KEY },
|
||||
{ "FAST_FORWARD_HOLD", RARCH_FAST_FORWARD_HOLD_KEY },
|
||||
{ "LOAD_STATE", RARCH_LOAD_STATE_KEY },
|
||||
{ "SAVE_STATE", RARCH_SAVE_STATE_KEY },
|
||||
{ "FULLSCREEN_TOGGLE", RARCH_FULLSCREEN_TOGGLE_KEY },
|
||||
{ "QUIT", RARCH_QUIT_KEY },
|
||||
{ "STATE_SLOT_PLUS", RARCH_STATE_SLOT_PLUS },
|
||||
{ "STATE_SLOT_MINUS", RARCH_STATE_SLOT_MINUS },
|
||||
{ "REWIND", RARCH_REWIND },
|
||||
{ "MOVIE_RECORD_TOGGLE", RARCH_MOVIE_RECORD_TOGGLE },
|
||||
{ "PAUSE_TOGGLE", RARCH_PAUSE_TOGGLE },
|
||||
{ "FRAMEADVANCE", RARCH_FRAMEADVANCE },
|
||||
{ "RESET", RARCH_RESET },
|
||||
{ "SHADER_NEXT", RARCH_SHADER_NEXT },
|
||||
{ "SHADER_PREV", RARCH_SHADER_PREV },
|
||||
{ "CHEAT_INDEX_PLUS", RARCH_CHEAT_INDEX_PLUS },
|
||||
{ "CHEAT_INDEX_MINUS", RARCH_CHEAT_INDEX_MINUS },
|
||||
{ "CHEAT_TOGGLE", RARCH_CHEAT_TOGGLE },
|
||||
{ "SCREENSHOT", RARCH_SCREENSHOT },
|
||||
{ "MUTE", RARCH_MUTE },
|
||||
{ "OSK", RARCH_OSK },
|
||||
{ "NETPLAY_FLIP", RARCH_NETPLAY_FLIP },
|
||||
{ "SLOWMOTION", RARCH_SLOWMOTION },
|
||||
{ "VOLUME_UP", RARCH_VOLUME_UP },
|
||||
{ "VOLUME_DOWN", RARCH_VOLUME_DOWN },
|
||||
{ "OVERLAY_NEXT", RARCH_OVERLAY_NEXT },
|
||||
{ "DISK_EJECT_TOGGLE", RARCH_DISK_EJECT_TOGGLE },
|
||||
{ "DISK_NEXT", RARCH_DISK_NEXT },
|
||||
{ "DISK_PREV", RARCH_DISK_PREV },
|
||||
{ "GRAB_MOUSE_TOGGLE", RARCH_GRAB_MOUSE_TOGGLE },
|
||||
{ "MENU_TOGGLE", RARCH_MENU_TOGGLE },
|
||||
{ "MENU_UP", RETRO_DEVICE_ID_JOYPAD_UP },
|
||||
{ "MENU_DOWN", RETRO_DEVICE_ID_JOYPAD_DOWN },
|
||||
{ "MENU_LEFT", RETRO_DEVICE_ID_JOYPAD_LEFT },
|
||||
{ "MENU_RIGHT", RETRO_DEVICE_ID_JOYPAD_RIGHT },
|
||||
{ "MENU_A", RETRO_DEVICE_ID_JOYPAD_A },
|
||||
{ "MENU_B", RETRO_DEVICE_ID_JOYPAD_B },
|
||||
};
|
||||
|
||||
#if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY)
|
||||
static bool cmd_init_network(rarch_cmd_t *handle, uint16_t port)
|
||||
{
|
||||
@@ -147,79 +214,11 @@ rarch_cmd_t *rarch_cmd_new(bool stdin_enable,
|
||||
|
||||
#if (defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY)) || defined(HAVE_STDIN_CMD)
|
||||
error:
|
||||
rarch_cmd_free(handle);
|
||||
rarch_cmd_ctl(RARCH_CMD_CTL_FREE, handle);
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
void rarch_cmd_free(rarch_cmd_t *handle)
|
||||
{
|
||||
#if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY)
|
||||
if (handle && handle->net_fd >= 0)
|
||||
socket_close(handle->net_fd);
|
||||
#endif
|
||||
|
||||
free(handle);
|
||||
}
|
||||
|
||||
struct cmd_map
|
||||
{
|
||||
const char *str;
|
||||
unsigned id;
|
||||
};
|
||||
|
||||
struct cmd_action_map
|
||||
{
|
||||
const char *str;
|
||||
bool (*action)(const char *arg);
|
||||
const char *arg_desc;
|
||||
};
|
||||
|
||||
static const struct cmd_map map[] = {
|
||||
{ "FAST_FORWARD", RARCH_FAST_FORWARD_KEY },
|
||||
{ "FAST_FORWARD_HOLD", RARCH_FAST_FORWARD_HOLD_KEY },
|
||||
{ "LOAD_STATE", RARCH_LOAD_STATE_KEY },
|
||||
{ "SAVE_STATE", RARCH_SAVE_STATE_KEY },
|
||||
{ "FULLSCREEN_TOGGLE", RARCH_FULLSCREEN_TOGGLE_KEY },
|
||||
{ "QUIT", RARCH_QUIT_KEY },
|
||||
{ "STATE_SLOT_PLUS", RARCH_STATE_SLOT_PLUS },
|
||||
{ "STATE_SLOT_MINUS", RARCH_STATE_SLOT_MINUS },
|
||||
{ "REWIND", RARCH_REWIND },
|
||||
{ "MOVIE_RECORD_TOGGLE", RARCH_MOVIE_RECORD_TOGGLE },
|
||||
{ "PAUSE_TOGGLE", RARCH_PAUSE_TOGGLE },
|
||||
{ "FRAMEADVANCE", RARCH_FRAMEADVANCE },
|
||||
{ "RESET", RARCH_RESET },
|
||||
{ "SHADER_NEXT", RARCH_SHADER_NEXT },
|
||||
{ "SHADER_PREV", RARCH_SHADER_PREV },
|
||||
{ "CHEAT_INDEX_PLUS", RARCH_CHEAT_INDEX_PLUS },
|
||||
{ "CHEAT_INDEX_MINUS", RARCH_CHEAT_INDEX_MINUS },
|
||||
{ "CHEAT_TOGGLE", RARCH_CHEAT_TOGGLE },
|
||||
{ "SCREENSHOT", RARCH_SCREENSHOT },
|
||||
{ "MUTE", RARCH_MUTE },
|
||||
{ "OSK", RARCH_OSK },
|
||||
{ "NETPLAY_FLIP", RARCH_NETPLAY_FLIP },
|
||||
{ "SLOWMOTION", RARCH_SLOWMOTION },
|
||||
{ "VOLUME_UP", RARCH_VOLUME_UP },
|
||||
{ "VOLUME_DOWN", RARCH_VOLUME_DOWN },
|
||||
{ "OVERLAY_NEXT", RARCH_OVERLAY_NEXT },
|
||||
{ "DISK_EJECT_TOGGLE", RARCH_DISK_EJECT_TOGGLE },
|
||||
{ "DISK_NEXT", RARCH_DISK_NEXT },
|
||||
{ "DISK_PREV", RARCH_DISK_PREV },
|
||||
{ "GRAB_MOUSE_TOGGLE", RARCH_GRAB_MOUSE_TOGGLE },
|
||||
{ "MENU_TOGGLE", RARCH_MENU_TOGGLE },
|
||||
{ "MENU_UP", RETRO_DEVICE_ID_JOYPAD_UP },
|
||||
{ "MENU_DOWN", RETRO_DEVICE_ID_JOYPAD_DOWN },
|
||||
{ "MENU_LEFT", RETRO_DEVICE_ID_JOYPAD_LEFT },
|
||||
{ "MENU_RIGHT", RETRO_DEVICE_ID_JOYPAD_RIGHT },
|
||||
{ "MENU_A", RETRO_DEVICE_ID_JOYPAD_A },
|
||||
{ "MENU_B", RETRO_DEVICE_ID_JOYPAD_B },
|
||||
};
|
||||
|
||||
#define COMMAND_EXT_GLSL 0x7c976537U
|
||||
#define COMMAND_EXT_GLSLP 0x0f840c87U
|
||||
#define COMMAND_EXT_CG 0x0059776fU
|
||||
#define COMMAND_EXT_CGP 0x0b8865bfU
|
||||
|
||||
static bool cmd_set_shader(const char *arg)
|
||||
{
|
||||
char msg[256];
|
||||
@@ -237,6 +236,10 @@ static bool cmd_set_shader(const char *arg)
|
||||
case COMMAND_EXT_CGP:
|
||||
type = RARCH_SHADER_CG;
|
||||
break;
|
||||
case COMMAND_EXT_SLANG:
|
||||
case COMMAND_EXT_SLANGP:
|
||||
type = RARCH_SHADER_SLANG;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -250,10 +253,6 @@ static bool cmd_set_shader(const char *arg)
|
||||
return video_driver_set_shader(type, arg);
|
||||
}
|
||||
|
||||
static const struct cmd_action_map action_map[] = {
|
||||
{ "SET_SHADER", cmd_set_shader, "<shader path>" },
|
||||
};
|
||||
|
||||
static bool command_get_arg(const char *tok,
|
||||
const char **arg, unsigned *index)
|
||||
{
|
||||
@@ -261,7 +260,7 @@ static bool command_get_arg(const char *tok,
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(map); i++)
|
||||
{
|
||||
if (!strcmp(tok, map[i].str))
|
||||
if (string_is_equal(tok, map[i].str))
|
||||
{
|
||||
if (arg)
|
||||
*arg = NULL;
|
||||
@@ -319,7 +318,7 @@ static void parse_sub_msg(rarch_cmd_t *handle, const char *tok)
|
||||
|
||||
static void parse_msg(rarch_cmd_t *handle, char *buf)
|
||||
{
|
||||
char *save = NULL;
|
||||
char *save = NULL;
|
||||
const char *tok = strtok_r(buf, "\n", &save);
|
||||
|
||||
while (tok)
|
||||
@@ -329,17 +328,6 @@ static void parse_msg(rarch_cmd_t *handle, char *buf)
|
||||
}
|
||||
}
|
||||
|
||||
void rarch_cmd_set(rarch_cmd_t *handle, unsigned id)
|
||||
{
|
||||
if (id < RARCH_BIND_LIST_END)
|
||||
handle->state[id] = true;
|
||||
}
|
||||
|
||||
bool rarch_cmd_get(rarch_cmd_t *handle, unsigned id)
|
||||
{
|
||||
return id < RARCH_BIND_LIST_END && handle->state[id];
|
||||
}
|
||||
|
||||
#if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY)
|
||||
static void network_cmd_poll(rarch_cmd_t *handle)
|
||||
{
|
||||
@@ -380,9 +368,9 @@ static size_t read_stdin(char *buf, size_t size)
|
||||
{
|
||||
DWORD i;
|
||||
DWORD has_read = 0;
|
||||
DWORD avail = 0;
|
||||
bool echo = false;
|
||||
HANDLE hnd = GetStdHandle(STD_INPUT_HANDLE);
|
||||
DWORD avail = 0;
|
||||
bool echo = false;
|
||||
HANDLE hnd = GetStdHandle(STD_INPUT_HANDLE);
|
||||
|
||||
if (hnd == INVALID_HANDLE_VALUE)
|
||||
return 0;
|
||||
@@ -523,19 +511,6 @@ static void stdin_cmd_poll(rarch_cmd_t *handle)
|
||||
}
|
||||
#endif
|
||||
|
||||
void rarch_cmd_poll(rarch_cmd_t *handle)
|
||||
{
|
||||
memset(handle->state, 0, sizeof(handle->state));
|
||||
|
||||
#if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY)
|
||||
network_cmd_poll(handle);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDIN_CMD
|
||||
stdin_cmd_poll(handle);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY)
|
||||
static bool send_udp_packet(const char *host,
|
||||
uint16_t port, const char *msg)
|
||||
@@ -611,7 +586,7 @@ static bool verify_command(const char *cmd)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool network_cmd_send(const char *cmd_)
|
||||
static bool network_cmd_send(const char *cmd_)
|
||||
{
|
||||
bool ret;
|
||||
char *command = NULL;
|
||||
@@ -655,3 +630,62 @@ bool network_cmd_send(const char *cmd_)
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool rarch_cmd_ctl(enum rarch_cmd_ctl_state state, void *data)
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
case RARCH_CMD_CTL_NETWORK_SEND:
|
||||
#if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY)
|
||||
network_cmd_send((const char*)data);
|
||||
#endif
|
||||
break;
|
||||
case RARCH_CMD_CTL_POLL:
|
||||
{
|
||||
rarch_cmd_t *handle = (rarch_cmd_t*)data;
|
||||
memset(handle->state, 0, sizeof(handle->state));
|
||||
|
||||
#if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY)
|
||||
network_cmd_poll(handle);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDIN_CMD
|
||||
stdin_cmd_poll(handle);
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
case RARCH_CMD_CTL_SET:
|
||||
{
|
||||
rarch_cmd_handle_t *handle = (rarch_cmd_handle_t*)data;
|
||||
if (!handle || !handle->handle)
|
||||
return false;
|
||||
if (handle->id < RARCH_BIND_LIST_END)
|
||||
handle->handle->state[handle->id] = true;
|
||||
}
|
||||
break;
|
||||
case RARCH_CMD_CTL_GET:
|
||||
{
|
||||
rarch_cmd_handle_t *handle = (rarch_cmd_handle_t*)data;
|
||||
if (!handle || !handle->handle)
|
||||
return false;
|
||||
return handle->id < RARCH_BIND_LIST_END
|
||||
&& handle->handle->state[handle->id];
|
||||
}
|
||||
case RARCH_CMD_CTL_FREE:
|
||||
{
|
||||
rarch_cmd_t *handle = (rarch_cmd_t*)data;
|
||||
#if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY)
|
||||
if (handle && handle->net_fd >= 0)
|
||||
socket_close(handle->net_fd);
|
||||
#endif
|
||||
|
||||
free(handle);
|
||||
}
|
||||
break;
|
||||
case RARCH_CMD_CTL_NONE:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -28,22 +28,28 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum rarch_cmd_ctl_state
|
||||
{
|
||||
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
|
||||
};
|
||||
|
||||
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);
|
||||
|
||||
void rarch_cmd_free(rarch_cmd_t *handle);
|
||||
|
||||
void rarch_cmd_poll(rarch_cmd_t *handle);
|
||||
|
||||
void rarch_cmd_set(rarch_cmd_t *handle, unsigned id);
|
||||
|
||||
bool rarch_cmd_get(rarch_cmd_t *handle, unsigned id);
|
||||
|
||||
#if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY)
|
||||
bool network_cmd_send(const char *cmd);
|
||||
#endif
|
||||
bool rarch_cmd_ctl(enum rarch_cmd_ctl_state state, void *data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -52,6 +52,8 @@ enum event_command
|
||||
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. */
|
||||
@@ -120,6 +122,8 @@ enum event_command
|
||||
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. */
|
||||
@@ -176,10 +180,6 @@ enum event_command
|
||||
EVENT_CMD_REMOTE_INIT,
|
||||
/* Deinitializes remote gamepad interface. */
|
||||
EVENT_CMD_REMOTE_DEINIT,
|
||||
/* Deinitializes drivers. */
|
||||
EVENT_CMD_DRIVERS_DEINIT,
|
||||
/* Initializes drivers. */
|
||||
EVENT_CMD_DRIVERS_INIT,
|
||||
/* Reinitializes audio driver. */
|
||||
EVENT_CMD_AUDIO_REINIT,
|
||||
/* Resizes windowed scale. Will reinitialize video driver. */
|
||||
@@ -194,6 +194,8 @@ enum event_command
|
||||
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. */
|
||||
@@ -201,20 +203,11 @@ enum event_command
|
||||
/* Toggles fullscreen mode. */
|
||||
EVENT_CMD_FULLSCREEN_TOGGLE,
|
||||
EVENT_CMD_PERFCNT_REPORT_FRONTEND_LOG,
|
||||
EVENT_CMD_REMAPPING_INIT,
|
||||
EVENT_CMD_REMAPPING_DEINIT,
|
||||
EVENT_CMD_VOLUME_UP,
|
||||
EVENT_CMD_VOLUME_DOWN
|
||||
EVENT_CMD_VOLUME_DOWN,
|
||||
EVENT_CMD_EXEC
|
||||
};
|
||||
|
||||
/**
|
||||
* event_disk_control_append_image:
|
||||
* @path : Path to disk image.
|
||||
*
|
||||
* Appends disk image to disk image list.
|
||||
**/
|
||||
void event_disk_control_append_image(const char *path);
|
||||
|
||||
/**
|
||||
* event_command:
|
||||
* @cmd : Command index.
|
||||
@@ -223,7 +216,7 @@ void event_disk_control_append_image(const char *path);
|
||||
*
|
||||
* Returns: true (1) on success, otherwise false (0).
|
||||
**/
|
||||
bool event_command(enum event_command action);
|
||||
bool event_cmd_ctl(enum event_command action, void *data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
enum
|
||||
{
|
||||
VIDEO_GL = 0,
|
||||
VIDEO_VULKAN,
|
||||
VIDEO_XVIDEO,
|
||||
VIDEO_SDL,
|
||||
VIDEO_SDL2,
|
||||
@@ -508,6 +509,9 @@ static const bool overlay_hide_in_menu = true;
|
||||
#ifdef HAVE_MENU
|
||||
static bool default_block_config_read = true;
|
||||
|
||||
static unsigned xmb_scale_factor = 100;
|
||||
static unsigned xmb_alpha_factor = 75;
|
||||
|
||||
static bool show_advanced_settings = true;
|
||||
static const uint32_t menu_entry_normal_color = 0xffffffff;
|
||||
static const uint32_t menu_entry_hover_color = 0xff64ff64;
|
||||
@@ -577,6 +581,9 @@ static const bool post_filter_record = false;
|
||||
/* Screenshots post-shaded GPU output if available. */
|
||||
static const bool gpu_screenshot = true;
|
||||
|
||||
/* Screenshots named automatically. */
|
||||
static const bool auto_screenshot_filename = true;
|
||||
|
||||
/* Record post-shaded GPU output instead of raw game footage if available. */
|
||||
static const bool gpu_record = false;
|
||||
|
||||
@@ -625,7 +632,12 @@ static const char *audio_device = NULL;
|
||||
|
||||
/* Desired audio latency in milliseconds. Might not be honored
|
||||
* if driver can't provide given latency. */
|
||||
#ifdef ANDROID
|
||||
/* For most Android devices, 64ms is way too low. */
|
||||
static const int out_latency = 128;
|
||||
#else
|
||||
static const int out_latency = 64;
|
||||
#endif
|
||||
|
||||
/* Will sync audio. (recommended) */
|
||||
static const bool audio_sync = true;
|
||||
@@ -751,12 +763,16 @@ static const bool input_descriptor_hide_unbound = false;
|
||||
|
||||
static const unsigned input_max_users = 5;
|
||||
|
||||
static const unsigned input_poll_type_behavior = 2;
|
||||
|
||||
#ifdef IOS
|
||||
static const bool ui_companion_start_on_boot = false;
|
||||
#else
|
||||
static const bool ui_companion_start_on_boot = true;
|
||||
#endif
|
||||
|
||||
static const bool ui_companion_enable = false;
|
||||
|
||||
#if defined(ANDROID)
|
||||
#if defined(ANDROID_ARM)
|
||||
static char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/android/latest/armeabi-v7a/";
|
||||
|
||||
@@ -74,6 +74,12 @@ static const bool _opengl_supp = true;
|
||||
static const bool _opengl_supp = false;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_VULKAN
|
||||
static const bool _vulkan_supp = true;
|
||||
#else
|
||||
static const bool _vulkan_supp = false;
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_OPENGLES) || defined(HAVE_OPENGLES2) || defined(HAVE_OPENGLES3)
|
||||
static const bool _opengles_supp = true;
|
||||
#else
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <compat/strl.h>
|
||||
#include <compat/posix_string.h>
|
||||
#include <retro_stat.h>
|
||||
#include <retro_assert.h>
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include "audio/audio_driver.h"
|
||||
@@ -35,6 +36,10 @@
|
||||
#include "system.h"
|
||||
#include "verbosity.h"
|
||||
|
||||
#ifdef HAVE_NETPLAY
|
||||
#include "netplay/netplay.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
@@ -474,6 +479,11 @@ static void config_set_defaults(void)
|
||||
if (def_menu)
|
||||
strlcpy(settings->menu.driver,
|
||||
def_menu, sizeof(settings->menu.driver));
|
||||
settings->menu.xmb_scale_factor = xmb_scale_factor;
|
||||
settings->menu.xmb_alpha_factor = xmb_alpha_factor;
|
||||
settings->menu.xmb_font[0] = '\0';
|
||||
settings->menu.throttle_framerate = true;
|
||||
settings->menu.linear_filter = true;
|
||||
#endif
|
||||
|
||||
settings->history_list_enable = def_history_list_enable;
|
||||
@@ -482,8 +492,9 @@ static void config_set_defaults(void)
|
||||
#if TARGET_OS_IPHONE
|
||||
settings->input.small_keyboard_enable = false;
|
||||
#endif
|
||||
settings->input.keyboard_gamepad_enable = true;
|
||||
settings->input.keyboard_gamepad_mapping_type = 1;
|
||||
settings->input.keyboard_gamepad_enable = true;
|
||||
settings->input.keyboard_gamepad_mapping_type = 1;
|
||||
settings->input.poll_type_behavior = 2;
|
||||
#ifdef HAVE_FFMPEG
|
||||
settings->multimedia.builtin_mediaplayer_enable = true;
|
||||
#else
|
||||
@@ -546,6 +557,7 @@ static void config_set_defaults(void)
|
||||
settings->video.post_filter_record = post_filter_record;
|
||||
settings->video.gpu_record = gpu_record;
|
||||
settings->video.gpu_screenshot = gpu_screenshot;
|
||||
settings->auto_screenshot_filename = auto_screenshot_filename;
|
||||
settings->video.rotation = ORIENTATION_NORMAL;
|
||||
|
||||
settings->audio.enable = audio_enable;
|
||||
@@ -612,6 +624,7 @@ static void config_set_defaults(void)
|
||||
#endif
|
||||
|
||||
settings->ui.companion_start_on_boot = ui_companion_start_on_boot;
|
||||
settings->ui.companion_enable = ui_companion_enable;
|
||||
settings->ui.menubar_enable = true;
|
||||
settings->ui.suspend_screensaver_enable = true;
|
||||
|
||||
@@ -621,6 +634,7 @@ static void config_set_defaults(void)
|
||||
#ifdef HAVE_CHEEVOS
|
||||
settings->cheevos.enable = false;
|
||||
settings->cheevos.test_unofficial = false;
|
||||
settings->cheevos.hardcore_mode_enable = false;
|
||||
*settings->cheevos.username = '\0';
|
||||
*settings->cheevos.password = '\0';
|
||||
#endif
|
||||
@@ -691,7 +705,7 @@ static void config_set_defaults(void)
|
||||
settings->input.libretro_device[i] = RETRO_DEVICE_JOYPAD;
|
||||
}
|
||||
|
||||
settings->core.set_supports_no_game_enable = true;
|
||||
settings->set_supports_no_game_enable = true;
|
||||
|
||||
video_driver_ctl(RARCH_DISPLAY_CTL_RESET_CUSTOM_VIEWPORT, NULL);
|
||||
|
||||
@@ -897,7 +911,7 @@ static void config_set_defaults(void)
|
||||
rarch_ctl(RARCH_CTL_SET_BLOCK_CONFIG_READ, NULL);
|
||||
else
|
||||
rarch_ctl(RARCH_CTL_UNSET_BLOCK_CONFIG_READ, NULL);
|
||||
|
||||
|
||||
first_initialized = false;
|
||||
}
|
||||
|
||||
@@ -1308,6 +1322,10 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
"threaded_data_runloop_enable");
|
||||
#endif
|
||||
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, menu.throttle_framerate,
|
||||
"menu_throttle_framerate");
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, menu.linear_filter,
|
||||
"menu_linear_filter");
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, menu.dpi.override_enable,
|
||||
"dpi_override_enable");
|
||||
CONFIG_GET_INT_BASE (conf, settings, menu.dpi.override_value,
|
||||
@@ -1342,7 +1360,7 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
&settings->menu.title_color);
|
||||
config_get_path(conf, "menu_wallpaper",
|
||||
settings->menu.wallpaper, sizeof(settings->menu.wallpaper));
|
||||
if (!strcmp(settings->menu.wallpaper, "default"))
|
||||
if (string_is_equal(settings->menu.wallpaper, "default"))
|
||||
*settings->menu.wallpaper = '\0';
|
||||
#endif
|
||||
|
||||
@@ -1356,8 +1374,8 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, video.black_frame_insertion, "video_black_frame_insertion");
|
||||
CONFIG_GET_INT_BASE(conf, settings, video.swap_interval, "video_swap_interval");
|
||||
settings->video.swap_interval = max(settings->video.swap_interval, 1);
|
||||
settings->video.swap_interval = min(settings->video.swap_interval, 4);
|
||||
settings->video.swap_interval = MAX(settings->video.swap_interval, 1);
|
||||
settings->video.swap_interval = MIN(settings->video.swap_interval, 4);
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, video.threaded, "video_threaded");
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, video.shared_context, "video_shared_context");
|
||||
#ifdef GEKKO
|
||||
@@ -1387,7 +1405,7 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, video.force_srgb_disable, "video_force_srgb_disable");
|
||||
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, core.set_supports_no_game_enable, "core_set_supports_no_game_enable");
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, set_supports_no_game_enable, "core_set_supports_no_game_enable");
|
||||
|
||||
#ifdef RARCH_CONSOLE
|
||||
/* TODO - will be refactored later to make it more clean - it's more
|
||||
@@ -1415,15 +1433,15 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, video.gpu_screenshot, "video_gpu_screenshot");
|
||||
|
||||
config_get_path(conf, "video_shader_dir", settings->video.shader_dir, sizeof(settings->video.shader_dir));
|
||||
if (!strcmp(settings->video.shader_dir, "default"))
|
||||
if (string_is_equal(settings->video.shader_dir, "default"))
|
||||
*settings->video.shader_dir = '\0';
|
||||
|
||||
config_get_path(conf, "video_filter_dir", settings->video.filter_dir, sizeof(settings->video.filter_dir));
|
||||
if (!strcmp(settings->video.filter_dir, "default"))
|
||||
if (string_is_equal(settings->video.filter_dir, "default"))
|
||||
*settings->video.filter_dir = '\0';
|
||||
|
||||
config_get_path(conf, "audio_filter_dir", settings->audio.filter_dir, sizeof(settings->audio.filter_dir));
|
||||
if (!strcmp(settings->audio.filter_dir, "default"))
|
||||
if (string_is_equal(settings->audio.filter_dir, "default"))
|
||||
*settings->audio.filter_dir = '\0';
|
||||
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, input.back_as_menu_toggle_enable, "back_as_menu_toggle_enable");
|
||||
@@ -1436,6 +1454,7 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, input.input_descriptor_hide_unbound, "input_descriptor_hide_unbound");
|
||||
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, ui.companion_start_on_boot, "ui_companion_start_on_boot");
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, ui.companion_enable, "ui_companion_enable");
|
||||
|
||||
config_get_path(conf, "core_updater_buildbot_url",
|
||||
settings->network.buildbot_url, sizeof(settings->network.buildbot_url));
|
||||
@@ -1498,6 +1517,7 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
#ifdef HAVE_CHEEVOS
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, cheevos.enable, "cheevos_enable");
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, cheevos.test_unofficial, "cheevos_test_unofficial");
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, cheevos.hardcore_mode_enable, "cheevos_hardcore_mode_enable");
|
||||
config_get_array(conf, "cheevos_username", settings->cheevos.username, sizeof(settings->cheevos.username));
|
||||
config_get_array(conf, "cheevos_password", settings->cheevos.password, sizeof(settings->cheevos.password));
|
||||
#endif
|
||||
@@ -1509,6 +1529,9 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
config_get_array(conf, "location_driver", settings->location.driver, sizeof(settings->location.driver));
|
||||
#ifdef HAVE_MENU
|
||||
config_get_array(conf, "menu_driver", settings->menu.driver, sizeof(settings->menu.driver));
|
||||
CONFIG_GET_INT_BASE(conf, settings, menu.xmb_scale_factor, "xmb_scale_factor");
|
||||
CONFIG_GET_INT_BASE(conf, settings, menu.xmb_alpha_factor, "xmb_alpha_factor");
|
||||
config_get_path(conf, "xmb_font", settings->menu.xmb_font, sizeof(settings->menu.xmb_font));
|
||||
#endif
|
||||
config_get_array(conf, "video_context_driver", settings->video.context_driver, sizeof(settings->video.context_driver));
|
||||
config_get_array(conf, "audio_driver", settings->audio.driver, sizeof(settings->audio.driver));
|
||||
@@ -1545,7 +1568,7 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
config_get_path(conf, "screenshot_directory", settings->screenshot_directory, sizeof(settings->screenshot_directory));
|
||||
if (*settings->screenshot_directory)
|
||||
{
|
||||
if (!strcmp(settings->screenshot_directory, "default"))
|
||||
if (string_is_equal(settings->screenshot_directory, "default"))
|
||||
*settings->screenshot_directory = '\0';
|
||||
else if (!path_is_directory(settings->screenshot_directory))
|
||||
{
|
||||
@@ -1553,9 +1576,8 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
*settings->screenshot_directory = '\0';
|
||||
}
|
||||
}
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, auto_screenshot_filename, "auto_screenshot_filename");
|
||||
|
||||
config_get_path(conf, "input_remapping_path", settings->input.remapping_path,
|
||||
sizeof(settings->input.remapping_path));
|
||||
config_get_path(conf, "resampler_directory", settings->resampler_directory,
|
||||
sizeof(settings->resampler_directory));
|
||||
config_get_path(conf, "cache_directory", settings->cache_directory,
|
||||
@@ -1572,24 +1594,24 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
sizeof(settings->boxarts_directory));
|
||||
config_get_path(conf, "playlist_directory", settings->playlist_directory,
|
||||
sizeof(settings->playlist_directory));
|
||||
if (!strcmp(settings->core_assets_directory, "default"))
|
||||
if (string_is_equal(settings->core_assets_directory, "default"))
|
||||
*settings->core_assets_directory = '\0';
|
||||
if (!strcmp(settings->assets_directory, "default"))
|
||||
if (string_is_equal(settings->assets_directory, "default"))
|
||||
*settings->assets_directory = '\0';
|
||||
if (!strcmp(settings->dynamic_wallpapers_directory, "default"))
|
||||
if (string_is_equal(settings->dynamic_wallpapers_directory, "default"))
|
||||
*settings->dynamic_wallpapers_directory = '\0';
|
||||
if (!strcmp(settings->boxarts_directory, "default"))
|
||||
if (string_is_equal(settings->boxarts_directory, "default"))
|
||||
*settings->boxarts_directory = '\0';
|
||||
if (!strcmp(settings->playlist_directory, "default"))
|
||||
if (string_is_equal(settings->playlist_directory, "default"))
|
||||
*settings->playlist_directory = '\0';
|
||||
#ifdef HAVE_MENU
|
||||
config_get_path(conf, "rgui_browser_directory", settings->menu_content_directory,
|
||||
sizeof(settings->menu_content_directory));
|
||||
if (!strcmp(settings->menu_content_directory, "default"))
|
||||
if (string_is_equal(settings->menu_content_directory, "default"))
|
||||
*settings->menu_content_directory = '\0';
|
||||
config_get_path(conf, "rgui_config_directory", settings->menu_config_directory,
|
||||
sizeof(settings->menu_config_directory));
|
||||
if (!strcmp(settings->menu_config_directory, "default"))
|
||||
if (string_is_equal(settings->menu_config_directory, "default"))
|
||||
*settings->menu_config_directory = '\0';
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, menu_show_start_screen, "rgui_show_start_screen");
|
||||
#endif
|
||||
@@ -1621,6 +1643,7 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
#endif
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, input.keyboard_gamepad_enable, "keyboard_gamepad_enable");
|
||||
CONFIG_GET_INT_BASE(conf, settings, input.keyboard_gamepad_mapping_type, "keyboard_gamepad_mapping_type");
|
||||
CONFIG_GET_INT_BASE(conf, settings, input.poll_type_behavior, "input_poll_type_behavior");
|
||||
|
||||
config_get_path(conf, "recording_output_directory", global->record.output_dir,
|
||||
sizeof(global->record.output_dir));
|
||||
@@ -1629,7 +1652,7 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
|
||||
#ifdef HAVE_OVERLAY
|
||||
config_get_path(conf, "overlay_directory", settings->overlay_directory, sizeof(settings->overlay_directory));
|
||||
if (!strcmp(settings->overlay_directory, "default"))
|
||||
if (string_is_equal(settings->overlay_directory, "default"))
|
||||
*settings->overlay_directory = '\0';
|
||||
|
||||
config_get_path(conf, "input_overlay", settings->input.overlay, sizeof(settings->input.overlay));
|
||||
@@ -1640,7 +1663,7 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
CONFIG_GET_FLOAT_BASE(conf, settings, input.overlay_scale, "input_overlay_scale");
|
||||
|
||||
config_get_path(conf, "osk_overlay_directory", global->dir.osk_overlay, sizeof(global->dir.osk_overlay));
|
||||
if (!strcmp(global->dir.osk_overlay, "default"))
|
||||
if (string_is_equal(global->dir.osk_overlay, "default"))
|
||||
*global->dir.osk_overlay = '\0';
|
||||
|
||||
config_get_path(conf, "input_osk_overlay", settings->osk.overlay, sizeof(settings->osk.overlay));
|
||||
@@ -1707,7 +1730,7 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
config_get_bool(conf, tmp, &settings->network_remote_enable_user[i]);
|
||||
}
|
||||
CONFIG_GET_INT_BASE(conf, settings, network_remote_base_port, "network_remote_base_port");
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, debug_panel_enable, "debug_panel_enable");
|
||||
@@ -1750,7 +1773,7 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
if (!global->has_set.save_path &&
|
||||
config_get_path(conf, "savefile_directory", tmp_str, sizeof(tmp_str)))
|
||||
{
|
||||
if (!strcmp(tmp_str, "default"))
|
||||
if (string_is_equal(tmp_str, "default"))
|
||||
strlcpy(global->dir.savefile, g_defaults.dir.sram,
|
||||
sizeof(global->dir.savefile));
|
||||
else if (path_is_directory(tmp_str))
|
||||
@@ -1769,7 +1792,7 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
if (!global->has_set.state_path &&
|
||||
config_get_path(conf, "savestate_directory", tmp_str, sizeof(tmp_str)))
|
||||
{
|
||||
if (!strcmp(tmp_str, "default"))
|
||||
if (string_is_equal(tmp_str, "default"))
|
||||
strlcpy(global->dir.savestate, g_defaults.dir.savestate,
|
||||
sizeof(global->dir.savestate));
|
||||
else if (path_is_directory(tmp_str))
|
||||
@@ -1809,7 +1832,7 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
*settings->system_directory = '\0';
|
||||
}
|
||||
|
||||
if (!strcmp(settings->system_directory, "default"))
|
||||
if (string_is_equal(settings->system_directory, "default"))
|
||||
{
|
||||
RARCH_WARN("SYSTEM DIR is empty, assume CONTENT DIR\n");
|
||||
*settings->system_directory = '\0';
|
||||
@@ -1848,7 +1871,7 @@ static void config_load_core_specific(void)
|
||||
if (!*settings->libretro)
|
||||
return;
|
||||
#ifdef HAVE_DYNAMIC
|
||||
if (global->inited.core.type == CORE_TYPE_DUMMY)
|
||||
if (rarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL))
|
||||
return;
|
||||
#endif
|
||||
|
||||
@@ -1918,10 +1941,10 @@ static void config_load_core_specific(void)
|
||||
*/
|
||||
bool config_load_override(void)
|
||||
{
|
||||
char buf[PATH_MAX_LENGTH] = {0};
|
||||
char config_directory[PATH_MAX_LENGTH] = {0}; /* path to the directory containing retroarch.cfg (prefix) */
|
||||
char core_path[PATH_MAX_LENGTH] = {0}; /* final path for core-specific configuration (prefix+suffix) */
|
||||
char game_path[PATH_MAX_LENGTH] = {0}; /* final path for game-specific configuration (prefix+suffix) */
|
||||
char buf[PATH_MAX_LENGTH];
|
||||
char config_directory[PATH_MAX_LENGTH];
|
||||
char core_path[PATH_MAX_LENGTH];
|
||||
char game_path[PATH_MAX_LENGTH];
|
||||
config_file_t *new_conf = NULL;
|
||||
const char *core_name = NULL;
|
||||
const char *game_name = NULL;
|
||||
@@ -1929,51 +1952,40 @@ bool config_load_override(void)
|
||||
global_t *global = global_get_ptr();
|
||||
settings_t *settings = config_get_ptr();
|
||||
rarch_system_info_t *system = NULL;
|
||||
|
||||
|
||||
runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &system);
|
||||
|
||||
if (!global || !settings || !system)
|
||||
{
|
||||
RARCH_ERR("Couldn't load override config file.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Early return in case a library isn't loaded */
|
||||
if (string_is_empty(system->info.library_name) || !strcmp(system->info.library_name,"No Core"))
|
||||
return false;
|
||||
|
||||
core_name = system ? system->info.library_name : NULL;
|
||||
game_name = global ? path_basename(global->name.base) : NULL;
|
||||
if (system)
|
||||
core_name = system->info.library_name;
|
||||
if (global)
|
||||
game_name = path_basename(global->name.base);
|
||||
|
||||
if (string_is_empty(core_name) || string_is_empty(game_name))
|
||||
return false;
|
||||
|
||||
RARCH_LOG("Overrides: core name: %s\n", core_name);
|
||||
RARCH_LOG("Overrides: game name: %s\n", game_name);
|
||||
|
||||
/* Config directory: config_directory.
|
||||
* Try config directory setting first,
|
||||
* fallback to the location of the current configuration file. */
|
||||
if (!string_is_empty(settings->menu_config_directory))
|
||||
strlcpy(config_directory, settings->menu_config_directory, PATH_MAX_LENGTH);
|
||||
strlcpy(config_directory,
|
||||
settings->menu_config_directory, sizeof(config_directory));
|
||||
else if (!string_is_empty(global->path.config))
|
||||
fill_pathname_basedir(config_directory, global->path.config, PATH_MAX_LENGTH);
|
||||
fill_pathname_basedir(config_directory,
|
||||
global->path.config, sizeof(config_directory));
|
||||
else
|
||||
{
|
||||
RARCH_WARN("Overrides: no config directory set\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
RARCH_LOG("Overrides: config directory: %s\n", config_directory);
|
||||
|
||||
/* Concatenate strings into full paths for core_path, game_path */
|
||||
fill_pathname_join(core_path, config_directory, core_name, PATH_MAX_LENGTH);
|
||||
fill_pathname_join(core_path, core_path, core_name, PATH_MAX_LENGTH);
|
||||
strlcat(core_path, ".cfg", PATH_MAX_LENGTH);
|
||||
fill_pathname_join(game_path,
|
||||
config_directory, core_name, sizeof(game_path));
|
||||
fill_string_join(game_path, game_name, sizeof(game_path));
|
||||
strlcat(game_path, ".cfg", sizeof(game_path));
|
||||
|
||||
fill_pathname_join(core_path,
|
||||
config_directory, core_name, sizeof(core_path));
|
||||
fill_string_join(core_path, core_name, sizeof(core_path));
|
||||
strlcat(core_path, ".cfg", sizeof(core_path));
|
||||
|
||||
fill_pathname_join(game_path, config_directory, core_name, PATH_MAX_LENGTH);
|
||||
fill_pathname_join(game_path, game_path, game_name, PATH_MAX_LENGTH);
|
||||
strlcat(game_path, ".cfg", PATH_MAX_LENGTH);
|
||||
|
||||
/* Create a new config file from core_path */
|
||||
new_conf = config_file_new(core_path);
|
||||
@@ -2030,7 +2042,7 @@ bool config_load_override(void)
|
||||
}
|
||||
|
||||
#ifdef HAVE_NETPLAY
|
||||
if (global->netplay.enable)
|
||||
if (netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_ENABLED, NULL))
|
||||
{
|
||||
RARCH_WARN("Overrides: can't use overrides in conjunction with netplay, disabling overrides\n");
|
||||
return false;
|
||||
@@ -2038,7 +2050,7 @@ bool config_load_override(void)
|
||||
#endif
|
||||
|
||||
/* Store the libretro_path we're using since it will be overwritten by the override when reloading */
|
||||
strlcpy(buf,settings->libretro,sizeof(buf));
|
||||
strlcpy(buf, settings->libretro, sizeof(buf));
|
||||
|
||||
/* Toggle has_save_path to false so it resets */
|
||||
global->has_set.save_path = false;
|
||||
@@ -2049,7 +2061,7 @@ bool config_load_override(void)
|
||||
|
||||
/* Restore the libretro_path we're using
|
||||
* since it will be overwritten by the override when reloading. */
|
||||
strlcpy(settings->libretro,buf,sizeof(settings->libretro));
|
||||
strlcpy(settings->libretro, buf, sizeof(settings->libretro));
|
||||
runloop_msg_queue_push("Configuration override loaded", 1, 100, true);
|
||||
|
||||
/* Reset save paths */
|
||||
@@ -2108,24 +2120,22 @@ bool config_load_override(void)
|
||||
*/
|
||||
bool config_load_remap(void)
|
||||
{
|
||||
char remap_directory[PATH_MAX_LENGTH]; /* path to the directory containing retroarch.cfg (prefix) */
|
||||
char core_path[PATH_MAX_LENGTH]; /* final path for core-specific configuration (prefix+suffix) */
|
||||
char game_path[PATH_MAX_LENGTH]; /* final path for game-specific configuration (prefix+suffix) */
|
||||
config_file_t *new_conf = NULL;
|
||||
const char *core_name = NULL;
|
||||
const char *game_name = NULL;
|
||||
char remap_directory[PATH_MAX_LENGTH] = {0}; /* path to the directory containing retroarch.cfg (prefix) */
|
||||
char core_path[PATH_MAX_LENGTH] = {0}; /* final path for core-specific configuration (prefix+suffix) */
|
||||
char game_path[PATH_MAX_LENGTH] = {0}; /* final path for game-specific configuration (prefix+suffix) */
|
||||
global_t *global = global_get_ptr();
|
||||
settings_t *settings = config_get_ptr();
|
||||
rarch_system_info_t *system = NULL;
|
||||
|
||||
|
||||
runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &system);
|
||||
|
||||
/* Early return in case a library isn't loaded or remapping is disabled */
|
||||
if (!system->info.library_name || !strcmp(system->info.library_name,"No Core"))
|
||||
return false;
|
||||
|
||||
core_name = system ? system->info.library_name : NULL;
|
||||
game_name = global ? path_basename(global->name.base) : NULL;
|
||||
if (system)
|
||||
core_name = system->info.library_name;
|
||||
if (global)
|
||||
game_name = path_basename(global->name.base);
|
||||
|
||||
if (string_is_empty(core_name) || string_is_empty(game_name))
|
||||
return false;
|
||||
@@ -2136,22 +2146,22 @@ bool config_load_remap(void)
|
||||
/* Remap directory: remap_directory.
|
||||
* Try remap directory setting, no fallbacks defined */
|
||||
if (string_is_empty(settings->input_remapping_directory))
|
||||
{
|
||||
RARCH_WARN("Remaps: no remap directory set.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
strlcpy(remap_directory, settings->input_remapping_directory, PATH_MAX_LENGTH);
|
||||
strlcpy(remap_directory,
|
||||
settings->input_remapping_directory, sizeof(remap_directory));
|
||||
RARCH_LOG("Remaps: remap directory: %s\n", remap_directory);
|
||||
|
||||
/* Concatenate strings into full paths for core_path, game_path */
|
||||
fill_pathname_join(core_path, remap_directory, core_name, PATH_MAX_LENGTH);
|
||||
fill_pathname_join(core_path, core_path, core_name, PATH_MAX_LENGTH);
|
||||
strlcat(core_path, ".rmp", PATH_MAX_LENGTH);
|
||||
fill_pathname_join(core_path,
|
||||
remap_directory, core_name, sizeof(core_path));
|
||||
fill_string_join(core_path, core_name, sizeof(core_path));
|
||||
strlcat(core_path, ".rmp", sizeof(core_path));
|
||||
|
||||
fill_pathname_join(game_path, remap_directory, core_name, PATH_MAX_LENGTH);
|
||||
fill_pathname_join(game_path, game_path, game_name, PATH_MAX_LENGTH);
|
||||
strlcat(game_path, ".rmp", PATH_MAX_LENGTH);
|
||||
fill_pathname_join(game_path,
|
||||
remap_directory, core_name, sizeof(game_path));
|
||||
fill_string_join(game_path, game_name, sizeof(game_path));
|
||||
strlcat(game_path, ".rmp", sizeof(game_path));
|
||||
|
||||
/* Create a new config file from game_path */
|
||||
new_conf = config_file_new(game_path);
|
||||
@@ -2169,7 +2179,6 @@ bool config_load_remap(void)
|
||||
else
|
||||
{
|
||||
RARCH_LOG("Remaps: no game-specific remap found at %s\n", game_path);
|
||||
*settings->input.remapping_path= '\0';
|
||||
input_remapping_set_defaults();
|
||||
}
|
||||
|
||||
@@ -2189,7 +2198,6 @@ bool config_load_remap(void)
|
||||
else
|
||||
{
|
||||
RARCH_LOG("Remaps: no core-specific remap found at %s\n", core_path);
|
||||
*settings->input.remapping_path= '\0';
|
||||
input_remapping_set_defaults();
|
||||
}
|
||||
|
||||
@@ -2410,6 +2418,7 @@ void config_load(void)
|
||||
config_load_core_specific();
|
||||
}
|
||||
|
||||
#if 0
|
||||
/**
|
||||
* config_save_keybinds_file:
|
||||
* @path : Path that shall be written to.
|
||||
@@ -2418,7 +2427,7 @@ void config_load(void)
|
||||
*
|
||||
* Returns: true (1) on success, otherwise returns false (0).
|
||||
**/
|
||||
bool config_save_keybinds_file(const char *path)
|
||||
static bool config_save_keybinds_file(const char *path)
|
||||
{
|
||||
unsigned i = 0;
|
||||
bool ret = false;
|
||||
@@ -2439,6 +2448,7 @@ bool config_save_keybinds_file(const char *path)
|
||||
config_file_free(conf);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
@@ -2532,6 +2542,7 @@ bool config_save_file(const char *path)
|
||||
config_set_float(conf, "input_axis_threshold",
|
||||
settings->input.axis_threshold);
|
||||
config_set_bool(conf, "ui_companion_start_on_boot", settings->ui.companion_start_on_boot);
|
||||
config_set_bool(conf, "ui_companion_enable", settings->ui.companion_enable);
|
||||
config_set_bool(conf, "video_gpu_record", settings->video.gpu_record);
|
||||
config_set_bool(conf, "input_remap_binds_enable",
|
||||
settings->input.remap_binds_enable);
|
||||
@@ -2614,6 +2625,8 @@ bool config_save_file(const char *path)
|
||||
settings->threaded_data_runloop_enable);
|
||||
#endif
|
||||
|
||||
config_set_bool(conf, "menu_throttle_framerate", settings->menu.throttle_framerate);
|
||||
config_set_bool(conf, "menu_linear_filter", settings->menu.linear_filter);
|
||||
config_set_bool(conf, "dpi_override_enable", settings->menu.dpi.override_enable);
|
||||
config_set_int (conf, "dpi_override_value", settings->menu.dpi.override_value);
|
||||
config_set_string(conf,"menu_driver", settings->menu.driver);
|
||||
@@ -2643,6 +2656,8 @@ bool config_save_file(const char *path)
|
||||
config_set_path(conf, "screenshot_directory",
|
||||
*settings->screenshot_directory ?
|
||||
settings->screenshot_directory : "default");
|
||||
config_set_bool(conf, "auto_screenshot_filename",
|
||||
settings->auto_screenshot_filename);
|
||||
config_set_int(conf, "aspect_ratio_index", settings->video.aspect_ratio_idx);
|
||||
config_set_string(conf, "audio_device", settings->audio.device);
|
||||
config_set_string(conf, "video_filter", settings->video.softfilter_plugin);
|
||||
@@ -2659,6 +2674,7 @@ bool config_save_file(const char *path)
|
||||
#ifdef HAVE_CHEEVOS
|
||||
config_set_bool(conf, "cheevos_enable", settings->cheevos.enable);
|
||||
config_set_bool(conf, "cheevos_test_unofficial", settings->cheevos.test_unofficial);
|
||||
config_set_bool(conf, "cheevos_hardcore_mode_enable", settings->cheevos.hardcore_mode_enable);
|
||||
config_set_string(conf, "cheevos_username", settings->cheevos.username);
|
||||
config_set_string(conf, "cheevos_password", settings->cheevos.password);
|
||||
#endif
|
||||
@@ -2694,8 +2710,6 @@ bool config_save_file(const char *path)
|
||||
settings->cache_directory);
|
||||
config_set_path(conf, "input_remapping_directory",
|
||||
settings->input_remapping_directory);
|
||||
config_set_path(conf, "input_remapping_path",
|
||||
settings->input.remapping_path);
|
||||
config_set_path(conf, "resampler_directory",
|
||||
settings->resampler_directory);
|
||||
config_set_string(conf, "audio_resampler", settings->audio.resampler);
|
||||
@@ -2729,6 +2743,10 @@ bool config_save_file(const char *path)
|
||||
*settings->playlist_directory ?
|
||||
settings->playlist_directory : "default");
|
||||
#ifdef HAVE_MENU
|
||||
config_set_int(conf, "xmb_scale_factor", settings->menu.xmb_scale_factor);
|
||||
config_set_int(conf, "xmb_alpha_factor", settings->menu.xmb_alpha_factor);
|
||||
config_set_path(conf, "xmb_font",
|
||||
!string_is_empty(settings->menu.xmb_font) ? settings->menu.xmb_font : "");
|
||||
config_set_path(conf, "rgui_browser_directory",
|
||||
*settings->menu_content_directory ?
|
||||
settings->menu_content_directory : "default");
|
||||
@@ -2893,9 +2911,10 @@ bool config_save_file(const char *path)
|
||||
#endif
|
||||
config_set_bool(conf, "keyboard_gamepad_enable", settings->input.keyboard_gamepad_enable);
|
||||
config_set_int(conf, "keyboard_gamepad_mapping_type", settings->input.keyboard_gamepad_mapping_type);
|
||||
config_set_int(conf, "input_poll_type_behavior", settings->input.poll_type_behavior);
|
||||
|
||||
config_set_bool(conf, "core_set_supports_no_game_enable",
|
||||
settings->core.set_supports_no_game_enable);
|
||||
settings->set_supports_no_game_enable);
|
||||
|
||||
config_set_int(conf, "menu_ok_btn", settings->menu_ok_btn);
|
||||
config_set_int(conf, "menu_cancel_btn", settings->menu_cancel_btn);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
*
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
@@ -112,6 +112,7 @@ typedef struct settings
|
||||
bool menubar_enable;
|
||||
bool suspend_screensaver_enable;
|
||||
bool companion_start_on_boot;
|
||||
bool companion_enable;
|
||||
} ui;
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
@@ -163,6 +164,11 @@ typedef struct settings
|
||||
unsigned entry_normal_color;
|
||||
unsigned entry_hover_color;
|
||||
unsigned title_color;
|
||||
unsigned xmb_scale_factor;
|
||||
unsigned xmb_alpha_factor;
|
||||
char xmb_font[PATH_MAX_LENGTH];
|
||||
bool throttle_framerate;
|
||||
bool linear_filter;
|
||||
} menu;
|
||||
#endif
|
||||
|
||||
@@ -252,8 +258,6 @@ typedef struct settings
|
||||
bool input_descriptor_label_show;
|
||||
bool input_descriptor_hide_unbound;
|
||||
|
||||
char remapping_path[PATH_MAX_LENGTH];
|
||||
|
||||
unsigned menu_toggle_gamepad_combo;
|
||||
bool back_as_menu_toggle_enable;
|
||||
|
||||
@@ -262,6 +266,7 @@ typedef struct settings
|
||||
#endif
|
||||
bool keyboard_gamepad_enable;
|
||||
unsigned keyboard_gamepad_mapping_type;
|
||||
unsigned poll_type_behavior;
|
||||
} input;
|
||||
|
||||
struct
|
||||
@@ -284,10 +289,7 @@ typedef struct settings
|
||||
bool buildbot_auto_extract_archive;
|
||||
} network;
|
||||
|
||||
struct
|
||||
{
|
||||
bool set_supports_no_game_enable;
|
||||
} core;
|
||||
bool set_supports_no_game_enable;
|
||||
|
||||
struct
|
||||
{
|
||||
@@ -300,6 +302,7 @@ typedef struct settings
|
||||
{
|
||||
bool enable;
|
||||
bool test_unofficial;
|
||||
bool hardcore_mode_enable;
|
||||
char username[32];
|
||||
char password[32];
|
||||
} cheevos;
|
||||
@@ -334,6 +337,8 @@ typedef struct settings
|
||||
char screenshot_directory[PATH_MAX_LENGTH];
|
||||
char system_directory[PATH_MAX_LENGTH];
|
||||
|
||||
bool auto_screenshot_filename;
|
||||
|
||||
char cache_directory[PATH_MAX_LENGTH];
|
||||
char playlist_directory[PATH_MAX_LENGTH];
|
||||
|
||||
@@ -520,16 +525,6 @@ bool config_unload_override(void);
|
||||
*/
|
||||
bool config_load_remap(void);
|
||||
|
||||
/**
|
||||
* config_save_keybinds_file:
|
||||
* @path : Path that shall be written to.
|
||||
*
|
||||
* Writes a keybinds config file to disk.
|
||||
*
|
||||
* Returns: true (1) on success, otherwise returns false (0).
|
||||
**/
|
||||
bool config_save_keybinds_file(const char *path);
|
||||
|
||||
/**
|
||||
* config_save_autoconf_profile:
|
||||
* @path : Path that shall be written to.
|
||||
|
||||
@@ -17,73 +17,90 @@
|
||||
#ifndef __RARCH_FILE_H
|
||||
#define __RARCH_FILE_H
|
||||
|
||||
#include <boolean.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <boolean.h>
|
||||
|
||||
#include "frontend/frontend_driver.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Handles files related to libretro. */
|
||||
enum content_ctl_state
|
||||
{
|
||||
CONTENT_CTL_NONE = 0,
|
||||
|
||||
/**
|
||||
* load_state:
|
||||
* @path : path that state will be loaded from.
|
||||
*
|
||||
* Load a state from disk to memory.
|
||||
*
|
||||
* Returns: true if successful, false otherwise.
|
||||
**/
|
||||
bool load_state(const char *path);
|
||||
CONTENT_CTL_IS_INITED,
|
||||
|
||||
/**
|
||||
* save_state:
|
||||
* @path : path of saved state that shall be written to.
|
||||
*
|
||||
* Save a state from memory to disk.
|
||||
*
|
||||
* Returns: true if successful, false otherwise.
|
||||
**/
|
||||
bool save_state(const char *path);
|
||||
CONTENT_CTL_DOES_NOT_NEED_CONTENT,
|
||||
|
||||
/**
|
||||
* load_ram_file:
|
||||
* @path : path of RAM state that will be loaded from.
|
||||
* @type : type of memory
|
||||
*
|
||||
* Load a RAM state from disk to memory.
|
||||
*/
|
||||
void load_ram_file(const char *path, int type);
|
||||
CONTENT_CTL_SET_DOES_NOT_NEED_CONTENT,
|
||||
|
||||
/**
|
||||
* save_ram_file:
|
||||
* @path : path of RAM state that shall be written to.
|
||||
* @type : type of memory
|
||||
*
|
||||
* Save a RAM state from memory to disk.
|
||||
*
|
||||
* In case the file could not be written to, a fallback function
|
||||
* 'dump_to_file_desperate' will be called.
|
||||
*/
|
||||
void save_ram_file(const char *path, int type);
|
||||
CONTENT_CTL_UNSET_DOES_NOT_NEED_CONTENT,
|
||||
|
||||
/**
|
||||
* init_content_file:
|
||||
*
|
||||
* Initializes and loads a content file for the currently
|
||||
* selected libretro core.
|
||||
*
|
||||
* global->content_is_init will be set to the return value
|
||||
* on exit.
|
||||
*
|
||||
* Returns : true if successful, otherwise false.
|
||||
**/
|
||||
bool init_content_file(void);
|
||||
/* Initializes and loads a content file for the currently
|
||||
* selected libretro core. */
|
||||
CONTENT_CTL_INIT,
|
||||
|
||||
void content_temporary_free(void);
|
||||
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 content_ctx_info
|
||||
{
|
||||
int argc; /* Argument count. */
|
||||
char **argv; /* Argument variable list. */
|
||||
void *args; /* Arguments passed from callee */
|
||||
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);
|
||||
|
||||
bool content_ctl(enum content_ctl_state state, void *data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -16,10 +16,14 @@
|
||||
*/
|
||||
|
||||
#include <file/file_path.h>
|
||||
#include <file/file_extract.h>
|
||||
#include <file/dir_list.h>
|
||||
#include <file/file_archive.h>
|
||||
#include <compat/strl.h>
|
||||
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include "core_info.h"
|
||||
#include "general.h"
|
||||
#include "configuration.h"
|
||||
#include "dir_list_special.h"
|
||||
#include "config.def.h"
|
||||
|
||||
@@ -27,6 +31,9 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
static const char *core_info_tmp_path = NULL;
|
||||
static const struct string_list *core_info_tmp_list = NULL;
|
||||
|
||||
static void core_info_list_resolve_all_extensions(
|
||||
core_info_list_t *core_info_list)
|
||||
{
|
||||
@@ -103,13 +110,91 @@ static void core_info_list_resolve_all_firmware(
|
||||
}
|
||||
}
|
||||
|
||||
static void core_info_list_free(core_info_list_t *core_info_list)
|
||||
{
|
||||
size_t i, j;
|
||||
|
||||
if (!core_info_list)
|
||||
return;
|
||||
|
||||
for (i = 0; i < core_info_list->count; i++)
|
||||
{
|
||||
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);
|
||||
free(info->system_manufacturer);
|
||||
free(info->display_name);
|
||||
free(info->supported_extensions);
|
||||
free(info->authors);
|
||||
free(info->permissions);
|
||||
free(info->licenses);
|
||||
free(info->categories);
|
||||
free(info->databases);
|
||||
free(info->notes);
|
||||
if (info->supported_extensions_list)
|
||||
string_list_free(info->supported_extensions_list);
|
||||
string_list_free(info->authors_list);
|
||||
string_list_free(info->note_list);
|
||||
string_list_free(info->permissions_list);
|
||||
string_list_free(info->licenses_list);
|
||||
string_list_free(info->categories_list);
|
||||
string_list_free(info->databases_list);
|
||||
config_file_free((config_file_t*)info->config_data);
|
||||
|
||||
for (j = 0; j < info->firmware_count; j++)
|
||||
{
|
||||
free(info->firmware[j].path);
|
||||
free(info->firmware[j].desc);
|
||||
}
|
||||
free(info->firmware);
|
||||
}
|
||||
|
||||
free(core_info_list->all_ext);
|
||||
free(core_info_list->list);
|
||||
free(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();
|
||||
|
||||
if (!contents->elems[i].data)
|
||||
return NULL;
|
||||
|
||||
fill_pathname_base(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, '_');
|
||||
if (substr)
|
||||
*substr = '\0';
|
||||
#endif
|
||||
|
||||
strlcat(info_path_base, ".info", sizeof(info_path_base));
|
||||
|
||||
fill_pathname_join(info_path, (*settings->libretro_info_path) ?
|
||||
settings->libretro_info_path : settings->libretro_directory,
|
||||
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_t *core_info = NULL;
|
||||
core_info_list_t *core_info_list = NULL;
|
||||
settings_t *settings = config_get_ptr();
|
||||
struct string_list *contents = dir_list_new_special(NULL, DIR_LIST_CORES, NULL);
|
||||
struct string_list *contents = dir_list_new_special(
|
||||
NULL, DIR_LIST_CORES, NULL);
|
||||
|
||||
if (!contents)
|
||||
return;
|
||||
@@ -127,35 +212,12 @@ void core_info_get_name(const char *path, char *s, size_t len)
|
||||
|
||||
for (i = 0; i < contents->size; i++)
|
||||
{
|
||||
config_file_t *conf = NULL;
|
||||
char info_path_base[PATH_MAX_LENGTH] = {0};
|
||||
char info_path[PATH_MAX_LENGTH] = {0};
|
||||
config_file_t *conf = NULL;
|
||||
|
||||
core_info[i].path = strdup(contents->elems[i].data);
|
||||
|
||||
if (!core_info[i].path)
|
||||
break;
|
||||
|
||||
if (strcmp(core_info[i].path, path) != 0)
|
||||
continue;
|
||||
|
||||
fill_pathname_base(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, '_');
|
||||
if (substr)
|
||||
*substr = '\0';
|
||||
#endif
|
||||
|
||||
strlcat(info_path_base, ".info", sizeof(info_path_base));
|
||||
|
||||
fill_pathname_join(info_path, (*settings->libretro_info_path) ?
|
||||
settings->libretro_info_path : settings->libretro_directory,
|
||||
info_path_base, sizeof(info_path));
|
||||
|
||||
conf = config_file_new(info_path);
|
||||
if (!string_is_equal(contents->elems[i].data, path))
|
||||
continue;
|
||||
|
||||
conf = core_info_list_iterate(contents, i);
|
||||
|
||||
if (conf)
|
||||
{
|
||||
@@ -164,6 +226,8 @@ void core_info_get_name(const char *path, char *s, size_t len)
|
||||
core_info[i].config_data = (void*)conf;
|
||||
}
|
||||
|
||||
core_info[i].path = strdup(contents->elems[i].data);
|
||||
|
||||
strlcpy(s, core_info[i].core_name, len);
|
||||
}
|
||||
|
||||
@@ -174,13 +238,14 @@ error:
|
||||
core_info_list_free(core_info_list);
|
||||
}
|
||||
|
||||
core_info_list_t *core_info_list_new(void)
|
||||
|
||||
static core_info_list_t *core_info_list_new(void)
|
||||
{
|
||||
size_t i;
|
||||
core_info_t *core_info = NULL;
|
||||
core_info_t *core_info = NULL;
|
||||
core_info_list_t *core_info_list = NULL;
|
||||
settings_t *settings = config_get_ptr();
|
||||
struct string_list *contents = dir_list_new_special(NULL, DIR_LIST_CORES, NULL);
|
||||
struct string_list *contents =
|
||||
dir_list_new_special(NULL, DIR_LIST_CORES, NULL);
|
||||
|
||||
if (!contents)
|
||||
return NULL;
|
||||
@@ -198,35 +263,12 @@ core_info_list_t *core_info_list_new(void)
|
||||
|
||||
for (i = 0; i < contents->size; i++)
|
||||
{
|
||||
config_file_t *conf = NULL;
|
||||
char info_path_base[PATH_MAX_LENGTH] = {0};
|
||||
char info_path[PATH_MAX_LENGTH] = {0};
|
||||
core_info[i].path = strdup(contents->elems[i].data);
|
||||
|
||||
if (!core_info[i].path)
|
||||
break;
|
||||
|
||||
fill_pathname_base(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, '_');
|
||||
if (substr)
|
||||
*substr = '\0';
|
||||
#endif
|
||||
|
||||
strlcat(info_path_base, ".info", sizeof(info_path_base));
|
||||
|
||||
fill_pathname_join(info_path, (*settings->libretro_info_path) ?
|
||||
settings->libretro_info_path : settings->libretro_directory,
|
||||
info_path_base, sizeof(info_path));
|
||||
|
||||
conf = config_file_new(info_path);
|
||||
config_file_t *conf = core_info_list_iterate(contents, i);
|
||||
|
||||
if (conf)
|
||||
{
|
||||
unsigned count = 0;
|
||||
|
||||
config_get_string(conf, "display_name",
|
||||
&core_info[i].display_name);
|
||||
config_get_string(conf, "corename",
|
||||
@@ -284,8 +326,11 @@ core_info_list_t *core_info_list_new(void)
|
||||
core_info[i].config_data = conf;
|
||||
}
|
||||
|
||||
core_info[i].path = strdup(contents->elems[i].data);
|
||||
|
||||
if (!core_info[i].display_name)
|
||||
core_info[i].display_name = strdup(path_basename(core_info[i].path));
|
||||
core_info[i].display_name =
|
||||
strdup(path_basename(core_info[i].path));
|
||||
}
|
||||
|
||||
core_info_list_resolve_all_extensions(core_info_list);
|
||||
@@ -301,54 +346,6 @@ error:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void core_info_list_free(core_info_list_t *core_info_list)
|
||||
{
|
||||
size_t i, j;
|
||||
|
||||
if (!core_info_list)
|
||||
return;
|
||||
|
||||
for (i = 0; i < core_info_list->count; i++)
|
||||
{
|
||||
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);
|
||||
free(info->system_manufacturer);
|
||||
free(info->display_name);
|
||||
free(info->supported_extensions);
|
||||
free(info->authors);
|
||||
free(info->permissions);
|
||||
free(info->licenses);
|
||||
free(info->categories);
|
||||
free(info->databases);
|
||||
free(info->notes);
|
||||
if (info->supported_extensions_list)
|
||||
string_list_free(info->supported_extensions_list);
|
||||
string_list_free(info->authors_list);
|
||||
string_list_free(info->note_list);
|
||||
string_list_free(info->permissions_list);
|
||||
string_list_free(info->licenses_list);
|
||||
string_list_free(info->categories_list);
|
||||
string_list_free(info->databases_list);
|
||||
config_file_free((config_file_t*)info->config_data);
|
||||
|
||||
for (j = 0; j < info->firmware_count; j++)
|
||||
{
|
||||
free(info->firmware[j].path);
|
||||
free(info->firmware[j].desc);
|
||||
}
|
||||
free(info->firmware);
|
||||
}
|
||||
|
||||
free(core_info_list->all_ext);
|
||||
free(core_info_list->list);
|
||||
free(core_info_list);
|
||||
}
|
||||
|
||||
size_t core_info_list_num_info_files(core_info_list_t *core_info_list)
|
||||
{
|
||||
@@ -359,7 +356,8 @@ size_t core_info_list_num_info_files(core_info_list_t *core_info_list)
|
||||
|
||||
for (i = 0; i < core_info_list->count; i++)
|
||||
{
|
||||
config_file_t *conf = (config_file_t*)core_info_list->list[i].config_data;
|
||||
config_file_t *conf = (config_file_t*)
|
||||
core_info_list->list[i].config_data;
|
||||
num += !!conf;
|
||||
}
|
||||
|
||||
@@ -367,7 +365,7 @@ size_t core_info_list_num_info_files(core_info_list_t *core_info_list)
|
||||
}
|
||||
|
||||
bool core_info_list_get_display_name(core_info_list_t *core_info_list,
|
||||
const char *path, char *buf, size_t size)
|
||||
const char *path, char *s, size_t len)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
@@ -377,10 +375,10 @@ bool core_info_list_get_display_name(core_info_list_t *core_info_list,
|
||||
for (i = 0; i < core_info_list->count; i++)
|
||||
{
|
||||
const core_info_t *info = &core_info_list->list[i];
|
||||
if (!strcmp(path_basename(info->path), path_basename(path))
|
||||
if (string_is_equal(path_basename(info->path), path_basename(path))
|
||||
&& info->display_name)
|
||||
{
|
||||
strlcpy(buf, info->display_name, size);
|
||||
strlcpy(s, info->display_name, len);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -428,7 +426,11 @@ error:
|
||||
return false;
|
||||
}
|
||||
|
||||
bool core_info_list_get_info(core_info_list_t *core_info_list,
|
||||
/* Shallow-copies internal state.
|
||||
*
|
||||
* Data in *info is invalidated when the
|
||||
* core_info_list is freed. */
|
||||
static bool core_info_list_get_info(core_info_list_t *core_info_list,
|
||||
core_info_t *out_info, const char *path)
|
||||
{
|
||||
size_t i;
|
||||
@@ -440,7 +442,9 @@ bool core_info_list_get_info(core_info_list_t *core_info_list,
|
||||
for (i = 0; i < core_info_list->count; i++)
|
||||
{
|
||||
const core_info_t *info = &core_info_list->list[i];
|
||||
if (!strcmp(path_basename(info->path), path_basename(path)))
|
||||
|
||||
if (string_is_equal(path_basename(info->path),
|
||||
path_basename(path)))
|
||||
{
|
||||
*out_info = *info;
|
||||
return true;
|
||||
@@ -450,7 +454,7 @@ bool core_info_list_get_info(core_info_list_t *core_info_list,
|
||||
return false;
|
||||
}
|
||||
|
||||
bool core_info_does_support_any_file(const core_info_t *core,
|
||||
static bool core_info_does_support_any_file(const core_info_t *core,
|
||||
const struct string_list *list)
|
||||
{
|
||||
size_t i;
|
||||
@@ -464,7 +468,8 @@ bool core_info_does_support_any_file(const core_info_t *core,
|
||||
return false;
|
||||
}
|
||||
|
||||
bool core_info_does_support_file(const core_info_t *core, const char *path)
|
||||
static bool core_info_does_support_file(
|
||||
const core_info_t *core, const char *path)
|
||||
{
|
||||
if (!path || !core || !core->supported_extensions_list)
|
||||
return false;
|
||||
@@ -472,27 +477,18 @@ bool core_info_does_support_file(const core_info_t *core, const char *path)
|
||||
core->supported_extensions_list, ".", path_get_extension(path));
|
||||
}
|
||||
|
||||
const char *core_info_list_get_all_extensions(void)
|
||||
{
|
||||
core_info_list_t *list = NULL;
|
||||
runloop_ctl(RUNLOOP_CTL_CURRENT_CORE_LIST_GET, &list);
|
||||
if (!list)
|
||||
return NULL;
|
||||
return list->all_ext;
|
||||
}
|
||||
|
||||
/* qsort_r() is not in standard C, sadly. */
|
||||
static const char *core_info_tmp_path;
|
||||
static const struct string_list *core_info_tmp_list;
|
||||
|
||||
static int core_info_qsort_cmp(const void *a_, const void *b_)
|
||||
{
|
||||
const core_info_t *a = (const core_info_t*)a_;
|
||||
const core_info_t *b = (const core_info_t*)b_;
|
||||
int support_a = core_info_does_support_any_file(a, core_info_tmp_list) ||
|
||||
core_info_does_support_file(a, core_info_tmp_path);
|
||||
int support_b = core_info_does_support_any_file(b, core_info_tmp_list) ||
|
||||
core_info_does_support_file(b, core_info_tmp_path);
|
||||
int support_a =
|
||||
core_info_does_support_any_file(a, core_info_tmp_list)
|
||||
|| core_info_does_support_file(a, core_info_tmp_path);
|
||||
int support_b =
|
||||
core_info_does_support_any_file(b, core_info_tmp_list)
|
||||
|| core_info_does_support_file(b, core_info_tmp_path);
|
||||
|
||||
if (support_a != support_b)
|
||||
return support_b - support_a;
|
||||
@@ -502,19 +498,19 @@ static int core_info_qsort_cmp(const void *a_, const void *b_)
|
||||
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;
|
||||
|
||||
(void)list;
|
||||
|
||||
core_info_tmp_path = path;
|
||||
|
||||
#ifdef HAVE_ZLIB
|
||||
if (!strcasecmp(path_get_extension(path), "zip"))
|
||||
list = zlib_get_file_list(path, NULL);
|
||||
if (string_is_equal_noncase(path_get_extension(path), "zip"))
|
||||
list = file_archive_get_file_list(path, NULL);
|
||||
core_info_tmp_list = list;
|
||||
#endif
|
||||
|
||||
@@ -546,30 +542,10 @@ void core_info_list_get_supported_cores(core_info_list_t *core_info_list,
|
||||
string_list_free(list);
|
||||
#endif
|
||||
|
||||
*infos = core_info_list->list;
|
||||
*infos = core_info_list->list;
|
||||
*num_infos = supported;
|
||||
}
|
||||
|
||||
core_info_t *core_info_find(core_info_list_t *list,
|
||||
const char *core)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < list->count; i++)
|
||||
{
|
||||
core_info_t *info = (core_info_t*)&list->list[i];
|
||||
|
||||
if (!info)
|
||||
continue;
|
||||
if (!info->path)
|
||||
continue;
|
||||
if (!strcmp(info->path, core))
|
||||
return info;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
core_info_t *core_info_get(core_info_list_t *list, size_t i)
|
||||
{
|
||||
core_info_t *info = NULL;
|
||||
@@ -583,6 +559,55 @@ core_info_t *core_info_get(core_info_list_t *list, size_t i)
|
||||
return info;
|
||||
}
|
||||
|
||||
static core_info_t *core_info_find(core_info_list_t *list,
|
||||
const char *core)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < list->count; i++)
|
||||
{
|
||||
core_info_t *info = core_info_get(list, i);
|
||||
|
||||
if (!info)
|
||||
continue;
|
||||
if (string_is_equal(info->path, core))
|
||||
return info;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
static bool core_info_list_update_missing_firmware(
|
||||
core_info_list_t *core_info_list,
|
||||
const char *core, const char *systemdir)
|
||||
{
|
||||
size_t i;
|
||||
char path[PATH_MAX_LENGTH] = {0};
|
||||
core_info_t *info = NULL;
|
||||
|
||||
if (!core_info_list || !core)
|
||||
return false;
|
||||
|
||||
info = core_info_find(core_info_list, core);
|
||||
|
||||
if (!info)
|
||||
return false;
|
||||
|
||||
for (i = 0; i < info->firmware_count; i++)
|
||||
{
|
||||
if (!info->firmware[i].path)
|
||||
continue;
|
||||
|
||||
fill_pathname_join(path, systemdir,
|
||||
info->firmware[i].path, sizeof(path));
|
||||
info->firmware[i].missing = !path_file_exists(path);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int core_info_firmware_cmp(const void *a_, const void *b_)
|
||||
{
|
||||
const core_info_firmware_t *a = (const core_info_firmware_t*)a_;
|
||||
@@ -594,31 +619,10 @@ static int core_info_firmware_cmp(const void *a_, const void *b_)
|
||||
return strcasecmp(a->path, b->path);
|
||||
}
|
||||
|
||||
void core_info_list_update_missing_firmware(core_info_list_t *core_info_list,
|
||||
const char *core, const char *systemdir)
|
||||
{
|
||||
size_t i;
|
||||
char path[PATH_MAX_LENGTH] = {0};
|
||||
core_info_t *info = NULL;
|
||||
/* Non-reentrant, does not allocate. Returns pointer to internal state. */
|
||||
|
||||
if (!core_info_list || !core)
|
||||
return;
|
||||
|
||||
if (!(info = core_info_find(core_info_list, core)))
|
||||
return;
|
||||
|
||||
for (i = 0; i < info->firmware_count; i++)
|
||||
{
|
||||
if (!info->firmware[i].path)
|
||||
continue;
|
||||
|
||||
fill_pathname_join(path, systemdir,
|
||||
info->firmware[i].path, sizeof(path));
|
||||
info->firmware[i].missing = !path_file_exists(path);
|
||||
}
|
||||
}
|
||||
|
||||
void core_info_list_get_missing_firmware(core_info_list_t *core_info_list,
|
||||
static void core_info_list_get_missing_firmware(
|
||||
core_info_list_t *core_info_list,
|
||||
const char *core, const char *systemdir,
|
||||
const core_info_firmware_t **firmware, size_t *num_firmware)
|
||||
{
|
||||
@@ -639,7 +643,8 @@ void core_info_list_get_missing_firmware(core_info_list_t *core_info_list,
|
||||
|
||||
for (i = 1; i < info->firmware_count; i++)
|
||||
{
|
||||
fill_pathname_join(path, systemdir, info->firmware[i].path, sizeof(path));
|
||||
fill_pathname_join(path, systemdir,
|
||||
info->firmware[i].path, sizeof(path));
|
||||
info->firmware[i].missing = !path_file_exists(path);
|
||||
*num_firmware += info->firmware[i].missing;
|
||||
}
|
||||
@@ -647,3 +652,90 @@ void core_info_list_get_missing_firmware(core_info_list_t *core_info_list,
|
||||
qsort(info->firmware, info->firmware_count, sizeof(*info->firmware),
|
||||
core_info_firmware_cmp);
|
||||
}
|
||||
#endif
|
||||
|
||||
bool core_info_ctl(enum core_info_state state, void *data)
|
||||
{
|
||||
static core_info_t *core_info_current = NULL;
|
||||
static core_info_list_t *core_info_curr_list = 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;
|
||||
|
||||
return core_info_list_update_missing_firmware(core_info_curr_list,
|
||||
info->path, info->system_directory);
|
||||
}
|
||||
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;
|
||||
|
||||
if (!info)
|
||||
return false;
|
||||
|
||||
core_info_ctl(CORE_INFO_CTL_CURRENT_CORE_GET, &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;
|
||||
}
|
||||
break;
|
||||
case CORE_INFO_CTL_NONE:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -24,6 +24,20 @@
|
||||
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
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *path;
|
||||
@@ -70,41 +84,26 @@ typedef struct
|
||||
char *all_ext;
|
||||
} core_info_list_t;
|
||||
|
||||
core_info_list_t *core_info_list_new(void);
|
||||
void core_info_list_free(core_info_list_t *list);
|
||||
typedef struct core_info_ctx_firmware
|
||||
{
|
||||
const char *path;
|
||||
const char *system_directory;
|
||||
} core_info_ctx_firmware_t;
|
||||
|
||||
typedef struct core_info_ctx_find
|
||||
{
|
||||
core_info_t *inf;
|
||||
const char *path;
|
||||
} core_info_ctx_find_t;
|
||||
|
||||
size_t core_info_list_num_info_files(core_info_list_t *list);
|
||||
|
||||
bool core_info_does_support_file(const core_info_t *info,
|
||||
const char *path);
|
||||
|
||||
bool core_info_does_support_any_file(const core_info_t *info,
|
||||
const struct string_list *list);
|
||||
|
||||
/* Non-reentrant, does not allocate. Returns pointer to internal state. */
|
||||
void core_info_list_get_supported_cores(core_info_list_t *list,
|
||||
const char *path, const core_info_t **infos, size_t *num_infos);
|
||||
|
||||
/* Non-reentrant, does not allocate. Returns pointer to internal state. */
|
||||
void core_info_list_get_missing_firmware(core_info_list_t *list,
|
||||
const char *core, const char *systemdir,
|
||||
const core_info_firmware_t **firmware, size_t *num_firmware);
|
||||
|
||||
void core_info_list_update_missing_firmware(core_info_list_t *list,
|
||||
const char *core, const char *systemdir);
|
||||
|
||||
/* Shallow-copies internal state. Data in *info is invalidated when the
|
||||
* core_info_list is freed. */
|
||||
bool core_info_list_get_info(core_info_list_t *list,
|
||||
core_info_t *info, const char *path);
|
||||
|
||||
const char *core_info_list_get_all_extensions(void);
|
||||
|
||||
core_info_t *core_info_find(core_info_list_t *list,
|
||||
const char *core);
|
||||
|
||||
bool core_info_list_get_display_name(core_info_list_t *list,
|
||||
const char *path, char *buf, size_t size);
|
||||
const char *path, char *s, size_t len);
|
||||
|
||||
bool core_info_get_display_name(const char *path, char *s, size_t len);
|
||||
|
||||
@@ -112,6 +111,8 @@ 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);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <compat/posix_string.h>
|
||||
#include <compat/strl.h>
|
||||
#include <retro_miscellaneous.h>
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include "core_options.h"
|
||||
|
||||
@@ -57,9 +58,17 @@ void core_option_free(core_option_manager_t *opt)
|
||||
|
||||
for (i = 0; i < opt->size; i++)
|
||||
{
|
||||
free(opt->opts[i].desc);
|
||||
free(opt->opts[i].key);
|
||||
string_list_free(opt->opts[i].vals);
|
||||
if (opt->opts[i].desc)
|
||||
free(opt->opts[i].desc);
|
||||
if (opt->opts[i].key)
|
||||
free(opt->opts[i].key);
|
||||
|
||||
if (opt->opts[i].vals)
|
||||
string_list_free(opt->opts[i].vals);
|
||||
|
||||
opt->opts[i].desc = NULL;
|
||||
opt->opts[i].key = NULL;
|
||||
opt->opts[i].vals = NULL;
|
||||
}
|
||||
|
||||
if (opt->conf)
|
||||
@@ -79,7 +88,10 @@ void core_option_get(core_option_manager_t *opt, struct retro_variable *var)
|
||||
|
||||
for (i = 0; i < opt->size; i++)
|
||||
{
|
||||
if (!strcmp(opt->opts[i].key, var->key))
|
||||
if (string_is_empty(opt->opts[i].key))
|
||||
continue;
|
||||
|
||||
if (string_is_equal(opt->opts[i].key, var->key))
|
||||
{
|
||||
var->value = core_option_get_val(opt, i);
|
||||
return;
|
||||
@@ -129,7 +141,7 @@ static bool parse_variable(core_option_manager_t *opt, size_t idx,
|
||||
|
||||
for (i = 0; i < option->vals->size; i++)
|
||||
{
|
||||
if (!strcmp(option->vals->elems[i].data, config_val))
|
||||
if (string_is_equal(option->vals->elems[i].data, config_val))
|
||||
{
|
||||
option->index = i;
|
||||
break;
|
||||
|
||||
@@ -17,11 +17,13 @@
|
||||
#ifndef CORE_OPTIONS_H__
|
||||
#define CORE_OPTIONS_H__
|
||||
|
||||
#include <boolean.h>
|
||||
#include "libretro.h"
|
||||
#include <stddef.h>
|
||||
|
||||
#include <boolean.h>
|
||||
#include <string/string_list.h>
|
||||
|
||||
#include "libretro.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -72,7 +74,8 @@ bool core_option_flush(core_option_manager_t *opt);
|
||||
* Returns: true (1) if core option values could be
|
||||
* successfully saved to disk, otherwise false (0).
|
||||
**/
|
||||
bool core_option_flush_game_specific(core_option_manager_t *opt, char* path);
|
||||
bool core_option_flush_game_specific(
|
||||
core_option_manager_t *opt, char* path);
|
||||
|
||||
/**
|
||||
* core_option_free:
|
||||
@@ -82,7 +85,8 @@ bool core_option_flush_game_specific(core_option_manager_t *opt, char* path);
|
||||
**/
|
||||
void core_option_free(core_option_manager_t *opt);
|
||||
|
||||
void core_option_get(core_option_manager_t *opt, struct retro_variable *var);
|
||||
void core_option_get(core_option_manager_t *opt,
|
||||
struct retro_variable *var);
|
||||
|
||||
/**
|
||||
* core_option_size:
|
||||
@@ -103,7 +107,8 @@ size_t core_option_size(core_option_manager_t *opt);
|
||||
*
|
||||
* Returns: Description for an option.
|
||||
**/
|
||||
const char *core_option_get_desc(core_option_manager_t *opt, size_t idx);
|
||||
const char *core_option_get_desc(core_option_manager_t *opt,
|
||||
size_t idx);
|
||||
|
||||
/**
|
||||
* core_option_get_val:
|
||||
@@ -114,7 +119,8 @@ const char *core_option_get_desc(core_option_manager_t *opt, size_t idx);
|
||||
*
|
||||
* Returns: Value for an option.
|
||||
**/
|
||||
const char *core_option_get_val(core_option_manager_t *opt, size_t idx);
|
||||
const char *core_option_get_val(core_option_manager_t *opt,
|
||||
size_t idx);
|
||||
|
||||
/**
|
||||
* core_option_get_vals:
|
||||
|
||||
@@ -5,6 +5,12 @@
|
||||
#include <assert.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#ifdef RARCH_INTERNAL
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -792,8 +798,10 @@ static bool codec_id_is_ass(enum AVCodecID id)
|
||||
#endif
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -801,14 +809,15 @@ static bool open_codecs(void)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
video_stream = -1;
|
||||
memset(audio_streams, 0, sizeof(audio_streams));
|
||||
memset(subtitle_streams, 0, sizeof(subtitle_streams));
|
||||
video_stream = -1;
|
||||
audio_streams_num = 0;
|
||||
audio_streams_ptr = 0;
|
||||
subtitle_streams_num = 0;
|
||||
subtitle_streams_ptr = 0;
|
||||
|
||||
memset(audio_streams, 0, sizeof(audio_streams));
|
||||
memset(subtitle_streams, 0, sizeof(subtitle_streams));
|
||||
|
||||
for (i = 0; i < fctx->nb_streams; i++)
|
||||
{
|
||||
switch (fctx->streams[i]->codec->codec_type)
|
||||
@@ -848,7 +857,7 @@ static bool open_codecs(void)
|
||||
|
||||
if (size)
|
||||
{
|
||||
ass_extra_data[subtitle_streams_num] = av_malloc(size);
|
||||
ass_extra_data[subtitle_streams_num] = (uint8_t*)av_malloc(size);
|
||||
memcpy(ass_extra_data[subtitle_streams_num], (*s)->extradata, size);
|
||||
}
|
||||
|
||||
@@ -858,12 +867,12 @@ static bool open_codecs(void)
|
||||
break;
|
||||
|
||||
case AVMEDIA_TYPE_ATTACHMENT:
|
||||
{
|
||||
AVCodecContext *ctx = fctx->streams[i]->codec;
|
||||
if (codec_id_is_ttf(ctx->codec_id))
|
||||
append_attachment(ctx->extradata, ctx->extradata_size);
|
||||
{
|
||||
AVCodecContext *ctx = fctx->streams[i]->codec;
|
||||
if (codec_id_is_ttf(ctx->codec_id))
|
||||
append_attachment(ctx->extradata, ctx->extradata_size);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
@@ -883,7 +892,8 @@ static bool init_media_info(void)
|
||||
{
|
||||
media.width = vctx->width;
|
||||
media.height = vctx->height;
|
||||
media.aspect = (float)vctx->width * av_q2d(vctx->sample_aspect_ratio) / vctx->height;
|
||||
media.aspect = (float)vctx->width *
|
||||
av_q2d(vctx->sample_aspect_ratio) / vctx->height;
|
||||
}
|
||||
|
||||
#ifdef HAVE_SSA
|
||||
@@ -895,7 +905,8 @@ static bool init_media_info(void)
|
||||
ass_set_message_cb(ass, ass_msg_cb, NULL);
|
||||
|
||||
for (i = 0; i < attachments_size; i++)
|
||||
ass_add_font(ass, (char*)"", (char*)attachments[i].data, attachments[i].size);
|
||||
ass_add_font(ass, (char*)"",
|
||||
(char*)attachments[i].data, attachments[i].size);
|
||||
|
||||
ass_render = ass_renderer_init(ass);
|
||||
ass_set_frame_size(ass_render, media.width, media.height);
|
||||
@@ -916,7 +927,8 @@ static bool init_media_info(void)
|
||||
}
|
||||
|
||||
static void set_colorspace(struct SwsContext *sws,
|
||||
unsigned width, unsigned height, enum AVColorSpace default_color, int in_range)
|
||||
unsigned width, unsigned height,
|
||||
enum AVColorSpace default_color, int in_range)
|
||||
{
|
||||
const int *coeffs = NULL;
|
||||
|
||||
@@ -951,7 +963,8 @@ static void set_colorspace(struct SwsContext *sws,
|
||||
}
|
||||
}
|
||||
|
||||
static bool decode_video(AVPacket *pkt, AVFrame *frame, AVFrame *conv, struct SwsContext *sws)
|
||||
static bool decode_video(AVPacket *pkt, AVFrame *frame,
|
||||
AVFrame *conv, struct SwsContext *sws)
|
||||
{
|
||||
int got_ptr = 0;
|
||||
int ret = avcodec_decode_video2(vctx, frame, &got_ptr, pkt);
|
||||
@@ -971,7 +984,8 @@ static bool decode_video(AVPacket *pkt, AVFrame *frame, AVFrame *conv, struct Sw
|
||||
return false;
|
||||
}
|
||||
|
||||
static int16_t *decode_audio(AVCodecContext *ctx, AVPacket *pkt, AVFrame *frame, int16_t *buffer, size_t *buffer_cap,
|
||||
static int16_t *decode_audio(AVCodecContext *ctx, AVPacket *pkt,
|
||||
AVFrame *frame, int16_t *buffer, size_t *buffer_cap,
|
||||
SwrContext *swr)
|
||||
{
|
||||
AVPacket pkt_tmp = *pkt;
|
||||
@@ -1020,7 +1034,9 @@ static int16_t *decode_audio(AVCodecContext *ctx, AVPacket *pkt, AVFrame *frame,
|
||||
}
|
||||
}
|
||||
|
||||
decode_last_audio_time = pts * av_q2d(fctx->streams[audio_streams[audio_streams_ptr]]->time_base);
|
||||
decode_last_audio_time = pts * av_q2d(
|
||||
fctx->streams[audio_streams[audio_streams_ptr]]->time_base);
|
||||
|
||||
if (!decode_thread_dead)
|
||||
fifo_write(audio_decode_fifo, buffer, required_buffer);
|
||||
|
||||
@@ -1101,7 +1117,8 @@ static void render_ass_img(AVFrame *conv_frame, ASS_Image *img)
|
||||
dst_g = (g * src_alpha + dst_g * dst_alpha) >> 8;
|
||||
dst_b = (b * src_alpha + dst_b * dst_alpha) >> 8;
|
||||
|
||||
dst[x] = (0xffu << 24) | (dst_r << 16) | (dst_g << 8) | (dst_b << 0);
|
||||
dst[x] = (0xffu << 24) | (dst_r << 16) |
|
||||
(dst_g << 8) | (dst_b << 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1285,7 +1302,8 @@ static void decode_thread(void *data)
|
||||
for (i = 0; i < sub.num_rects; i++)
|
||||
{
|
||||
if (sub.rects[i]->ass)
|
||||
ass_process_data(ass_track_active, sub.rects[i]->ass, strlen(sub.rects[i]->ass));
|
||||
ass_process_data(ass_track_active,
|
||||
sub.rects[i]->ass, strlen(sub.rects[i]->ass));
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1406,14 +1424,16 @@ static void context_reset(void)
|
||||
#if !defined(HAVE_OPENGLES)
|
||||
glGenBuffers(1, &frames[i].pbo);
|
||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, frames[i].pbo);
|
||||
glBufferData(GL_PIXEL_UNPACK_BUFFER, media.width * media.height * sizeof(uint32_t), NULL, GL_STREAM_DRAW);
|
||||
glBufferData(GL_PIXEL_UNPACK_BUFFER, media.width
|
||||
* media.height * sizeof(uint32_t), NULL, GL_STREAM_DRAW);
|
||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
glGenBuffers(1, &vbo);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, vbo);
|
||||
glBufferData(GL_ARRAY_BUFFER, sizeof(vertex_data), vertex_data, GL_STATIC_DRAW);
|
||||
glBufferData(GL_ARRAY_BUFFER,
|
||||
sizeof(vertex_data), vertex_data, GL_STATIC_DRAW);
|
||||
|
||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
@@ -1569,7 +1589,8 @@ bool CORE_PREFIX(retro_load_game)(const struct retro_game_info *info)
|
||||
|
||||
if (video_stream >= 0 || is_glfft)
|
||||
{
|
||||
video_decode_fifo = fifo_new(media.width * media.height * sizeof(uint32_t) * 32);
|
||||
video_decode_fifo = fifo_new(media.width
|
||||
* media.height * sizeof(uint32_t) * 32);
|
||||
|
||||
#ifdef HAVE_OPENGL
|
||||
use_gl = true;
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
#include <assert.h>
|
||||
|
||||
#include <boolean.h>
|
||||
#include <file/dir_list.h>
|
||||
#include <file/file_path.h>
|
||||
#include <compat/strl.h>
|
||||
|
||||
#define STB_IMAGE_IMPLEMENTATION
|
||||
|
||||
@@ -17,11 +20,11 @@
|
||||
#define STBI_SUPPORT_ZLIB
|
||||
#endif
|
||||
|
||||
#include "../deps/stb/stb_image.h"
|
||||
#include "../../deps/stb/stb_image.h"
|
||||
|
||||
#ifdef RARCH_INTERNAL
|
||||
#include "internal_cores.h"
|
||||
#include "../libretro.h"
|
||||
#include "../../libretro.h"
|
||||
#define IMAGE_CORE_PREFIX(s) libretro_imageviewer_##s
|
||||
#else
|
||||
#include "libretro.h"
|
||||
@@ -35,26 +38,31 @@ static retro_input_state_t IMAGE_CORE_PREFIX(input_state_cb);
|
||||
static retro_audio_sample_batch_t IMAGE_CORE_PREFIX(audio_batch_cb);
|
||||
static retro_environment_t IMAGE_CORE_PREFIX(environ_cb);
|
||||
|
||||
static bool process_new_image;
|
||||
static uint32_t* image_buffer;
|
||||
static int image_width;
|
||||
static int image_height;
|
||||
static bool image_uploaded;
|
||||
static bool slideshow_enable;
|
||||
struct string_list *file_list;
|
||||
|
||||
#if 0
|
||||
#define DUPE_TEST
|
||||
#endif
|
||||
|
||||
#ifdef RARCH_INTERNAL
|
||||
static const char* IMAGE_CORE_PREFIX(valid_extensions) = "jpg|jpeg|png|bmp|tga";
|
||||
#else
|
||||
static const char* IMAGE_CORE_PREFIX(valid_extensions) = "jpg|jpeg|png|bmp|psd|tga|gif|hdr|pic|ppm|pgm";
|
||||
#endif
|
||||
|
||||
void IMAGE_CORE_PREFIX(retro_get_system_info)(struct retro_system_info *info)
|
||||
{
|
||||
info->library_name = "image display";
|
||||
info->library_version = "v0.1";
|
||||
info->need_fullpath = true;
|
||||
info->block_extract = false;
|
||||
#ifdef RARCH_INTERNAL
|
||||
info->valid_extensions = "jpg|jpeg|png|bmp|tga";
|
||||
#else
|
||||
info->valid_extensions = "jpg|jpeg|png|bmp|psd|tga|gif|hdr|pic|ppm|pgm";
|
||||
#endif
|
||||
info->valid_extensions = IMAGE_CORE_PREFIX(valid_extensions);
|
||||
}
|
||||
|
||||
void IMAGE_CORE_PREFIX(retro_get_system_av_info)(struct retro_system_av_info *info)
|
||||
@@ -163,23 +171,42 @@ void IMAGE_CORE_PREFIX(retro_cheat_set)(unsigned a, bool b, const char * c)
|
||||
{
|
||||
}
|
||||
|
||||
bool IMAGE_CORE_PREFIX(retro_load_game)(const struct retro_game_info *info)
|
||||
static bool imageviewer_load(const char *path, int image_index)
|
||||
{
|
||||
int comp;
|
||||
uint32_t *buf, *end;
|
||||
if (image_buffer)
|
||||
free(image_buffer);
|
||||
|
||||
image_buffer = (uint32_t*)stbi_load(
|
||||
path,
|
||||
&image_width,
|
||||
&image_height,
|
||||
&comp,
|
||||
4);
|
||||
|
||||
if (!image_buffer)
|
||||
return false;
|
||||
|
||||
process_new_image = true;
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool IMAGE_CORE_PREFIX(retro_load_game)(const struct retro_game_info *info)
|
||||
{
|
||||
enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_XRGB8888;
|
||||
|
||||
image_buffer = (uint32_t*)stbi_load (info->path,&image_width, &image_height, &comp, 4);
|
||||
/* RGBA > XRGB8888 */
|
||||
buf = &image_buffer[0];
|
||||
end = buf + (image_width*image_height*sizeof(uint32_t))/4;
|
||||
char *dir = strdup(info->path);
|
||||
|
||||
slideshow_enable = false;
|
||||
|
||||
path_basedir(dir);
|
||||
|
||||
file_list = dir_list_new(dir, IMAGE_CORE_PREFIX(valid_extensions),
|
||||
false,false);
|
||||
dir_list_sort(file_list, false);
|
||||
free(dir);
|
||||
|
||||
while(buf < end)
|
||||
{
|
||||
uint32_t pixel = *buf;
|
||||
*buf = (pixel & 0xff00ff00) | ((pixel << 16) & 0x00ff0000) | ((pixel >> 16) & 0xff);
|
||||
buf++;
|
||||
}
|
||||
|
||||
if (!IMAGE_CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt))
|
||||
{
|
||||
@@ -188,6 +215,8 @@ bool IMAGE_CORE_PREFIX(retro_load_game)(const struct retro_game_info *info)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!imageviewer_load(info->path, 0))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -221,10 +250,133 @@ size_t IMAGE_CORE_PREFIX(retro_get_memory_size)(unsigned id)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void IMAGE_CORE_PREFIX(retro_run)(void)
|
||||
{
|
||||
bool first_image = false;
|
||||
bool last_image = false;
|
||||
bool backwards_image = false;
|
||||
bool forward_image = false;
|
||||
bool load_image = false;
|
||||
bool next_image = false;
|
||||
bool prev_image = false;
|
||||
static int frames = 0;
|
||||
static int image_index = 0;
|
||||
uint16_t input = 0;
|
||||
static uint16_t previnput;
|
||||
uint16_t realinput = 0;
|
||||
int i;
|
||||
|
||||
IMAGE_CORE_PREFIX(input_poll_cb)();
|
||||
|
||||
if (slideshow_enable)
|
||||
{
|
||||
if ((frames % 120 == 0) && image_index < (signed)(file_list->size - 1))
|
||||
next_image = true;
|
||||
}
|
||||
|
||||
for (i=0;i<16;i++)
|
||||
{
|
||||
if (IMAGE_CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_JOYPAD, 0, i))
|
||||
{
|
||||
realinput |= 1<<i;
|
||||
}
|
||||
}
|
||||
input = realinput & ~previnput;
|
||||
previnput = realinput;
|
||||
|
||||
if (input & (1<<RETRO_DEVICE_ID_JOYPAD_UP))
|
||||
{
|
||||
if ((image_index + 5) < (signed)(file_list->size - 1))
|
||||
forward_image = true;
|
||||
else
|
||||
last_image = true;
|
||||
}
|
||||
|
||||
if (input & (1<<RETRO_DEVICE_ID_JOYPAD_DOWN))
|
||||
{
|
||||
if ((image_index - 5) > 0)
|
||||
backwards_image = true;
|
||||
else
|
||||
first_image = true;
|
||||
}
|
||||
|
||||
if (input & (1<<RETRO_DEVICE_ID_JOYPAD_LEFT))
|
||||
{
|
||||
if (image_index > 0)
|
||||
prev_image = true;
|
||||
}
|
||||
if (input & (1<<RETRO_DEVICE_ID_JOYPAD_RIGHT))
|
||||
{
|
||||
if (image_index < (signed)(file_list->size - 1))
|
||||
next_image = true;
|
||||
}
|
||||
|
||||
if (input & (1<<RETRO_DEVICE_ID_JOYPAD_Y))
|
||||
{
|
||||
slideshow_enable = !slideshow_enable;
|
||||
}
|
||||
|
||||
if (prev_image)
|
||||
{
|
||||
image_index--;
|
||||
load_image = true;
|
||||
}
|
||||
else if (next_image)
|
||||
{
|
||||
image_index++;
|
||||
load_image = true;
|
||||
}
|
||||
else if (backwards_image)
|
||||
{
|
||||
image_index -= 5;
|
||||
load_image = true;
|
||||
}
|
||||
else if (forward_image)
|
||||
{
|
||||
image_index += 5;
|
||||
load_image = true;
|
||||
}
|
||||
else if (first_image)
|
||||
{
|
||||
image_index = 0;
|
||||
load_image = true;
|
||||
}
|
||||
else if (last_image)
|
||||
{
|
||||
image_index = file_list->size - 1;
|
||||
load_image = true;
|
||||
}
|
||||
|
||||
if (load_image)
|
||||
{
|
||||
if (!imageviewer_load(file_list->elems[image_index].data, image_index))
|
||||
{
|
||||
IMAGE_CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_SHUTDOWN, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
if (process_new_image)
|
||||
{
|
||||
/* 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)
|
||||
{
|
||||
uint32_t pixel = *buf;
|
||||
*buf = (pixel & 0xff00ff00) | ((pixel << 16) & 0x00ff0000) | ((pixel >> 16) & 0xff);
|
||||
buf++;
|
||||
}
|
||||
|
||||
IMAGE_CORE_PREFIX(retro_get_system_av_info)(&info);
|
||||
|
||||
IMAGE_CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_SET_GEOMETRY, &info.geometry);
|
||||
|
||||
process_new_image = false;
|
||||
}
|
||||
|
||||
#ifdef DUPE_TEST
|
||||
if (!image_uploaded)
|
||||
{
|
||||
@@ -236,6 +388,7 @@ void IMAGE_CORE_PREFIX(retro_run)(void)
|
||||
#else
|
||||
IMAGE_CORE_PREFIX(video_cb)(image_buffer, image_width, image_height, image_width * sizeof(uint32_t));
|
||||
#endif
|
||||
frames++;
|
||||
}
|
||||
|
||||
unsigned IMAGE_CORE_PREFIX(retro_api_version)(void)
|
||||
@@ -0,0 +1 @@
|
||||
#include "../internal_cores.h"
|
||||
@@ -0,0 +1,172 @@
|
||||
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 Darwin,$(shell uname -a)),)
|
||||
system_platform = osx
|
||||
arch = intel
|
||||
ifeq ($(shell uname -p),powerpc)
|
||||
arch = ppc
|
||||
endif
|
||||
else ifneq ($(findstring MINGW,$(shell uname -a)),)
|
||||
system_platform = win
|
||||
endif
|
||||
|
||||
TARGET_NAME = testgl_ff
|
||||
|
||||
ifeq ($(platform), unix)
|
||||
TARGET := $(TARGET_NAME)_libretro.so
|
||||
fpic := -fPIC
|
||||
SHARED := -shared -Wl,--version-script=link.T -Wl,--no-undefined
|
||||
GL_LIB := -lGL
|
||||
else ifneq (,$(findstring osx,$(platform)))
|
||||
TARGET := $(TARGET_NAME)_libretro.dylib
|
||||
fpic := -fPIC
|
||||
SHARED := -dynamiclib
|
||||
GL_LIB := -framework OpenGL
|
||||
CFLAGS += -DOSX
|
||||
ifeq ($(arch),ppc)
|
||||
CFLAGS += -D__ppc__ -DOSX_PPC
|
||||
endif
|
||||
OSXVER = `sw_vers -productVersion | cut -d. -f 2`
|
||||
OSX_LT_MAVERICKS = `(( $(OSXVER) <= 9)) && echo "YES"`
|
||||
fpic += -mmacosx-version-min=10.1
|
||||
else ifeq ($(platform), pi)
|
||||
TARGET := $(TARGET_NAME)_libretro.so
|
||||
fpic := -fPIC
|
||||
SHARED := -shared -Wl,--version-script=link.T -Wl,--no-undefined
|
||||
CFLAGS += -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/vmcs_host/linux
|
||||
GLES := 1
|
||||
LIBS += -L/opt/vc/lib
|
||||
else ifneq (,$(findstring ios,$(platform)))
|
||||
TARGET := $(TARGET_NAME)_libretro_ios.dylib
|
||||
fpic := -fPIC
|
||||
SHARED := -dynamiclib
|
||||
|
||||
ifeq ($(IOSSDK),)
|
||||
IOSSDK := $(shell xcodebuild -version -sdk iphoneos Path)
|
||||
endif
|
||||
|
||||
GL_LIB := -framework OpenGLES
|
||||
DEFINES := -DIOS
|
||||
CFLAGS += -DGLES $(DEFINES)
|
||||
CC = cc -arch armv7 -isysroot $(IOSSDK)
|
||||
ifeq ($(platform),ios9)
|
||||
CC += -miphoneos-version-min=8.0
|
||||
CFLAGS += -miphoneos-version-min=8.0
|
||||
else
|
||||
CC += -miphoneos-version-min=5.0
|
||||
CFLAGS += -miphoneos-version-min=5.0
|
||||
endif
|
||||
else ifneq (,$(findstring qnx,$(platform)))
|
||||
TARGET := $(TARGET_NAME)_libretro_qnx.so
|
||||
fpic := -fPIC
|
||||
SHARED := -shared -Wl,--version-script=link.T
|
||||
GL_LIB := -lGL
|
||||
|
||||
CC = qcc -Vgcc_ntoarmv7le
|
||||
AR = qcc -Vgcc_ntoarmv7le
|
||||
CFLAGS += -DGLES
|
||||
GL_LIB := -lGLESv2
|
||||
GLES := 1
|
||||
else ifneq (,$(findstring armv,$(platform)))
|
||||
CC = gcc
|
||||
TARGET := $(TARGET_NAME)_libretro.so
|
||||
fpic := -fPIC
|
||||
SHARED := -shared -Wl,--version-script=link.T -Wl,--no-undefined
|
||||
CFLAGS += -I.
|
||||
ifneq (,$(findstring gles,$(platform)))
|
||||
GLES := 1
|
||||
else
|
||||
GL_LIB := -lGL
|
||||
endif
|
||||
ifneq (,$(findstring cortexa8,$(platform)))
|
||||
CFLAGS += -marm -mcpu=cortex-a8
|
||||
else ifneq (,$(findstring cortexa9,$(platform)))
|
||||
CFLAGS += -marm -mcpu=cortex-a9
|
||||
endif
|
||||
CFLAGS += -marm
|
||||
ifneq (,$(findstring neon,$(platform)))
|
||||
CFLAGS += -mfpu=neon
|
||||
endif
|
||||
ifneq (,$(findstring softfloat,$(platform)))
|
||||
CFLAGS += -mfloat-abi=softfp
|
||||
else ifneq (,$(findstring hardfloat,$(platform)))
|
||||
CFLAGS += -mfloat-abi=hard
|
||||
endif
|
||||
CFLAGS += -DARM
|
||||
# emscripten
|
||||
else ifeq ($(platform), emscripten)
|
||||
TARGET := $(TARGET_NAME)_libretro_emscripten.bc
|
||||
else
|
||||
CC = gcc
|
||||
TARGET := $(TARGET_NAME)_libretro.dll
|
||||
SHARED := -shared -static-libgcc -static-libstdc++ -s -Wl,--version-script=link.T -Wl,--no-undefined
|
||||
GL_LIB := -lopengl32
|
||||
CFLAGS += -I..
|
||||
endif
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
CFLAGS += -O0 -g
|
||||
else
|
||||
CFLAGS += -O3
|
||||
endif
|
||||
|
||||
ifneq (,$(findstring qnx,$(platform)))
|
||||
CFLAGS += -Wc,-std=c99
|
||||
else
|
||||
CFLAGS += -std=gnu99
|
||||
endif
|
||||
|
||||
OBJECTS := libretro_gl_ff_test.o ../../libretro-common/glsym/rglgen.o
|
||||
CFLAGS += -Wall -pedantic $(fpic)
|
||||
|
||||
ifeq ($(GLES), 1)
|
||||
CFLAGS += -DGLES -DHAVE_OPENGLES2
|
||||
ifeq ($(GLES31), 1)
|
||||
CFLAGS += -DHAVE_OPENGLES3 -DGLES31 -DGLES3
|
||||
else ifeq ($(GLES3), 1)
|
||||
CFLAGS += -DHAVE_OPENGLES3 -DGLES3
|
||||
endif
|
||||
LIBS += -lGLESv2 # Still link against GLESv2 when using GLES3 API, at least on desktop Linux.
|
||||
OBJECTS += ../../libretro-common/glsym/glsym_es2.o
|
||||
else
|
||||
OBJECTS += ../../libretro-common/glsym/glsym_gl.o
|
||||
LIBS += $(GL_LIB)
|
||||
endif
|
||||
|
||||
ifeq ($(CORE), 1)
|
||||
CFLAGS += -DCORE
|
||||
endif
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
$(TARGET): $(OBJECTS)
|
||||
$(CC) $(fpic) $(SHARED) $(INCLUDES) -o $@ $(OBJECTS) $(LIBS) -lm $(EXTRA_GL_LIBS)
|
||||
|
||||
%.o: %.c
|
||||
$(CC) -I../../libretro-common/include $(CFLAGS) -c -o $@ $<
|
||||
|
||||
clean:
|
||||
rm -f $(OBJECTS) $(TARGET)
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := retro-test-gl-ff
|
||||
|
||||
ifeq ($(TARGET_ARCH),arm)
|
||||
LOCAL_CFLAGS += -DANDROID_ARM
|
||||
LOCAL_ARM_MODE := arm
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET_ARCH),x86)
|
||||
LOCAL_CFLAGS += -DANDROID_X86
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET_ARCH),mips)
|
||||
LOCAL_CFLAGS += -DANDROID_MIPS
|
||||
endif
|
||||
|
||||
GLES_LIB := -lGLESv2
|
||||
|
||||
LOCAL_SRC_FILES += $(addprefix ../,$(wildcard *.c) ../../../libretro-common/glsym/rglgen.c ../../../libretro-common/glsym/glsym_es2.c)
|
||||
LOCAL_CFLAGS += -O2 -Wall -std=gnu99 -ffast-math -DGLES -DHAVE_OPENGLES2 -I../../../libretro-common/include
|
||||
LOCAL_LDLIBS += $(GLES_LIB)
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
APP_ABI := all
|
||||
ifeq ($(GLES), 3)
|
||||
APP_PLATFORM := android-18
|
||||
else
|
||||
APP_PLATFORM := android-9
|
||||
endif
|
||||
|
||||
@@ -0,0 +1,366 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <glsym/glsym.h>
|
||||
|
||||
#include "../../libretro.h"
|
||||
|
||||
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
|
||||
static struct retro_hw_render_callback hw_render;
|
||||
|
||||
#if defined(HAVE_PSGL)
|
||||
#define RARCH_GL_FRAMEBUFFER GL_FRAMEBUFFER_OES
|
||||
#define RARCH_GL_FRAMEBUFFER_COMPLETE GL_FRAMEBUFFER_COMPLETE_OES
|
||||
#define RARCH_GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0_EXT
|
||||
#elif defined(OSX_PPC)
|
||||
#define RARCH_GL_FRAMEBUFFER GL_FRAMEBUFFER_EXT
|
||||
#define RARCH_GL_FRAMEBUFFER_COMPLETE GL_FRAMEBUFFER_COMPLETE_EXT
|
||||
#define RARCH_GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0_EXT
|
||||
#else
|
||||
#define RARCH_GL_FRAMEBUFFER GL_FRAMEBUFFER
|
||||
#define RARCH_GL_FRAMEBUFFER_COMPLETE GL_FRAMEBUFFER_COMPLETE
|
||||
#define RARCH_GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0
|
||||
#endif
|
||||
|
||||
#define BASE_WIDTH 320
|
||||
#define BASE_HEIGHT 240
|
||||
#ifdef GLES
|
||||
#define MAX_WIDTH 1024
|
||||
#define MAX_HEIGHT 1024
|
||||
#else
|
||||
#define MAX_WIDTH 2048
|
||||
#define MAX_HEIGHT 2048
|
||||
#endif
|
||||
|
||||
static unsigned width = BASE_WIDTH;
|
||||
static unsigned height = BASE_HEIGHT;
|
||||
|
||||
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 GL (FF)";
|
||||
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 = MAX_WIDTH,
|
||||
.max_height = MAX_HEIGHT,
|
||||
.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 retro_set_environment(retro_environment_t cb)
|
||||
{
|
||||
environ_cb = cb;
|
||||
|
||||
struct retro_variable variables[] = {
|
||||
{
|
||||
"testgl_resolution",
|
||||
#ifdef GLES
|
||||
"Internal resolution; 320x240|360x480|480x272|512x384|512x512|640x240|640x448|640x480|720x576|800x600|960x720|1024x768",
|
||||
#else
|
||||
"Internal resolution; 320x240|360x480|480x272|512x384|512x512|640x240|640x448|640x480|720x576|800x600|960x720|1024x768|1024x1024|1280x720|1280x960|1600x1200|1920x1080|1920x1440|1920x1600|2048x2048",
|
||||
#endif
|
||||
},
|
||||
#ifdef CORE
|
||||
{ "testgl_multisample", "Multisampling; 1x|2x|4x" },
|
||||
#endif
|
||||
{ NULL, NULL },
|
||||
};
|
||||
|
||||
bool no_rom = true;
|
||||
cb(RETRO_ENVIRONMENT_SET_SUPPORT_NO_GAME, &no_rom);
|
||||
cb(RETRO_ENVIRONMENT_SET_VARIABLES, variables);
|
||||
}
|
||||
|
||||
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 void update_variables(void)
|
||||
{
|
||||
struct retro_variable var = {
|
||||
.key = "testgl_resolution",
|
||||
};
|
||||
|
||||
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
|
||||
{
|
||||
char *pch;
|
||||
char str[100];
|
||||
snprintf(str, sizeof(str), "%s", var.value);
|
||||
|
||||
pch = strtok(str, "x");
|
||||
if (pch)
|
||||
width = strtoul(pch, NULL, 0);
|
||||
pch = strtok(NULL, "x");
|
||||
if (pch)
|
||||
height = strtoul(pch, NULL, 0);
|
||||
|
||||
fprintf(stderr, "[libretro-test]: Got size: %u x %u.\n", width, height);
|
||||
}
|
||||
|
||||
#ifdef CORE
|
||||
var.key = "testgl_multisample";
|
||||
var.value = NULL;
|
||||
|
||||
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
|
||||
{
|
||||
switch (*var.value)
|
||||
{
|
||||
case '1':
|
||||
init_multisample(1);
|
||||
break;
|
||||
|
||||
case '2':
|
||||
init_multisample(2);
|
||||
break;
|
||||
|
||||
case '4':
|
||||
init_multisample(4);
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static unsigned frame_count;
|
||||
|
||||
void retro_run(void)
|
||||
{
|
||||
bool updated = false;
|
||||
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE, &updated) && updated)
|
||||
update_variables();
|
||||
|
||||
input_poll_cb();
|
||||
|
||||
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_UP))
|
||||
{
|
||||
}
|
||||
|
||||
float ratio = width / (float)height;
|
||||
|
||||
glBindFramebuffer(RARCH_GL_FRAMEBUFFER, hw_render.get_current_framebuffer());
|
||||
|
||||
glClearColor(0.3, 0.4, 0.5, 1.0);
|
||||
glViewport(0, 0, width, height);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(-ratio, ratio, -1.f, 1.f, 1.f, -1.f);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
glRotatef((float)frame_count * 2, 0.0f, 0.0f, 0.1f);
|
||||
|
||||
glLoadIdentity();
|
||||
glBegin(GL_TRIANGLES);
|
||||
|
||||
glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
glVertex2f(-0.5f, -0.5f);
|
||||
|
||||
glColor4f(1.0f, 1.0f, 0.0f, 1.0f);
|
||||
glVertex2f(0.5f, -0.5f);
|
||||
|
||||
glColor4f(0.0f, 1.0f, 1.0f, 1.0f);
|
||||
glVertex2f(-0.5f, 0.5f);
|
||||
|
||||
glColor4f(1.0f, 0.0f, 1.0f, 1.0f);
|
||||
glVertex2f(0.5f, 0.5f);
|
||||
|
||||
glEnd();
|
||||
|
||||
frame_count++;
|
||||
|
||||
video_cb(RETRO_HW_FRAME_BUFFER_VALID, width, height, 0);
|
||||
}
|
||||
|
||||
static void context_reset(void)
|
||||
{
|
||||
fprintf(stderr, "Context reset!\n");
|
||||
rglgen_resolve_symbols(hw_render.get_proc_address);
|
||||
}
|
||||
|
||||
static void context_destroy(void)
|
||||
{
|
||||
fprintf(stderr, "Context destroy!\n");
|
||||
}
|
||||
|
||||
#ifdef GLES
|
||||
static bool retro_init_hw_context(void)
|
||||
{
|
||||
#if defined(GLES31)
|
||||
hw_render.context_type = RETRO_HW_CONTEXT_OPENGLES_VERSION;
|
||||
hw_render.version_major = 3;
|
||||
hw_render.version_minor = 1;
|
||||
#elif defined(GLES3)
|
||||
hw_render.context_type = RETRO_HW_CONTEXT_OPENGLES3;
|
||||
#else
|
||||
hw_render.context_type = RETRO_HW_CONTEXT_OPENGLES2;
|
||||
#endif
|
||||
hw_render.context_reset = context_reset;
|
||||
hw_render.context_destroy = context_destroy;
|
||||
hw_render.depth = true;
|
||||
hw_render.bottom_left_origin = true;
|
||||
|
||||
if (!environ_cb(RETRO_ENVIRONMENT_SET_HW_RENDER, &hw_render))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
#else
|
||||
static bool retro_init_hw_context(void)
|
||||
{
|
||||
hw_render.context_type = RETRO_HW_CONTEXT_OPENGL;
|
||||
hw_render.context_reset = context_reset;
|
||||
hw_render.context_destroy = context_destroy;
|
||||
hw_render.depth = true;
|
||||
hw_render.bottom_left_origin = true;
|
||||
|
||||
if (!environ_cb(RETRO_ENVIRONMENT_SET_HW_RENDER, &hw_render))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool retro_load_game(const struct retro_game_info *info)
|
||||
{
|
||||
update_variables();
|
||||
|
||||
enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_XRGB8888;
|
||||
if (!environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt))
|
||||
{
|
||||
fprintf(stderr, "XRGB8888 is not supported.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!retro_init_hw_context())
|
||||
{
|
||||
fprintf(stderr, "HW Context could not be initialized, exiting...\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
fprintf(stderr, "Loaded game!\n");
|
||||
(void)info;
|
||||
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: *;
|
||||
};
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
ifneq ($(EMSCRIPTEN),)
|
||||
platform = emscripten
|
||||
endif
|
||||
|
||||
ifeq ($(platform),)
|
||||
platform = unix
|
||||
ifeq ($(shell uname -a),)
|
||||
@@ -140,7 +136,7 @@ else
|
||||
CFLAGS += -std=gnu99
|
||||
endif
|
||||
|
||||
OBJECTS := libretro-test.o ../../libretro-common/glsym/rglgen.o
|
||||
OBJECTS := libretro_gl_test.o ../../libretro-common/glsym/rglgen.o
|
||||
CFLAGS += -Wall -pedantic $(fpic)
|
||||
|
||||
ifeq ($(GLES), 1)
|
||||
|
||||
@@ -35,13 +35,13 @@ static struct retro_hw_render_callback hw_render;
|
||||
#define MAX_HEIGHT 2048
|
||||
#endif
|
||||
|
||||
static unsigned width = BASE_WIDTH;
|
||||
static unsigned width = BASE_WIDTH;
|
||||
static unsigned height = BASE_HEIGHT;
|
||||
|
||||
static GLuint prog;
|
||||
static GLuint vbo;
|
||||
|
||||
#ifdef CORE
|
||||
#if defined(CORE)
|
||||
static bool context_alive;
|
||||
static bool multisample_fbo;
|
||||
static unsigned multisample;
|
||||
@@ -49,10 +49,7 @@ static GLuint vao;
|
||||
|
||||
static GLuint fbo;
|
||||
static GLuint rbo_color, rbo_depth_stencil;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef CORE
|
||||
static const char *vertex_shader[] = {
|
||||
"#version 140\n"
|
||||
"uniform mat4 uMVP;",
|
||||
@@ -114,7 +111,7 @@ static void compile_program(void)
|
||||
glDeleteShader(frag);
|
||||
}
|
||||
|
||||
#ifdef CORE
|
||||
#if defined(CORE)
|
||||
static void init_multisample(unsigned samples)
|
||||
{
|
||||
multisample = samples;
|
||||
@@ -184,7 +181,7 @@ static void setup_vao(void)
|
||||
1.0, 0.0, 1.0, 1.0,
|
||||
};
|
||||
|
||||
#ifdef CORE
|
||||
#if defined(CORE)
|
||||
glGenVertexArrays(1, &vao);
|
||||
#endif
|
||||
|
||||
@@ -342,6 +339,8 @@ static void update_variables(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
static unsigned frame_count;
|
||||
|
||||
void retro_run(void)
|
||||
{
|
||||
bool updated = false;
|
||||
@@ -350,6 +349,11 @@ void retro_run(void)
|
||||
|
||||
input_poll_cb();
|
||||
|
||||
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_UP))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#ifdef CORE
|
||||
glBindVertexArray(vao);
|
||||
if (multisample_fbo)
|
||||
@@ -377,8 +381,6 @@ void retro_run(void)
|
||||
|
||||
int loc = glGetUniformLocation(prog, "uMVP");
|
||||
|
||||
static unsigned frame_count;
|
||||
frame_count++;
|
||||
float angle = frame_count / 100.0;
|
||||
float cos_angle = cos(angle);
|
||||
float sin_angle = sin(angle);
|
||||
@@ -421,6 +423,9 @@ void retro_run(void)
|
||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
frame_count++;
|
||||
|
||||
video_cb(RETRO_HW_FRAME_BUFFER_VALID, width, height, 0);
|
||||
}
|
||||
|
||||
@@ -428,6 +433,7 @@ static void context_reset(void)
|
||||
{
|
||||
fprintf(stderr, "Context reset!\n");
|
||||
rglgen_resolve_symbols(hw_render.get_proc_address);
|
||||
|
||||
compile_program();
|
||||
setup_vao();
|
||||
#ifdef CORE
|
||||
@@ -478,7 +484,7 @@ static bool retro_init_hw_context(void)
|
||||
#else
|
||||
static bool retro_init_hw_context(void)
|
||||
{
|
||||
#ifdef CORE
|
||||
#if defined(CORE)
|
||||
hw_render.context_type = RETRO_HW_CONTEXT_OPENGL_CORE;
|
||||
hw_render.version_major = 3;
|
||||
hw_render.version_minor = 1;
|
||||
@@ -0,0 +1,65 @@
|
||||
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
|
||||
|
||||
ifeq ($(platform), unix)
|
||||
TARGET := $(TARGET_NAME)_libretro.so
|
||||
fpic := -fPIC
|
||||
SHARED := -shared -Wl,--version-script=link.T -Wl,--no-undefined
|
||||
VULKAN_LIB := -lvulkan
|
||||
else
|
||||
CC = gcc
|
||||
TARGET := $(TARGET_NAME)_libretro.dll
|
||||
SHARED := -shared -static-libgcc -static-libstdc++ -s -Wl,--version-script=link.T -Wl,--no-undefined
|
||||
VULKAN_LIB := -lvulkan
|
||||
CFLAGS += -I..
|
||||
endif
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
CFLAGS += -O0 -g
|
||||
else
|
||||
CFLAGS += -O3
|
||||
endif
|
||||
|
||||
CFLAGS += -std=gnu99
|
||||
OBJECTS := libretro-test.o
|
||||
CFLAGS += -Wall -pedantic $(fpic)
|
||||
LIBS += $(VULKAN_LIB)
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
$(TARGET): $(OBJECTS)
|
||||
$(CC) $(fpic) $(SHARED) $(INCLUDES) -o $@ $(OBJECTS) $(LIBS) -lm $(EXTRA_VULKAN_LIBS)
|
||||
|
||||
%.o: %.c
|
||||
$(CC) -I../../libretro-common/include $(CFLAGS) -c -o $@ $<
|
||||
|
||||
clean:
|
||||
rm -f $(OBJECTS) $(TARGET)
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
@@ -0,0 +1,790 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#define VK_PROTOTYPES
|
||||
#include "../../libretro_vulkan.h"
|
||||
#include "shaders/triangle.vert.inc"
|
||||
#include "shaders/triangle.frag.inc"
|
||||
|
||||
#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;
|
||||
|
||||
#define BASE_WIDTH 320
|
||||
#define BASE_HEIGHT 240
|
||||
#define MAX_SYNC 8
|
||||
|
||||
struct buffer
|
||||
{
|
||||
VkBuffer buffer;
|
||||
VkDeviceMemory memory;
|
||||
};
|
||||
|
||||
struct vulkan_data
|
||||
{
|
||||
unsigned index;
|
||||
unsigned num_swapchain_images;
|
||||
uint32_t swapchain_mask;
|
||||
struct buffer vbo;
|
||||
struct buffer ubo[MAX_SYNC];
|
||||
|
||||
VkPhysicalDeviceMemoryProperties memory_properties;
|
||||
VkPhysicalDeviceProperties gpu_properties;
|
||||
|
||||
VkDescriptorSetLayout set_layout;
|
||||
VkDescriptorPool desc_pool;
|
||||
VkDescriptorSet desc_set[MAX_SYNC];
|
||||
|
||||
VkPipelineCache pipeline_cache;
|
||||
VkPipelineLayout pipeline_layout;
|
||||
VkRenderPass render_pass;
|
||||
VkPipeline pipeline;
|
||||
|
||||
struct retro_vulkan_image images[MAX_SYNC];
|
||||
VkDeviceMemory image_memory[MAX_SYNC];
|
||||
VkFramebuffer framebuffers[MAX_SYNC];
|
||||
VkCommandPool cmd_pool[MAX_SYNC];
|
||||
VkCommandBuffer cmd[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 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 update_ubo(void)
|
||||
{
|
||||
static unsigned frame;
|
||||
float c = cosf(frame * 0.01f);
|
||||
float s = sinf(frame * 0.01f);
|
||||
frame++;
|
||||
|
||||
float tmp[16] = {0.0f};
|
||||
tmp[ 0] = c;
|
||||
tmp[ 1] = s;
|
||||
tmp[ 4] = -s;
|
||||
tmp[ 5] = c;
|
||||
tmp[10] = 1.0f;
|
||||
tmp[15] = 1.0f;
|
||||
|
||||
float *mvp = NULL;
|
||||
vkMapMemory(vulkan->device, vk.ubo[vk.index].memory,
|
||||
0, 16 * sizeof(float), 0, (void**)&mvp);
|
||||
memcpy(mvp, tmp, sizeof(tmp));
|
||||
vkUnmapMemory(vulkan->device, vk.ubo[vk.index].memory);
|
||||
}
|
||||
|
||||
static void vulkan_test_render(void)
|
||||
{
|
||||
update_ubo();
|
||||
|
||||
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_COLOR_ATTACHMENT_WRITE_BIT;
|
||||
prepare_rendering.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED;
|
||||
prepare_rendering.newLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
|
||||
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_COLOR_ATTACHMENT_OUTPUT_BIT,
|
||||
false,
|
||||
0, NULL,
|
||||
0, NULL,
|
||||
1, &prepare_rendering);
|
||||
|
||||
VkClearValue clear_value;
|
||||
clear_value.color.float32[0] = 0.8f;
|
||||
clear_value.color.float32[1] = 0.6f;
|
||||
clear_value.color.float32[2] = 0.2f;
|
||||
clear_value.color.float32[3] = 1.0f;
|
||||
|
||||
VkRenderPassBeginInfo rp_begin = { VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO };
|
||||
rp_begin.renderPass = vk.render_pass;
|
||||
rp_begin.framebuffer = vk.framebuffers[vk.index];
|
||||
rp_begin.renderArea.extent.width = BASE_WIDTH;
|
||||
rp_begin.renderArea.extent.height = BASE_HEIGHT;
|
||||
rp_begin.clearValueCount = 1;
|
||||
rp_begin.pClearValues = &clear_value;
|
||||
vkCmdBeginRenderPass(cmd, &rp_begin, VK_SUBPASS_CONTENTS_INLINE);
|
||||
|
||||
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);
|
||||
|
||||
VkViewport vp = { 0 };
|
||||
vp.x = 0.0f;
|
||||
vp.y = 0.0f;
|
||||
vp.width = BASE_WIDTH;
|
||||
vp.height = BASE_HEIGHT;
|
||||
vp.minDepth = 0.0f;
|
||||
vp.maxDepth = 1.0f;
|
||||
vkCmdSetViewport(cmd, 0, 1, &vp);
|
||||
|
||||
VkRect2D scissor;
|
||||
memset(&scissor, 0, sizeof(scissor));
|
||||
scissor.extent.width = BASE_WIDTH;
|
||||
scissor.extent.height = BASE_HEIGHT;
|
||||
vkCmdSetScissor(cmd, 0, 1, &scissor);
|
||||
|
||||
VkDeviceSize offset = 0;
|
||||
vkCmdBindVertexBuffers(cmd, 0, 1, &vk.vbo.buffer, &offset);
|
||||
|
||||
vkCmdDraw(cmd, 3, 1, 0, 0);
|
||||
|
||||
vkCmdEndRenderPass(cmd);
|
||||
|
||||
VkImageMemoryBarrier prepare_presentation = { VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER };
|
||||
prepare_presentation.srcAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
|
||||
prepare_presentation.dstAccessMask = VK_ACCESS_SHADER_READ_BIT;
|
||||
prepare_presentation.oldLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
|
||||
prepare_presentation.newLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
|
||||
|
||||
prepare_presentation.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
|
||||
prepare_presentation.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
|
||||
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_ALL_GRAPHICS_BIT,
|
||||
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
|
||||
false,
|
||||
0, NULL,
|
||||
0, NULL,
|
||||
1, &prepare_presentation);
|
||||
|
||||
vkEndCommandBuffer(cmd);
|
||||
}
|
||||
|
||||
static struct buffer create_buffer(const void *initial, size_t size, VkBufferUsageFlags usage)
|
||||
{
|
||||
struct buffer buffer;
|
||||
VkDevice device = vulkan->device;
|
||||
|
||||
VkBufferCreateInfo info = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
|
||||
info.usage = usage;
|
||||
info.size = size;
|
||||
|
||||
vkCreateBuffer(device, &info, NULL, &buffer.buffer);
|
||||
|
||||
VkMemoryRequirements mem_reqs;
|
||||
vkGetBufferMemoryRequirements(device, buffer.buffer, &mem_reqs);
|
||||
|
||||
VkMemoryAllocateInfo alloc = { VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO };
|
||||
alloc.allocationSize = mem_reqs.size;
|
||||
|
||||
alloc.memoryTypeIndex = find_memory_type_from_requirements(mem_reqs.memoryTypeBits,
|
||||
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT);
|
||||
|
||||
vkAllocateMemory(device, &alloc, NULL, &buffer.memory);
|
||||
vkBindBufferMemory(device, buffer.buffer, buffer.memory, 0);
|
||||
|
||||
if (initial)
|
||||
{
|
||||
void *ptr;
|
||||
vkMapMemory(device, buffer.memory, 0, size, 0, &ptr);
|
||||
memcpy(ptr, initial, size);
|
||||
vkUnmapMemory(device, buffer.memory);
|
||||
}
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
static void init_vertex_buffer(void)
|
||||
{
|
||||
static const float data[] = {
|
||||
-0.5f, -0.5f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, // vec4 position, vec4 color
|
||||
-0.5f, +0.5f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f,
|
||||
+0.5f, -0.5f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f,
|
||||
};
|
||||
|
||||
vk.vbo = create_buffer(data, sizeof(data), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT);
|
||||
}
|
||||
|
||||
static void init_uniform_buffer(void)
|
||||
{
|
||||
for (unsigned i = 0; i < vk.num_swapchain_images; i++)
|
||||
{
|
||||
vk.ubo[i] = create_buffer(NULL, 16 * sizeof(float),
|
||||
VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT);
|
||||
}
|
||||
}
|
||||
|
||||
static VkShaderModule create_shader_module(const uint8_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;
|
||||
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_UNIFORM_BUFFER;
|
||||
binding.descriptorCount = 1;
|
||||
binding.stageFlags = VK_SHADER_STAGE_VERTEX_BIT;
|
||||
binding.pImmutableSamplers = NULL;
|
||||
|
||||
const VkDescriptorPoolSize pool_sizes[1] = {
|
||||
{ VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, vk.num_swapchain_images },
|
||||
};
|
||||
|
||||
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;
|
||||
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 };
|
||||
VkDescriptorBufferInfo buffer_info;
|
||||
|
||||
write.dstSet = vk.desc_set[i];
|
||||
write.dstBinding = 0;
|
||||
write.descriptorCount = 1;
|
||||
write.descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER;
|
||||
write.pBufferInfo = &buffer_info;
|
||||
|
||||
buffer_info.buffer = vk.ubo[i].buffer;
|
||||
buffer_info.offset = 0;
|
||||
buffer_info.range = 16 * sizeof(float);
|
||||
|
||||
vkUpdateDescriptorSets(device, 1, &write, 0, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static void init_pipeline(void)
|
||||
{
|
||||
VkDevice device = vulkan->device;
|
||||
|
||||
VkPipelineInputAssemblyStateCreateInfo input_assembly = { VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO };
|
||||
input_assembly.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
|
||||
|
||||
VkVertexInputAttributeDescription attributes[2] = {{ 0 }};
|
||||
attributes[0].location = 0;
|
||||
attributes[0].binding = 0;
|
||||
attributes[0].format = VK_FORMAT_R32G32B32A32_SFLOAT;
|
||||
attributes[0].offset = 0;
|
||||
attributes[1].location = 1;
|
||||
attributes[1].binding = 0;
|
||||
attributes[1].format = VK_FORMAT_R32G32B32A32_SFLOAT;
|
||||
attributes[1].offset = 4 * sizeof(float);
|
||||
|
||||
VkVertexInputBindingDescription binding = { 0 };
|
||||
binding.binding = 0;
|
||||
binding.stride = sizeof(float) * 8;
|
||||
binding.inputRate = VK_VERTEX_INPUT_RATE_VERTEX;
|
||||
|
||||
VkPipelineVertexInputStateCreateInfo vertex_input = { VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO };
|
||||
vertex_input.vertexBindingDescriptionCount = 1;
|
||||
vertex_input.pVertexBindingDescriptions = &binding;
|
||||
vertex_input.vertexAttributeDescriptionCount = 2;
|
||||
vertex_input.pVertexAttributeDescriptions = attributes;
|
||||
|
||||
VkPipelineRasterizationStateCreateInfo raster = { VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO };
|
||||
raster.polygonMode = VK_POLYGON_MODE_FILL;
|
||||
raster.cullMode = VK_CULL_MODE_BACK_BIT;
|
||||
raster.frontFace = VK_FRONT_FACE_COUNTER_CLOCKWISE;
|
||||
raster.depthClampEnable = false;
|
||||
raster.rasterizerDiscardEnable = false;
|
||||
raster.depthBiasEnable = false;
|
||||
raster.lineWidth = 1.0f;
|
||||
|
||||
VkPipelineColorBlendAttachmentState blend_attachment = { 0 };
|
||||
blend_attachment.blendEnable = false;
|
||||
blend_attachment.colorWriteMask = 0xf;
|
||||
|
||||
VkPipelineColorBlendStateCreateInfo blend = { VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO };
|
||||
blend.attachmentCount = 1;
|
||||
blend.pAttachments = &blend_attachment;
|
||||
|
||||
VkPipelineViewportStateCreateInfo viewport = { VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO };
|
||||
viewport.viewportCount = 1;
|
||||
viewport.scissorCount = 1;
|
||||
|
||||
VkPipelineDepthStencilStateCreateInfo depth_stencil = { VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO };
|
||||
depth_stencil.depthTestEnable = false;
|
||||
depth_stencil.depthWriteEnable = false;
|
||||
depth_stencil.depthBoundsTestEnable = false;
|
||||
depth_stencil.stencilTestEnable = false;
|
||||
|
||||
VkPipelineMultisampleStateCreateInfo multisample = { VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO };
|
||||
multisample.rasterizationSamples = VK_SAMPLE_COUNT_1_BIT;
|
||||
|
||||
static const VkDynamicState dynamics[] = {
|
||||
VK_DYNAMIC_STATE_VIEWPORT,
|
||||
VK_DYNAMIC_STATE_SCISSOR,
|
||||
};
|
||||
VkPipelineDynamicStateCreateInfo dynamic = { VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO };
|
||||
dynamic.pDynamicStates = dynamics;
|
||||
dynamic.dynamicStateCount = sizeof(dynamics) / sizeof(dynamics[0]);
|
||||
|
||||
VkPipelineShaderStageCreateInfo shader_stages[2] = {
|
||||
{ VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO },
|
||||
{ VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO },
|
||||
};
|
||||
|
||||
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].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].pName = "main";
|
||||
|
||||
VkGraphicsPipelineCreateInfo pipe = { VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO };
|
||||
pipe.stageCount = 2;
|
||||
pipe.pStages = shader_stages;
|
||||
pipe.pVertexInputState = &vertex_input;
|
||||
pipe.pInputAssemblyState = &input_assembly;
|
||||
pipe.pRasterizationState = &raster;
|
||||
pipe.pColorBlendState = &blend;
|
||||
pipe.pMultisampleState = &multisample;
|
||||
pipe.pViewportState = &viewport;
|
||||
pipe.pDepthStencilState = &depth_stencil;
|
||||
pipe.pDynamicState = &dynamic;
|
||||
pipe.renderPass = vk.render_pass;
|
||||
pipe.layout = vk.pipeline_layout;
|
||||
|
||||
vkCreateGraphicsPipelines(vulkan->device, vk.pipeline_cache, 1, &pipe, NULL, &vk.pipeline);
|
||||
|
||||
vkDestroyShaderModule(device, shader_stages[0].module, NULL);
|
||||
vkDestroyShaderModule(device, shader_stages[1].module, NULL);
|
||||
}
|
||||
|
||||
static void init_render_pass(VkFormat format)
|
||||
{
|
||||
VkAttachmentDescription attachment = { 0 };
|
||||
attachment.format = format;
|
||||
attachment.samples = VK_SAMPLE_COUNT_1_BIT;
|
||||
attachment.loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
|
||||
attachment.storeOp = VK_ATTACHMENT_STORE_OP_STORE;
|
||||
attachment.stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
|
||||
attachment.stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
|
||||
|
||||
attachment.initialLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
|
||||
attachment.finalLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
|
||||
|
||||
VkAttachmentReference color_ref = { 0, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL };
|
||||
VkSubpassDescription subpass = { 0 };
|
||||
subpass.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS;
|
||||
subpass.colorAttachmentCount = 1;
|
||||
subpass.pColorAttachments = &color_ref;
|
||||
|
||||
VkRenderPassCreateInfo rp_info = { VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO };
|
||||
rp_info.attachmentCount = 1;
|
||||
rp_info.pAttachments = &attachment;
|
||||
rp_info.subpassCount = 1;
|
||||
rp_info.pSubpasses = &subpass;
|
||||
vkCreateRenderPass(vulkan->device, &rp_info, NULL, &vk.render_pass);
|
||||
}
|
||||
|
||||
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_COLOR_ATTACHMENT_BIT |
|
||||
VK_IMAGE_USAGE_SAMPLED_BIT |
|
||||
VK_IMAGE_USAGE_TRANSFER_SRC_BIT;
|
||||
image.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
|
||||
image.mipLevels = 1;
|
||||
image.arrayLayers = 1;
|
||||
|
||||
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_SHADER_READ_ONLY_OPTIMAL;
|
||||
|
||||
VkFramebufferCreateInfo fb_info = { VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO };
|
||||
fb_info.renderPass = vk.render_pass;
|
||||
fb_info.attachmentCount = 1;
|
||||
fb_info.pAttachments = &vk.images[i].image_view;
|
||||
fb_info.width = BASE_WIDTH;
|
||||
fb_info.height = BASE_HEIGHT;
|
||||
fb_info.layers = 1;
|
||||
|
||||
vkCreateFramebuffer(device, &fb_info, NULL, &vk.framebuffers[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 = 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_uniform_buffer();
|
||||
init_vertex_buffer();
|
||||
init_command();
|
||||
init_descriptor();
|
||||
|
||||
VkPipelineCacheCreateInfo pipeline_cache_info = { VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO };
|
||||
vkCreatePipelineCache(vulkan->device, &pipeline_cache_info,
|
||||
NULL, &vk.pipeline_cache);
|
||||
|
||||
init_render_pass(VK_FORMAT_R8G8B8A8_UNORM);
|
||||
init_pipeline();
|
||||
init_swapchain();
|
||||
}
|
||||
|
||||
static void vulkan_test_deinit(void)
|
||||
{
|
||||
VkDevice device = vulkan->device;
|
||||
vkDeviceWaitIdle(device);
|
||||
|
||||
for (unsigned i = 0; i < vk.num_swapchain_images; i++)
|
||||
{
|
||||
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);
|
||||
|
||||
vkFreeMemory(device, vk.ubo[i].memory, NULL);
|
||||
vkDestroyBuffer(device, vk.ubo[i].buffer, NULL);
|
||||
}
|
||||
|
||||
vkFreeDescriptorSets(device, vk.desc_pool, vk.num_swapchain_images, vk.desc_set);
|
||||
vkDestroyDescriptorPool(device, vk.desc_pool, NULL);
|
||||
|
||||
vkDestroyRenderPass(device, vk.render_pass, NULL);
|
||||
vkDestroyPipeline(device, vk.pipeline, NULL);
|
||||
vkDestroyPipelineLayout(device, vk.pipeline_layout, 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++)
|
||||
{
|
||||
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], 0, NULL);
|
||||
vulkan->set_command_buffers(vulkan->handle, 1, &vk.cmd[vk.index]);
|
||||
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;
|
||||
}
|
||||
vulkan_test_init();
|
||||
}
|
||||
|
||||
static void context_destroy(void)
|
||||
{
|
||||
fprintf(stderr, "Context destroy!\n");
|
||||
vulkan_test_deinit();
|
||||
vulkan = NULL;
|
||||
memset(&vk, 0, sizeof(vk));
|
||||
}
|
||||
|
||||
static bool retro_init_hw_context(void)
|
||||
{
|
||||
hw_render.context_type = RETRO_HW_CONTEXT_VULKAN;
|
||||
hw_render.version_major = VK_API_VERSION;
|
||||
hw_render.version_minor = 0;
|
||||
hw_render.context_reset = context_reset;
|
||||
hw_render.context_destroy = context_destroy;
|
||||
hw_render.cache_context = true;
|
||||
if (!environ_cb(RETRO_ENVIRONMENT_SET_HW_RENDER, &hw_render))
|
||||
return false;
|
||||
|
||||
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;
|
||||
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,23 @@
|
||||
VERT_SHADERS := $(wildcard *.vert)
|
||||
FRAG_SHADERS := $(wildcard *.frag)
|
||||
SPIRV := $(VERT_SHADERS:.vert=.vert.spv) $(FRAG_SHADERS:.frag=.frag.spv)
|
||||
INCLUDES := $(SPIRV:.spv=.inc)
|
||||
|
||||
GLSLANG := glslangValidator
|
||||
|
||||
all: $(INCLUDES)
|
||||
|
||||
%.frag.spv: %.frag
|
||||
$(GLSLANG) -V -o $@ $<
|
||||
|
||||
%.vert.spv: %.vert
|
||||
$(GLSLANG) -V -o $@ $<
|
||||
|
||||
%.inc: %.spv
|
||||
xxd -i $< $@
|
||||
|
||||
clean:
|
||||
rm -f $(INCLUDES)
|
||||
rm -f $(SPIRV)
|
||||
|
||||
.PHONY: clean
|
||||
@@ -0,0 +1,9 @@
|
||||
#version 310 es
|
||||
precision mediump float;
|
||||
layout(location = 0) in vec4 vColor;
|
||||
layout(location = 0) out vec4 FragColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
FragColor = vColor;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
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;
|
||||
@@ -0,0 +1,15 @@
|
||||
#version 310 es
|
||||
layout(location = 0) in vec4 Position;
|
||||
layout(location = 1) in vec4 Color;
|
||||
layout(location = 0) out vec4 vColor;
|
||||
|
||||
layout(std140, set = 0, binding = 0) uniform UBO
|
||||
{
|
||||
mat4 MVP;
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = MVP * Position;
|
||||
vColor = Color;
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
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;
|
||||
@@ -120,6 +120,8 @@ else
|
||||
CFLAGS += -std=gnu99
|
||||
endif
|
||||
|
||||
CFLAGS += -I../../libretro-common/include
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
$(TARGET): $(OBJECTS)
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#include "../../libretro.h"
|
||||
|
||||
static uint16_t *frame_buf;
|
||||
static uint32_t *frame_buf;
|
||||
static struct retro_log_callback logging;
|
||||
static retro_log_printf_t log_cb;
|
||||
static bool use_audio_cb;
|
||||
@@ -27,7 +27,7 @@ static void fallback_log(enum retro_log_level level, const char *fmt, ...)
|
||||
|
||||
void retro_init(void)
|
||||
{
|
||||
frame_buf = calloc(320 * 240, sizeof(uint16_t));
|
||||
frame_buf = calloc(320 * 240, sizeof(uint32_t));
|
||||
}
|
||||
|
||||
void retro_deinit(void)
|
||||
@@ -278,11 +278,29 @@ static void update_input(void)
|
||||
|
||||
static void render_checkered(void)
|
||||
{
|
||||
uint16_t color_r = 31 << 11;
|
||||
uint16_t color_g = 63 << 5;
|
||||
/* Try rendering straight into VRAM if we can. */
|
||||
uint32_t *buf = NULL;
|
||||
unsigned stride = 0;
|
||||
struct retro_framebuffer fb = {0};
|
||||
fb.width = 320;
|
||||
fb.height = 240;
|
||||
fb.access_flags = RETRO_MEMORY_ACCESS_WRITE;
|
||||
if (environ_cb(RETRO_ENVIRONMENT_GET_CURRENT_SOFTWARE_FRAMEBUFFER, &fb) && fb.format == RETRO_PIXEL_FORMAT_XRGB8888)
|
||||
{
|
||||
buf = fb.data;
|
||||
stride = fb.pitch >> 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
buf = frame_buf;
|
||||
stride = 320;
|
||||
}
|
||||
|
||||
uint16_t *line = frame_buf;
|
||||
for (unsigned y = 0; y < 240; y++, line += 320)
|
||||
uint32_t color_r = 0xff << 16;
|
||||
uint32_t color_g = 0xff << 8;
|
||||
|
||||
uint32_t *line = buf;
|
||||
for (unsigned y = 0; y < 240; y++, line += stride)
|
||||
{
|
||||
unsigned index_y = ((y - y_coord) >> 4) & 1;
|
||||
for (unsigned x = 0; x < 320; x++)
|
||||
@@ -294,9 +312,9 @@ static void render_checkered(void)
|
||||
|
||||
for (unsigned y = mouse_rel_y - 5; y <= mouse_rel_y + 5; y++)
|
||||
for (unsigned x = mouse_rel_x - 5; x <= mouse_rel_x + 5; x++)
|
||||
frame_buf[y * 320 + x] = 0x1f;
|
||||
buf[y * stride + x] = 0xff;
|
||||
|
||||
video_cb(frame_buf, 320, 240, 320 << 1);
|
||||
video_cb(buf, 320, 240, stride << 2);
|
||||
}
|
||||
|
||||
static void check_variables(void)
|
||||
@@ -381,10 +399,10 @@ bool retro_load_game(const struct retro_game_info *info)
|
||||
|
||||
environ_cb(RETRO_ENVIRONMENT_SET_INPUT_DESCRIPTORS, desc);
|
||||
|
||||
enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_RGB565;
|
||||
enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_XRGB8888;
|
||||
if (!environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt))
|
||||
{
|
||||
log_cb(RETRO_LOG_INFO, "RGB565 is not supported.\n");
|
||||
log_cb(RETRO_LOG_INFO, "XRGB8888 is not supported.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ else ifeq ($(LIBRETRO), catsfc)
|
||||
APP_PRODUCT_CODE = RARCH-CATSFC
|
||||
APP_UNIQUE_ID = 0xBAC07
|
||||
APP_ICON = ctr/assets/catsfc.png
|
||||
#APP_BANNER = ctr/assets/libretro_banner.png
|
||||
APP_BANNER = ctr/assets/catsfc_banner.png
|
||||
#APP_AUDIO = ctr/assets/silent.wav
|
||||
|
||||
else ifeq ($(LIBRETRO), mednafen_wswan)
|
||||
@@ -117,7 +117,7 @@ else ifeq ($(LIBRETRO), picodrive)
|
||||
APP_PRODUCT_CODE = RARCH-PICODRIVE
|
||||
APP_UNIQUE_ID = 0xBAC0C
|
||||
APP_ICON = ctr/assets/picodrive.png
|
||||
#APP_BANNER = ctr/assets/libretro_banner.png
|
||||
APP_BANNER = ctr/assets/picodrive_banner.png
|
||||
#APP_AUDIO = ctr/assets/silent.wav
|
||||
|
||||
else ifeq ($(LIBRETRO), snes9x_next)
|
||||
@@ -262,6 +262,16 @@ else ifeq ($(LIBRETRO), pocketsnes)
|
||||
APP_PRODUCT_CODE = RARCH-POCKETSNES
|
||||
APP_UNIQUE_ID = 0xBAC1A
|
||||
APP_ICON = ctr/assets/pocketsnes.png
|
||||
APP_BANNER = ctr/assets/pocketsnes_banner.png
|
||||
#APP_AUDIO = ctr/assets/silent.wav
|
||||
|
||||
else ifeq ($(LIBRETRO), dosbox)
|
||||
APP_TITLE = DosBox
|
||||
#APP_DESCRIPTION = Retroarch 3DS
|
||||
APP_AUTHOR = various
|
||||
APP_PRODUCT_CODE = RARCH-DOSBOX
|
||||
APP_UNIQUE_ID = 0xBAC1B
|
||||
APP_ICON = ctr/assets/dosbox.png
|
||||
#APP_BANNER = ctr/assets/libretro_banner.png
|
||||
#APP_AUDIO = ctr/assets/silent.wav
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 6.1 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 668 B After Width: | Height: | Size: 6.2 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 29 KiB |
@@ -17,13 +17,11 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <file/file_extract.h>
|
||||
#include <retro_endianness.h>
|
||||
|
||||
#include "dir_list_special.h"
|
||||
#include "database_info.h"
|
||||
#include "msg_hash.h"
|
||||
#include "general.h"
|
||||
#include "verbosity.h"
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@@ -51,6 +49,7 @@
|
||||
#define DB_CURSOR_ROM_NAME 0x16bbcf13U
|
||||
#define DB_CURSOR_NAME 0x7c9b0c46U
|
||||
#define DB_CURSOR_DESCRIPTION 0x91b0c789U
|
||||
#define DB_CURSOR_GENRE 0x0f802156U
|
||||
#define DB_CURSOR_PUBLISHER 0x5e099013U
|
||||
#define DB_CURSOR_DEVELOPER 0x1783d2abU
|
||||
#define DB_CURSOR_ORIGIN 0x1315e3edU
|
||||
@@ -68,10 +67,12 @@
|
||||
#define DB_CURSOR_EDGE_MAGAZINE_RATING 0xd30dc4feU
|
||||
#define DB_CURSOR_EDGE_MAGAZINE_ISSUE 0xa0f30d42U
|
||||
#define DB_CURSOR_FAMITSU_MAGAZINE_RATING 0x0a50ca62U
|
||||
#define DB_CURSOR_TGDB_RATING 0x8d61458aU
|
||||
#define DB_CURSOR_MAX_USERS 0x1084ff77U
|
||||
#define DB_CURSOR_RELEASEDATE_MONTH 0x790ad76cU
|
||||
#define DB_CURSOR_RELEASEDATE_YEAR 0x7fd06ed7U
|
||||
#define DB_CURSOR_RUMBLE_SUPPORTED 0x1a4dc3ecU
|
||||
#define DB_CURSOR_COOP_SUPPORTED 0x7c953ff6U
|
||||
#define DB_CURSOR_ANALOG_SUPPORTED 0xf220fc17U
|
||||
#define DB_CURSOR_SIZE 0x7c9dede0U
|
||||
#define DB_CURSOR_SERIAL 0x1b843ec5U
|
||||
@@ -238,6 +239,7 @@ static int database_cursor_iterate(libretrodb_cursor_t *cur,
|
||||
|
||||
db_info->analog_supported = -1;
|
||||
db_info->rumble_supported = -1;
|
||||
db_info->coop_supported = -1;
|
||||
|
||||
for (i = 0; i < item.val.map.len; i++)
|
||||
{
|
||||
@@ -265,6 +267,9 @@ static int database_cursor_iterate(libretrodb_cursor_t *cur,
|
||||
case DB_CURSOR_DESCRIPTION:
|
||||
db_info->description = strdup(val->val.string.buff);
|
||||
break;
|
||||
case DB_CURSOR_GENRE:
|
||||
db_info->genre = strdup(val->val.string.buff);
|
||||
break;
|
||||
case DB_CURSOR_PUBLISHER:
|
||||
db_info->publisher = strdup(val->val.string.buff);
|
||||
break;
|
||||
@@ -307,6 +312,9 @@ static int database_cursor_iterate(libretrodb_cursor_t *cur,
|
||||
case DB_CURSOR_FAMITSU_MAGAZINE_RATING:
|
||||
db_info->famitsu_magazine_rating = val->val.uint_;
|
||||
break;
|
||||
case DB_CURSOR_TGDB_RATING:
|
||||
db_info->tgdb_rating = val->val.uint_;
|
||||
break;
|
||||
case DB_CURSOR_MAX_USERS:
|
||||
db_info->max_users = val->val.uint_;
|
||||
break;
|
||||
@@ -319,6 +327,9 @@ static int database_cursor_iterate(libretrodb_cursor_t *cur,
|
||||
case DB_CURSOR_RUMBLE_SUPPORTED:
|
||||
db_info->rumble_supported = val->val.uint_;
|
||||
break;
|
||||
case DB_CURSOR_COOP_SUPPORTED:
|
||||
db_info->coop_supported = val->val.uint_;
|
||||
break;
|
||||
case DB_CURSOR_ANALOG_SUPPORTED:
|
||||
db_info->analog_supported = val->val.uint_;
|
||||
break;
|
||||
|
||||
@@ -20,10 +20,10 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <boolean.h>
|
||||
#include <file/file_extract.h>
|
||||
|
||||
#include <file/file_archive.h>
|
||||
|
||||
#include "libretro-db/libretrodb.h"
|
||||
#include "playlist.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -55,7 +55,7 @@ typedef struct
|
||||
size_t list_ptr;
|
||||
struct string_list *list;
|
||||
#ifdef HAVE_ZLIB
|
||||
zlib_transfer_t state;
|
||||
file_archive_transfer_t state;
|
||||
#endif
|
||||
} database_info_handle_t;
|
||||
|
||||
@@ -65,6 +65,7 @@ typedef struct
|
||||
char *rom_name;
|
||||
char *serial;
|
||||
char *description;
|
||||
char *genre;
|
||||
char *publisher;
|
||||
struct string_list *developer;
|
||||
char *origin;
|
||||
@@ -86,8 +87,10 @@ typedef struct
|
||||
unsigned max_users;
|
||||
unsigned releasemonth;
|
||||
unsigned releaseyear;
|
||||
unsigned tgdb_rating;
|
||||
int analog_supported;
|
||||
int rumble_supported;
|
||||
int coop_supported;
|
||||
void *userdata;
|
||||
} database_info_t;
|
||||
|
||||
@@ -113,10 +116,8 @@ void database_info_free(database_info_handle_t *handle);
|
||||
int database_info_build_query(
|
||||
char *query, size_t len, const char *label, const char *path);
|
||||
|
||||
/*
|
||||
* NOTE: Allocates memory, it is the caller's responsibility to free the
|
||||
* memory after it is no longer required.
|
||||
*/
|
||||
/* NOTE: Allocates memory, it is the caller's responsibility to free the
|
||||
* memory after it is no longer required. */
|
||||
char *bin_to_hex_alloc(const uint8_t *data, size_t len);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -77,5 +77,4 @@ struct defaults
|
||||
/* Public data structures. */
|
||||
extern struct defaults g_defaults;
|
||||
|
||||
|
||||
#endif
|
||||
@@ -16,95 +16,12 @@
|
||||
#ifndef _GX_DEFINES_H
|
||||
#define _GX_DEFINES_H
|
||||
|
||||
#define _SHIFTL(v, s, w) ((uint32_t) (((uint32_t)(v) & ((0x01 << (w)) - 1)) << (s)))
|
||||
#define _SHIFTR(v, s, w) ((uint32_t)(((uint32_t)(v) >> (s)) & ((0x01 << (w)) - 1)))
|
||||
|
||||
#ifndef __lhbrx
|
||||
#define __lhbrx(base,index) \
|
||||
({ register u16 res; \
|
||||
__asm__ volatile ("lhbrx %0,%1,%2" : "=r"(res) : "b%"(index), "r"(base) : "memory"); \
|
||||
res; })
|
||||
#endif
|
||||
|
||||
#ifndef __sthbrx
|
||||
#define __sthbrx(base,index,value) \
|
||||
__asm__ volatile ("sthbrx %0,%1,%2" : : "r"(value), "b%"(index), "r"(base) : "memory")
|
||||
#endif
|
||||
|
||||
#ifndef __stwbrx
|
||||
#define __stwbrx(base,index,value) \
|
||||
__asm__ volatile ("stwbrx %0,%1,%2" : : "r"(value), "b%"(index), "r"(base) : "memory")
|
||||
#endif
|
||||
|
||||
#ifndef _sync
|
||||
#define _sync() asm volatile("sync")
|
||||
#endif
|
||||
|
||||
#ifndef _nop
|
||||
#define _nop() asm volatile("nop")
|
||||
#endif
|
||||
|
||||
#ifndef ppcsync
|
||||
#define ppcsync() asm volatile("sc")
|
||||
#endif
|
||||
|
||||
#ifndef ppchalt
|
||||
#define ppchalt() ({ \
|
||||
_sync(); \
|
||||
while(1) { \
|
||||
_nop(); \
|
||||
asm volatile("li 3,0"); \
|
||||
_nop(); \
|
||||
} \
|
||||
})
|
||||
#endif
|
||||
|
||||
#ifndef _CPU_ISR_Enable
|
||||
#define _CPU_ISR_Enable() \
|
||||
{ register u32 _val = 0; \
|
||||
__asm__ __volatile__ ( \
|
||||
"mfmsr %0\n" \
|
||||
"ori %0,%0,0x8000\n" \
|
||||
"mtmsr %0" \
|
||||
: "=&r" ((_val)) : "0" ((_val)) \
|
||||
); \
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef _CPU_ISR_Disable
|
||||
#define _CPU_ISR_Disable( _isr_cookie ) \
|
||||
{ register u32 _disable_mask = 0; \
|
||||
_isr_cookie = 0; \
|
||||
__asm__ __volatile__ ( \
|
||||
"mfmsr %0\n" \
|
||||
"rlwinm %1,%0,0,17,15\n" \
|
||||
"mtmsr %1\n" \
|
||||
"extrwi %0,%0,1,16" \
|
||||
: "=&r" ((_isr_cookie)), "=&r" ((_disable_mask)) \
|
||||
: "0" ((_isr_cookie)), "1" ((_disable_mask)) \
|
||||
); \
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef _CPU_ISR_Restore
|
||||
#define _CPU_ISR_Restore( _isr_cookie ) \
|
||||
{ register u32 _enable_mask = 0; \
|
||||
__asm__ __volatile__ ( \
|
||||
" cmpwi %0,0\n" \
|
||||
" beq 1f\n" \
|
||||
" mfmsr %1\n" \
|
||||
" ori %1,%1,0x8000\n" \
|
||||
" mtmsr %1\n" \
|
||||
"1:" \
|
||||
: "=r"((_isr_cookie)),"=&r" ((_enable_mask)) \
|
||||
: "0"((_isr_cookie)),"1" ((_enable_mask)) \
|
||||
); \
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef GEKKO
|
||||
|
||||
extern void __lwp_thread_stopmultitasking(void (*exitfunc)());
|
||||
#define SYSMEM1_SIZE 0x01800000
|
||||
|
||||
#define _SHIFTL(v, s, w) ((uint32_t) (((uint32_t)(v) & ((0x01 << (w)) - 1)) << (s)))
|
||||
#define _SHIFTR(v, s, w) ((uint32_t)(((uint32_t)(v) >> (s)) & ((0x01 << (w)) - 1)))
|
||||
|
||||
#define OSThread lwp_t
|
||||
#define OSCond lwpq_t
|
||||
@@ -120,19 +37,52 @@ extern void __lwp_thread_stopmultitasking(void (*exitfunc)());
|
||||
#define OSWaitCond(cond, mutex) LWP_CondWait(cond, mutex)
|
||||
|
||||
#define OSInitThreadQueue(queue) LWP_InitQueue(queue)
|
||||
#define OSCloseThreadQueue(queue) LWP_CloseQueue(queue)
|
||||
#define OSSleepThread(queue) LWP_ThreadSleep(queue)
|
||||
#define OSJoinThread(thread, val) LWP_JoinThread(thread, val)
|
||||
|
||||
#define OSCreateThread(thread, func, intarg, ptrarg, stackbase, stacksize, priority, attrs) LWP_CreateThread(thread, func, ptrarg, stackbase, stacksize, priority)
|
||||
|
||||
#define VISetPostRetraceCallback(cb) VIDEO_SetPostRetraceCallback(cb)
|
||||
#define VISetBlack(black) VIDEO_SetBlack(black)
|
||||
#define VIFlush() VIDEO_Flush()
|
||||
#define VISetNextFrameBuffer(fb) VIDEO_SetNextFramebuffer(fb)
|
||||
#define VIWaitForRetrace() VIDEO_WaitVSync()
|
||||
#define VIConfigure(rm) VIDEO_Configure(rm)
|
||||
#define VIInit() VIDEO_Init()
|
||||
#define VIPadFrameBufferWidth(width) VIDEO_PadFramebufferWidth(width)
|
||||
#define BLIT_LINE_16(off) \
|
||||
{ \
|
||||
const uint32_t *tmp_src = src; \
|
||||
uint32_t *tmp_dst = dst; \
|
||||
for (unsigned x = 0; x < width2 >> 1; x++, tmp_src += 2, tmp_dst += 8) \
|
||||
{ \
|
||||
tmp_dst[ 0 + off] = BLIT_LINE_16_CONV(tmp_src[0]); \
|
||||
tmp_dst[ 1 + off] = BLIT_LINE_16_CONV(tmp_src[1]); \
|
||||
} \
|
||||
src += tmp_pitch; \
|
||||
}
|
||||
|
||||
#define BLIT_LINE_32(off) \
|
||||
{ \
|
||||
const uint16_t *tmp_src = src; \
|
||||
uint16_t *tmp_dst = dst; \
|
||||
for (unsigned x = 0; x < width2 >> 3; x++, tmp_src += 8, tmp_dst += 32) \
|
||||
{ \
|
||||
tmp_dst[ 0 + off] = tmp_src[0] | 0xFF00; \
|
||||
tmp_dst[ 16 + off] = tmp_src[1]; \
|
||||
tmp_dst[ 1 + off] = tmp_src[2] | 0xFF00; \
|
||||
tmp_dst[ 17 + off] = tmp_src[3]; \
|
||||
tmp_dst[ 2 + off] = tmp_src[4] | 0xFF00; \
|
||||
tmp_dst[ 18 + off] = tmp_src[5]; \
|
||||
tmp_dst[ 3 + off] = tmp_src[6] | 0xFF00; \
|
||||
tmp_dst[ 19 + off] = tmp_src[7]; \
|
||||
} \
|
||||
src += tmp_pitch; \
|
||||
}
|
||||
|
||||
#define CHUNK_FRAMES 64
|
||||
#define CHUNK_SIZE (CHUNK_FRAMES * sizeof(uint32_t))
|
||||
#define BLOCKS 16
|
||||
|
||||
#define AIInit AUDIO_Init
|
||||
#define AIInitDMA AUDIO_InitDMA
|
||||
#define AIStartDMA AUDIO_StartDMA
|
||||
#define AIStopDMA AUDIO_StopDMA
|
||||
#define AIRegisterDMACallback AUDIO_RegisterDMACallback
|
||||
#define AISetDSPSampleRate AUDIO_SetDSPSampleRate
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,384 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2016 - 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/>.
|
||||
*/
|
||||
|
||||
#include "glslang.hpp"
|
||||
|
||||
#include "ShaderLang.h"
|
||||
#include "GlslangToSpv.h"
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include <cstring>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "../../general.h"
|
||||
|
||||
using namespace glslang;
|
||||
using namespace std;
|
||||
|
||||
struct SlangProcess
|
||||
{
|
||||
public:
|
||||
SlangProcess();
|
||||
|
||||
TBuiltInResource& GetResources() { return Resources; }
|
||||
~SlangProcess() { FinalizeProcess(); }
|
||||
|
||||
private:
|
||||
TBuiltInResource Resources;
|
||||
};
|
||||
|
||||
SlangProcess::SlangProcess()
|
||||
{
|
||||
InitializeProcess();
|
||||
|
||||
char DefaultConfig[] =
|
||||
"MaxLights 32\n"
|
||||
"MaxClipPlanes 6\n"
|
||||
"MaxTextureUnits 32\n"
|
||||
"MaxTextureCoords 32\n"
|
||||
"MaxVertexAttribs 64\n"
|
||||
"MaxVertexUniformComponents 4096\n"
|
||||
"MaxVaryingFloats 64\n"
|
||||
"MaxVertexTextureImageUnits 32\n"
|
||||
"MaxCombinedTextureImageUnits 80\n"
|
||||
"MaxTextureImageUnits 32\n"
|
||||
"MaxFragmentUniformComponents 4096\n"
|
||||
"MaxDrawBuffers 32\n"
|
||||
"MaxVertexUniformVectors 128\n"
|
||||
"MaxVaryingVectors 8\n"
|
||||
"MaxFragmentUniformVectors 16\n"
|
||||
"MaxVertexOutputVectors 16\n"
|
||||
"MaxFragmentInputVectors 15\n"
|
||||
"MinProgramTexelOffset -8\n"
|
||||
"MaxProgramTexelOffset 7\n"
|
||||
"MaxClipDistances 8\n"
|
||||
"MaxComputeWorkGroupCountX 65535\n"
|
||||
"MaxComputeWorkGroupCountY 65535\n"
|
||||
"MaxComputeWorkGroupCountZ 65535\n"
|
||||
"MaxComputeWorkGroupSizeX 1024\n"
|
||||
"MaxComputeWorkGroupSizeY 1024\n"
|
||||
"MaxComputeWorkGroupSizeZ 64\n"
|
||||
"MaxComputeUniformComponents 1024\n"
|
||||
"MaxComputeTextureImageUnits 16\n"
|
||||
"MaxComputeImageUniforms 8\n"
|
||||
"MaxComputeAtomicCounters 8\n"
|
||||
"MaxComputeAtomicCounterBuffers 1\n"
|
||||
"MaxVaryingComponents 60\n"
|
||||
"MaxVertexOutputComponents 64\n"
|
||||
"MaxGeometryInputComponents 64\n"
|
||||
"MaxGeometryOutputComponents 128\n"
|
||||
"MaxFragmentInputComponents 128\n"
|
||||
"MaxImageUnits 8\n"
|
||||
"MaxCombinedImageUnitsAndFragmentOutputs 8\n"
|
||||
"MaxCombinedShaderOutputResources 8\n"
|
||||
"MaxImageSamples 0\n"
|
||||
"MaxVertexImageUniforms 0\n"
|
||||
"MaxTessControlImageUniforms 0\n"
|
||||
"MaxTessEvaluationImageUniforms 0\n"
|
||||
"MaxGeometryImageUniforms 0\n"
|
||||
"MaxFragmentImageUniforms 8\n"
|
||||
"MaxCombinedImageUniforms 8\n"
|
||||
"MaxGeometryTextureImageUnits 16\n"
|
||||
"MaxGeometryOutputVertices 256\n"
|
||||
"MaxGeometryTotalOutputComponents 1024\n"
|
||||
"MaxGeometryUniformComponents 1024\n"
|
||||
"MaxGeometryVaryingComponents 64\n"
|
||||
"MaxTessControlInputComponents 128\n"
|
||||
"MaxTessControlOutputComponents 128\n"
|
||||
"MaxTessControlTextureImageUnits 16\n"
|
||||
"MaxTessControlUniformComponents 1024\n"
|
||||
"MaxTessControlTotalOutputComponents 4096\n"
|
||||
"MaxTessEvaluationInputComponents 128\n"
|
||||
"MaxTessEvaluationOutputComponents 128\n"
|
||||
"MaxTessEvaluationTextureImageUnits 16\n"
|
||||
"MaxTessEvaluationUniformComponents 1024\n"
|
||||
"MaxTessPatchComponents 120\n"
|
||||
"MaxPatchVertices 32\n"
|
||||
"MaxTessGenLevel 64\n"
|
||||
"MaxViewports 16\n"
|
||||
"MaxVertexAtomicCounters 0\n"
|
||||
"MaxTessControlAtomicCounters 0\n"
|
||||
"MaxTessEvaluationAtomicCounters 0\n"
|
||||
"MaxGeometryAtomicCounters 0\n"
|
||||
"MaxFragmentAtomicCounters 8\n"
|
||||
"MaxCombinedAtomicCounters 8\n"
|
||||
"MaxAtomicCounterBindings 1\n"
|
||||
"MaxVertexAtomicCounterBuffers 0\n"
|
||||
"MaxTessControlAtomicCounterBuffers 0\n"
|
||||
"MaxTessEvaluationAtomicCounterBuffers 0\n"
|
||||
"MaxGeometryAtomicCounterBuffers 0\n"
|
||||
"MaxFragmentAtomicCounterBuffers 1\n"
|
||||
"MaxCombinedAtomicCounterBuffers 1\n"
|
||||
"MaxAtomicCounterBufferSize 16384\n"
|
||||
"MaxTransformFeedbackBuffers 4\n"
|
||||
"MaxTransformFeedbackInterleavedComponents 64\n"
|
||||
"MaxCullDistances 8\n"
|
||||
"MaxCombinedClipAndCullDistances 8\n"
|
||||
"MaxSamples 4\n"
|
||||
|
||||
"nonInductiveForLoops 1\n"
|
||||
"whileLoops 1\n"
|
||||
"doWhileLoops 1\n"
|
||||
"generalUniformIndexing 1\n"
|
||||
"generalAttributeMatrixVectorIndexing 1\n"
|
||||
"generalVaryingIndexing 1\n"
|
||||
"generalSamplerIndexing 1\n"
|
||||
"generalVariableIndexing 1\n"
|
||||
"generalConstantMatrixVectorIndexing 1\n";
|
||||
|
||||
const char *delims = " \t\n\r";
|
||||
const char *token = strtok(DefaultConfig, delims);
|
||||
while (token)
|
||||
{
|
||||
const char *value_str = strtok(0, delims);
|
||||
int value = strtoul(value_str, nullptr, 0);
|
||||
|
||||
if (strcmp(token, "MaxLights") == 0)
|
||||
Resources.maxLights = value;
|
||||
else if (strcmp(token, "MaxClipPlanes") == 0)
|
||||
Resources.maxClipPlanes = value;
|
||||
else if (strcmp(token, "MaxTextureUnits") == 0)
|
||||
Resources.maxTextureUnits = value;
|
||||
else if (strcmp(token, "MaxTextureCoords") == 0)
|
||||
Resources.maxTextureCoords = value;
|
||||
else if (strcmp(token, "MaxVertexAttribs") == 0)
|
||||
Resources.maxVertexAttribs = value;
|
||||
else if (strcmp(token, "MaxVertexUniformComponents") == 0)
|
||||
Resources.maxVertexUniformComponents = value;
|
||||
else if (strcmp(token, "MaxVaryingFloats") == 0)
|
||||
Resources.maxVaryingFloats = value;
|
||||
else if (strcmp(token, "MaxVertexTextureImageUnits") == 0)
|
||||
Resources.maxVertexTextureImageUnits = value;
|
||||
else if (strcmp(token, "MaxCombinedTextureImageUnits") == 0)
|
||||
Resources.maxCombinedTextureImageUnits = value;
|
||||
else if (strcmp(token, "MaxTextureImageUnits") == 0)
|
||||
Resources.maxTextureImageUnits = value;
|
||||
else if (strcmp(token, "MaxFragmentUniformComponents") == 0)
|
||||
Resources.maxFragmentUniformComponents = value;
|
||||
else if (strcmp(token, "MaxDrawBuffers") == 0)
|
||||
Resources.maxDrawBuffers = value;
|
||||
else if (strcmp(token, "MaxVertexUniformVectors") == 0)
|
||||
Resources.maxVertexUniformVectors = value;
|
||||
else if (strcmp(token, "MaxVaryingVectors") == 0)
|
||||
Resources.maxVaryingVectors = value;
|
||||
else if (strcmp(token, "MaxFragmentUniformVectors") == 0)
|
||||
Resources.maxFragmentUniformVectors = value;
|
||||
else if (strcmp(token, "MaxVertexOutputVectors") == 0)
|
||||
Resources.maxVertexOutputVectors = value;
|
||||
else if (strcmp(token, "MaxFragmentInputVectors") == 0)
|
||||
Resources.maxFragmentInputVectors = value;
|
||||
else if (strcmp(token, "MinProgramTexelOffset") == 0)
|
||||
Resources.minProgramTexelOffset = value;
|
||||
else if (strcmp(token, "MaxProgramTexelOffset") == 0)
|
||||
Resources.maxProgramTexelOffset = value;
|
||||
else if (strcmp(token, "MaxClipDistances") == 0)
|
||||
Resources.maxClipDistances = value;
|
||||
else if (strcmp(token, "MaxComputeWorkGroupCountX") == 0)
|
||||
Resources.maxComputeWorkGroupCountX = value;
|
||||
else if (strcmp(token, "MaxComputeWorkGroupCountY") == 0)
|
||||
Resources.maxComputeWorkGroupCountY = value;
|
||||
else if (strcmp(token, "MaxComputeWorkGroupCountZ") == 0)
|
||||
Resources.maxComputeWorkGroupCountZ = value;
|
||||
else if (strcmp(token, "MaxComputeWorkGroupSizeX") == 0)
|
||||
Resources.maxComputeWorkGroupSizeX = value;
|
||||
else if (strcmp(token, "MaxComputeWorkGroupSizeY") == 0)
|
||||
Resources.maxComputeWorkGroupSizeY = value;
|
||||
else if (strcmp(token, "MaxComputeWorkGroupSizeZ") == 0)
|
||||
Resources.maxComputeWorkGroupSizeZ = value;
|
||||
else if (strcmp(token, "MaxComputeUniformComponents") == 0)
|
||||
Resources.maxComputeUniformComponents = value;
|
||||
else if (strcmp(token, "MaxComputeTextureImageUnits") == 0)
|
||||
Resources.maxComputeTextureImageUnits = value;
|
||||
else if (strcmp(token, "MaxComputeImageUniforms") == 0)
|
||||
Resources.maxComputeImageUniforms = value;
|
||||
else if (strcmp(token, "MaxComputeAtomicCounters") == 0)
|
||||
Resources.maxComputeAtomicCounters = value;
|
||||
else if (strcmp(token, "MaxComputeAtomicCounterBuffers") == 0)
|
||||
Resources.maxComputeAtomicCounterBuffers = value;
|
||||
else if (strcmp(token, "MaxVaryingComponents") == 0)
|
||||
Resources.maxVaryingComponents = value;
|
||||
else if (strcmp(token, "MaxVertexOutputComponents") == 0)
|
||||
Resources.maxVertexOutputComponents = value;
|
||||
else if (strcmp(token, "MaxGeometryInputComponents") == 0)
|
||||
Resources.maxGeometryInputComponents = value;
|
||||
else if (strcmp(token, "MaxGeometryOutputComponents") == 0)
|
||||
Resources.maxGeometryOutputComponents = value;
|
||||
else if (strcmp(token, "MaxFragmentInputComponents") == 0)
|
||||
Resources.maxFragmentInputComponents = value;
|
||||
else if (strcmp(token, "MaxImageUnits") == 0)
|
||||
Resources.maxImageUnits = value;
|
||||
else if (strcmp(token, "MaxCombinedImageUnitsAndFragmentOutputs") == 0)
|
||||
Resources.maxCombinedImageUnitsAndFragmentOutputs = value;
|
||||
else if (strcmp(token, "MaxCombinedShaderOutputResources") == 0)
|
||||
Resources.maxCombinedShaderOutputResources = value;
|
||||
else if (strcmp(token, "MaxImageSamples") == 0)
|
||||
Resources.maxImageSamples = value;
|
||||
else if (strcmp(token, "MaxVertexImageUniforms") == 0)
|
||||
Resources.maxVertexImageUniforms = value;
|
||||
else if (strcmp(token, "MaxTessControlImageUniforms") == 0)
|
||||
Resources.maxTessControlImageUniforms = value;
|
||||
else if (strcmp(token, "MaxTessEvaluationImageUniforms") == 0)
|
||||
Resources.maxTessEvaluationImageUniforms = value;
|
||||
else if (strcmp(token, "MaxGeometryImageUniforms") == 0)
|
||||
Resources.maxGeometryImageUniforms = value;
|
||||
else if (strcmp(token, "MaxFragmentImageUniforms") == 0)
|
||||
Resources.maxFragmentImageUniforms = value;
|
||||
else if (strcmp(token, "MaxCombinedImageUniforms") == 0)
|
||||
Resources.maxCombinedImageUniforms = value;
|
||||
else if (strcmp(token, "MaxGeometryTextureImageUnits") == 0)
|
||||
Resources.maxGeometryTextureImageUnits = value;
|
||||
else if (strcmp(token, "MaxGeometryOutputVertices") == 0)
|
||||
Resources.maxGeometryOutputVertices = value;
|
||||
else if (strcmp(token, "MaxGeometryTotalOutputComponents") == 0)
|
||||
Resources.maxGeometryTotalOutputComponents = value;
|
||||
else if (strcmp(token, "MaxGeometryUniformComponents") == 0)
|
||||
Resources.maxGeometryUniformComponents = value;
|
||||
else if (strcmp(token, "MaxGeometryVaryingComponents") == 0)
|
||||
Resources.maxGeometryVaryingComponents = value;
|
||||
else if (strcmp(token, "MaxTessControlInputComponents") == 0)
|
||||
Resources.maxTessControlInputComponents = value;
|
||||
else if (strcmp(token, "MaxTessControlOutputComponents") == 0)
|
||||
Resources.maxTessControlOutputComponents = value;
|
||||
else if (strcmp(token, "MaxTessControlTextureImageUnits") == 0)
|
||||
Resources.maxTessControlTextureImageUnits = value;
|
||||
else if (strcmp(token, "MaxTessControlUniformComponents") == 0)
|
||||
Resources.maxTessControlUniformComponents = value;
|
||||
else if (strcmp(token, "MaxTessControlTotalOutputComponents") == 0)
|
||||
Resources.maxTessControlTotalOutputComponents = value;
|
||||
else if (strcmp(token, "MaxTessEvaluationInputComponents") == 0)
|
||||
Resources.maxTessEvaluationInputComponents = value;
|
||||
else if (strcmp(token, "MaxTessEvaluationOutputComponents") == 0)
|
||||
Resources.maxTessEvaluationOutputComponents = value;
|
||||
else if (strcmp(token, "MaxTessEvaluationTextureImageUnits") == 0)
|
||||
Resources.maxTessEvaluationTextureImageUnits = value;
|
||||
else if (strcmp(token, "MaxTessEvaluationUniformComponents") == 0)
|
||||
Resources.maxTessEvaluationUniformComponents = value;
|
||||
else if (strcmp(token, "MaxTessPatchComponents") == 0)
|
||||
Resources.maxTessPatchComponents = value;
|
||||
else if (strcmp(token, "MaxPatchVertices") == 0)
|
||||
Resources.maxPatchVertices = value;
|
||||
else if (strcmp(token, "MaxTessGenLevel") == 0)
|
||||
Resources.maxTessGenLevel = value;
|
||||
else if (strcmp(token, "MaxViewports") == 0)
|
||||
Resources.maxViewports = value;
|
||||
else if (strcmp(token, "MaxVertexAtomicCounters") == 0)
|
||||
Resources.maxVertexAtomicCounters = value;
|
||||
else if (strcmp(token, "MaxTessControlAtomicCounters") == 0)
|
||||
Resources.maxTessControlAtomicCounters = value;
|
||||
else if (strcmp(token, "MaxTessEvaluationAtomicCounters") == 0)
|
||||
Resources.maxTessEvaluationAtomicCounters = value;
|
||||
else if (strcmp(token, "MaxGeometryAtomicCounters") == 0)
|
||||
Resources.maxGeometryAtomicCounters = value;
|
||||
else if (strcmp(token, "MaxFragmentAtomicCounters") == 0)
|
||||
Resources.maxFragmentAtomicCounters = value;
|
||||
else if (strcmp(token, "MaxCombinedAtomicCounters") == 0)
|
||||
Resources.maxCombinedAtomicCounters = value;
|
||||
else if (strcmp(token, "MaxAtomicCounterBindings") == 0)
|
||||
Resources.maxAtomicCounterBindings = value;
|
||||
else if (strcmp(token, "MaxVertexAtomicCounterBuffers") == 0)
|
||||
Resources.maxVertexAtomicCounterBuffers = value;
|
||||
else if (strcmp(token, "MaxTessControlAtomicCounterBuffers") == 0)
|
||||
Resources.maxTessControlAtomicCounterBuffers = value;
|
||||
else if (strcmp(token, "MaxTessEvaluationAtomicCounterBuffers") == 0)
|
||||
Resources.maxTessEvaluationAtomicCounterBuffers = value;
|
||||
else if (strcmp(token, "MaxGeometryAtomicCounterBuffers") == 0)
|
||||
Resources.maxGeometryAtomicCounterBuffers = value;
|
||||
else if (strcmp(token, "MaxFragmentAtomicCounterBuffers") == 0)
|
||||
Resources.maxFragmentAtomicCounterBuffers = value;
|
||||
else if (strcmp(token, "MaxCombinedAtomicCounterBuffers") == 0)
|
||||
Resources.maxCombinedAtomicCounterBuffers = value;
|
||||
else if (strcmp(token, "MaxAtomicCounterBufferSize") == 0)
|
||||
Resources.maxAtomicCounterBufferSize = value;
|
||||
else if (strcmp(token, "MaxTransformFeedbackBuffers") == 0)
|
||||
Resources.maxTransformFeedbackBuffers = value;
|
||||
else if (strcmp(token, "MaxTransformFeedbackInterleavedComponents") == 0)
|
||||
Resources.maxTransformFeedbackInterleavedComponents = value;
|
||||
else if (strcmp(token, "MaxCullDistances") == 0)
|
||||
Resources.maxCullDistances = value;
|
||||
else if (strcmp(token, "MaxCombinedClipAndCullDistances") == 0)
|
||||
Resources.maxCombinedClipAndCullDistances = value;
|
||||
else if (strcmp(token, "MaxSamples") == 0)
|
||||
Resources.maxSamples = value;
|
||||
else if (strcmp(token, "nonInductiveForLoops") == 0)
|
||||
Resources.limits.nonInductiveForLoops = (value != 0);
|
||||
else if (strcmp(token, "whileLoops") == 0)
|
||||
Resources.limits.whileLoops = (value != 0);
|
||||
else if (strcmp(token, "doWhileLoops") == 0)
|
||||
Resources.limits.doWhileLoops = (value != 0);
|
||||
else if (strcmp(token, "generalUniformIndexing") == 0)
|
||||
Resources.limits.generalUniformIndexing = (value != 0);
|
||||
else if (strcmp(token, "generalAttributeMatrixVectorIndexing") == 0)
|
||||
Resources.limits.generalAttributeMatrixVectorIndexing = (value != 0);
|
||||
else if (strcmp(token, "generalVaryingIndexing") == 0)
|
||||
Resources.limits.generalVaryingIndexing = (value != 0);
|
||||
else if (strcmp(token, "generalSamplerIndexing") == 0)
|
||||
Resources.limits.generalSamplerIndexing = (value != 0);
|
||||
else if (strcmp(token, "generalVariableIndexing") == 0)
|
||||
Resources.limits.generalVariableIndexing = (value != 0);
|
||||
else if (strcmp(token, "generalConstantMatrixVectorIndexing") == 0)
|
||||
Resources.limits.generalConstantMatrixVectorIndexing = (value != 0);
|
||||
|
||||
token = strtok(0, delims);
|
||||
}
|
||||
}
|
||||
|
||||
bool glslang::compile_spirv(const string &source, Stage stage, std::vector<uint32_t> *spirv)
|
||||
{
|
||||
static SlangProcess process;
|
||||
|
||||
TProgram program;
|
||||
EShLanguage language;
|
||||
switch (stage)
|
||||
{
|
||||
case StageVertex: language = EShLangVertex; break;
|
||||
case StageTessControl: language = EShLangTessControl; break;
|
||||
case StageTessEvaluation: language = EShLangTessEvaluation; break;
|
||||
case StageGeometry: language = EShLangGeometry; break;
|
||||
case StageFragment: language = EShLangFragment; break;
|
||||
case StageCompute: language = EShLangCompute; break;
|
||||
default: return false;
|
||||
}
|
||||
TShader shader(language);
|
||||
|
||||
const char *src = source.c_str();
|
||||
shader.setStrings(&src, 1);
|
||||
|
||||
string msg;
|
||||
if (!shader.preprocess(&process.GetResources(), 100, ENoProfile, false, false, EShMsgDefault, &msg, TShader::ForbidInclude()))
|
||||
{
|
||||
fprintf(stderr, "%s\n", msg.c_str());
|
||||
return {};
|
||||
}
|
||||
|
||||
if (!shader.parse(&process.GetResources(), 100, false, EShMsgDefault))
|
||||
{
|
||||
RARCH_ERR("%s\n", shader.getInfoLog());
|
||||
RARCH_ERR("%s\n", shader.getInfoDebugLog());
|
||||
return false;
|
||||
}
|
||||
|
||||
program.addShader(&shader);
|
||||
|
||||
if (!program.link(EShMsgDefault))
|
||||
{
|
||||
RARCH_ERR("%s\n", program.getInfoLog());
|
||||
RARCH_ERR("%s\n", program.getInfoDebugLog());
|
||||
return false;
|
||||
}
|
||||
|
||||
GlslangToSpv(*program.getIntermediate(language), *spirv);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
#ifndef GLSLANG_COMPILER_HPP
|
||||
#define GLSLANG_COMPILER_HPP
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <stdint.h>
|
||||
|
||||
namespace glslang
|
||||
{
|
||||
enum Stage
|
||||
{
|
||||
StageVertex = 0,
|
||||
StageTessControl,
|
||||
StageTessEvaluation,
|
||||
StageGeometry,
|
||||
StageFragment,
|
||||
StageCompute
|
||||
};
|
||||
|
||||
bool compile_spirv(const std::string &source, Stage stage, std::vector<uint32_t> *spirv);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,357 @@
|
||||
/* A Bison parser, made by GNU Bison 3.0.4. */
|
||||
|
||||
/* Bison interface for Yacc-like parsers in C
|
||||
|
||||
Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
|
||||
|
||||
This program 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 Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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 this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* As a special exception, you may create a larger work that contains
|
||||
part or all of the Bison parser skeleton and distribute that work
|
||||
under terms of your choice, so long as that work isn't itself a
|
||||
parser generator using the skeleton or a modified version thereof
|
||||
as a parser skeleton. Alternatively, if you modify or redistribute
|
||||
the parser skeleton itself, you may (at your option) remove this
|
||||
special exception, which will cause the skeleton and the resulting
|
||||
Bison output files to be licensed under the GNU General Public
|
||||
License without this special exception.
|
||||
|
||||
This special exception was added by the Free Software Foundation in
|
||||
version 2.2 of Bison. */
|
||||
|
||||
#ifndef YY_YY_GLSLANG_TAB_CPP_H_INCLUDED
|
||||
# define YY_YY_GLSLANG_TAB_CPP_H_INCLUDED
|
||||
/* Debug traces. */
|
||||
#ifndef YYDEBUG
|
||||
# define YYDEBUG 1
|
||||
#endif
|
||||
#if YYDEBUG
|
||||
extern int yydebug;
|
||||
#endif
|
||||
|
||||
/* Token type. */
|
||||
#ifndef YYTOKENTYPE
|
||||
# define YYTOKENTYPE
|
||||
enum yytokentype
|
||||
{
|
||||
ATTRIBUTE = 258,
|
||||
VARYING = 259,
|
||||
CONST = 260,
|
||||
BOOL = 261,
|
||||
FLOAT = 262,
|
||||
DOUBLE = 263,
|
||||
INT = 264,
|
||||
UINT = 265,
|
||||
BREAK = 266,
|
||||
CONTINUE = 267,
|
||||
DO = 268,
|
||||
ELSE = 269,
|
||||
FOR = 270,
|
||||
IF = 271,
|
||||
DISCARD = 272,
|
||||
RETURN = 273,
|
||||
SWITCH = 274,
|
||||
CASE = 275,
|
||||
DEFAULT = 276,
|
||||
SUBROUTINE = 277,
|
||||
BVEC2 = 278,
|
||||
BVEC3 = 279,
|
||||
BVEC4 = 280,
|
||||
IVEC2 = 281,
|
||||
IVEC3 = 282,
|
||||
IVEC4 = 283,
|
||||
UVEC2 = 284,
|
||||
UVEC3 = 285,
|
||||
UVEC4 = 286,
|
||||
VEC2 = 287,
|
||||
VEC3 = 288,
|
||||
VEC4 = 289,
|
||||
MAT2 = 290,
|
||||
MAT3 = 291,
|
||||
MAT4 = 292,
|
||||
CENTROID = 293,
|
||||
IN = 294,
|
||||
OUT = 295,
|
||||
INOUT = 296,
|
||||
UNIFORM = 297,
|
||||
PATCH = 298,
|
||||
SAMPLE = 299,
|
||||
BUFFER = 300,
|
||||
SHARED = 301,
|
||||
COHERENT = 302,
|
||||
VOLATILE = 303,
|
||||
RESTRICT = 304,
|
||||
READONLY = 305,
|
||||
WRITEONLY = 306,
|
||||
DVEC2 = 307,
|
||||
DVEC3 = 308,
|
||||
DVEC4 = 309,
|
||||
DMAT2 = 310,
|
||||
DMAT3 = 311,
|
||||
DMAT4 = 312,
|
||||
NOPERSPECTIVE = 313,
|
||||
FLAT = 314,
|
||||
SMOOTH = 315,
|
||||
LAYOUT = 316,
|
||||
MAT2X2 = 317,
|
||||
MAT2X3 = 318,
|
||||
MAT2X4 = 319,
|
||||
MAT3X2 = 320,
|
||||
MAT3X3 = 321,
|
||||
MAT3X4 = 322,
|
||||
MAT4X2 = 323,
|
||||
MAT4X3 = 324,
|
||||
MAT4X4 = 325,
|
||||
DMAT2X2 = 326,
|
||||
DMAT2X3 = 327,
|
||||
DMAT2X4 = 328,
|
||||
DMAT3X2 = 329,
|
||||
DMAT3X3 = 330,
|
||||
DMAT3X4 = 331,
|
||||
DMAT4X2 = 332,
|
||||
DMAT4X3 = 333,
|
||||
DMAT4X4 = 334,
|
||||
ATOMIC_UINT = 335,
|
||||
SAMPLER1D = 336,
|
||||
SAMPLER2D = 337,
|
||||
SAMPLER3D = 338,
|
||||
SAMPLERCUBE = 339,
|
||||
SAMPLER1DSHADOW = 340,
|
||||
SAMPLER2DSHADOW = 341,
|
||||
SAMPLERCUBESHADOW = 342,
|
||||
SAMPLER1DARRAY = 343,
|
||||
SAMPLER2DARRAY = 344,
|
||||
SAMPLER1DARRAYSHADOW = 345,
|
||||
SAMPLER2DARRAYSHADOW = 346,
|
||||
ISAMPLER1D = 347,
|
||||
ISAMPLER2D = 348,
|
||||
ISAMPLER3D = 349,
|
||||
ISAMPLERCUBE = 350,
|
||||
ISAMPLER1DARRAY = 351,
|
||||
ISAMPLER2DARRAY = 352,
|
||||
USAMPLER1D = 353,
|
||||
USAMPLER2D = 354,
|
||||
USAMPLER3D = 355,
|
||||
USAMPLERCUBE = 356,
|
||||
USAMPLER1DARRAY = 357,
|
||||
USAMPLER2DARRAY = 358,
|
||||
SAMPLER2DRECT = 359,
|
||||
SAMPLER2DRECTSHADOW = 360,
|
||||
ISAMPLER2DRECT = 361,
|
||||
USAMPLER2DRECT = 362,
|
||||
SAMPLERBUFFER = 363,
|
||||
ISAMPLERBUFFER = 364,
|
||||
USAMPLERBUFFER = 365,
|
||||
SAMPLERCUBEARRAY = 366,
|
||||
SAMPLERCUBEARRAYSHADOW = 367,
|
||||
ISAMPLERCUBEARRAY = 368,
|
||||
USAMPLERCUBEARRAY = 369,
|
||||
SAMPLER2DMS = 370,
|
||||
ISAMPLER2DMS = 371,
|
||||
USAMPLER2DMS = 372,
|
||||
SAMPLER2DMSARRAY = 373,
|
||||
ISAMPLER2DMSARRAY = 374,
|
||||
USAMPLER2DMSARRAY = 375,
|
||||
SAMPLEREXTERNALOES = 376,
|
||||
SAMPLER = 377,
|
||||
SAMPLERSHADOW = 378,
|
||||
TEXTURE1D = 379,
|
||||
TEXTURE2D = 380,
|
||||
TEXTURE3D = 381,
|
||||
TEXTURECUBE = 382,
|
||||
TEXTURE1DARRAY = 383,
|
||||
TEXTURE2DARRAY = 384,
|
||||
ITEXTURE1D = 385,
|
||||
ITEXTURE2D = 386,
|
||||
ITEXTURE3D = 387,
|
||||
ITEXTURECUBE = 388,
|
||||
ITEXTURE1DARRAY = 389,
|
||||
ITEXTURE2DARRAY = 390,
|
||||
UTEXTURE1D = 391,
|
||||
UTEXTURE2D = 392,
|
||||
UTEXTURE3D = 393,
|
||||
UTEXTURECUBE = 394,
|
||||
UTEXTURE1DARRAY = 395,
|
||||
UTEXTURE2DARRAY = 396,
|
||||
TEXTURE2DRECT = 397,
|
||||
ITEXTURE2DRECT = 398,
|
||||
UTEXTURE2DRECT = 399,
|
||||
TEXTUREBUFFER = 400,
|
||||
ITEXTUREBUFFER = 401,
|
||||
UTEXTUREBUFFER = 402,
|
||||
TEXTURECUBEARRAY = 403,
|
||||
ITEXTURECUBEARRAY = 404,
|
||||
UTEXTURECUBEARRAY = 405,
|
||||
TEXTURE2DMS = 406,
|
||||
ITEXTURE2DMS = 407,
|
||||
UTEXTURE2DMS = 408,
|
||||
TEXTURE2DMSARRAY = 409,
|
||||
ITEXTURE2DMSARRAY = 410,
|
||||
UTEXTURE2DMSARRAY = 411,
|
||||
SUBPASSINPUT = 412,
|
||||
SUBPASSINPUTMS = 413,
|
||||
ISUBPASSINPUT = 414,
|
||||
ISUBPASSINPUTMS = 415,
|
||||
USUBPASSINPUT = 416,
|
||||
USUBPASSINPUTMS = 417,
|
||||
IMAGE1D = 418,
|
||||
IIMAGE1D = 419,
|
||||
UIMAGE1D = 420,
|
||||
IMAGE2D = 421,
|
||||
IIMAGE2D = 422,
|
||||
UIMAGE2D = 423,
|
||||
IMAGE3D = 424,
|
||||
IIMAGE3D = 425,
|
||||
UIMAGE3D = 426,
|
||||
IMAGE2DRECT = 427,
|
||||
IIMAGE2DRECT = 428,
|
||||
UIMAGE2DRECT = 429,
|
||||
IMAGECUBE = 430,
|
||||
IIMAGECUBE = 431,
|
||||
UIMAGECUBE = 432,
|
||||
IMAGEBUFFER = 433,
|
||||
IIMAGEBUFFER = 434,
|
||||
UIMAGEBUFFER = 435,
|
||||
IMAGE1DARRAY = 436,
|
||||
IIMAGE1DARRAY = 437,
|
||||
UIMAGE1DARRAY = 438,
|
||||
IMAGE2DARRAY = 439,
|
||||
IIMAGE2DARRAY = 440,
|
||||
UIMAGE2DARRAY = 441,
|
||||
IMAGECUBEARRAY = 442,
|
||||
IIMAGECUBEARRAY = 443,
|
||||
UIMAGECUBEARRAY = 444,
|
||||
IMAGE2DMS = 445,
|
||||
IIMAGE2DMS = 446,
|
||||
UIMAGE2DMS = 447,
|
||||
IMAGE2DMSARRAY = 448,
|
||||
IIMAGE2DMSARRAY = 449,
|
||||
UIMAGE2DMSARRAY = 450,
|
||||
STRUCT = 451,
|
||||
VOID = 452,
|
||||
WHILE = 453,
|
||||
IDENTIFIER = 454,
|
||||
TYPE_NAME = 455,
|
||||
FLOATCONSTANT = 456,
|
||||
DOUBLECONSTANT = 457,
|
||||
INTCONSTANT = 458,
|
||||
UINTCONSTANT = 459,
|
||||
BOOLCONSTANT = 460,
|
||||
LEFT_OP = 461,
|
||||
RIGHT_OP = 462,
|
||||
INC_OP = 463,
|
||||
DEC_OP = 464,
|
||||
LE_OP = 465,
|
||||
GE_OP = 466,
|
||||
EQ_OP = 467,
|
||||
NE_OP = 468,
|
||||
AND_OP = 469,
|
||||
OR_OP = 470,
|
||||
XOR_OP = 471,
|
||||
MUL_ASSIGN = 472,
|
||||
DIV_ASSIGN = 473,
|
||||
ADD_ASSIGN = 474,
|
||||
MOD_ASSIGN = 475,
|
||||
LEFT_ASSIGN = 476,
|
||||
RIGHT_ASSIGN = 477,
|
||||
AND_ASSIGN = 478,
|
||||
XOR_ASSIGN = 479,
|
||||
OR_ASSIGN = 480,
|
||||
SUB_ASSIGN = 481,
|
||||
LEFT_PAREN = 482,
|
||||
RIGHT_PAREN = 483,
|
||||
LEFT_BRACKET = 484,
|
||||
RIGHT_BRACKET = 485,
|
||||
LEFT_BRACE = 486,
|
||||
RIGHT_BRACE = 487,
|
||||
DOT = 488,
|
||||
COMMA = 489,
|
||||
COLON = 490,
|
||||
EQUAL = 491,
|
||||
SEMICOLON = 492,
|
||||
BANG = 493,
|
||||
DASH = 494,
|
||||
TILDE = 495,
|
||||
PLUS = 496,
|
||||
STAR = 497,
|
||||
SLASH = 498,
|
||||
PERCENT = 499,
|
||||
LEFT_ANGLE = 500,
|
||||
RIGHT_ANGLE = 501,
|
||||
VERTICAL_BAR = 502,
|
||||
CARET = 503,
|
||||
AMPERSAND = 504,
|
||||
QUESTION = 505,
|
||||
INVARIANT = 506,
|
||||
PRECISE = 507,
|
||||
HIGH_PRECISION = 508,
|
||||
MEDIUM_PRECISION = 509,
|
||||
LOW_PRECISION = 510,
|
||||
PRECISION = 511,
|
||||
PACKED = 512,
|
||||
RESOURCE = 513,
|
||||
SUPERP = 514
|
||||
};
|
||||
#endif
|
||||
|
||||
/* Value type. */
|
||||
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
||||
|
||||
union YYSTYPE
|
||||
{
|
||||
#line 66 "glslang/glslang/MachineIndependent/glslang.y" /* yacc.c:1909 */
|
||||
|
||||
struct {
|
||||
glslang::TSourceLoc loc;
|
||||
union {
|
||||
glslang::TString *string;
|
||||
int i;
|
||||
unsigned int u;
|
||||
bool b;
|
||||
double d;
|
||||
};
|
||||
glslang::TSymbol* symbol;
|
||||
} lex;
|
||||
struct {
|
||||
glslang::TSourceLoc loc;
|
||||
glslang::TOperator op;
|
||||
union {
|
||||
TIntermNode* intermNode;
|
||||
glslang::TIntermNodePair nodePair;
|
||||
glslang::TIntermTyped* intermTypedNode;
|
||||
};
|
||||
union {
|
||||
glslang::TPublicType type;
|
||||
glslang::TFunction* function;
|
||||
glslang::TParameter param;
|
||||
glslang::TTypeLoc typeLine;
|
||||
glslang::TTypeList* typeList;
|
||||
glslang::TArraySizes* arraySizes;
|
||||
glslang::TIdentifierList* identifierList;
|
||||
};
|
||||
} interm;
|
||||
|
||||
#line 346 "glslang_tab.cpp.h" /* yacc.c:1909 */
|
||||
};
|
||||
|
||||
typedef union YYSTYPE YYSTYPE;
|
||||
# define YYSTYPE_IS_TRIVIAL 1
|
||||
# define YYSTYPE_IS_DECLARED 1
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
int yyparse (glslang::TParseContext* pParseContext);
|
||||
|
||||
#endif /* !YY_YY_GLSLANG_TAB_CPP_H_INCLUDED */
|
||||
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
bison --defines=glslang_tab.cpp.h -o glslang_tab.cpp -t glslang/glslang/MachineIndependent/glslang.y
|
||||
@@ -0,0 +1,43 @@
|
||||
CONTRIBUTING
|
||||
============
|
||||
## Submitting changes
|
||||
Please send a GitHub Pull Request with a clear list of what you've done (read more about [pull requests](http://help.github.com/pull-requests/)).
|
||||
|
||||
## Features
|
||||
If you have an idea for new features just [open an issue](https://github.com/vurtun/zahnrad/issues) with your suggestion.
|
||||
* Find and correct spelling mistakes
|
||||
* Add (insert your favorite platform or render backend here) demo implementation (some possibilities: DirectX 9/DirectX 10/DirectX 11 and win32 with OpenGL)
|
||||
* Add clipboard user callbacks back into all demos
|
||||
* Add additional widgets [some possible widgets](http://doc.qt.io/qt-5/widget-classes.html#the-widget-classes)
|
||||
* Add support for multiple pointers for touch input devices (probably requires to rewrite mouse handling in `struct zr_input`)
|
||||
* Extend xlib demo to support image drawing with arbitrary image width and height
|
||||
* Change cursor in `zr_widget_edit_box` and `zr_widget_edit_field` to thin standard cursor version used in editors
|
||||
* Extend piemenu to support submenus (another ring around the first ring or something like [this:](http://gdj.gdj.netdna-cdn.com/wp-content/uploads/2013/02/ui+concepts+13.gif)) and turn it into a default library widget.
|
||||
* Add label describing the currently active piemenu entry
|
||||
* Maybe write a piemenu text only version for platforms that do not want or can use images
|
||||
* Rewrite the chart API to support a better range of charts (maybe take notes from Javascript chart frameworks)
|
||||
* Create an API to allow scaling between groups (maybe extend and convert the demo example)
|
||||
* Add multiple Tab support (maybe use `zr_group` and add a header)
|
||||
* Come up with a better way to provide and create widget and window styles
|
||||
* Add tables with scaleable column width
|
||||
* Extend context to not only support overlapping windows but tiled windows as well
|
||||
|
||||
## Bugs
|
||||
* Seperator widget is currently bugged and does not work as intended
|
||||
* Text handling is still a little bit janky and probably needs to be further tested and polished
|
||||
* `zr_edit_buffer` with multiline flag is bugged for '\n', need to differentiate between visible and non-visible characters
|
||||
|
||||
## Coding conventions
|
||||
* Only use C89 (ANSI C)
|
||||
* Do not use any compiler specific extensions
|
||||
* For indent use four spaces
|
||||
* Do not typedef structs, unions and enums
|
||||
* Variable, object and function names should always be lowercase and use underscores instead of camel case
|
||||
* Whitespace after for, while, if, do and switch
|
||||
* Always use parentheses if you use the sizeof operator (e.g: sizeof(struct zr_context) and not sizeof struct zr_context)
|
||||
* Beginning braces on the new line for functions and on the same line otherwise.
|
||||
* If function becomes to big either a.) create a subblock inside the function and comment or b.) write a functional function
|
||||
* Only use fixed size types (zr_uint, zr_size, ...) if you really need to and use basic types otherwise
|
||||
* Do not include any header files in either zahnrad.h or zahnrad.c
|
||||
* Do not add dependencies rather write your own version if possible
|
||||
* Write correct commit messages: (http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
|
||||
@@ -0,0 +1,17 @@
|
||||
Copyright (c) 2016 Micha Mettke
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
@@ -0,0 +1,89 @@
|
||||
# Zahnrad
|
||||
[](https://scan.coverity.com/projects/5863)
|
||||
|
||||
This is a minimal state immediate mode graphical user interface toolkit
|
||||
written in ANSI C and licensed under zlib. It was designed as a simple embeddable user interface for
|
||||
application and does not have any direct dependencies,
|
||||
a default renderbackend or OS window and input handling but instead provides a very modular
|
||||
library approach by using simple input state for input and draw
|
||||
commands describing primitive shapes as output. So instead of providing a
|
||||
layered library that tries to abstract over a number of platform and
|
||||
render backends it only focuses on the actual UI.
|
||||
|
||||
## Features
|
||||
- Immediate mode graphical user interface toolkit
|
||||
- Written in C89 (ANSI C)
|
||||
- Small codebase (~9kLOC)
|
||||
- Focus on portability, efficiency and simplicity
|
||||
- No dependencies (not even the standard library)
|
||||
- No global or hidden state
|
||||
- Configurable style and colors
|
||||
- UTF-8 support
|
||||
|
||||
## Optional
|
||||
- Vertex buffer output
|
||||
- Font handling
|
||||
|
||||
## Building
|
||||
The library is self-contained within four different files that only have to be
|
||||
copied and compiled into your application. Files zahnrad.c and zahnrad.h make up
|
||||
the core of the library, while stb_rect_pack.h and stb_truetype.h are
|
||||
for a optional font handling implementation and can be removed if not needed.
|
||||
- zahnrad.c
|
||||
- zahnrad.h
|
||||
- stb_rect_pack.h (optional)
|
||||
- stb_truetype.h (optional)
|
||||
|
||||
There are no dependencies or a particular building process required. You just have
|
||||
to compile the .c file and #include zahnrad.h into your project. To actually
|
||||
run you have to provide the input state, configuration style and memory
|
||||
for draw commands to the library. After the GUI was executed all draw commands
|
||||
have to be either executed or optionally converted into a vertex buffer to
|
||||
draw the GUI.
|
||||
|
||||
## Gallery
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
## Example
|
||||
```c
|
||||
/* init gui state */
|
||||
struct zr_context ctx;
|
||||
zr_init_fixed(&ctx, calloc(1, MAX_MEMORY), MAX_MEMORY, &font);
|
||||
|
||||
enum {EASY, HARD};
|
||||
int op = EASY;
|
||||
float value = 0.6f;
|
||||
int i = 20;
|
||||
|
||||
struct zr_layout layout;
|
||||
zr_begin(&ctx, &layout, "Show", zr_rect(50, 50, 220, 220),
|
||||
ZR_WINDOW_BORDER|ZR_WINDOW_MOVEABLE|ZR_WINDOW_CLOSEABLE);
|
||||
{
|
||||
/* fixed widget pixel width */
|
||||
zr_layout_row_static(&ctx, 30, 80, 1);
|
||||
if (zr_button_text(&ctx, "button", ZR_BUTTON_DEFAULT)) {
|
||||
/* event handling */
|
||||
}
|
||||
|
||||
/* fixed widget window ratio width */
|
||||
zr_layout_row_dynamic(&ctx, 30, 2);
|
||||
if (zr_option(&ctx, "easy", op == EASY)) op = EASY;
|
||||
if (zr_option(&ctx, "hard", op == HARD)) op = HARD;
|
||||
|
||||
/* custom widget pixel width */
|
||||
zr_layout_row_begin(&ctx, ZR_STATIC, 30, 2);
|
||||
{
|
||||
zr_layout_row_push(&ctx, 50);
|
||||
zr_label(&ctx, "Volume:", ZR_TEXT_LEFT);
|
||||
zr_layout_row_push(&ctx, 110);
|
||||
zr_slider_float(&ctx, 0, &value, 1.0f, 0.1f);
|
||||
}
|
||||
zr_layout_row_end(&ctx);
|
||||
}
|
||||
zr_end(ctx);
|
||||
```
|
||||

|
||||
|
||||
@@ -0,0 +1,545 @@
|
||||
/* stb_rect_pack.h - v0.05 - public domain - rectangle packing */
|
||||
/* Sean Barrett 2014 */
|
||||
/* */
|
||||
/* Useful for e.g. packing rectangular textures into an atlas. */
|
||||
/* Does not do rotation. */
|
||||
/* */
|
||||
/* Not necessarily the awesomest packing method, but better than */
|
||||
/* the totally naive one in stb_truetype (which is primarily what */
|
||||
/* this is meant to replace). */
|
||||
/* */
|
||||
/* Has only had a few tests run, may have issues. */
|
||||
/* */
|
||||
/* More docs to come. */
|
||||
/* */
|
||||
/* No memory allocations; uses qsort() and assert() from stdlib. */
|
||||
/* */
|
||||
/* This library currently uses the Skyline Bottom-Left algorithm. */
|
||||
/* */
|
||||
/* Please note: better rectangle packers are welcome! Please */
|
||||
/* implement them to the same API, but with a different init */
|
||||
/* function. */
|
||||
/* */
|
||||
/* Version history: */
|
||||
/* */
|
||||
/* 0.05: added STBRP_ASSERT to allow replacing assert */
|
||||
/* 0.04: fixed minor bug in STBRP_LARGE_RECTS support */
|
||||
/* 0.01: initial release */
|
||||
|
||||
/*//////////////////////////////////////////////////////////////////////////// */
|
||||
/* */
|
||||
/* INCLUDE SECTION */
|
||||
#ifndef STB_INCLUDE_STB_RECT_PACK_H
|
||||
#define STB_INCLUDE_STB_RECT_PACK_H
|
||||
|
||||
#define STB_RECT_PACK_VERSION 1
|
||||
|
||||
#ifdef STBRP_STATIC
|
||||
#define STBRP_DEF static
|
||||
#else
|
||||
#define STBRP_DEF extern
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct stbrp_context stbrp_context;
|
||||
typedef struct stbrp_node stbrp_node;
|
||||
typedef struct stbrp_rect stbrp_rect;
|
||||
|
||||
#ifdef STBRP_LARGE_RECTS
|
||||
typedef int stbrp_coord;
|
||||
#else
|
||||
typedef unsigned short stbrp_coord;
|
||||
#endif
|
||||
|
||||
STBRP_DEF void stbrp_pack_rects (stbrp_context *context, stbrp_rect *rects, int num_rects);
|
||||
/* Assign packed locations to rectangles. The rectangles are of type */
|
||||
/* 'stbrp_rect' defined below, stored in the array 'rects', and there */
|
||||
/* are 'num_rects' many of them. */
|
||||
/* */
|
||||
/* Rectangles which are successfully packed have the 'was_packed' flag */
|
||||
/* set to a non-zero value and 'x' and 'y' store the minimum location */
|
||||
/* on each axis (i.e. bottom-left in cartesian coordinates, top-left */
|
||||
/* if you imagine y increasing downwards). Rectangles which do not fit */
|
||||
/* have the 'was_packed' flag set to 0. */
|
||||
/* */
|
||||
/* You should not try to access the 'rects' array from another thread */
|
||||
/* while this function is running, as the function temporarily reorders */
|
||||
/* the array while it executes. */
|
||||
/* */
|
||||
/* To pack into another rectangle, you need to call stbrp_init_target */
|
||||
/* again. To continue packing into the same rectangle, you can call */
|
||||
/* this function again. Calling this multiple times with multiple rect */
|
||||
/* arrays will probably produce worse packing results than calling it */
|
||||
/* a single time with the full rectangle array, but the option is */
|
||||
/* available. */
|
||||
|
||||
struct stbrp_rect
|
||||
{
|
||||
/* reserved for your use: */
|
||||
int id;
|
||||
|
||||
/* input: */
|
||||
stbrp_coord w, h;
|
||||
|
||||
/* output: */
|
||||
stbrp_coord x, y;
|
||||
int was_packed; /* non-zero if valid packing */
|
||||
|
||||
}; /* 16 bytes, nominally */
|
||||
|
||||
|
||||
STBRP_DEF void stbrp_init_target (stbrp_context *context, int width, int height, stbrp_node *nodes, int num_nodes);
|
||||
/* Initialize a rectangle packer to: */
|
||||
/* pack a rectangle that is 'width' by 'height' in dimensions */
|
||||
/* using temporary storage provided by the array 'nodes', which is 'num_nodes' long */
|
||||
/* */
|
||||
/* You must call this function every time you start packing into a new target. */
|
||||
/* */
|
||||
/* There is no "shutdown" function. The 'nodes' memory must stay valid for */
|
||||
/* the following stbrp_pack_rects() call (or calls), but can be freed after */
|
||||
/* the call (or calls) finish. */
|
||||
/* */
|
||||
/* Note: to guarantee best results, either: */
|
||||
/* 1. make sure 'num_nodes' >= 'width' */
|
||||
/* or 2. call stbrp_allow_out_of_mem() defined below with 'allow_out_of_mem = 1' */
|
||||
/* */
|
||||
/* If you don't do either of the above things, widths will be quantized to multiples */
|
||||
/* of small integers to guarantee the algorithm doesn't run out of temporary storage. */
|
||||
/* */
|
||||
/* If you do #2, then the non-quantized algorithm will be used, but the algorithm */
|
||||
/* may run out of temporary storage and be unable to pack some rectangles. */
|
||||
|
||||
STBRP_DEF void stbrp_setup_allow_out_of_mem (stbrp_context *context, int allow_out_of_mem);
|
||||
/* Optionally call this function after init but before doing any packing to */
|
||||
/* change the handling of the out-of-temp-memory scenario, described above. */
|
||||
/* If you call init again, this will be reset to the default (false). */
|
||||
|
||||
|
||||
STBRP_DEF void stbrp_setup_heuristic (stbrp_context *context, int heuristic);
|
||||
/* Optionally select which packing heuristic the library should use. Different */
|
||||
/* heuristics will produce better/worse results for different data sets. */
|
||||
/* If you call init again, this will be reset to the default. */
|
||||
|
||||
enum
|
||||
{
|
||||
STBRP_HEURISTIC_Skyline_default=0,
|
||||
STBRP_HEURISTIC_Skyline_BL_sortHeight = STBRP_HEURISTIC_Skyline_default,
|
||||
STBRP_HEURISTIC_Skyline_BF_sortHeight
|
||||
};
|
||||
|
||||
|
||||
/*//////////////////////////////////////////////////////////////////////////// */
|
||||
/* */
|
||||
/* the details of the following structures don't matter to you, but they must */
|
||||
/* be visible so you can handle the memory allocations for them */
|
||||
|
||||
struct stbrp_node
|
||||
{
|
||||
stbrp_coord x,y;
|
||||
stbrp_node *next;
|
||||
};
|
||||
|
||||
struct stbrp_context
|
||||
{
|
||||
int width;
|
||||
int height;
|
||||
int align;
|
||||
int init_mode;
|
||||
int heuristic;
|
||||
int num_nodes;
|
||||
stbrp_node *active_head;
|
||||
stbrp_node *free_head;
|
||||
stbrp_node extra[2]; /* we allocate two extra nodes so optimal user-node-count is 'width' not 'width+2' */
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/*//////////////////////////////////////////////////////////////////////////// */
|
||||
/* */
|
||||
/* IMPLEMENTATION SECTION */
|
||||
/* */
|
||||
|
||||
#ifdef STB_RECT_PACK_IMPLEMENTATION
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifndef STBRP_ASSERT
|
||||
#include <assert.h>
|
||||
#define STBRP_ASSERT assert
|
||||
#endif
|
||||
|
||||
enum
|
||||
{
|
||||
STBRP__INIT_skyline = 1
|
||||
};
|
||||
|
||||
STBRP_DEF void stbrp_setup_heuristic(stbrp_context *context, int heuristic)
|
||||
{
|
||||
switch (context->init_mode) {
|
||||
case STBRP__INIT_skyline:
|
||||
STBRP_ASSERT(heuristic == STBRP_HEURISTIC_Skyline_BL_sortHeight || heuristic == STBRP_HEURISTIC_Skyline_BF_sortHeight);
|
||||
context->heuristic = heuristic;
|
||||
break;
|
||||
default:
|
||||
STBRP_ASSERT(0);
|
||||
}
|
||||
}
|
||||
|
||||
STBRP_DEF void stbrp_setup_allow_out_of_mem(stbrp_context *context, int allow_out_of_mem)
|
||||
{
|
||||
if (allow_out_of_mem)
|
||||
/* if it's ok to run out of memory, then don't bother aligning them; */
|
||||
/* this gives better packing, but may fail due to OOM (even though */
|
||||
/* the rectangles easily fit). @TODO a smarter approach would be to only */
|
||||
/* quantize once we've hit OOM, then we could get rid of this parameter. */
|
||||
context->align = 1;
|
||||
else {
|
||||
/* if it's not ok to run out of memory, then quantize the widths */
|
||||
/* so that num_nodes is always enough nodes. */
|
||||
/* */
|
||||
/* I.e. num_nodes * align >= width */
|
||||
/* align >= width / num_nodes */
|
||||
/* align = ceil(width/num_nodes) */
|
||||
|
||||
context->align = (context->width + context->num_nodes-1) / context->num_nodes;
|
||||
}
|
||||
}
|
||||
|
||||
STBRP_DEF void stbrp_init_target(stbrp_context *context, int width, int height, stbrp_node *nodes, int num_nodes)
|
||||
{
|
||||
int i;
|
||||
#ifndef STBRP_LARGE_RECTS
|
||||
STBRP_ASSERT(width <= 0xffff && height <= 0xffff);
|
||||
#endif
|
||||
|
||||
for (i=0; i < num_nodes-1; ++i)
|
||||
nodes[i].next = &nodes[i+1];
|
||||
nodes[i].next = NULL;
|
||||
context->init_mode = STBRP__INIT_skyline;
|
||||
context->heuristic = STBRP_HEURISTIC_Skyline_default;
|
||||
context->free_head = &nodes[0];
|
||||
context->active_head = &context->extra[0];
|
||||
context->width = width;
|
||||
context->height = height;
|
||||
context->num_nodes = num_nodes;
|
||||
stbrp_setup_allow_out_of_mem(context, 0);
|
||||
|
||||
/* node 0 is the full width, node 1 is the sentinel (lets us not store width explicitly) */
|
||||
context->extra[0].x = 0;
|
||||
context->extra[0].y = 0;
|
||||
context->extra[0].next = &context->extra[1];
|
||||
context->extra[1].x = (stbrp_coord) width;
|
||||
#ifdef STBRP_LARGE_RECTS
|
||||
context->extra[1].y = (1<<30);
|
||||
#else
|
||||
context->extra[1].y = 65535;
|
||||
#endif
|
||||
context->extra[1].next = NULL;
|
||||
}
|
||||
|
||||
/* find minimum y position if it starts at x1 */
|
||||
static int stbrp__skyline_find_min_y(stbrp_context *c, stbrp_node *first, int x0, int width, int *pwaste)
|
||||
{
|
||||
stbrp_node *node = first;
|
||||
int x1 = x0 + width;
|
||||
int min_y, visited_width, waste_area;
|
||||
STBRP_ASSERT(first->x <= x0);
|
||||
(void)c;
|
||||
|
||||
#if 0
|
||||
/* skip in case we're past the node */
|
||||
while (node->next->x <= x0)
|
||||
++node;
|
||||
#else
|
||||
STBRP_ASSERT(node->next->x > x0); /* we ended up handling this in the caller for efficiency */
|
||||
#endif
|
||||
|
||||
STBRP_ASSERT(node->x <= x0);
|
||||
|
||||
min_y = 0;
|
||||
waste_area = 0;
|
||||
visited_width = 0;
|
||||
while (node->x < x1) {
|
||||
if (node->y > min_y) {
|
||||
/* raise min_y higher. */
|
||||
/* we've accounted for all waste up to min_y, */
|
||||
/* but we'll now add more waste for everything we've visted */
|
||||
waste_area += visited_width * (node->y - min_y);
|
||||
min_y = node->y;
|
||||
/* the first time through, visited_width might be reduced */
|
||||
if (node->x < x0)
|
||||
visited_width += node->next->x - x0;
|
||||
else
|
||||
visited_width += node->next->x - node->x;
|
||||
} else {
|
||||
/* add waste area */
|
||||
int under_width = node->next->x - node->x;
|
||||
if (under_width + visited_width > width)
|
||||
under_width = width - visited_width;
|
||||
waste_area += under_width * (min_y - node->y);
|
||||
visited_width += under_width;
|
||||
}
|
||||
node = node->next;
|
||||
}
|
||||
|
||||
*pwaste = waste_area;
|
||||
return min_y;
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int x,y;
|
||||
stbrp_node **prev_link;
|
||||
} stbrp__findresult;
|
||||
|
||||
static stbrp__findresult stbrp__skyline_find_best_pos(stbrp_context *c, int width, int height)
|
||||
{
|
||||
int best_waste = (1<<30), best_x, best_y = (1 << 30);
|
||||
stbrp__findresult fr;
|
||||
stbrp_node **prev, *node, *tail, **best = NULL;
|
||||
|
||||
/* align to multiple of c->align */
|
||||
width = (width + c->align - 1);
|
||||
width -= width % c->align;
|
||||
STBRP_ASSERT(width % c->align == 0);
|
||||
|
||||
node = c->active_head;
|
||||
prev = &c->active_head;
|
||||
while (node->x + width <= c->width) {
|
||||
int y,waste;
|
||||
y = stbrp__skyline_find_min_y(c, node, node->x, width, &waste);
|
||||
if (c->heuristic == STBRP_HEURISTIC_Skyline_BL_sortHeight) { /* actually just want to test BL */
|
||||
/* bottom left */
|
||||
if (y < best_y) {
|
||||
best_y = y;
|
||||
best = prev;
|
||||
}
|
||||
} else {
|
||||
/* best-fit */
|
||||
if (y + height <= c->height) {
|
||||
/* can only use it if it first vertically */
|
||||
if (y < best_y || (y == best_y && waste < best_waste)) {
|
||||
best_y = y;
|
||||
best_waste = waste;
|
||||
best = prev;
|
||||
}
|
||||
}
|
||||
}
|
||||
prev = &node->next;
|
||||
node = node->next;
|
||||
}
|
||||
|
||||
best_x = (best == NULL) ? 0 : (*best)->x;
|
||||
|
||||
/* if doing best-fit (BF), we also have to try aligning right edge to each node position */
|
||||
/* */
|
||||
/* e.g, if fitting */
|
||||
/* */
|
||||
/* ____________________ */
|
||||
/* |____________________| */
|
||||
/* */
|
||||
/* into */
|
||||
/* */
|
||||
/* | | */
|
||||
/* | ____________| */
|
||||
/* |____________| */
|
||||
/* */
|
||||
/* then right-aligned reduces waste, but bottom-left BL is always chooses left-aligned */
|
||||
/* */
|
||||
/* This makes BF take about 2x the time */
|
||||
|
||||
if (c->heuristic == STBRP_HEURISTIC_Skyline_BF_sortHeight) {
|
||||
tail = c->active_head;
|
||||
node = c->active_head;
|
||||
prev = &c->active_head;
|
||||
/* find first node that's admissible */
|
||||
while (tail->x < width)
|
||||
tail = tail->next;
|
||||
while (tail) {
|
||||
int xpos = tail->x - width;
|
||||
int y,waste;
|
||||
STBRP_ASSERT(xpos >= 0);
|
||||
/* find the left position that matches this */
|
||||
while (node->next->x <= xpos) {
|
||||
prev = &node->next;
|
||||
node = node->next;
|
||||
}
|
||||
STBRP_ASSERT(node->next->x > xpos && node->x <= xpos);
|
||||
y = stbrp__skyline_find_min_y(c, node, xpos, width, &waste);
|
||||
if (y + height < c->height) {
|
||||
if (y <= best_y) {
|
||||
if (y < best_y || waste < best_waste || (waste==best_waste && xpos < best_x)) {
|
||||
best_x = xpos;
|
||||
STBRP_ASSERT(y <= best_y);
|
||||
best_y = y;
|
||||
best_waste = waste;
|
||||
best = prev;
|
||||
}
|
||||
}
|
||||
}
|
||||
tail = tail->next;
|
||||
}
|
||||
}
|
||||
|
||||
fr.prev_link = best;
|
||||
fr.x = best_x;
|
||||
fr.y = best_y;
|
||||
return fr;
|
||||
}
|
||||
|
||||
static stbrp__findresult stbrp__skyline_pack_rectangle(stbrp_context *context, int width, int height)
|
||||
{
|
||||
/* find best position according to heuristic */
|
||||
stbrp__findresult res = stbrp__skyline_find_best_pos(context, width, height);
|
||||
stbrp_node *node, *cur;
|
||||
|
||||
/* bail if: */
|
||||
/* 1. it failed */
|
||||
/* 2. the best node doesn't fit (we don't always check this) */
|
||||
/* 3. we're out of memory */
|
||||
if (res.prev_link == NULL || res.y + height > context->height || context->free_head == NULL) {
|
||||
res.prev_link = NULL;
|
||||
return res;
|
||||
}
|
||||
|
||||
/* on success, create new node */
|
||||
node = context->free_head;
|
||||
node->x = (stbrp_coord) res.x;
|
||||
node->y = (stbrp_coord) (res.y + height);
|
||||
|
||||
context->free_head = node->next;
|
||||
|
||||
/* insert the new node into the right starting point, and */
|
||||
/* let 'cur' point to the remaining nodes needing to be */
|
||||
/* stiched back in */
|
||||
|
||||
cur = *res.prev_link;
|
||||
if (cur->x < res.x) {
|
||||
/* preserve the existing one, so start testing with the next one */
|
||||
stbrp_node *next = cur->next;
|
||||
cur->next = node;
|
||||
cur = next;
|
||||
} else {
|
||||
*res.prev_link = node;
|
||||
}
|
||||
|
||||
/* from here, traverse cur and free the nodes, until we get to one */
|
||||
/* that shouldn't be freed */
|
||||
while (cur->next && cur->next->x <= res.x + width) {
|
||||
stbrp_node *next = cur->next;
|
||||
/* move the current node to the free list */
|
||||
cur->next = context->free_head;
|
||||
context->free_head = cur;
|
||||
cur = next;
|
||||
}
|
||||
|
||||
/* stitch the list back in */
|
||||
node->next = cur;
|
||||
|
||||
if (cur->x < res.x + width)
|
||||
cur->x = (stbrp_coord) (res.x + width);
|
||||
|
||||
#ifdef _DEBUG
|
||||
cur = context->active_head;
|
||||
while (cur->x < context->width) {
|
||||
STBRP_ASSERT(cur->x < cur->next->x);
|
||||
cur = cur->next;
|
||||
}
|
||||
STBRP_ASSERT(cur->next == NULL);
|
||||
|
||||
{
|
||||
stbrp_node *L1 = NULL, *L2 = NULL;
|
||||
int count=0;
|
||||
cur = context->active_head;
|
||||
while (cur) {
|
||||
L1 = cur;
|
||||
cur = cur->next;
|
||||
++count;
|
||||
}
|
||||
cur = context->free_head;
|
||||
while (cur) {
|
||||
L2 = cur;
|
||||
cur = cur->next;
|
||||
++count;
|
||||
}
|
||||
STBRP_ASSERT(count == context->num_nodes+2);
|
||||
}
|
||||
#endif
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
static int rect_height_compare(const void *a, const void *b)
|
||||
{
|
||||
const stbrp_rect *p = (const stbrp_rect *) a;
|
||||
const stbrp_rect *q = (const stbrp_rect *) b;
|
||||
if (p->h > q->h)
|
||||
return -1;
|
||||
if (p->h < q->h)
|
||||
return 1;
|
||||
return (p->w > q->w) ? -1 : (p->w < q->w);
|
||||
}
|
||||
|
||||
static int rect_width_compare(const void *a, const void *b)
|
||||
{
|
||||
const stbrp_rect *p = (const stbrp_rect *) a;
|
||||
const stbrp_rect *q = (const stbrp_rect *) b;
|
||||
if (p->w > q->w)
|
||||
return -1;
|
||||
if (p->w < q->w)
|
||||
return 1;
|
||||
return (p->h > q->h) ? -1 : (p->h < q->h);
|
||||
}
|
||||
|
||||
static int rect_original_order(const void *a, const void *b)
|
||||
{
|
||||
const stbrp_rect *p = (const stbrp_rect *) a;
|
||||
const stbrp_rect *q = (const stbrp_rect *) b;
|
||||
return (p->was_packed < q->was_packed) ? -1 : (p->was_packed > q->was_packed);
|
||||
}
|
||||
|
||||
#ifdef STBRP_LARGE_RECTS
|
||||
#define STBRP__MAXVAL 0xffffffff
|
||||
#else
|
||||
#define STBRP__MAXVAL 0xffff
|
||||
#endif
|
||||
|
||||
STBRP_DEF void stbrp_pack_rects(stbrp_context *context, stbrp_rect *rects, int num_rects)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* we use the 'was_packed' field internally to allow sorting/unsorting */
|
||||
for (i=0; i < num_rects; ++i) {
|
||||
rects[i].was_packed = i;
|
||||
#ifndef STBRP_LARGE_RECTS
|
||||
STBRP_ASSERT(rects[i].w <= 0xffff && rects[i].h <= 0xffff);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* sort according to heuristic */
|
||||
qsort(rects, (size_t)num_rects, sizeof(rects[0]), rect_height_compare);
|
||||
|
||||
for (i=0; i < num_rects; ++i) {
|
||||
stbrp__findresult fr = stbrp__skyline_pack_rectangle(context, rects[i].w, rects[i].h);
|
||||
if (fr.prev_link) {
|
||||
rects[i].x = (stbrp_coord) fr.x;
|
||||
rects[i].y = (stbrp_coord) fr.y;
|
||||
} else {
|
||||
rects[i].x = rects[i].y = STBRP__MAXVAL;
|
||||
}
|
||||
}
|
||||
|
||||
/* unsort */
|
||||
qsort(rects, (size_t)num_rects, sizeof(rects[0]), rect_original_order);
|
||||
|
||||
/* set was_packed flags */
|
||||
for (i=0; i < num_rects; ++i)
|
||||
rects[i].was_packed = !(rects[i].x == STBRP__MAXVAL && rects[i].y == STBRP__MAXVAL);
|
||||
}
|
||||
#endif
|
||||