mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-09 03:29:43 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6690711ace | ||
|
|
da72a96041 | ||
|
|
2eb4571290 | ||
|
|
70d3bce2bf | ||
|
|
dbd56997f4 | ||
|
|
a643952554 | ||
|
|
7869072dd9 | ||
|
|
9c44bbd9ee | ||
|
|
44cfa6d876 | ||
|
|
bb45bf9a66 | ||
|
|
b25b2a0e6c | ||
|
|
00a49d068e | ||
|
|
317ecabadf | ||
|
|
18f8ded154 | ||
|
|
62508eca77 | ||
|
|
0badc3ffd2 | ||
|
|
e0c7bd2e57 | ||
|
|
ff5190ac76 | ||
|
|
54427bd377 | ||
|
|
4039bc89d6 | ||
|
|
0fc31d2616 | ||
|
|
eeeec23c66 | ||
|
|
c9eac5cdc0 | ||
|
|
1e47961420 | ||
|
|
da6a301a6e | ||
|
|
84f9a4c1d7 | ||
|
|
ce5d065014 | ||
|
|
53fc458795 | ||
|
|
78c13f59d0 | ||
|
|
5d31e561a2 | ||
|
|
e15bcabc10 | ||
|
|
da8a9bfeba | ||
|
|
fbe43730b8 | ||
|
|
e62c63cc0e | ||
|
|
6c243ef6fe | ||
|
|
56180af727 | ||
|
|
6534f71238 | ||
|
|
74937e4a52 | ||
|
|
41a731967f | ||
|
|
c3e9f64bc2 | ||
|
|
7f871d6e9a | ||
|
|
3be2491232 | ||
|
|
906b94966b | ||
|
|
8ff81312ad | ||
|
|
96723f3a57 | ||
|
|
31f3fc0abb | ||
|
|
fab90f4b96 | ||
|
|
fe8a502488 | ||
|
|
0bd38a5e1d | ||
|
|
2d348f68f9 | ||
|
|
3dd9a9ff98 | ||
|
|
72ec71a71c | ||
|
|
8c28ec0867 | ||
|
|
e00de48e92 | ||
|
|
e29b915536 | ||
|
|
3adbbc0bde | ||
|
|
c2d6ecdc86 | ||
|
|
f11a240190 | ||
|
|
2e1fa648b8 | ||
|
|
2b3eeef2fa | ||
|
|
d0708fc832 | ||
|
|
bd9dd06ddd | ||
|
|
3d7b7f6afa | ||
|
|
b979af0a8c | ||
|
|
f4762f6f33 | ||
|
|
004d9a613c | ||
|
|
78bb85e2f3 | ||
|
|
8b9456f419 | ||
|
|
d2a80e26db | ||
|
|
0268212d40 | ||
|
|
a7b856b65f | ||
|
|
ad71c56ea4 | ||
|
|
b7447b1dfc | ||
|
|
f1098d8f6a | ||
|
|
16a6142577 | ||
|
|
07e1f6e748 | ||
|
|
1b9d9647b0 | ||
|
|
d6443431c6 | ||
|
|
73d198ed7f | ||
|
|
d4d2f7fa6b | ||
|
|
01c59cf0eb | ||
|
|
bede7cfe2b | ||
|
|
f9462ed562 | ||
|
|
f59420094a | ||
|
|
4372d55325 | ||
|
|
3a23afcaa9 | ||
|
|
be7da8d626 | ||
|
|
09f5ccf050 | ||
|
|
e135f0b209 | ||
|
|
65dfddd910 | ||
|
|
e9f0ff08fe | ||
|
|
7d99e7cd51 | ||
|
|
5032c677e6 | ||
|
|
8dd4333e16 | ||
|
|
2931ae3d17 | ||
|
|
a1ac5af8af | ||
|
|
7f004aee71 | ||
|
|
dd2bb5a17b | ||
|
|
729b1bf64b | ||
|
|
6d720ff337 | ||
|
|
1a9206ea51 | ||
|
|
96bc0111c8 | ||
|
|
c0a97eeb60 | ||
|
|
9baba9183c | ||
|
|
0c09050760 | ||
|
|
ec9aea1189 | ||
|
|
cc215061fc | ||
|
|
0ef416970c | ||
|
|
f9417b9442 | ||
|
|
865e5b78dc | ||
|
|
9a4eb1b3d1 | ||
|
|
928767c5f3 | ||
|
|
92985a4405 | ||
|
|
aa96995171 | ||
|
|
7b8c108b5f | ||
|
|
6eda5a9e3f | ||
|
|
7128037670 | ||
|
|
874dabd475 | ||
|
|
58c5cc6f46 | ||
|
|
fd5861d79c | ||
|
|
b058ca5263 | ||
|
|
96de4b3e0e | ||
|
|
0dc69d4721 | ||
|
|
e576296131 | ||
|
|
2aad6bf2bb | ||
|
|
6db13ab51d | ||
|
|
02ea0a8a80 | ||
|
|
cedb005c93 | ||
|
|
28cc81bfe7 | ||
|
|
cacc8451a6 | ||
|
|
61d6fb57e6 | ||
|
|
48eb86cb47 | ||
|
|
e3dfa361f0 | ||
|
|
895783d854 | ||
|
|
65dec874a8 | ||
|
|
829656391a | ||
|
|
11cc280239 | ||
|
|
7dffc6286b | ||
|
|
bd11c241ec | ||
|
|
b497e2ea5a | ||
|
|
4734234dc5 | ||
|
|
05d9e6a47d | ||
|
|
5d449d5024 | ||
|
|
ba415b6d3a | ||
|
|
e69c43f2a8 | ||
|
|
f3521e4cc8 | ||
|
|
cf74d1b853 | ||
|
|
617b69d81f | ||
|
|
b0e9266416 | ||
|
|
b76c724872 | ||
|
|
7150ea5df2 | ||
|
|
68a17c5401 | ||
|
|
eb53356522 | ||
|
|
1efff4bdc3 | ||
|
|
6b6a2b93fa | ||
|
|
2c221e747e | ||
|
|
3b9c406123 | ||
|
|
15a30dae70 | ||
|
|
0264863520 | ||
|
|
060478184b | ||
|
|
dd4f24ecde | ||
|
|
a5dc73dfde | ||
|
|
27b4e72613 | ||
|
|
4fd2fee2a7 | ||
|
|
6cc60a2d02 | ||
|
|
d4a50935d2 | ||
|
|
b4f4720f51 | ||
|
|
3f526ed625 | ||
|
|
d20a2edcb4 | ||
|
|
f4b40cd108 | ||
|
|
e93924b0e2 | ||
|
|
aa55c1a7d9 | ||
|
|
7c4df601f8 | ||
|
|
af1e9c4157 | ||
|
|
fdd6d26d85 | ||
|
|
b2ed32d664 | ||
|
|
2010e57279 | ||
|
|
90d31a527c | ||
|
|
76d00b8b66 | ||
|
|
2ce247f11a | ||
|
|
faa717a8ab | ||
|
|
5f4687d16c | ||
|
|
ee076f848e | ||
|
|
89d4a5761a | ||
|
|
936c0bb3b0 | ||
|
|
e15a385e70 | ||
|
|
576415d762 | ||
|
|
748f5dc74b | ||
|
|
68265f6c52 | ||
|
|
54c0ca4bf5 | ||
|
|
a83e6b3405 | ||
|
|
0a3ca14fde | ||
|
|
43943fe794 | ||
|
|
d4184df592 | ||
|
|
01a9185a2d | ||
|
|
9ff8a3c8e2 | ||
|
|
65359297d8 | ||
|
|
a6acc7b31b | ||
|
|
242e579b89 | ||
|
|
78d48c53d2 | ||
|
|
18b0fb1422 | ||
|
|
bb43c8115f | ||
|
|
a8485d451a | ||
|
|
8cb66dd021 | ||
|
|
b00202a83d | ||
|
|
d7b3e9cc8f | ||
|
|
5fbcb50b5e | ||
|
|
20888aee7f | ||
|
|
43ce4756a1 | ||
|
|
d28763a89a | ||
|
|
1d82b08af0 | ||
|
|
aa7ee86da6 | ||
|
|
9a356d85a0 | ||
|
|
fbc1134a6e | ||
|
|
7db1d2047b | ||
|
|
bbb7871028 | ||
|
|
dcd5391a75 | ||
|
|
a34ce90940 | ||
|
|
6083f850aa | ||
|
|
cc7f661f9c | ||
|
|
493b6850a5 | ||
|
|
33cf9ce023 | ||
|
|
161b19cb73 | ||
|
|
d94a0a912c | ||
|
|
7242d8dcf7 | ||
|
|
64559154cf | ||
|
|
08b7ac500b | ||
|
|
3902a6715a | ||
|
|
38bc378c4d | ||
|
|
61a71e91e0 | ||
|
|
5a0d656a47 | ||
|
|
d0153fb024 | ||
|
|
6b049681b6 | ||
|
|
b6a51f006a | ||
|
|
422c6d8984 | ||
|
|
ce077533c2 | ||
|
|
bfcfb40a7b | ||
|
|
be6cdbc3c0 | ||
|
|
99246ae3e8 | ||
|
|
63f0e998db | ||
|
|
4250161327 | ||
|
|
012c4006b1 | ||
|
|
f3f6e6ff70 | ||
|
|
1e2917a78c | ||
|
|
9cd0d46476 | ||
|
|
339a0cdef4 | ||
|
|
0f6c3564dc | ||
|
|
0f38dc8e3e | ||
|
|
f47c020946 | ||
|
|
818009e75c | ||
|
|
c7f8df9327 | ||
|
|
a06ebe33e4 | ||
|
|
d76cca7a47 | ||
|
|
dad5215d93 | ||
|
|
397861ee7e | ||
|
|
f8f8650349 | ||
|
|
171453ac1d | ||
|
|
fe255f103e | ||
|
|
a4308640a2 | ||
|
|
9a1fed8598 | ||
|
|
c11f06e584 | ||
|
|
d9ddb92a90 | ||
|
|
989823691e | ||
|
|
9e686299d2 | ||
|
|
a1e91ff606 | ||
|
|
b34da03281 | ||
|
|
ac18671ead | ||
|
|
4750e87c76 | ||
|
|
0c0134d4d6 | ||
|
|
d0a87a236d | ||
|
|
a908cf4101 | ||
|
|
d239bee4e8 | ||
|
|
15530a351b | ||
|
|
2c75c45f3b | ||
|
|
ba91ae5909 | ||
|
|
4f2d1d7c93 | ||
|
|
1add138dae | ||
|
|
9ba0cbfac7 | ||
|
|
af976d5da3 | ||
|
|
3ddb5d51b3 | ||
|
|
c9ed624078 | ||
|
|
02776fed31 | ||
|
|
f2ed54fcf3 | ||
|
|
39305b920c | ||
|
|
033ccf4803 | ||
|
|
d22b72a892 | ||
|
|
ec19f27971 | ||
|
|
01dcf48c5b | ||
|
|
8de7fa63ae | ||
|
|
cb3a3a7980 | ||
|
|
06c1fb2a5c | ||
|
|
d1d3bd6e4b | ||
|
|
343824858b | ||
|
|
04370c6597 | ||
|
|
252414f4d7 | ||
|
|
5530f7fe63 | ||
|
|
0bdf68d0ea | ||
|
|
6de2827b57 | ||
|
|
29d07d1ba6 | ||
|
|
a912a64514 | ||
|
|
a7142680ca | ||
|
|
a713325459 | ||
|
|
6fe8637f6a | ||
|
|
2443c34ae2 | ||
|
|
9af9a1c89e | ||
|
|
d7e6ada920 | ||
|
|
a1969de2c3 | ||
|
|
4325a323e5 | ||
|
|
a29ac9598a | ||
|
|
1bbc2f09b5 | ||
|
|
b479903e3f | ||
|
|
30c1cd8de9 | ||
|
|
4a29f71272 | ||
|
|
65bd8194cd | ||
|
|
3387a0d678 | ||
|
|
17273493ef | ||
|
|
cddeabd4ec | ||
|
|
f3d072cdcf | ||
|
|
1aa8a950ef | ||
|
|
cbcbd895d2 | ||
|
|
528eddbed5 | ||
|
|
846bea4074 | ||
|
|
0283a87560 | ||
|
|
ee639d8b20 | ||
|
|
03de4a0b35 | ||
|
|
c761b14eb4 | ||
|
|
1d1b868103 | ||
|
|
86388cddfe | ||
|
|
ddd8e29d87 | ||
|
|
47b37e949f | ||
|
|
8b302c369e | ||
|
|
7f63016ccb | ||
|
|
9d0047798d | ||
|
|
0ffba39280 | ||
|
|
4f54025a50 | ||
|
|
0f8895bcc3 | ||
|
|
2d69615f1d | ||
|
|
faa3e3557c | ||
|
|
acf9f7aad1 | ||
|
|
c75143a62f | ||
|
|
ab1c26d532 | ||
|
|
a8b8ca7a96 | ||
|
|
06796bcc14 | ||
|
|
8a8a270159 | ||
|
|
c7be8edd89 | ||
|
|
38cc90d0e0 | ||
|
|
3264426a96 | ||
|
|
25c2acb98d | ||
|
|
8e4934edae | ||
|
|
1b111feb9e | ||
|
|
4994de806a | ||
|
|
34389dbd22 | ||
|
|
2fc465ea83 | ||
|
|
287fa45e73 | ||
|
|
0410d7a59e | ||
|
|
7b3b4de3b9 | ||
|
|
09b0a09ca2 | ||
|
|
ec4f961348 | ||
|
|
1465cf1ffc | ||
|
|
05f2153549 | ||
|
|
a609a748db | ||
|
|
27fc306b19 | ||
|
|
66ba52eab0 | ||
|
|
c8d97d05e7 | ||
|
|
0f21ab247c | ||
|
|
97d5a971a4 | ||
|
|
811a2d1419 | ||
|
|
ef835f93d5 | ||
|
|
e48e294009 | ||
|
|
71df73e640 | ||
|
|
58f145282e | ||
|
|
6579b5f3c8 | ||
|
|
30ade96fc0 | ||
|
|
641a37ce06 | ||
|
|
46b2100132 | ||
|
|
07d28091a2 | ||
|
|
19367da0ae | ||
|
|
0f337d49c8 | ||
|
|
1515c299f1 | ||
|
|
9386fb2fa0 | ||
|
|
b6c12e5b85 | ||
|
|
e7ab158a3b | ||
|
|
ade309d1f1 | ||
|
|
b3220cf53e | ||
|
|
c4f2de321a | ||
|
|
8616b21e1f | ||
|
|
e9d16655f0 | ||
|
|
02e0be55a8 | ||
|
|
f0f60901ff | ||
|
|
8b6abde2f9 | ||
|
|
ad0d73d8f0 | ||
|
|
6144ca0e31 | ||
|
|
3a717adbf9 | ||
|
|
a8032a6c4c | ||
|
|
6f4e3079bd | ||
|
|
e1512cc473 | ||
|
|
8317c5849c | ||
|
|
1b0381ca02 | ||
|
|
5bdd9be52b | ||
|
|
c370afd861 | ||
|
|
a969547e81 | ||
|
|
d8de78231b | ||
|
|
5d6b4d0a56 | ||
|
|
3b5c4d963a | ||
|
|
a99dcaa929 | ||
|
|
6d7dab2e66 | ||
|
|
0b4ae30f6b | ||
|
|
7f9249830a | ||
|
|
4e63113f72 | ||
|
|
d562bf38cb | ||
|
|
0b7ee2fcf7 | ||
|
|
1230edf1ee | ||
|
|
ae218cf1a5 | ||
|
|
ad627701da | ||
|
|
e0cf1ab450 | ||
|
|
6be66507d6 | ||
|
|
a5e2585fdc | ||
|
|
864f9d7c2c | ||
|
|
f45d2db0b1 | ||
|
|
00c7d918e9 | ||
|
|
ae561de0c8 | ||
|
|
5bba5813cf | ||
|
|
87e8c28749 | ||
|
|
92faefbccc | ||
|
|
dfe723c727 | ||
|
|
4e041ff3d0 | ||
|
|
1dfb29ddaf | ||
|
|
7b88378952 | ||
|
|
6f0011fd9f | ||
|
|
1f7e6690e3 | ||
|
|
86cb092b02 | ||
|
|
79ef0268e5 | ||
|
|
1439b38b20 | ||
|
|
2479699131 | ||
|
|
8a90e2777c | ||
|
|
7f6ff3ba84 | ||
|
|
3913adbe99 | ||
|
|
8bd789389f | ||
|
|
6241f52b90 | ||
|
|
b5dc5470a4 | ||
|
|
c85e44d597 | ||
|
|
6f6330576c | ||
|
|
9d85afd358 | ||
|
|
0f65518118 | ||
|
|
934681614f | ||
|
|
5c0f7876b8 | ||
|
|
b3f486ae44 | ||
|
|
d7cbb4472e | ||
|
|
84eb56892f | ||
|
|
31c6bba86a | ||
|
|
0e984f6c95 | ||
|
|
3cb6117226 | ||
|
|
f4f839f776 | ||
|
|
1583f7de97 | ||
|
|
86cf3243aa | ||
|
|
14a8ec050d | ||
|
|
4f74976cac | ||
|
|
6a39d504e0 | ||
|
|
7cd10fd707 | ||
|
|
f418c7fde1 | ||
|
|
b9bb75c193 | ||
|
|
e61e617e80 | ||
|
|
a2acb0e6f0 | ||
|
|
c6292a38f5 | ||
|
|
8701af084a | ||
|
|
5cc1b85f70 | ||
|
|
930b854272 | ||
|
|
5f98068e7d | ||
|
|
90018dbbe0 | ||
|
|
0093e0cbf9 | ||
|
|
74be1f5906 | ||
|
|
899db8fb37 | ||
|
|
511fbcda93 | ||
|
|
1e9aed1683 | ||
|
|
f28c0475b5 | ||
|
|
29495d4973 | ||
|
|
7321a9431b | ||
|
|
dfe08c7148 | ||
|
|
b63a3f8fcc | ||
|
|
f2e3789c8e | ||
|
|
45d4718406 | ||
|
|
f7c0225e1a | ||
|
|
015c166b1d | ||
|
|
9218d57b9d | ||
|
|
53dad5bc73 | ||
|
|
edcf3fd1ee | ||
|
|
49e43dd085 | ||
|
|
ea824bdee1 | ||
|
|
bf39033bc3 | ||
|
|
c3f77efb2c | ||
|
|
c5e4c90e88 | ||
|
|
960783987d | ||
|
|
f68d98a6a4 | ||
|
|
06ccd36b2f | ||
|
|
928f4e9e65 | ||
|
|
df90f233a4 | ||
|
|
1c1cf4535d | ||
|
|
e1a3ceaaee | ||
|
|
9976077895 | ||
|
|
83efd732dd | ||
|
|
033cecf08c | ||
|
|
19e86256a7 | ||
|
|
5f0aa1852e | ||
|
|
c390794452 | ||
|
|
64f53d8237 | ||
|
|
fff07d46b3 | ||
|
|
0e393211f3 | ||
|
|
08632c89b6 | ||
|
|
8d4d0d16c6 | ||
|
|
9239c2b349 | ||
|
|
ea6bd2797c | ||
|
|
3e4d7c404a | ||
|
|
00b398f6d2 | ||
|
|
1dea1fa0e2 | ||
|
|
8e86d11f57 | ||
|
|
01c82a09f0 | ||
|
|
a58c77113f | ||
|
|
a430c7f543 | ||
|
|
7e7a1fa5f9 | ||
|
|
f25581e88d | ||
|
|
e555295681 | ||
|
|
94c042f686 | ||
|
|
7660b67ad4 | ||
|
|
494ceee05e | ||
|
|
2bcc36b387 | ||
|
|
695a93e071 | ||
|
|
00dce981c8 | ||
|
|
c015711090 | ||
|
|
d818578076 | ||
|
|
64e2f9e2f0 | ||
|
|
8c02d63f2e | ||
|
|
6a814229e1 | ||
|
|
7086277c56 | ||
|
|
0f8e406a05 | ||
|
|
8e2dada12a | ||
|
|
8ba1f2fca6 | ||
|
|
e88e580832 | ||
|
|
5218be3a0c | ||
|
|
7dfb3c373a | ||
|
|
013e9cd8cb | ||
|
|
53a1369dba | ||
|
|
01f83ba289 | ||
|
|
e96c2b4ef3 | ||
|
|
175d601a4e | ||
|
|
9b4bb51c2e | ||
|
|
55a28eb8a3 | ||
|
|
2e66300320 | ||
|
|
b20a03f3b9 | ||
|
|
502c2a41a9 | ||
|
|
bf017e3a0c | ||
|
|
2bb90f3702 | ||
|
|
f0a1b94a11 | ||
|
|
a8144abbce | ||
|
|
0da67ad4f9 | ||
|
|
99a9769014 | ||
|
|
ea037799a4 | ||
|
|
f51e0f62e5 | ||
|
|
67cf1153c6 | ||
|
|
2a3bba34e0 | ||
|
|
a20a2da85e | ||
|
|
554ca4f087 | ||
|
|
5eb3bb05f7 | ||
|
|
7fe34b97a6 | ||
|
|
734ef07fcc | ||
|
|
cce0320bb5 | ||
|
|
dba04c73e4 | ||
|
|
f42911cab7 | ||
|
|
6e3416b990 | ||
|
|
c7a9182d59 | ||
|
|
9a90008543 | ||
|
|
92dee9b3aa | ||
|
|
43860e384a | ||
|
|
20706b51de | ||
|
|
cf9d8a8adb | ||
|
|
c536e0fbdc | ||
|
|
001aa3ba4a | ||
|
|
db24cb1ec5 | ||
|
|
78426895db | ||
|
|
26d37e006a | ||
|
|
15fa7f9cd1 | ||
|
|
90b1db7178 | ||
|
|
490a2f77ae | ||
|
|
ffed6b2dd0 | ||
|
|
38a305bb6e | ||
|
|
7e7eb233a5 | ||
|
|
87a5fd2e44 | ||
|
|
1ff4445ba0 | ||
|
|
577f210b30 | ||
|
|
8c2664e5fb | ||
|
|
236200ef63 | ||
|
|
b454192a43 | ||
|
|
8572fb622e | ||
|
|
82db5a4950 | ||
|
|
786bdacd4c | ||
|
|
200b88c3ca | ||
|
|
b1bd0f7b7f | ||
|
|
7d5eb2bc27 | ||
|
|
b96d365968 | ||
|
|
21c7ff99d1 | ||
|
|
3838b3c045 | ||
|
|
9083ede9b5 | ||
|
|
b7b03c531a | ||
|
|
939bc70ac6 | ||
|
|
ca62f342b0 | ||
|
|
79f5e9ca98 | ||
|
|
92601a0fb8 | ||
|
|
80df588cf0 | ||
|
|
e35e0e0f23 | ||
|
|
83ab0d799f | ||
|
|
4f3ade1b95 | ||
|
|
d3f0ca76bc | ||
|
|
f23b42b437 | ||
|
|
1d5955bced | ||
|
|
80ea008e77 | ||
|
|
9b1ada22b9 | ||
|
|
8fcfa3659a | ||
|
|
6dc267ef1c | ||
|
|
c142b123a1 | ||
|
|
84ff9207f9 | ||
|
|
1b289c0f05 | ||
|
|
e41127459e | ||
|
|
89d896339c | ||
|
|
d04940a159 | ||
|
|
ce9573e4c3 | ||
|
|
870bce981d | ||
|
|
60681195f8 | ||
|
|
0ab6350610 | ||
|
|
2640748b89 | ||
|
|
6f424ebc4c | ||
|
|
61b044b124 | ||
|
|
c20e9fd6bd | ||
|
|
a2f50174dd | ||
|
|
ab09ebe687 | ||
|
|
adfb0b5a6d | ||
|
|
cb7ef6615c | ||
|
|
17e2458903 | ||
|
|
288c2c3996 | ||
|
|
b82976b206 | ||
|
|
072d6ff125 | ||
|
|
e1c47a68fe | ||
|
|
69bcac61dd | ||
|
|
76d06c89ca | ||
|
|
8f7f40b86c | ||
|
|
56c47bbe56 | ||
|
|
2fee5edba4 | ||
|
|
92d2765157 | ||
|
|
0b9595b7e1 | ||
|
|
e13fd6da41 | ||
|
|
9e06843127 | ||
|
|
b6941a045d | ||
|
|
5fe9f8dc11 | ||
|
|
57981b2990 | ||
|
|
23c8150b6e | ||
|
|
c1a7419469 | ||
|
|
ce34c4bba8 | ||
|
|
d5dc50c436 | ||
|
|
c17755ab1a | ||
|
|
2427351afb | ||
|
|
39149b36b2 | ||
|
|
2323cef8d1 | ||
|
|
3e72b89021 | ||
|
|
a3007b1604 | ||
|
|
60f9f8329c | ||
|
|
6b3a8112d1 | ||
|
|
3b377f2e41 | ||
|
|
6a6caff671 | ||
|
|
439b3e5007 | ||
|
|
f8ac103888 | ||
|
|
77143179b5 | ||
|
|
d5816cb298 | ||
|
|
3e3cc9f2f2 | ||
|
|
2e11895ef9 | ||
|
|
1af81201a0 | ||
|
|
4cc122648c | ||
|
|
2064681a67 | ||
|
|
7fa6b946ce | ||
|
|
bf9add6325 | ||
|
|
ab1c4d0c4d | ||
|
|
cf7687b49c | ||
|
|
2e14d0979b | ||
|
|
6360b0ef25 | ||
|
|
6f37163675 | ||
|
|
4c14267f5b | ||
|
|
61bae588fb | ||
|
|
1303a310e8 | ||
|
|
bb993c3f27 | ||
|
|
fa0ba621d7 | ||
|
|
1e3aba3494 | ||
|
|
33b0a189f5 | ||
|
|
6f5be6b3b3 | ||
|
|
b00878a595 | ||
|
|
ddb912b373 | ||
|
|
e9fd6863ce | ||
|
|
79008d4fd6 | ||
|
|
c18da3039f | ||
|
|
b4c6831b56 | ||
|
|
43c8fc50be | ||
|
|
24af521bf1 | ||
|
|
75003b65f1 | ||
|
|
ef79734e7c | ||
|
|
fdaf6ffead | ||
|
|
6bd88e6848 | ||
|
|
5eba4984cf | ||
|
|
42725179ec | ||
|
|
e83d460997 | ||
|
|
f27d2b70f6 | ||
|
|
8a7c233e3f | ||
|
|
1cb8faf6c9 | ||
|
|
7b48a0c57e | ||
|
|
cf0dd7f5e8 | ||
|
|
7cc6c477b8 | ||
|
|
66544dcea4 | ||
|
|
552959933d | ||
|
|
b961a2b2b2 | ||
|
|
908e266cc4 | ||
|
|
b80b52b806 | ||
|
|
d5a0819aba | ||
|
|
3d7bc4f7fe | ||
|
|
5a37033803 | ||
|
|
483699357d | ||
|
|
4d30df7a64 | ||
|
|
ca63357b54 | ||
|
|
b20989d31d | ||
|
|
c8f4d97839 | ||
|
|
f960e9ad26 | ||
|
|
32a8b57826 | ||
|
|
12e51eb4b5 | ||
|
|
6f8a1e8ab2 | ||
|
|
0af195c2df | ||
|
|
2c8b558dac | ||
|
|
570bd93eed | ||
|
|
fd443082a7 | ||
|
|
dfeef5b78d | ||
|
|
f1a5725f66 | ||
|
|
6add83e3ec | ||
|
|
dce96d0869 | ||
|
|
1822f3bf90 | ||
|
|
3b97ee2c75 | ||
|
|
c2b0f8faea | ||
|
|
72cdd37ad2 | ||
|
|
5dcb78ea21 | ||
|
|
7899d449e6 | ||
|
|
840278796e | ||
|
|
6f01b8dc2c | ||
|
|
a21687b5d7 | ||
|
|
fa7eeb57b8 | ||
|
|
84923a0465 | ||
|
|
07524fe433 | ||
|
|
f9992c5e47 | ||
|
|
1114e3960e | ||
|
|
0b8afdd5b4 | ||
|
|
05d5e8b7dd | ||
|
|
26a858b66c | ||
|
|
26bcd42698 | ||
|
|
4ba6dcd69b | ||
|
|
a1225c570f | ||
|
|
b0434b4811 | ||
|
|
6e9e5b6907 | ||
|
|
a8f34c6960 | ||
|
|
bfef3b6191 | ||
|
|
fba912834d | ||
|
|
1164adb902 | ||
|
|
f59e334ceb | ||
|
|
5c0f4f4ac8 | ||
|
|
ac6362cae4 | ||
|
|
972d3faabb | ||
|
|
f55ee11554 | ||
|
|
7508eab655 | ||
|
|
0955fac195 | ||
|
|
f0fd3895b6 | ||
|
|
3720cf87e7 | ||
|
|
be9bf7dc44 | ||
|
|
c7e13e2bcd | ||
|
|
435aa5ee7c | ||
|
|
f7d4cc25e5 | ||
|
|
43b931129d | ||
|
|
93b7dc1bdd | ||
|
|
ef4a1a3c0f | ||
|
|
87840e5b6c | ||
|
|
70bb4c69f3 | ||
|
|
8b4a41155d | ||
|
|
6b3c3f326a | ||
|
|
48347053cd | ||
|
|
1270d8f96a | ||
|
|
b40b169098 | ||
|
|
97981c7a9d | ||
|
|
c46032c63a | ||
|
|
ea7cf9d9ca | ||
|
|
84c62cfb2b | ||
|
|
34958ec39a | ||
|
|
41cf1df5a9 | ||
|
|
efb8649027 | ||
|
|
52b6d73c5a | ||
|
|
1c56e86da4 | ||
|
|
797e62f604 | ||
|
|
2169f89946 | ||
|
|
7f5a6cdbf9 | ||
|
|
8d06c32d18 | ||
|
|
1bf76bc1f6 | ||
|
|
033cf569e4 | ||
|
|
a5cbafe0e5 | ||
|
|
71f2fa531c | ||
|
|
6b01dd86ae | ||
|
|
9259b141a6 | ||
|
|
da7430be52 | ||
|
|
9102a9d999 | ||
|
|
e2fc8900b5 | ||
|
|
2af2b4eebf | ||
|
|
2c7cc41f1b | ||
|
|
f8c31dd56a | ||
|
|
ba90c4afaf | ||
|
|
160118ff6c | ||
|
|
90b7875f21 | ||
|
|
e02cc9ae5f | ||
|
|
6df0249d3e | ||
|
|
9b6e97f967 | ||
|
|
9fea079af3 | ||
|
|
a446f9040b | ||
|
|
91d14cbb62 |
No files matched your search
@@ -1,3 +1,6 @@
|
||||
[submodule "deps/glslang/glslang"]
|
||||
path = deps/glslang/glslang
|
||||
url = git://github.com/KhronosGroup/glslang.git
|
||||
[submodule "deps/spir2cross"]
|
||||
path = deps/spir2cross
|
||||
url = git://github.com/ARM-software/spir2cross
|
||||
@@ -67,7 +67,9 @@ OBJCFLAGS := $(CFLAGS) -D__STDC_CONSTANT_MACROS
|
||||
|
||||
ifeq ($(CXX_BUILD), 1)
|
||||
LINK = $(CXX)
|
||||
CFLAGS := $(CXXFLAGS) -xc++
|
||||
CFLAGS := $(CXXFLAGS) -xc++
|
||||
CFLAGS += -DCXX_BUILD
|
||||
CXXFLAGS += -DCXX_BUILD
|
||||
else
|
||||
ifeq ($(findstring Win32,$(OS)),)
|
||||
LINK = $(CC)
|
||||
|
||||
+30
-21
@@ -129,16 +129,17 @@ OBJ += frontend/frontend.o \
|
||||
tasks/task_file_transfer.o \
|
||||
content.o \
|
||||
libretro-common/encodings/encoding_utf.o \
|
||||
libretro-common/file/file_list.o \
|
||||
libretro-common/file/dir_list.o \
|
||||
libretro-common/lists/file_list.o \
|
||||
libretro-common/lists/dir_list.o \
|
||||
libretro-common/file/retro_dirent.o \
|
||||
libretro-common/file/retro_file.o \
|
||||
libretro-common/streams/file_stream.o \
|
||||
libretro-common/streams/interface_stream.o \
|
||||
libretro-common/streams/memory_stream.o \
|
||||
libretro-common/file/retro_stat.o \
|
||||
libretro-common/string/string_list.o \
|
||||
libretro-common/lists/string_list.o \
|
||||
libretro-common/string/stdstring.o \
|
||||
libretro-common/memmap/memalign.o \
|
||||
dir_list_special.o \
|
||||
string_list_special.o \
|
||||
list_special.o \
|
||||
libretro-common/file/nbio/nbio_stdio.o \
|
||||
libretro-common/file/file_path.o \
|
||||
file_path_special.o \
|
||||
@@ -166,14 +167,14 @@ OBJ += frontend/frontend.o \
|
||||
tasks/task_overlay.o \
|
||||
input/input_overlay.o \
|
||||
patch.o \
|
||||
libretro-common/queues/fifo_buffer.o \
|
||||
libretro-common/queues/fifo_queue.o \
|
||||
core_options.o \
|
||||
libretro-common/compat/compat_fnmatch.o \
|
||||
libretro-common/compat/compat_posix_string.o \
|
||||
cheats.o \
|
||||
core_info.o \
|
||||
libretro-common/file/config_file.o \
|
||||
libretro-common/file/config_file_userdata.o \
|
||||
config_file_userdata.o \
|
||||
screenshot.o \
|
||||
libretro-common/gfx/scaler/scaler.o \
|
||||
gfx/drivers_shader/shader_null.o \
|
||||
@@ -388,8 +389,8 @@ ifeq ($(HW_CONTEXT_MENU_DRIVERS), 1)
|
||||
HAVE_MATERIALUI = 1
|
||||
endif
|
||||
|
||||
#ifeq ($(HAVE_ZAHNRAD),)
|
||||
#HAVE_ZAHNRAD = 1
|
||||
#ifeq ($(HAVE_NUKLEAR),)
|
||||
#HAVE_NUKLEAR = 1
|
||||
#endif
|
||||
|
||||
ifeq ($(HAVE_XMB),)
|
||||
@@ -398,7 +399,7 @@ ifeq ($(HW_CONTEXT_MENU_DRIVERS), 1)
|
||||
else
|
||||
HAVE_ZARCH = 0
|
||||
HAVE_MATERIALUI = 0
|
||||
#HAVE_ZAHNRAD = 0
|
||||
#HAVE_NUKLEAR = 0
|
||||
HAVE_XMB = 0
|
||||
endif
|
||||
|
||||
@@ -410,12 +411,11 @@ 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
|
||||
ifeq ($(HAVE_NUKLEAR), 1)
|
||||
OBJ += menu/drivers/nk_common.o
|
||||
OBJ += menu/drivers/nk_menu.o
|
||||
OBJ += menu/drivers/nuklear.o
|
||||
DEFINES += -DHAVE_NUKLEAR
|
||||
endif
|
||||
ifeq ($(HAVE_ZARCH), 1)
|
||||
OBJ += menu/drivers/zarch.o
|
||||
@@ -429,6 +429,7 @@ endif
|
||||
|
||||
ifeq ($(HAVE_LAKKA), 1)
|
||||
DEFINES += -DHAVE_LAKKA
|
||||
DEFINES += -DLAKKA_PROJECT=$(LAKKA_PROJECT)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_MENU_COMMON), 1)
|
||||
@@ -597,6 +598,7 @@ endif
|
||||
ifeq ($(HAVE_HID), 1)
|
||||
DEFINES += -DHAVE_HID
|
||||
OBJ += input/connect/joypad_connection.o \
|
||||
input/connect/connect_ps2adapter.o \
|
||||
input/connect/connect_ps3.o \
|
||||
input/connect/connect_ps4.o \
|
||||
input/connect/connect_wii.o \
|
||||
@@ -750,25 +752,31 @@ ifeq ($(HAVE_VULKAN), 1)
|
||||
$(wildcard deps/glslang/glslang/glslang/MachineIndependent/preprocessor/*.cpp) \
|
||||
$(wildcard deps/glslang/glslang/glslang/OSDependent/$(GLSLANG_PLATFORM)/*.cpp)
|
||||
|
||||
SPIR2CROSS_SOURCES := deps/spir2cross/spir2cross.cpp
|
||||
|
||||
DEFINES += \
|
||||
-Ideps/glslang/glslang/glslang/OSDependent/$(GLSLANG_PLATFORM) \
|
||||
-Ideps/glslang/glslang \
|
||||
-Ideps/glslang/glslang/glslang/MachineIndependent \
|
||||
-Ideps/glslang/glslang/glslang/Public \
|
||||
-Ideps/glslang/glslang/SPIRV \
|
||||
-Ideps/glslang
|
||||
-Ideps/glslang \
|
||||
-Ideps/spir2cross
|
||||
|
||||
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)
|
||||
SPIR2CROSS_OBJ := $(SPIR2CROSS_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)
|
||||
gfx/drivers_shader/slang_reflection.o \
|
||||
$(GLSLANG_OBJ) \
|
||||
$(SPIR2CROSS_OBJ)
|
||||
ifeq ($(HAVE_MENU_COMMON), 1)
|
||||
OBJ += menu/drivers_display/menu_display_vulkan.o
|
||||
endif
|
||||
@@ -874,8 +882,8 @@ endif
|
||||
|
||||
|
||||
ifeq ($(HAVE_ZLIB), 1)
|
||||
OBJ += libretro-common/file/file_archive.o \
|
||||
libretro-common/file/file_archive_zlib.o \
|
||||
OBJ += libretro-common/file/archive_file.o \
|
||||
libretro-common/file/archive_file_zlib.o \
|
||||
tasks/task_decompress.o
|
||||
OBJ += $(ZLIB_OBJS)
|
||||
DEFINES += -DHAVE_ZLIB
|
||||
@@ -944,6 +952,7 @@ ifeq ($(HAVE_NETWORKING), 1)
|
||||
DEFINES += -DHAVE_NETWORKING
|
||||
OBJ += libretro-common/net/net_compat.o \
|
||||
libretro-common/net/net_http.o \
|
||||
libretro-common/net/net_socket.o \
|
||||
net_http_special.o \
|
||||
tasks/task_http.o
|
||||
|
||||
|
||||
+41
-34
@@ -21,20 +21,32 @@ APP_RSF = ctr/tools/template.rsf
|
||||
APP_SYSTEM_MODE = 64MB
|
||||
APP_SYSTEM_MODE_EXT = 124MB
|
||||
APP_BIG_TEXT_SECTION = 0
|
||||
APP_USE_SVCHAX = 0
|
||||
|
||||
include ctr/Makefile.cores
|
||||
|
||||
OBJS :=
|
||||
OBJS += gfx/drivers/ctr_sprite.o
|
||||
OBJS += gfx/drivers/ctr_shaders/ctr_sprite.o
|
||||
OBJS += ctr/ctr_system.o
|
||||
OBJS += ctr/ctr_memory.o
|
||||
OBJS += ctr/ctr_linear.o
|
||||
OBJS += ctr/ctr_svchax.o
|
||||
|
||||
ifeq ($(APP_BIG_TEXT_SECTION), 1)
|
||||
APP_USE_SVCHAX = 1
|
||||
LDFLAGS += -Wl,--defsym,__ctr_patch_services=__service_ptr
|
||||
endif
|
||||
|
||||
ifeq ($(APP_USE_SVCHAX), 1)
|
||||
OBJS += ctr/ctr_svchax.o
|
||||
endif
|
||||
|
||||
ifeq ($(GRIFFIN_BUILD), 1)
|
||||
OBJS += griffin/griffin.o
|
||||
else
|
||||
OBJS += libretro-common/file/file_extract.o
|
||||
CFLAGS += -DHAVE_COMPRESSION
|
||||
OBJS += libretro-common/file/archive_file.o
|
||||
OBJS += libretro-common/file/archive_file_zlib.o
|
||||
OBJS += libretro-common/encodings/encoding_utf.o
|
||||
OBJS += verbosity.o
|
||||
OBJS += performance.o
|
||||
OBJS += libretro-common/compat/compat_getopt.o
|
||||
@@ -43,13 +55,13 @@ else
|
||||
OBJS += libretro-common/compat/compat_fnmatch.o
|
||||
OBJS += libretro-common/memmap/memalign.o
|
||||
OBJS += libretro-common/file/config_file.o
|
||||
OBJS += libretro-common/file/config_file_userdata.o
|
||||
OBJS += config_file_userdata.o
|
||||
OBJS += core_options.o
|
||||
OBJS += cheats.o
|
||||
OBJS += libretro-common/hash/rhash.o
|
||||
OBJS += gfx/video_context_driver.o
|
||||
OBJS += gfx/drivers_context/gfx_null_ctx.o
|
||||
OBJS += gfx/image/image.o
|
||||
OBJS += gfx/video_texture_image.o
|
||||
OBJS += libretro-common/formats/tga/rtga.o
|
||||
OBJS += libretro-common/formats/png/rpng.o
|
||||
OBJS += libretro-common/formats/png/rpng_encode.o
|
||||
@@ -75,10 +87,11 @@ else
|
||||
OBJS += input/drivers_joypad/hid_joypad.o
|
||||
OBJS += input/drivers_hid/null_hid.o
|
||||
OBJS += gfx/video_state_tracker.o
|
||||
OBJS += libretro-common/queues/fifo_buffer.o
|
||||
OBJS += libretro-common/queues/fifo_queue.o
|
||||
OBJS += audio/audio_resampler_driver.o
|
||||
OBJS += audio/drivers_resampler/sinc.o
|
||||
OBJS += audio/drivers_resampler/nearest.o
|
||||
OBJS += audio/drivers_resampler/sinc_resampler.o
|
||||
OBJS += audio/drivers_resampler/nearest_resampler.o
|
||||
OBJS += audio/drivers_resampler/null_resampler.o
|
||||
OBJS += audio/drivers_resampler/cc_resampler.o
|
||||
OBJS += camera/drivers/nullcamera.o
|
||||
OBJS += location/drivers/nulllocation.o
|
||||
@@ -86,7 +99,7 @@ else
|
||||
OBJS += audio/drivers/ctr_dsp_audio.o
|
||||
OBJS += audio/drivers/nullaudio.o
|
||||
OBJS += gfx/video_driver.o
|
||||
OBJS += gfx/video_common.o
|
||||
OBJS += gfx/video_coord_array.o
|
||||
OBJS += input/input_driver.o
|
||||
OBJS += audio/audio_driver.o
|
||||
OBJS += camera/camera_driver.o
|
||||
@@ -122,17 +135,15 @@ else
|
||||
OBJS += content.o
|
||||
OBJS += libretro-common/file/file_path.o
|
||||
OBJS += file_path_special.o
|
||||
OBJS += libretro-common/file/dir_list.o
|
||||
OBJS += libretro-common/lists/dir_list.o
|
||||
OBJS += libretro-common/file/retro_dirent.o
|
||||
OBJS += libretro-common/file/retro_file.o
|
||||
OBJS += libretro-common/streams/file_stream.o
|
||||
OBJS += libretro-common/file/retro_stat.o
|
||||
OBJS += dir_list_special.o
|
||||
OBJS += string_list_special.o
|
||||
OBJS += libretro-common/string/string_list.o
|
||||
OBJS += list_special.o
|
||||
OBJS += libretro-common/lists/string_list.o
|
||||
OBJS += libretro-common/string/stdstring.o
|
||||
OBJS += file_ops.o
|
||||
OBJS += libretro-common/file/nbio/nbio_stdio.o
|
||||
OBJS += libretro-common/file/file_list.o
|
||||
OBJS += libretro-common/lists/file_list.o
|
||||
OBJS += libretro-common/queues/message_queue.o
|
||||
OBJS += patch.o
|
||||
OBJS += configuration.o
|
||||
@@ -147,7 +158,8 @@ else
|
||||
OBJS += libretro_version_1.o
|
||||
OBJS += retroarch.o
|
||||
OBJS += runloop.o
|
||||
OBJS += tasks/tasks.o
|
||||
OBJS += libretro-common/queues/task_queue.o
|
||||
OBJS += tasks/tasks_internal.o
|
||||
OBJS += msg_hash.o
|
||||
OBJS += intl/msg_hash_de.o
|
||||
OBJS += intl/msg_hash_es.o
|
||||
@@ -161,8 +173,9 @@ else
|
||||
OBJS += movie.o
|
||||
OBJS += record/record_driver.o
|
||||
OBJS += record/drivers/record_null.o
|
||||
OBJS += tasks/task_decompress.o
|
||||
OBJS += tasks/task_content.o
|
||||
OBJS += tasks/task_file_transfer.o
|
||||
OBJS += tasks/task_decompress.o
|
||||
OBJS += screenshot.o
|
||||
OBJS += playlist.o
|
||||
OBJS += menu/menu_driver.o
|
||||
@@ -172,6 +185,7 @@ else
|
||||
OBJS += menu/menu_entries.o
|
||||
OBJS += menu/menu_setting.o
|
||||
OBJS += menu/menu_cbs.o
|
||||
OBJS += menu/menu_content.o
|
||||
OBJS += menu/cbs/menu_cbs_ok.o
|
||||
OBJS += menu/cbs/menu_cbs_cancel.o
|
||||
OBJS += menu/cbs/menu_cbs_select.o
|
||||
@@ -220,8 +234,6 @@ else
|
||||
OBJS += deps/zlib/trees.o
|
||||
OBJS += deps/zlib/uncompr.o
|
||||
OBJS += deps/zlib/zutil.o
|
||||
OBJS += deps/zlib/ioapi.o
|
||||
OBJS += deps/zlib/unzip.o
|
||||
OBJS += audio/audio_utils.o
|
||||
endif
|
||||
|
||||
@@ -285,7 +297,7 @@ CFLAGS += -DHAVE_ZLIB -DHAVE_RPNG -DWANT_ZLIB -DHAVE_BUILTIN_AUTOCONFIG
|
||||
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11
|
||||
|
||||
ASFLAGS := -g $(ARCH) -O3
|
||||
LDFLAGS = -specs=ctr/3dsx_custom.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
|
||||
LDFLAGS += -specs=ctr/3dsx_custom.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
|
||||
|
||||
CFLAGS += -std=gnu99 -ffast-math
|
||||
|
||||
@@ -313,11 +325,6 @@ $(TARGET): $(TARGET_3DSX) $(TARGET_3DS) $(TARGET_CIA)
|
||||
$(TARGET).3dsx: $(TARGET).elf
|
||||
$(TARGET).elf: $(OBJS) libretro_ctr.a
|
||||
|
||||
ctr_sprite_shader_shbin.h: gfx/drivers/ctr_sprite.o
|
||||
gfx/drivers/ctr_gfx.c: ctr_sprite_shader_shbin.h
|
||||
griffin/griffin.o: gfx/drivers/ctr_gfx.c
|
||||
|
||||
|
||||
PREFIX := $(DEVKITARM)/bin/arm-none-eabi-
|
||||
|
||||
CC := $(PREFIX)gcc
|
||||
@@ -340,14 +347,15 @@ else
|
||||
BANNERTOOL = ctr/tools/bannertool.exe
|
||||
endif
|
||||
|
||||
%.o: %.shader
|
||||
python $(AEMSTRO)/aemstro_as.py $< $(notdir $<).shbin
|
||||
$(DEVKITARM)/bin/bin2s $(notdir $<).shbin | $(PREFIX)as -o $@
|
||||
echo "extern const u8" `(echo $(notdir $<).shbin | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end[];" > `(echo $(notdir $<).shbin | tr . _)`.h
|
||||
echo "extern const u8" `(echo $(notdir $<).shbin | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"[];" >> `(echo $(notdir $<).shbin | tr . _)`.h
|
||||
echo "extern const u32" `(echo $(notdir $<).shbin | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_size";" >> `(echo $(notdir $<).shbin | tr . _)`.h
|
||||
rm $(notdir $<).shbin
|
||||
%.o: %.vsh %.gsh
|
||||
$(DEVKITARM)/bin/picasso $^ -o $*.shbin
|
||||
$(DEVKITARM)/bin/bin2s $*.shbin | $(PREFIX)as -o $@
|
||||
rm $*.shbin
|
||||
|
||||
%.o: %.vsh
|
||||
$(DEVKITARM)/bin/picasso $^ -o $*.shbin
|
||||
$(DEVKITARM)/bin/bin2s $*.shbin | $(PREFIX)as -o $@
|
||||
rm $*.shbin
|
||||
|
||||
%.o: %.cpp
|
||||
$(CXX) -c -o $@ $< $(CXXFLAGS) $(INCDIRS)
|
||||
@@ -403,7 +411,6 @@ clean:
|
||||
rm -f $(TARGET).smdh
|
||||
rm -f $(TARGET).bnr
|
||||
rm -f $(TARGET).icn
|
||||
rm -f *_shader_shbin.h
|
||||
rm -f ctr/ctr_config_*.o
|
||||
rm -f ctr/3dsx_custom_crt0.o
|
||||
|
||||
|
||||
@@ -24,20 +24,22 @@ PPU_SRCS = frontend/frontend_salamander.c \
|
||||
frontend/drivers/platform_ps3.c \
|
||||
frontend/drivers/platform_null.c \
|
||||
libretro-common/file/file_path.c \
|
||||
libretro-common/file/dir_list.c \
|
||||
libretro-common/lists/dir_list.c \
|
||||
libretro-common/lists/string_list.c \
|
||||
libretro-common/file/retro_dirent.c \
|
||||
libretro-common/file/retro_stat.c \
|
||||
libretro-common/hash/rhash.c \
|
||||
libretro-common/string/stdstring.c \
|
||||
libretro-common/string/string_list.c \
|
||||
libretro-common/compat/compat_strl.c \
|
||||
libretro-common/file/retro_file.c \
|
||||
libretro-common/streams/file_stream.c \
|
||||
libretro-common/file/config_file.c \
|
||||
verbosity.c
|
||||
|
||||
ifeq ($(HAVE_LOGGER), 1)
|
||||
PPU_CFLAGS += -DHAVE_LOGGER
|
||||
PPU_SRCS += netlogger.c
|
||||
PPU_SRCS += netlogger.c \
|
||||
libretro-common/net/net_compat.c \
|
||||
libretro-common/net/net_socket.c
|
||||
endif
|
||||
|
||||
PPU_TARGET = retroarch-salamander_ps3.elf
|
||||
|
||||
@@ -37,12 +37,12 @@ OBJS = frontend/frontend_salamander.o \
|
||||
frontend/drivers/platform_null.o \
|
||||
libretro-common/file/file_path.o \
|
||||
libretro-common/string/stdstring.o \
|
||||
libretro-common/string/string_list.o \
|
||||
libretro-common/file/dir_list.o \
|
||||
libretro-common/lists/string_list.o \
|
||||
libretro-common/lists/dir_list.o \
|
||||
libretro-common/file/retro_dirent.o \
|
||||
libretro-common/compat/compat_strl.o \
|
||||
libretro-common/file/config_file.o \
|
||||
libretro-common/file/retro_file.o \
|
||||
libretro-common/streams/file_stream.o \
|
||||
libretro-common/file/retro_stat.o \
|
||||
libretro-common/hash/rhash.o \
|
||||
verbosity.o \
|
||||
|
||||
@@ -47,9 +47,9 @@ OBJ = frontend/frontend_salamander.o \
|
||||
libretro-common/file/file_path.o \
|
||||
libretro-common/hash/rhash.o \
|
||||
libretro-common/string/stdstring.o \
|
||||
libretro-common/string/string_list.o \
|
||||
libretro-common/file/dir_list.o \
|
||||
libretro-common/file/retro_file.o \
|
||||
libretro-common/lists/string_list.o \
|
||||
libretro-common/lists/dir_list.o \
|
||||
libretro-common/streams/file_stream.o \
|
||||
libretro-common/file/retro_dirent.o \
|
||||
libretro-common/file/retro_stat.o \
|
||||
libretro-common/compat/compat_strl.o \
|
||||
@@ -60,7 +60,9 @@ OBJ = frontend/frontend_salamander.o \
|
||||
ifeq ($(HAVE_LOGGER), 1)
|
||||
CFLAGS += -DHAVE_LOGGER
|
||||
CFLAGS += -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT)
|
||||
OBJ += logger/netlogger.o
|
||||
OBJ += logger/netlogger.o \
|
||||
libretro-common/net/net_compat.o \
|
||||
libretro-common/net/net_socket.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_FILE_LOGGER), 1)
|
||||
|
||||
+36
-7
@@ -18,6 +18,8 @@
|
||||
|
||||
#include <retro_assert.h>
|
||||
|
||||
#include <lists/string_list.h>
|
||||
|
||||
#include "audio_driver.h"
|
||||
#include "audio_resampler_driver.h"
|
||||
#include "../record/record_driver.h"
|
||||
@@ -26,14 +28,11 @@
|
||||
|
||||
#include "../command_event.h"
|
||||
#include "../configuration.h"
|
||||
#include "../general.h"
|
||||
#include "../retroarch.h"
|
||||
#include "../runloop.h"
|
||||
#include "../performance.h"
|
||||
#include "../verbosity.h"
|
||||
#include "../string_list_special.h"
|
||||
|
||||
#ifdef HAVE_NETPLAY
|
||||
#include "../netplay/netplay.h"
|
||||
#endif
|
||||
#include "../list_special.h"
|
||||
|
||||
#ifndef AUDIO_BUFFER_FREE_SAMPLES_COUNT
|
||||
#define AUDIO_BUFFER_FREE_SAMPLES_COUNT (8 * 1024)
|
||||
@@ -780,6 +779,7 @@ static bool find_audio_driver(void)
|
||||
bool audio_driver_ctl(enum rarch_audio_ctl_state state, void *data)
|
||||
{
|
||||
static struct retro_audio_callback audio_callback;
|
||||
static struct string_list *audio_driver_devices_list = NULL;
|
||||
static struct retro_perf_counter resampler_proc = {0};
|
||||
static const rarch_resampler_t *audio_driver_resampler = NULL;
|
||||
static void *audio_driver_resampler_data = NULL;
|
||||
@@ -793,6 +793,31 @@ bool audio_driver_ctl(enum rarch_audio_ctl_state state, void *data)
|
||||
rarch_resampler_freep(&audio_driver_resampler,
|
||||
&audio_driver_resampler_data);
|
||||
break;
|
||||
case RARCH_AUDIO_CTL_DEVICES_LIST_FREE:
|
||||
if (!current_audio || !current_audio->device_list_free
|
||||
|| !audio_driver_context_audio_data)
|
||||
return false;
|
||||
current_audio->device_list_free(audio_driver_context_audio_data,
|
||||
audio_driver_devices_list);
|
||||
audio_driver_devices_list = NULL;
|
||||
break;
|
||||
case RARCH_AUDIO_CTL_DEVICES_LIST_NEW:
|
||||
if (!current_audio || !current_audio->device_list_new
|
||||
|| !audio_driver_context_audio_data)
|
||||
return false;
|
||||
audio_driver_devices_list = (struct string_list*)
|
||||
current_audio->device_list_new(audio_driver_context_audio_data);
|
||||
if (!audio_driver_devices_list)
|
||||
return false;
|
||||
break;
|
||||
case RARCH_AUDIO_CTL_DEVICES_LIST_GET:
|
||||
{
|
||||
struct string_list**ptr = (struct string_list**)data;
|
||||
if (!ptr)
|
||||
return false;
|
||||
*ptr = audio_driver_devices_list;
|
||||
}
|
||||
break;
|
||||
case RARCH_AUDIO_CTL_RESAMPLER_INIT:
|
||||
return rarch_resampler_realloc(
|
||||
&audio_driver_resampler_data,
|
||||
@@ -818,6 +843,7 @@ bool audio_driver_ctl(enum rarch_audio_ctl_state state, void *data)
|
||||
audio_driver_context_audio_data = NULL;
|
||||
break;
|
||||
case RARCH_AUDIO_CTL_DEINIT:
|
||||
audio_driver_ctl(RARCH_AUDIO_CTL_DEVICES_LIST_FREE, NULL);
|
||||
if (!uninit_audio())
|
||||
return false;
|
||||
break;
|
||||
@@ -854,12 +880,15 @@ bool audio_driver_ctl(enum rarch_audio_ctl_state state, void *data)
|
||||
{
|
||||
const struct retro_audio_callback *cb =
|
||||
(const struct retro_audio_callback*)data;
|
||||
#ifdef HAVE_NETPLAY
|
||||
global_t *global = global_get_ptr();
|
||||
#endif
|
||||
|
||||
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))
|
||||
if (global->netplay.enable)
|
||||
return false;
|
||||
#endif
|
||||
if (cb)
|
||||
|
||||
+17
-1
@@ -27,6 +27,13 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define AUDIO_CHUNK_SIZE_BLOCKING 512
|
||||
|
||||
/* So we don't get complete line-noise when fast-forwarding audio. */
|
||||
#define AUDIO_CHUNK_SIZE_NONBLOCKING 2048
|
||||
|
||||
#define AUDIO_MAX_RATIO 16
|
||||
|
||||
enum rarch_audio_ctl_state
|
||||
{
|
||||
RARCH_AUDIO_CTL_NONE = 0,
|
||||
@@ -58,7 +65,10 @@ enum rarch_audio_ctl_state
|
||||
RARCH_AUDIO_CTL_IS_ACTIVE,
|
||||
RARCH_AUDIO_CTL_RESAMPLER_DEINIT,
|
||||
RARCH_AUDIO_CTL_RESAMPLER_INIT,
|
||||
RARCH_AUDIO_CTL_RESAMPLER_PROCESS
|
||||
RARCH_AUDIO_CTL_RESAMPLER_PROCESS,
|
||||
RARCH_AUDIO_CTL_DEVICES_LIST_NEW,
|
||||
RARCH_AUDIO_CTL_DEVICES_LIST_FREE,
|
||||
RARCH_AUDIO_CTL_DEVICES_LIST_GET
|
||||
};
|
||||
|
||||
typedef struct audio_driver
|
||||
@@ -100,6 +110,12 @@ typedef struct audio_driver
|
||||
/* Human-readable identifier. */
|
||||
const char *ident;
|
||||
|
||||
/* Optional. Get audio device list (allocates, caller has to free this) */
|
||||
void *(*device_list_new)(void *data);
|
||||
|
||||
/* Optional. Frees audio device list */
|
||||
void (*device_list_free)(void *data, void *data2);
|
||||
|
||||
/* Optional. */
|
||||
size_t (*write_avail)(void *data);
|
||||
|
||||
|
||||
@@ -22,12 +22,12 @@
|
||||
#include <dynamic/dylib.h>
|
||||
|
||||
#include <file/file_path.h>
|
||||
#include <file/config_file_userdata.h>
|
||||
#include <file/dir_list.h>
|
||||
#include <lists/dir_list.h>
|
||||
|
||||
#include "audio_dsp_filter.h"
|
||||
#include "audio_filters/dspfilter.h"
|
||||
|
||||
#include "../config_file_userdata.h"
|
||||
#include "../frontend/frontend_driver.h"
|
||||
#include "../performance.h"
|
||||
#include "../dynamic.h"
|
||||
|
||||
@@ -16,15 +16,15 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <file/config_file_userdata.h>
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include "audio_resampler_driver.h"
|
||||
#include "../config_file_userdata.h"
|
||||
#ifdef RARCH_INTERNAL
|
||||
#include "../performance.h"
|
||||
#endif
|
||||
#ifndef DONT_HAVE_STRING_LIST
|
||||
#include "../string_list_special.h"
|
||||
#include "../list_special.h"
|
||||
#endif
|
||||
|
||||
static const rarch_resampler_t *resampler_drivers[] = {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <queues/fifo_buffer.h>
|
||||
#include <queues/fifo_queue.h>
|
||||
#include <rthreads/rthreads.h>
|
||||
|
||||
#include "audio_thread_wrapper.h"
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <lists/string_list.h>
|
||||
|
||||
#include <alsa/asoundlib.h>
|
||||
|
||||
#include "../audio_driver.h"
|
||||
@@ -324,6 +326,64 @@ static size_t alsa_buffer_size(void *data)
|
||||
return alsa->buffer_size;
|
||||
}
|
||||
|
||||
static void *alsa_device_list_new(void *data)
|
||||
{
|
||||
void **hints, **n;
|
||||
union string_list_elem_attr attr;
|
||||
struct string_list *s = string_list_new();
|
||||
|
||||
if (!s)
|
||||
return NULL;
|
||||
|
||||
attr.i = 0;
|
||||
|
||||
if (snd_device_name_hint(-1, "pcm", &hints) != 0)
|
||||
goto error;
|
||||
|
||||
n = hints;
|
||||
|
||||
while (*n != NULL)
|
||||
{
|
||||
char *name = snd_device_name_get_hint(*n, "NAME");
|
||||
char *io = snd_device_name_get_hint(*n, "IOID");
|
||||
char *desc = snd_device_name_get_hint(*n, "DESC");
|
||||
|
||||
/* description of device IOID - input / output identifcation
|
||||
* ("Input" or "Output"), NULL means both) */
|
||||
|
||||
if (!io || !strcmp(io,"Output"))
|
||||
string_list_append(s, name, attr);
|
||||
|
||||
if (name)
|
||||
free(name);
|
||||
if (io)
|
||||
free(io);
|
||||
if (desc)
|
||||
free(desc);
|
||||
|
||||
n++;
|
||||
}
|
||||
|
||||
/* free hint buffer too */
|
||||
snd_device_name_free_hint(hints);
|
||||
|
||||
return s;
|
||||
|
||||
error:
|
||||
string_list_free(s);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void alsa_device_list_free(void *data, void *array_list_data)
|
||||
{
|
||||
struct string_list *s = (struct string_list*)array_list_data;
|
||||
|
||||
if (!s)
|
||||
return;
|
||||
|
||||
string_list_free(s);
|
||||
}
|
||||
|
||||
audio_driver_t audio_alsa = {
|
||||
alsa_init,
|
||||
alsa_write,
|
||||
@@ -334,6 +394,8 @@ audio_driver_t audio_alsa = {
|
||||
alsa_free,
|
||||
alsa_use_float,
|
||||
"alsa",
|
||||
alsa_device_list_new,
|
||||
alsa_device_list_free,
|
||||
alsa_write_avail,
|
||||
alsa_buffer_size,
|
||||
};
|
||||
@@ -377,6 +377,8 @@ audio_driver_t audio_alsa = {
|
||||
alsa_qsa_free,
|
||||
alsa_qsa_use_float,
|
||||
"alsa",
|
||||
NULL,
|
||||
NULL,
|
||||
alsa_qsa_write_avail,
|
||||
alsa_qsa_buffer_size,
|
||||
};
|
||||
@@ -16,10 +16,12 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <lists/string_list.h>
|
||||
|
||||
#include <alsa/asoundlib.h>
|
||||
|
||||
#include <rthreads/rthreads.h>
|
||||
#include <queues/fifo_buffer.h>
|
||||
#include <queues/fifo_queue.h>
|
||||
|
||||
#include "../audio_driver.h"
|
||||
#include "../../configuration.h"
|
||||
@@ -342,6 +344,64 @@ static size_t alsa_thread_buffer_size(void *data)
|
||||
return alsa->buffer_size;
|
||||
}
|
||||
|
||||
static void *alsa_device_list_new(void *data)
|
||||
{
|
||||
void **hints, **n;
|
||||
union string_list_elem_attr attr;
|
||||
struct string_list *s = string_list_new();
|
||||
|
||||
if (!s)
|
||||
return NULL;
|
||||
|
||||
attr.i = 0;
|
||||
|
||||
if (snd_device_name_hint(-1, "pcm", &hints) != 0)
|
||||
goto error;
|
||||
|
||||
n = hints;
|
||||
|
||||
while (*n != NULL)
|
||||
{
|
||||
char *name = snd_device_name_get_hint(*n, "NAME");
|
||||
char *io = snd_device_name_get_hint(*n, "IOID");
|
||||
char *desc = snd_device_name_get_hint(*n, "DESC");
|
||||
|
||||
/* description of device IOID - input / output identifcation
|
||||
* ("Input" or "Output"), NULL means both) */
|
||||
|
||||
if (!io || !strcmp(io,"Output"))
|
||||
string_list_append(s, name, attr);
|
||||
|
||||
if (name)
|
||||
free(name);
|
||||
if (io)
|
||||
free(io);
|
||||
if (desc)
|
||||
free(desc);
|
||||
|
||||
n++;
|
||||
}
|
||||
|
||||
/* free hint buffer too */
|
||||
snd_device_name_free_hint(hints);
|
||||
|
||||
return s;
|
||||
|
||||
error:
|
||||
string_list_free(s);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void alsa_device_list_free(void *data, void *array_list_data)
|
||||
{
|
||||
struct string_list *s = (struct string_list*)array_list_data;
|
||||
|
||||
if (!s)
|
||||
return;
|
||||
|
||||
string_list_free(s);
|
||||
}
|
||||
|
||||
audio_driver_t audio_alsathread = {
|
||||
alsa_thread_init,
|
||||
alsa_thread_write,
|
||||
@@ -352,6 +412,8 @@ audio_driver_t audio_alsathread = {
|
||||
alsa_thread_free,
|
||||
alsa_thread_use_float,
|
||||
"alsathread",
|
||||
alsa_device_list_new,
|
||||
alsa_device_list_free,
|
||||
alsa_thread_write_avail,
|
||||
alsa_thread_buffer_size,
|
||||
};
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <AudioUnit/AUComponent.h>
|
||||
|
||||
#include <boolean.h>
|
||||
#include <queues/fifo_buffer.h>
|
||||
#include <queues/fifo_queue.h>
|
||||
#include <rthreads/rthreads.h>
|
||||
#include <retro_endianness.h>
|
||||
#include <string/stdstring.h>
|
||||
@@ -440,6 +440,17 @@ static size_t coreaudio_buffer_size(void *data)
|
||||
return dev->buffer_size;
|
||||
}
|
||||
|
||||
static void *coreaudio_device_list_new(void *data)
|
||||
{
|
||||
/* TODO/FIXME */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void coreaudio_device_list_free(void *data, void *array_list_data)
|
||||
{
|
||||
/* TODO/FIXME */
|
||||
}
|
||||
|
||||
audio_driver_t audio_coreaudio = {
|
||||
coreaudio_init,
|
||||
coreaudio_write,
|
||||
@@ -450,6 +461,8 @@ audio_driver_t audio_coreaudio = {
|
||||
coreaudio_free,
|
||||
coreaudio_use_float,
|
||||
"coreaudio",
|
||||
coreaudio_device_list_new,
|
||||
coreaudio_device_list_free,
|
||||
coreaudio_write_avail,
|
||||
coreaudio_buffer_size,
|
||||
};
|
||||
@@ -300,6 +300,8 @@ audio_driver_t audio_ctr_csnd = {
|
||||
ctr_csnd_audio_free,
|
||||
ctr_csnd_audio_use_float,
|
||||
"csnd",
|
||||
NULL,
|
||||
NULL,
|
||||
ctr_csnd_audio_write_avail,
|
||||
ctr_csnd_audio_buffer_size
|
||||
};
|
||||
@@ -214,6 +214,8 @@ audio_driver_t audio_ctr_dsp = {
|
||||
ctr_dsp_audio_free,
|
||||
ctr_dsp_audio_use_float,
|
||||
"dsp",
|
||||
NULL,
|
||||
NULL,
|
||||
ctr_dsp_audio_write_avail,
|
||||
ctr_dsp_audio_buffer_size
|
||||
};
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include <retro_inline.h>
|
||||
#include <retro_miscellaneous.h>
|
||||
#include <rthreads/rthreads.h>
|
||||
#include <queues/fifo_buffer.h>
|
||||
#include <queues/fifo_queue.h>
|
||||
|
||||
#include "../audio_driver.h"
|
||||
#include "../../configuration.h"
|
||||
@@ -489,6 +489,8 @@ audio_driver_t audio_dsound = {
|
||||
dsound_free,
|
||||
dsound_use_float,
|
||||
"dsound",
|
||||
NULL,
|
||||
NULL,
|
||||
dsound_write_avail,
|
||||
dsound_buffer_size,
|
||||
};
|
||||
@@ -241,6 +241,8 @@ audio_driver_t audio_gx = {
|
||||
gx_audio_free,
|
||||
gx_audio_use_float,
|
||||
"gx",
|
||||
NULL,
|
||||
NULL,
|
||||
gx_audio_write_avail,
|
||||
gx_audio_buffer_size,
|
||||
};
|
||||
@@ -362,6 +362,8 @@ audio_driver_t audio_jack = {
|
||||
ja_free,
|
||||
ja_use_float,
|
||||
"jack",
|
||||
NULL,
|
||||
NULL,
|
||||
ja_write_avail,
|
||||
ja_buffer_size,
|
||||
};
|
||||
@@ -85,6 +85,8 @@ audio_driver_t audio_null = {
|
||||
null_audio_free,
|
||||
null_audio_use_float,
|
||||
"null",
|
||||
NULL,
|
||||
NULL,
|
||||
null_audio_write_avail,
|
||||
NULL
|
||||
};
|
||||
@@ -267,6 +267,8 @@ audio_driver_t audio_openal = {
|
||||
al_free,
|
||||
al_use_float,
|
||||
"openal",
|
||||
NULL,
|
||||
NULL,
|
||||
al_write_avail,
|
||||
al_buffer_size,
|
||||
};
|
||||
@@ -313,6 +313,8 @@ audio_driver_t audio_opensl = {
|
||||
sl_free,
|
||||
sl_use_float,
|
||||
"opensl",
|
||||
NULL,
|
||||
NULL,
|
||||
sl_write_avail,
|
||||
sl_buffer_size,
|
||||
};
|
||||
@@ -212,6 +212,8 @@ audio_driver_t audio_oss = {
|
||||
oss_free,
|
||||
oss_use_float,
|
||||
"oss",
|
||||
NULL,
|
||||
NULL,
|
||||
oss_write_avail,
|
||||
oss_buffer_size,
|
||||
};
|
||||
@@ -17,7 +17,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <queues/fifo_buffer.h>
|
||||
#include <queues/fifo_queue.h>
|
||||
|
||||
#include "../audio_driver.h"
|
||||
#include "../../configuration.h"
|
||||
@@ -247,6 +247,8 @@ audio_driver_t audio_ps3 = {
|
||||
ps3_audio_free,
|
||||
ps3_audio_use_float,
|
||||
"ps3",
|
||||
NULL,
|
||||
NULL,
|
||||
ps3_audio_write_avail,
|
||||
NULL
|
||||
};
|
||||
@@ -286,6 +286,8 @@ audio_driver_t audio_psp = {
|
||||
#else
|
||||
"psp",
|
||||
#endif
|
||||
NULL,
|
||||
NULL,
|
||||
psp_write_avail,
|
||||
psp_buffer_size,
|
||||
};
|
||||
@@ -343,6 +343,8 @@ audio_driver_t audio_pulse = {
|
||||
pulse_free,
|
||||
pulse_use_float,
|
||||
"pulse",
|
||||
NULL,
|
||||
NULL,
|
||||
pulse_write_avail,
|
||||
pulse_buffer_size,
|
||||
};
|
||||
@@ -142,6 +142,8 @@ audio_driver_t audio_roar = {
|
||||
ra_free,
|
||||
ra_use_float,
|
||||
"roar",
|
||||
NULL,
|
||||
NULL,
|
||||
ra_write_avail,
|
||||
NULL
|
||||
};
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
#include <boolean.h>
|
||||
|
||||
#include <queues/fifo_buffer.h>
|
||||
#include <queues/fifo_queue.h>
|
||||
#include <rthreads/rthreads.h>
|
||||
|
||||
#include "../audio_driver.h"
|
||||
@@ -233,6 +233,8 @@ audio_driver_t audio_rsound = {
|
||||
rs_free,
|
||||
rs_use_float,
|
||||
"rsound",
|
||||
NULL,
|
||||
NULL,
|
||||
rs_write_avail,
|
||||
rs_buffer_size,
|
||||
};
|
||||
@@ -32,7 +32,7 @@ extern "C" {
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#include <queues/fifo_buffer.h>
|
||||
#include <queues/fifo_queue.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#define RSD_DEFAULT_HOST "127.0.0.1" /* Stupid Windows. */
|
||||
|
||||
@@ -110,6 +110,8 @@ audio_driver_t audio_rwebaudio = {
|
||||
rwebaudio_free,
|
||||
rwebaudio_use_float,
|
||||
"rwebaudio",
|
||||
NULL,
|
||||
NULL,
|
||||
rwebaudio_write_avail,
|
||||
rwebaudio_buffer_size,
|
||||
};
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#include <boolean.h>
|
||||
#include <rthreads/rthreads.h>
|
||||
#include <queues/fifo_buffer.h>
|
||||
#include <queues/fifo_queue.h>
|
||||
#include <retro_inline.h>
|
||||
|
||||
#include "../audio_driver.h"
|
||||
@@ -253,6 +253,8 @@ audio_driver_t audio_sdl = {
|
||||
#else
|
||||
"sdl",
|
||||
#endif
|
||||
NULL,
|
||||
NULL,
|
||||
sdl_audio_write_avail,
|
||||
NULL
|
||||
};
|
||||
@@ -347,6 +347,8 @@ audio_driver_t audio_xa = {
|
||||
xa_free,
|
||||
xa_use_float,
|
||||
"xaudio",
|
||||
NULL,
|
||||
NULL,
|
||||
xa_write_avail,
|
||||
xa_buffer_size,
|
||||
};
|
||||
@@ -146,6 +146,8 @@ audio_driver_t audio_xenon360 = {
|
||||
xenon360_audio_free,
|
||||
xenon360_use_float,
|
||||
"xenon360",
|
||||
NULL,
|
||||
NULL,
|
||||
xenon360_write_avail,
|
||||
NULL
|
||||
};
|
||||
+23
-26
@@ -20,22 +20,19 @@ CFLAGS += -I$(LIBRETRO_COMM_DIR)/include -I../../
|
||||
LDFLAGS += -lm
|
||||
|
||||
SHAREDOBJ += $(LIBRETRO_COMM_DIR)/memmap/memalign.o \
|
||||
$(LIBRETRO_COMM_DIR)/string/string_list.o \
|
||||
$(LIBRETRO_COMM_DIR)/file/config_file_userdata.o \
|
||||
$(LIBRETRO_COMM_DIR)/lists/string_list.o \
|
||||
../..//config_file_userdata.o \
|
||||
../audio_resampler_driver.o \
|
||||
$(LIBRETRO_COMM_DIR)/file/config_file.o \
|
||||
$(LIBRETRO_COMM_DIR)/file/retro_file.o \
|
||||
$(LIBRETRO_COMM_DIR)/streams/file_stream.o \
|
||||
$(LIBRETRO_COMM_DIR)/string/stdstring.o \
|
||||
$(LIBRETRO_COMM_DIR)/file/file_path.o \
|
||||
$(LIBRETRO_COMM_DIR)/compat/compat.o \
|
||||
$(LIBRETRO_COMM_DIR)/file/retro_stat.o \
|
||||
$(LIBRETRO_COMM_DIR)/compat/compat_strl.o \
|
||||
$(LIBRETRO_COMM_DIR)/hash/rhash.o \
|
||||
|
||||
all: $(TESTS)
|
||||
|
||||
resampler-sinc.o: ../audio_resampler_driver.c $(SHAREDOBJ)
|
||||
$(CC) -c -o $@ $< $(CFLAGS)
|
||||
|
||||
resampler-cc.o: ../audio_resampler_driver.c $(SHAREDOBJ)
|
||||
$(CC) -c -o $@ $< $(CFLAGS) -DRESAMPLER_IDENT='"CC"'
|
||||
|
||||
main-cc.o: main.c
|
||||
$(CC) -c -o $@ $< $(CFLAGS) -DRESAMPLER_IDENT='"CC"'
|
||||
|
||||
@@ -45,16 +42,16 @@ snr-cc.o: snr.c
|
||||
cc-resampler.o: ../drivers_resampler/cc_resampler.c
|
||||
$(CC) -c -o $@ $< $(CFLAGS)
|
||||
|
||||
sinc-lowest.o: ../drivers_resampler/sinc.c
|
||||
sinc-lowest.o: ../drivers_resampler/sinc_resampler.c
|
||||
$(CC) -c -o $@ $< $(CFLAGS) -DSINC_LOWEST_QUALITY
|
||||
|
||||
sinc-lower.o: ../drivers_resampler/sinc.c
|
||||
sinc-lower.o: ../drivers_resampler/sinc_resampler.c
|
||||
$(CC) -c -o $@ $< $(CFLAGS) -DSINC_LOWER_QUALITY
|
||||
|
||||
sinc.o: ../drivers_resampler/sinc.c
|
||||
sinc.o: ../drivers_resampler/sinc_resampler.c
|
||||
$(CC) -c -o $@ $< $(CFLAGS)
|
||||
|
||||
nearest.o: ../drivers_resampler/nearest.c
|
||||
nearest_resampler.o: ../drivers_resampler/nearest_resampler.c
|
||||
$(CC) -c -o $@ $< $(CFLAGS)
|
||||
|
||||
sinc-higher.o: ../drivers_resampler/sinc.c
|
||||
@@ -63,40 +60,40 @@ sinc-higher.o: ../drivers_resampler/sinc.c
|
||||
sinc-highest.o: ../drivers_resampler/sinc.c
|
||||
$(CC) -c -o $@ $< $(CFLAGS) -DSINC_HIGHEST_QUALITY
|
||||
|
||||
test-sinc-lowest: sinc-lowest.o ../audio_utils.o main.o resampler-sinc.o resampler-cc.o nearest.o $(SHAREDOBJ)
|
||||
test-sinc-lowest: sinc-lowest.o ../audio_utils.o main.o nearest_resampler.o $(SHAREDOBJ)
|
||||
$(CC) -o $@ $^ $(LDFLAGS)
|
||||
|
||||
test-snr-sinc-lowest: sinc-lowest.o ../audio_utils.o snr.o resampler-sinc.o resampler-cc.o nearest.o $(SHAREDOBJ)
|
||||
test-snr-sinc-lowest: sinc-lowest.o ../audio_utils.o snr.o nearest_resampler.o $(SHAREDOBJ)
|
||||
$(CC) -o $@ $^ $(LDFLAGS)
|
||||
|
||||
test-sinc-lower: sinc-lower.o ../audio_utils.o main.o resampler-sinc.o resampler-cc.o nearest.o $(SHAREDOBJ)
|
||||
test-sinc-lower: sinc-lower.o ../audio_utils.o main.o nearest_resampler.o $(SHAREDOBJ)
|
||||
$(CC) -o $@ $^ $(LDFLAGS)
|
||||
|
||||
test-snr-sinc-lower: sinc-lower.o ../audio_utils.o snr.o resampler-sinc.o resampler-cc.o nearest.o $(SHAREDOBJ)
|
||||
test-snr-sinc-lower: sinc-lower.o ../audio_utils.o snr.o nearest_resampler.o $(SHAREDOBJ)
|
||||
$(CC) -o $@ $^ $(LDFLAGS)
|
||||
|
||||
test-sinc: sinc.o ../audio_utils.o main.o resampler-sinc.o resampler-cc.o nearest.o $(SHAREDOBJ)
|
||||
test-sinc: sinc.o ../audio_utils.o main.o nearest_resampler.o $(SHAREDOBJ)
|
||||
$(CC) -o $@ $^ $(LDFLAGS)
|
||||
|
||||
test-snr-sinc: sinc.o ../audio_utils.o snr.o resampler-sinc.o resampler-cc.o nearest.o $(SHAREDOBJ)
|
||||
test-snr-sinc: sinc.o ../audio_utils.o snr.o nearest_resampler.o $(SHAREDOBJ)
|
||||
$(CC) -o $@ $^ $(LDFLAGS)
|
||||
|
||||
test-sinc-higher: sinc-higher.o ../audio_utils.o main.o resampler-sinc.o resampler-cc.o nearest.o $(SHAREDOBJ)
|
||||
test-sinc-higher: sinc-higher.o ../audio_utils.o main.o nearest_resampler.o $(SHAREDOBJ)
|
||||
$(CC) -o $@ $^ $(LDFLAGS)
|
||||
|
||||
test-snr-sinc-higher: sinc-higher.o ../audio_utils.o snr.o resampler-sinc.o resampler-cc.o nearest.o $(SHAREDOBJ)
|
||||
test-snr-sinc-higher: sinc-higher.o ../audio_utils.o snr.o nearest_resampler.o $(SHAREDOBJ)
|
||||
$(CC) -o $@ $^ $(LDFLAGS)
|
||||
|
||||
test-sinc-highest: sinc-highest.o ../audio_utils.o main.o resampler-sinc.o resampler-cc.o nearest.o $(SHAREDOBJ)
|
||||
test-sinc-highest: sinc-highest.o ../audio_utils.o main.o nearest_resampler.o $(SHAREDOBJ)
|
||||
$(CC) -o $@ $^ $(LDFLAGS)
|
||||
|
||||
test-snr-sinc-highest: sinc-highest.o ../audio_utils.o snr.o resampler-sinc.o resampler-cc.o nearest.o $(SHAREDOBJ)
|
||||
test-snr-sinc-highest: sinc-highest.o ../audio_utils.o snr.o nearest_resampler.o $(SHAREDOBJ)
|
||||
$(CC) -o $@ $^ $(LDFLAGS)
|
||||
|
||||
test-cc: cc-resampler.o ../audio_utils.o main-cc.o resampler-cc.o resampler-cc.o sinc.o nearest.o $(SHAREDOBJ)
|
||||
test-cc: cc-resampler.o ../audio_utils.o main-cc.o resampler-cc.o sinc.o nearest_resampler.o $(SHAREDOBJ)
|
||||
$(CC) -o $@ $^ $(LDFLAGS)
|
||||
|
||||
test-snr-cc: cc-resampler.o ../audio_utils.o snr-cc.o resampler-cc.o sinc.o nearest.o $(SHAREDOBJ)
|
||||
test-snr-cc: cc-resampler.o ../audio_utils.o snr-cc.o resampler-cc.o sinc.o nearest_resampler.o $(SHAREDOBJ)
|
||||
$(CC) -o $@ $^ $(LDFLAGS)
|
||||
|
||||
%.o: %.c
|
||||
|
||||
+24
-39
@@ -20,7 +20,7 @@
|
||||
|
||||
#include <boolean.h>
|
||||
|
||||
#include <string/string_list.h>
|
||||
#include <lists/string_list.h>
|
||||
#include <rthreads/rthreads.h>
|
||||
|
||||
#include "autosave.h"
|
||||
@@ -55,28 +55,6 @@ struct autosave
|
||||
|
||||
static struct autosave_st autosave_state;
|
||||
|
||||
/**
|
||||
* autosave_lock:
|
||||
* @handle : pointer to autosave object
|
||||
*
|
||||
* Locks autosave.
|
||||
**/
|
||||
static void autosave_lock(autosave_t *handle)
|
||||
{
|
||||
slock_lock(handle->lock);
|
||||
}
|
||||
|
||||
/**
|
||||
* autosave_unlock:
|
||||
* @handle : pointer to autosave object
|
||||
*
|
||||
* Unlocks autosave.
|
||||
**/
|
||||
static void autosave_unlock(autosave_t *handle)
|
||||
{
|
||||
slock_unlock(handle->lock);
|
||||
}
|
||||
|
||||
/**
|
||||
* autosave_thread:
|
||||
* @data : pointer to autosave object
|
||||
@@ -85,19 +63,19 @@ static void autosave_unlock(autosave_t *handle)
|
||||
**/
|
||||
static void autosave_thread(void *data)
|
||||
{
|
||||
bool first_log = true;
|
||||
bool first_log = true;
|
||||
autosave_t *save = (autosave_t*)data;
|
||||
|
||||
while (!save->quit)
|
||||
{
|
||||
bool differ;
|
||||
|
||||
autosave_lock(save);
|
||||
slock_lock(save->lock);
|
||||
differ = memcmp(save->buffer, save->retro_buffer,
|
||||
save->bufsize) != 0;
|
||||
if (differ)
|
||||
memcpy(save->buffer, save->retro_buffer, save->bufsize);
|
||||
autosave_unlock(save);
|
||||
slock_unlock(save->lock);
|
||||
|
||||
if (differ)
|
||||
{
|
||||
@@ -149,12 +127,13 @@ static void autosave_thread(void *data)
|
||||
* Returns: pointer to new autosave_t object if successful, otherwise
|
||||
* NULL.
|
||||
**/
|
||||
autosave_t *autosave_new(const char *path, const void *data, size_t size,
|
||||
static autosave_t *autosave_new(const char *path,
|
||||
const void *data, size_t size,
|
||||
unsigned interval)
|
||||
{
|
||||
autosave_t *handle = (autosave_t*)calloc(1, sizeof(*handle));
|
||||
autosave_t *handle = (autosave_t*)calloc(1, sizeof(*handle));
|
||||
if (!handle)
|
||||
return NULL;
|
||||
goto error;
|
||||
|
||||
handle->bufsize = size;
|
||||
handle->interval = interval;
|
||||
@@ -163,10 +142,8 @@ autosave_t *autosave_new(const char *path, const void *data, size_t size,
|
||||
handle->retro_buffer = data;
|
||||
|
||||
if (!handle->buffer)
|
||||
{
|
||||
free(handle);
|
||||
return NULL;
|
||||
}
|
||||
goto error;
|
||||
|
||||
memcpy(handle->buffer, handle->retro_buffer, handle->bufsize);
|
||||
|
||||
handle->lock = slock_new();
|
||||
@@ -176,6 +153,11 @@ autosave_t *autosave_new(const char *path, const void *data, size_t size,
|
||||
handle->thread = sthread_create(autosave_thread, handle);
|
||||
|
||||
return handle;
|
||||
|
||||
error:
|
||||
if (handle)
|
||||
free(handle);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -184,7 +166,7 @@ autosave_t *autosave_new(const char *path, const void *data, size_t size,
|
||||
*
|
||||
* Frees autosave object.
|
||||
**/
|
||||
void autosave_free(autosave_t *handle)
|
||||
static void autosave_free(autosave_t *handle)
|
||||
{
|
||||
if (!handle)
|
||||
return;
|
||||
@@ -215,7 +197,7 @@ void lock_autosave(void)
|
||||
for (i = 0; i < autosave_state.num; i++)
|
||||
{
|
||||
if (autosave_state.list[i])
|
||||
autosave_lock(autosave_state.list[i]);
|
||||
slock_lock(autosave_state.list[i]->lock);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -231,24 +213,27 @@ void unlock_autosave(void)
|
||||
for (i = 0; i < autosave_state.num; i++)
|
||||
{
|
||||
if (autosave_state.list[i])
|
||||
autosave_unlock(autosave_state.list[i]);
|
||||
slock_unlock(autosave_state.list[i]->lock);
|
||||
}
|
||||
}
|
||||
|
||||
void autosave_event_init(void)
|
||||
{
|
||||
unsigned i;
|
||||
autosave_t **list = NULL;
|
||||
settings_t *settings = config_get_ptr();
|
||||
global_t *global = global_get_ptr();
|
||||
|
||||
if (settings->autosave_interval < 1 || !global->savefiles)
|
||||
return;
|
||||
|
||||
if (!(autosave_state.list = (autosave_t**)calloc(global->savefiles->size,
|
||||
sizeof(*autosave_state.list))))
|
||||
list = (autosave_t**)calloc(global->savefiles->size,
|
||||
sizeof(*autosave_state.list));
|
||||
if (!list)
|
||||
return;
|
||||
|
||||
autosave_state.num = global->savefiles->size;
|
||||
autosave_state.list = list;
|
||||
autosave_state.num = global->savefiles->size;
|
||||
|
||||
for (i = 0; i < global->savefiles->size; i++)
|
||||
{
|
||||
|
||||
-23
@@ -25,29 +25,6 @@ extern "C" {
|
||||
|
||||
typedef struct autosave autosave_t;
|
||||
|
||||
/**
|
||||
* autosave_new:
|
||||
* @path : path to autosave file
|
||||
* @data : pointer to buffer
|
||||
* @size : size of @data buffer
|
||||
* @interval : interval at which saves should be performed.
|
||||
*
|
||||
* Create and initialize autosave object.
|
||||
*
|
||||
* Returns: pointer to new autosave_t object if successful, otherwise
|
||||
* NULL.
|
||||
**/
|
||||
autosave_t *autosave_new(const char *path, const void *data,
|
||||
size_t size, unsigned interval);
|
||||
|
||||
/**
|
||||
* autosave_free:
|
||||
* @handle : pointer to autosave object
|
||||
*
|
||||
* Frees autosave object.
|
||||
**/
|
||||
void autosave_free(autosave_t *handle);
|
||||
|
||||
/**
|
||||
* lock_autosave:
|
||||
*
|
||||
|
||||
@@ -18,8 +18,10 @@
|
||||
|
||||
#include "camera_driver.h"
|
||||
|
||||
#include "../general.h"
|
||||
#include "../string_list_special.h"
|
||||
#include "../configuration.h"
|
||||
#include "../retroarch.h"
|
||||
#include "../runloop.h"
|
||||
#include "../list_special.h"
|
||||
#include "../verbosity.h"
|
||||
|
||||
static const camera_driver_t *camera_drivers[] = {
|
||||
|
||||
@@ -130,7 +130,7 @@ bool cheat_manager_save(const char *path)
|
||||
settings_t *settings = config_get_ptr();
|
||||
cheat_manager_t *handle = cheat_manager_state;
|
||||
|
||||
fill_pathname_join(buf, settings->cheat_database,
|
||||
fill_pathname_join(buf, settings->path.cheat_database,
|
||||
path, sizeof(buf));
|
||||
|
||||
fill_pathname_noext(cheats_file, buf, ".cht", sizeof(cheats_file));
|
||||
@@ -177,6 +177,38 @@ bool cheat_manager_save(const char *path)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static cheat_manager_t *cheat_manager_new(unsigned size)
|
||||
{
|
||||
unsigned i;
|
||||
cheat_manager_t *handle = (cheat_manager_t*)
|
||||
calloc(1, sizeof(struct cheat_manager));
|
||||
|
||||
if (!handle)
|
||||
return NULL;
|
||||
|
||||
handle->buf_size = size;
|
||||
handle->size = size;
|
||||
handle->cheats = (struct item_cheat*)
|
||||
calloc(handle->buf_size, sizeof(struct item_cheat));
|
||||
|
||||
if (!handle->cheats)
|
||||
{
|
||||
handle->buf_size = 0;
|
||||
handle->size = 0;
|
||||
handle->cheats = NULL;
|
||||
return handle;
|
||||
}
|
||||
|
||||
for (i = 0; i < handle->size; i++)
|
||||
{
|
||||
handle->cheats[i].desc = NULL;
|
||||
handle->cheats[i].code = NULL;
|
||||
handle->cheats[i].state = false;
|
||||
}
|
||||
|
||||
return handle;
|
||||
}
|
||||
|
||||
bool cheat_manager_load(const char *path)
|
||||
{
|
||||
unsigned cheats = 0, i;
|
||||
@@ -230,37 +262,6 @@ bool cheat_manager_load(const char *path)
|
||||
return true;
|
||||
}
|
||||
|
||||
cheat_manager_t *cheat_manager_new(unsigned size)
|
||||
{
|
||||
unsigned i;
|
||||
cheat_manager_t *handle = (cheat_manager_t*)
|
||||
calloc(1, sizeof(struct cheat_manager));
|
||||
|
||||
if (!handle)
|
||||
return NULL;
|
||||
|
||||
handle->buf_size = size;
|
||||
handle->size = size;
|
||||
handle->cheats = (struct item_cheat*)
|
||||
calloc(handle->buf_size, sizeof(struct item_cheat));
|
||||
|
||||
if (!handle->cheats)
|
||||
{
|
||||
handle->buf_size = 0;
|
||||
handle->size = 0;
|
||||
handle->cheats = NULL;
|
||||
return handle;
|
||||
}
|
||||
|
||||
for (i = 0; i < handle->size; i++)
|
||||
{
|
||||
handle->cheats[i].desc = NULL;
|
||||
handle->cheats[i].code = NULL;
|
||||
handle->cheats[i].state = false;
|
||||
}
|
||||
|
||||
return handle;
|
||||
}
|
||||
|
||||
bool cheat_manager_realloc(unsigned new_size)
|
||||
{
|
||||
|
||||
@@ -27,8 +27,6 @@ typedef struct cheat_manager cheat_manager_t;
|
||||
|
||||
unsigned cheat_manager_get_size(void);
|
||||
|
||||
cheat_manager_t *cheat_manager_new(unsigned size);
|
||||
|
||||
bool cheat_manager_load(const char *path);
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include <ctype.h>
|
||||
|
||||
#include <formats/jsonsax.h>
|
||||
#include <retro_file.h>
|
||||
#include <streams/file_stream.h>
|
||||
#include <rhash.h>
|
||||
#include <rthreads/async_job.h>
|
||||
|
||||
@@ -1688,7 +1688,7 @@ static size_t cheevos_eval_md5(
|
||||
}
|
||||
else
|
||||
{
|
||||
RFILE *file = retro_fopen(info->path, RFILE_MODE_READ, 0);
|
||||
RFILE *file = filestream_open(info->path, RFILE_MODE_READ, 0);
|
||||
size_t size = 0;
|
||||
|
||||
if (!file)
|
||||
@@ -1697,7 +1697,7 @@ static size_t cheevos_eval_md5(
|
||||
for (;;)
|
||||
{
|
||||
uint8_t buffer[4096];
|
||||
ssize_t num_read = retro_fread(file,
|
||||
ssize_t num_read = filestream_read(file,
|
||||
(void*)buffer, sizeof(buffer));
|
||||
|
||||
if (num_read <= 0)
|
||||
@@ -1707,7 +1707,7 @@ static size_t cheevos_eval_md5(
|
||||
size += num_read;
|
||||
}
|
||||
|
||||
retro_fclose(file);
|
||||
filestream_close(file);
|
||||
return size;
|
||||
}
|
||||
}
|
||||
@@ -1825,14 +1825,14 @@ static unsigned cheevos_find_game_id_nes(
|
||||
}
|
||||
else
|
||||
{
|
||||
RFILE *file = retro_fopen(info->path, RFILE_MODE_READ, 0);
|
||||
RFILE *file = filestream_open(info->path, RFILE_MODE_READ, 0);
|
||||
ssize_t num_read;
|
||||
|
||||
if (!file)
|
||||
return 0;
|
||||
|
||||
num_read = retro_fread(file, (void*)&header, sizeof(header));
|
||||
retro_fclose(file);
|
||||
num_read = filestream_read(file, (void*)&header, sizeof(header));
|
||||
filestream_close(file);
|
||||
|
||||
if (num_read < (ssize_t)sizeof(header))
|
||||
return 0;
|
||||
@@ -1861,7 +1861,15 @@ static unsigned cheevos_find_game_id_nes(
|
||||
}
|
||||
else
|
||||
{
|
||||
RFILE *file = retro_fopen(info->path, RFILE_MODE_READ, 0);
|
||||
unsigned bytes;
|
||||
ssize_t num_read;
|
||||
int i, mapper_no;
|
||||
int not_power2[] =
|
||||
{
|
||||
53, 198, 228
|
||||
};
|
||||
bool round = true;
|
||||
RFILE *file = filestream_open(info->path, RFILE_MODE_READ, 0);
|
||||
uint8_t * data = (uint8_t *) malloc(rom_size << 14);
|
||||
|
||||
if (!file || !data)
|
||||
@@ -1871,36 +1879,32 @@ static unsigned cheevos_find_game_id_nes(
|
||||
memset(data, 0xFF, rom_size << 14);
|
||||
|
||||
/* from fceu core - compute size using the cart mapper */
|
||||
int MapperNo = (header.rom_type >> 4);
|
||||
MapperNo |= (header.rom_type2 & 0xF0);
|
||||
mapper_no = (header.rom_type >> 4);
|
||||
mapper_no |= (header.rom_type2 & 0xF0);
|
||||
|
||||
int not_power2[] =
|
||||
{
|
||||
53, 198, 228
|
||||
};
|
||||
|
||||
bool round = true;
|
||||
for (int i = 0; i != sizeof(not_power2) / sizeof(not_power2[0]); ++i) {
|
||||
//for games not to the power of 2, so we just read enough
|
||||
//prg rom from it, but we have to keep ROM_size to the power of 2
|
||||
//since PRGCartMapping wants ROM_size to be to the power of 2
|
||||
//so instead if not to power of 2, we just use head.ROM_size when
|
||||
//we use FCEU_read
|
||||
if (not_power2[i] == MapperNo) {
|
||||
for (i = 0; i != sizeof(not_power2) / sizeof(not_power2[0]); ++i)
|
||||
{
|
||||
/* for games not to the power of 2, so we just read enough
|
||||
* PRG rom from it, but we have to keep ROM_size to the power of 2
|
||||
* since PRGCartMapping wants ROM_size to be to the power of 2
|
||||
* so instead if not to power of 2, we just use head.ROM_size when
|
||||
* we use FCEU_read. */
|
||||
if (not_power2[i] == mapper_no) {
|
||||
round = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
MD5_Init(&ctx);
|
||||
retro_fseek(file, sizeof(header), SEEK_SET);
|
||||
filestream_seek(file, sizeof(header), SEEK_SET);
|
||||
/* from fceu core - check if Trainer included in ROM data */
|
||||
if (header.rom_type & 4)
|
||||
retro_fseek(file, sizeof(header), SEEK_CUR);
|
||||
filestream_seek(file, sizeof(header), SEEK_CUR);
|
||||
|
||||
unsigned bytes = (round) ? rom_size : header.rom_size;
|
||||
ssize_t num_read = retro_fread(file, (void*) data, 0x4000 * bytes );
|
||||
retro_fclose(file);
|
||||
bytes = (round) ? rom_size : header.rom_size;
|
||||
num_read = filestream_read(file, (void*) data, 0x4000 * bytes );
|
||||
filestream_close(file);
|
||||
|
||||
if (num_read <= 0)
|
||||
return 0;
|
||||
@@ -2105,9 +2109,9 @@ static void cheevos_populate_menu(void *data)
|
||||
settings_t *settings = config_get_ptr();
|
||||
menu_displaylist_info_t *info = (menu_displaylist_info_t*)data;
|
||||
|
||||
menu_entries_push(info->list, "Unlocked Achievements:",
|
||||
menu_entries_add(info->list, "Unlocked Achievements:",
|
||||
"", MENU_SETTINGS_CHEEVOS_NONE, 0, 0);
|
||||
menu_entries_push(info->list, "", "", MENU_SETTINGS_CHEEVOS_NONE, 0, 0);
|
||||
menu_entries_add(info->list, "", "", MENU_SETTINGS_CHEEVOS_NONE, 0, 0);
|
||||
|
||||
cheevo = cheevos_locals.core.cheevos;
|
||||
end = cheevos_locals.core.cheevos + cheevos_locals.core.count;
|
||||
@@ -2115,7 +2119,7 @@ static void cheevos_populate_menu(void *data)
|
||||
for (i = 0; cheevo < end; i++, cheevo++)
|
||||
{
|
||||
if (!cheevo->active)
|
||||
menu_entries_push(info->list, cheevo->title,
|
||||
menu_entries_add(info->list, cheevo->title,
|
||||
cheevo->description, MENU_SETTINGS_CHEEVOS_START + i, 0, 0);
|
||||
}
|
||||
|
||||
@@ -2128,15 +2132,15 @@ static void cheevos_populate_menu(void *data)
|
||||
for (i = cheevos_locals.core.count; cheevo < end; i++, cheevo++)
|
||||
{
|
||||
if (!cheevo->active)
|
||||
menu_entries_push(info->list, cheevo->title,
|
||||
menu_entries_add(info->list, cheevo->title,
|
||||
cheevo->description, MENU_SETTINGS_CHEEVOS_START + i, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
menu_entries_push(info->list, "", "", MENU_SETTINGS_CHEEVOS_NONE, 0, 0);
|
||||
menu_entries_push(info->list, "Locked Achievements:", "",
|
||||
menu_entries_add(info->list, "", "", MENU_SETTINGS_CHEEVOS_NONE, 0, 0);
|
||||
menu_entries_add(info->list, "Locked Achievements:", "",
|
||||
MENU_SETTINGS_CHEEVOS_NONE, 0, 0);
|
||||
menu_entries_push(info->list, "", "", MENU_SETTINGS_CHEEVOS_NONE, 0, 0);
|
||||
menu_entries_add(info->list, "", "", MENU_SETTINGS_CHEEVOS_NONE, 0, 0);
|
||||
|
||||
cheevo = cheevos_locals.core.cheevos;
|
||||
end = cheevos_locals.core.cheevos + cheevos_locals.core.count;
|
||||
@@ -2144,7 +2148,7 @@ static void cheevos_populate_menu(void *data)
|
||||
for (i = 0; cheevo < end; i++, cheevo++)
|
||||
{
|
||||
if (cheevo->active)
|
||||
menu_entries_push(info->list, cheevo->title,
|
||||
menu_entries_add(info->list, cheevo->title,
|
||||
cheevo->description, MENU_SETTINGS_CHEEVOS_START + i, 0, 0);
|
||||
}
|
||||
|
||||
@@ -2157,7 +2161,7 @@ static void cheevos_populate_menu(void *data)
|
||||
for (i = cheevos_locals.core.count; cheevo < end; i++, cheevo++)
|
||||
{
|
||||
if (cheevo->active)
|
||||
menu_entries_push(info->list, cheevo->title,
|
||||
menu_entries_add(info->list, cheevo->title,
|
||||
cheevo->description, MENU_SETTINGS_CHEEVOS_START + i, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <compat/posix_string.h>
|
||||
#include <file/file_path.h>
|
||||
#include <net/net_compat.h>
|
||||
#include <net/net_socket.h>
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include "msg_hash.h"
|
||||
@@ -122,41 +123,23 @@ static const struct cmd_map map[] = {
|
||||
#if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY)
|
||||
static bool cmd_init_network(rarch_cmd_t *handle, uint16_t port)
|
||||
{
|
||||
struct addrinfo hints = {0};
|
||||
char port_buf[16] = {0};
|
||||
int fd;
|
||||
struct addrinfo *res = NULL;
|
||||
int yes = 1;
|
||||
|
||||
if (!network_init())
|
||||
return false;
|
||||
|
||||
RARCH_LOG("Bringing up command interface on port %hu.\n",
|
||||
(unsigned short)port);
|
||||
|
||||
#if defined(_WIN32) || defined(HAVE_SOCKET_LEGACY)
|
||||
hints.ai_family = AF_INET;
|
||||
#else
|
||||
hints.ai_family = AF_UNSPEC;
|
||||
#endif
|
||||
hints.ai_socktype = SOCK_DGRAM;
|
||||
hints.ai_flags = AI_PASSIVE;
|
||||
fd = socket_init((void**)&res, port, NULL, SOCKET_TYPE_DATAGRAM);
|
||||
|
||||
|
||||
snprintf(port_buf, sizeof(port_buf), "%hu", (unsigned short)port);
|
||||
if (getaddrinfo_retro(NULL, port_buf, &hints, &res) < 0)
|
||||
if (fd < 0)
|
||||
goto error;
|
||||
|
||||
handle->net_fd = socket(res->ai_family,
|
||||
res->ai_socktype, res->ai_protocol);
|
||||
if (handle->net_fd < 0)
|
||||
goto error;
|
||||
handle->net_fd = fd;
|
||||
|
||||
if (!socket_nonblock(handle->net_fd))
|
||||
goto error;
|
||||
|
||||
setsockopt(handle->net_fd, SOL_SOCKET,
|
||||
SO_REUSEADDR, (const char*)&yes, sizeof(int));
|
||||
if (bind(handle->net_fd, res->ai_addr, res->ai_addrlen) < 0)
|
||||
if (!socket_bind(handle->net_fd, (void*)res))
|
||||
{
|
||||
RARCH_ERR("Failed to bind socket.\n");
|
||||
goto error;
|
||||
@@ -522,11 +505,6 @@ static bool send_udp_packet(const char *host,
|
||||
int fd = -1;
|
||||
bool ret = true;
|
||||
|
||||
#if defined(_WIN32) || defined(HAVE_SOCKET_LEGACY)
|
||||
hints.ai_family = AF_INET;
|
||||
#else
|
||||
hints.ai_family = AF_UNSPEC;
|
||||
#endif
|
||||
hints.ai_socktype = SOCK_DGRAM;
|
||||
|
||||
snprintf(port_buf, sizeof(port_buf), "%hu", (unsigned short)port);
|
||||
@@ -547,7 +525,7 @@ static bool send_udp_packet(const char *host,
|
||||
goto end;
|
||||
}
|
||||
|
||||
len = strlen(msg);
|
||||
len = strlen(msg);
|
||||
ret_len = sendto(fd, msg, len, 0, tmp->ai_addr, tmp->ai_addrlen);
|
||||
|
||||
if (ret_len < len)
|
||||
|
||||
+49
-37
@@ -17,11 +17,12 @@
|
||||
|
||||
#include <compat/strl.h>
|
||||
#include <file/file_path.h>
|
||||
#include <file/dir_list.h>
|
||||
#include <lists/dir_list.h>
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include "command_event.h"
|
||||
|
||||
#include "defaults.h"
|
||||
#include "frontend/frontend_driver.h"
|
||||
#include "audio/audio_driver.h"
|
||||
#include "record/record_driver.h"
|
||||
@@ -38,7 +39,7 @@
|
||||
#include "rewind.h"
|
||||
#include "system.h"
|
||||
#include "ui/ui_companion_driver.h"
|
||||
#include "dir_list_special.h"
|
||||
#include "list_special.h"
|
||||
|
||||
#ifdef HAVE_CHEEVOS
|
||||
#include "cheevos.h"
|
||||
@@ -461,8 +462,7 @@ static void event_load_auto_state(void)
|
||||
global_t *global = global_get_ptr();
|
||||
|
||||
#ifdef HAVE_NETPLAY
|
||||
if (netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_ENABLED, NULL)
|
||||
&& !global->netplay.is_spectate)
|
||||
if (global->netplay.enable && !global->netplay.is_spectate)
|
||||
return;
|
||||
#endif
|
||||
|
||||
@@ -670,11 +670,10 @@ static bool event_save_core_config(void)
|
||||
global_t *global = global_get_ptr();
|
||||
|
||||
*config_dir = '\0';
|
||||
|
||||
if (*settings->menu_config_directory)
|
||||
strlcpy(config_dir, settings->menu_config_directory,
|
||||
if (!string_is_empty(settings->directory.menu_config))
|
||||
strlcpy(config_dir, settings->directory.menu_config,
|
||||
sizeof(config_dir));
|
||||
else if (*global->path.config) /* Fallback */
|
||||
else if (!string_is_empty(global->path.config)) /* Fallback */
|
||||
fill_pathname_basedir(config_dir, global->path.config,
|
||||
sizeof(config_dir));
|
||||
else
|
||||
@@ -683,18 +682,23 @@ static bool event_save_core_config(void)
|
||||
RARCH_ERR("%s\n", msg_hash_to_str(MSG_CONFIG_DIRECTORY_NOT_SET));
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Infer file name based on libretro core. */
|
||||
if (*settings->libretro && path_file_exists(settings->libretro))
|
||||
if (!string_is_empty(settings->path.libretro)
|
||||
&& path_file_exists(settings->path.libretro))
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
RARCH_LOG("Using core name for new config\n");
|
||||
/* In case of collision, find an alternative name. */
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
char tmp[64];
|
||||
|
||||
fill_pathname_base(config_name, settings->libretro,
|
||||
fill_pathname_base(
|
||||
config_name,
|
||||
settings->path.libretro,
|
||||
sizeof(config_name));
|
||||
|
||||
path_remove_extension(config_name);
|
||||
fill_pathname_join(config_path, config_dir, config_name,
|
||||
sizeof(config_path));
|
||||
@@ -703,7 +707,7 @@ static bool event_save_core_config(void)
|
||||
else
|
||||
strlcpy(tmp, ".cfg", sizeof(tmp));
|
||||
|
||||
snprintf(config_path, sizeof(config_path), "%s%s", config_path, tmp);
|
||||
strlcat(config_path, tmp, sizeof(config_path));
|
||||
if (!path_file_exists(config_path))
|
||||
{
|
||||
found_path = true;
|
||||
@@ -766,7 +770,7 @@ void event_save_current_config(void)
|
||||
global_t *global = global_get_ptr();
|
||||
bool ret = false;
|
||||
|
||||
if (settings->config_save_on_exit && *global->path.config)
|
||||
if (settings->config_save_on_exit && !string_is_empty(global->path.config))
|
||||
{
|
||||
/* Save last core-specific config to the default config location,
|
||||
* needed on consoles for core switching and reusing last good
|
||||
@@ -779,22 +783,21 @@ void event_save_current_config(void)
|
||||
ret = config_save_file(global->path.core_specific_config);
|
||||
else
|
||||
ret = config_save_file(global->path.config);
|
||||
}
|
||||
if (ret)
|
||||
{
|
||||
snprintf(msg, sizeof(msg), "Saved new config to \"%s\".",
|
||||
global->path.config);
|
||||
RARCH_LOG("%s\n", msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(msg, sizeof(msg), "Failed saving config to \"%s\".",
|
||||
global->path.config);
|
||||
RARCH_ERR("%s\n", msg);
|
||||
}
|
||||
|
||||
if (ret)
|
||||
{
|
||||
snprintf(msg, sizeof(msg), "Saved new config to \"%s\".",
|
||||
global->path.config);
|
||||
RARCH_LOG("%s\n", msg);
|
||||
runloop_msg_queue_push(msg, 1, 180, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(msg, sizeof(msg), "Failed saving config to \"%s\".",
|
||||
global->path.config);
|
||||
RARCH_ERR("%s\n", msg);
|
||||
}
|
||||
|
||||
runloop_msg_queue_push(msg, 1, 180, true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -985,7 +988,7 @@ bool event_cmd_ctl(enum event_command cmd, void *data)
|
||||
#else
|
||||
char *fullpath = NULL;
|
||||
runloop_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath);
|
||||
runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, settings->libretro);
|
||||
runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, settings->path.libretro);
|
||||
event_cmd_ctl(EVENT_CMD_EXEC, (void*)fullpath);
|
||||
event_cmd_ctl(EVENT_CMD_QUIT, NULL);
|
||||
#endif
|
||||
@@ -1010,13 +1013,17 @@ bool event_cmd_ctl(enum event_command cmd, void *data)
|
||||
core_info_ctx_find_t info_find;
|
||||
|
||||
#if defined(HAVE_DYNAMIC)
|
||||
if (!(*settings->libretro))
|
||||
if (!(*settings->path.libretro))
|
||||
return false;
|
||||
|
||||
libretro_get_system_info(settings->libretro, system,
|
||||
libretro_get_system_info(
|
||||
settings->path.libretro,
|
||||
system,
|
||||
ptr);
|
||||
#else
|
||||
libretro_get_system_info_static(system, ptr);
|
||||
#endif
|
||||
info_find.path = settings->libretro;
|
||||
info_find.path = settings->path.libretro;
|
||||
|
||||
if (!core_info_ctl(CORE_INFO_CTL_LOAD, &info_find))
|
||||
return false;
|
||||
@@ -1191,7 +1198,12 @@ bool event_cmd_ctl(enum event_command cmd, void *data)
|
||||
break;
|
||||
case EVENT_CMD_AUTOSAVE_DEINIT:
|
||||
#ifdef HAVE_THREADS
|
||||
autosave_event_deinit();
|
||||
{
|
||||
global_t *global = global_get_ptr();
|
||||
if (!global->sram.use)
|
||||
return false;
|
||||
autosave_event_deinit();
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case EVENT_CMD_AUTOSAVE_INIT:
|
||||
@@ -1260,9 +1272,9 @@ bool event_cmd_ctl(enum event_command cmd, void *data)
|
||||
break;
|
||||
case EVENT_CMD_DSP_FILTER_INIT:
|
||||
event_cmd_ctl(EVENT_CMD_DSP_FILTER_DEINIT, NULL);
|
||||
if (!*settings->audio.dsp_plugin)
|
||||
if (!*settings->path.audio_dsp_plugin)
|
||||
break;
|
||||
audio_driver_dsp_filter_init(settings->audio.dsp_plugin);
|
||||
audio_driver_dsp_filter_init(settings->path.audio_dsp_plugin);
|
||||
break;
|
||||
case EVENT_CMD_GPU_RECORD_DEINIT:
|
||||
video_driver_ctl(RARCH_DISPLAY_CTL_GPU_RECORD_DEINIT, NULL);
|
||||
@@ -1290,9 +1302,9 @@ bool event_cmd_ctl(enum event_command cmd, void *data)
|
||||
return false;
|
||||
RARCH_LOG("%s: [%s].\n",
|
||||
msg_hash_to_str(MSG_LOADING_HISTORY_FILE),
|
||||
settings->content_history_path);
|
||||
settings->path.content_history);
|
||||
g_defaults.history = content_playlist_init(
|
||||
settings->content_history_path,
|
||||
settings->path.content_history,
|
||||
settings->content_history_size);
|
||||
break;
|
||||
case EVENT_CMD_CORE_INFO_DEINIT:
|
||||
@@ -1301,7 +1313,7 @@ bool event_cmd_ctl(enum event_command cmd, void *data)
|
||||
case EVENT_CMD_CORE_INFO_INIT:
|
||||
event_cmd_ctl(EVENT_CMD_CORE_INFO_DEINIT, NULL);
|
||||
|
||||
if (*settings->libretro_directory)
|
||||
if (*settings->directory.libretro)
|
||||
core_info_ctl(CORE_INFO_CTL_LIST_INIT, NULL);
|
||||
break;
|
||||
case EVENT_CMD_CORE_DEINIT:
|
||||
|
||||
+18
-1
@@ -18,7 +18,6 @@
|
||||
#define __CONFIG_DEF_H
|
||||
|
||||
#include <boolean.h>
|
||||
#include "libretro.h"
|
||||
#include "driver.h"
|
||||
#include "gfx/video_driver.h"
|
||||
|
||||
@@ -126,6 +125,7 @@ enum
|
||||
MENU_XUI,
|
||||
MENU_MATERIALUI,
|
||||
MENU_XMB,
|
||||
MENU_NUKLEAR,
|
||||
|
||||
RECORD_FFMPEG,
|
||||
RECORD_NULL
|
||||
@@ -511,6 +511,21 @@ static bool default_block_config_read = true;
|
||||
|
||||
static unsigned xmb_scale_factor = 100;
|
||||
static unsigned xmb_alpha_factor = 75;
|
||||
static unsigned xmb_theme = 0;
|
||||
|
||||
#ifdef HAVE_LAKKA
|
||||
static bool xmb_shadows_enable = false;
|
||||
#else
|
||||
static bool xmb_shadows_enable = true;
|
||||
#endif
|
||||
|
||||
static unsigned menu_background_gradient = 4;
|
||||
|
||||
#if defined(HAVE_OPENGLES2) || defined(OSX_PPC)
|
||||
static unsigned menu_shader_pipeline = 1;
|
||||
#else
|
||||
static unsigned menu_shader_pipeline = 2;
|
||||
#endif
|
||||
|
||||
static bool show_advanced_settings = true;
|
||||
static const uint32_t menu_entry_normal_color = 0xffffffff;
|
||||
@@ -765,6 +780,8 @@ static const unsigned input_max_users = 5;
|
||||
|
||||
static const unsigned input_poll_type_behavior = 2;
|
||||
|
||||
static const unsigned menu_thumbnails_default = 3;
|
||||
|
||||
#ifdef IOS
|
||||
static const bool ui_companion_start_on_boot = false;
|
||||
#else
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2010-2015 The RetroArch team
|
||||
/* Copyright (C) 2010-2016 The RetroArch team
|
||||
*
|
||||
* ---------------------------------------------------------------------------------------
|
||||
* The following license statement only applies to this file (config_file_userdata.c).
|
||||
@@ -20,9 +20,10 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <file/config_file_userdata.h>
|
||||
#include <file/file_path.h>
|
||||
#include <string/string_list.h>
|
||||
#include <lists/string_list.h>
|
||||
|
||||
#include "config_file_userdata.h"
|
||||
|
||||
#define get_array_setup() \
|
||||
char key[2][256]; \
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2010-2015 The RetroArch team
|
||||
/* Copyright (C) 2010-2016 The RetroArch team
|
||||
*
|
||||
* ---------------------------------------------------------------------------------------
|
||||
* The following license statement only applies to this file (config_file_userdata.h).
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "config_file.h"
|
||||
#include <file/config_file.h>
|
||||
|
||||
struct config_file_userdata
|
||||
{
|
||||
+442
-389
File diff suppressed because it is too large.
Load diff
+60
-43
@@ -72,17 +72,12 @@ typedef struct settings
|
||||
unsigned aspect_ratio_idx;
|
||||
unsigned rotation;
|
||||
|
||||
char shader_path[PATH_MAX_LENGTH];
|
||||
bool shader_enable;
|
||||
|
||||
char softfilter_plugin[PATH_MAX_LENGTH];
|
||||
float refresh_rate;
|
||||
bool threaded;
|
||||
|
||||
char filter_dir[PATH_MAX_LENGTH];
|
||||
char shader_dir[PATH_MAX_LENGTH];
|
||||
|
||||
char font_path[PATH_MAX_LENGTH];
|
||||
float font_size;
|
||||
bool font_enable;
|
||||
float msg_pos_x;
|
||||
@@ -123,9 +118,8 @@ typedef struct settings
|
||||
bool timedate_enable;
|
||||
bool core_enable;
|
||||
bool dynamic_wallpaper_enable;
|
||||
bool boxart_enable;
|
||||
unsigned thumbnails;
|
||||
bool throttle;
|
||||
char wallpaper[PATH_MAX_LENGTH];
|
||||
|
||||
struct
|
||||
{
|
||||
@@ -166,6 +160,10 @@ typedef struct settings
|
||||
unsigned title_color;
|
||||
unsigned xmb_scale_factor;
|
||||
unsigned xmb_alpha_factor;
|
||||
unsigned xmb_theme;
|
||||
unsigned background_gradient;
|
||||
bool xmb_shadows_enable;
|
||||
unsigned shader_pipeline;
|
||||
char xmb_font[PATH_MAX_LENGTH];
|
||||
bool throttle_framerate;
|
||||
bool linear_filter;
|
||||
@@ -196,22 +194,20 @@ typedef struct settings
|
||||
struct
|
||||
{
|
||||
char driver[32];
|
||||
char resampler[32];
|
||||
char device[PATH_MAX_LENGTH];
|
||||
bool enable;
|
||||
bool mute_enable;
|
||||
unsigned out_rate;
|
||||
unsigned block_frames;
|
||||
char device[PATH_MAX_LENGTH];
|
||||
unsigned latency;
|
||||
bool sync;
|
||||
|
||||
char dsp_plugin[PATH_MAX_LENGTH];
|
||||
char filter_dir[PATH_MAX_LENGTH];
|
||||
|
||||
bool rate_control;
|
||||
float rate_control_delta;
|
||||
float max_timing_skew;
|
||||
float volume; /* dB scale. */
|
||||
char resampler[32];
|
||||
} audio;
|
||||
|
||||
struct
|
||||
@@ -219,6 +215,7 @@ typedef struct settings
|
||||
char driver[32];
|
||||
char joypad_driver[32];
|
||||
char keyboard_layout[64];
|
||||
char device_names[MAX_USERS][64];
|
||||
|
||||
unsigned remap_ids[MAX_USERS][RARCH_BIND_LIST_END];
|
||||
struct retro_keybind binds[MAX_USERS][RARCH_BIND_LIST_END];
|
||||
@@ -239,7 +236,6 @@ typedef struct settings
|
||||
float axis_threshold;
|
||||
unsigned joypad_map[MAX_USERS];
|
||||
unsigned device[MAX_USERS];
|
||||
char device_names[MAX_USERS][64];
|
||||
unsigned device_name_index[MAX_USERS];
|
||||
bool autodetect_enable;
|
||||
bool netplay_client_swap_input;
|
||||
@@ -250,11 +246,9 @@ typedef struct settings
|
||||
bool overlay_enable;
|
||||
bool overlay_enable_autopreferred;
|
||||
bool overlay_hide_in_menu;
|
||||
char overlay[PATH_MAX_LENGTH];
|
||||
float overlay_opacity;
|
||||
float overlay_scale;
|
||||
|
||||
char autoconfig_dir[PATH_MAX_LENGTH];
|
||||
bool input_descriptor_label_show;
|
||||
bool input_descriptor_hide_unbound;
|
||||
|
||||
@@ -272,7 +266,6 @@ typedef struct settings
|
||||
struct
|
||||
{
|
||||
bool enable;
|
||||
char overlay[PATH_MAX_LENGTH];
|
||||
float opacity;
|
||||
float scale;
|
||||
} osk;
|
||||
@@ -313,35 +306,58 @@ typedef struct settings
|
||||
bool bundle_assets_extract_enable;
|
||||
unsigned bundle_assets_extract_version_current;
|
||||
unsigned bundle_assets_extract_last_version;
|
||||
char bundle_assets_src_path[PATH_MAX_LENGTH];
|
||||
char bundle_assets_dst_path[PATH_MAX_LENGTH];
|
||||
char bundle_assets_dst_path_subdir[PATH_MAX_LENGTH];
|
||||
|
||||
char core_options_path[PATH_MAX_LENGTH];
|
||||
char content_history_path[PATH_MAX_LENGTH];
|
||||
char content_history_directory[PATH_MAX_LENGTH];
|
||||
struct
|
||||
{
|
||||
char cheat_database[PATH_MAX_LENGTH];
|
||||
char content_database[PATH_MAX_LENGTH];
|
||||
char libretro[PATH_MAX_LENGTH];
|
||||
char osk_overlay[PATH_MAX_LENGTH];
|
||||
char overlay[PATH_MAX_LENGTH];
|
||||
char menu_wallpaper[PATH_MAX_LENGTH];
|
||||
char audio_dsp_plugin[PATH_MAX_LENGTH];
|
||||
char softfilter_plugin[PATH_MAX_LENGTH];
|
||||
char core_options[PATH_MAX_LENGTH];
|
||||
char content_history[PATH_MAX_LENGTH];
|
||||
char libretro_info[PATH_MAX_LENGTH];
|
||||
char cheat_settings[PATH_MAX_LENGTH];
|
||||
char bundle_assets_src[PATH_MAX_LENGTH];
|
||||
char bundle_assets_dst[PATH_MAX_LENGTH];
|
||||
char bundle_assets_dst_subdir[PATH_MAX_LENGTH];
|
||||
char shader[PATH_MAX_LENGTH];
|
||||
char font[PATH_MAX_LENGTH];
|
||||
} path;
|
||||
|
||||
struct
|
||||
{
|
||||
char audio_filter[PATH_MAX_LENGTH];
|
||||
char autoconfig[PATH_MAX_LENGTH];
|
||||
char video_filter[PATH_MAX_LENGTH];
|
||||
char video_shader[PATH_MAX_LENGTH];
|
||||
char content_history[PATH_MAX_LENGTH];
|
||||
char libretro[PATH_MAX_LENGTH];
|
||||
char cursor[PATH_MAX_LENGTH];
|
||||
char input_remapping[PATH_MAX_LENGTH];
|
||||
char overlay[PATH_MAX_LENGTH];
|
||||
char resampler[PATH_MAX_LENGTH];
|
||||
char screenshot[PATH_MAX_LENGTH];
|
||||
char system[PATH_MAX_LENGTH];
|
||||
char cache[PATH_MAX_LENGTH];
|
||||
char playlist[PATH_MAX_LENGTH];
|
||||
char core_assets[PATH_MAX_LENGTH];
|
||||
char assets[PATH_MAX_LENGTH];
|
||||
char dynamic_wallpapers[PATH_MAX_LENGTH];
|
||||
char thumbnails[PATH_MAX_LENGTH];
|
||||
char menu_config[PATH_MAX_LENGTH];
|
||||
char menu_content[PATH_MAX_LENGTH];
|
||||
} directory;
|
||||
|
||||
unsigned content_history_size;
|
||||
|
||||
char libretro[PATH_MAX_LENGTH];
|
||||
char libretro_directory[PATH_MAX_LENGTH];
|
||||
unsigned libretro_log_level;
|
||||
char libretro_info_path[PATH_MAX_LENGTH];
|
||||
char content_database[PATH_MAX_LENGTH];
|
||||
char cheat_database[PATH_MAX_LENGTH];
|
||||
char cursor_directory[PATH_MAX_LENGTH];
|
||||
char cheat_settings_path[PATH_MAX_LENGTH];
|
||||
char input_remapping_directory[PATH_MAX_LENGTH];
|
||||
|
||||
char overlay_directory[PATH_MAX_LENGTH];
|
||||
char resampler_directory[PATH_MAX_LENGTH];
|
||||
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];
|
||||
|
||||
bool history_list_enable;
|
||||
bool rewind_enable;
|
||||
size_t rewind_buffer_size;
|
||||
@@ -366,13 +382,7 @@ typedef struct settings
|
||||
unsigned network_remote_base_port;
|
||||
bool debug_panel_enable;
|
||||
|
||||
char core_assets_directory[PATH_MAX_LENGTH];
|
||||
char assets_directory[PATH_MAX_LENGTH];
|
||||
char dynamic_wallpapers_directory[PATH_MAX_LENGTH];
|
||||
char boxarts_directory[PATH_MAX_LENGTH];
|
||||
char menu_config_directory[PATH_MAX_LENGTH];
|
||||
#if defined(HAVE_MENU)
|
||||
char menu_content_directory[PATH_MAX_LENGTH];
|
||||
bool menu_show_start_screen;
|
||||
#endif
|
||||
bool fps_show;
|
||||
@@ -398,6 +408,13 @@ typedef struct settings
|
||||
unsigned int user_language;
|
||||
|
||||
bool config_save_on_exit;
|
||||
|
||||
#ifdef HAVE_SYSTEMD
|
||||
bool ssh_enable;
|
||||
bool samba_enable;
|
||||
bool bluetooth_enable;
|
||||
#endif
|
||||
|
||||
} settings_t;
|
||||
|
||||
/**
|
||||
|
||||
@@ -40,18 +40,19 @@
|
||||
#include <compat/posix_string.h>
|
||||
#include <file/file_path.h>
|
||||
#ifdef HAVE_COMPRESSION
|
||||
#include <file/file_archive.h>
|
||||
#include <file/archive_file.h>
|
||||
#endif
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include <retro_miscellaneous.h>
|
||||
#include <retro_file.h>
|
||||
#include <streams/file_stream.h>
|
||||
#include <retro_stat.h>
|
||||
#include <retro_assert.h>
|
||||
|
||||
#include <string/string_list.h>
|
||||
#include <lists/string_list.h>
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include "defaults.h"
|
||||
#include "msg_hash.h"
|
||||
#include "content.h"
|
||||
#include "general.h"
|
||||
@@ -61,6 +62,7 @@
|
||||
#include "system.h"
|
||||
#include "retroarch.h"
|
||||
#include "command_event.h"
|
||||
#include "file_path_special.h"
|
||||
#include "libretro_version_1.h"
|
||||
#include "verbosity.h"
|
||||
|
||||
@@ -229,7 +231,7 @@ static int content_7zip_file_read(
|
||||
{
|
||||
const void *ptr = (const void*)(output + offset);
|
||||
|
||||
if (!retro_write_file(optional_outfile, ptr, outsize))
|
||||
if (!filestream_write_file(optional_outfile, ptr, outsize))
|
||||
{
|
||||
RARCH_ERR("Could not open outfilepath %s.\n",
|
||||
optional_outfile);
|
||||
@@ -488,7 +490,8 @@ static int content_zip_file_decompressed(
|
||||
{
|
||||
RARCH_LOG("Extracting file : %s\n", st->opt_file);
|
||||
memcpy(buf, handle.data, size);
|
||||
if (!retro_write_file(st->opt_file, buf, size))
|
||||
|
||||
if (!filestream_write_file(st->opt_file, buf, size))
|
||||
goto_error = true;
|
||||
}
|
||||
|
||||
@@ -641,7 +644,7 @@ error:
|
||||
* @length : Number of items read, -1 on error.
|
||||
*
|
||||
* Read the contents of a file into @buf. Will call content_file_compressed_read
|
||||
* if path contains a compressed file, otherwise will call retro_read_file().
|
||||
* if path contains a compressed file, otherwise will call filestream_read_file().
|
||||
*
|
||||
* Returns: 1 if file read, 0 on error.
|
||||
*/
|
||||
@@ -654,7 +657,7 @@ static int content_file_read(const char *path, void **buf, ssize_t *length)
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
return retro_read_file(path, buf, length);
|
||||
return filestream_read_file(path, buf, length);
|
||||
}
|
||||
|
||||
struct string_list *compressed_file_list_new(const char *path,
|
||||
@@ -677,13 +680,22 @@ struct string_list *compressed_file_list_new(const char *path,
|
||||
|
||||
static void check_defaults_dir_create_dir(const char *path)
|
||||
{
|
||||
if (path_is_directory(path))
|
||||
char new_path[PATH_MAX_LENGTH];
|
||||
fill_pathname_expand_special(new_path,
|
||||
path, sizeof(new_path));
|
||||
|
||||
if (path_is_directory(new_path))
|
||||
return;
|
||||
path_mkdir(path);
|
||||
path_mkdir(new_path);
|
||||
}
|
||||
|
||||
static void check_defaults_dirs(void)
|
||||
static void check_default_dirs(void)
|
||||
{
|
||||
/* early return for people with a custom folder setup
|
||||
so it doesn't create unnecessary directories
|
||||
*/
|
||||
if (path_file_exists("custom.ini"))
|
||||
return;
|
||||
if (*g_defaults.dir.core_assets)
|
||||
check_defaults_dir_create_dir(g_defaults.dir.core_assets);
|
||||
if (*g_defaults.dir.remap)
|
||||
@@ -732,6 +744,8 @@ static void check_defaults_dirs(void)
|
||||
check_defaults_dir_create_dir(g_defaults.dir.cursor);
|
||||
if (*g_defaults.dir.cheats)
|
||||
check_defaults_dir_create_dir(g_defaults.dir.cheats);
|
||||
if (*g_defaults.dir.thumbnails)
|
||||
check_defaults_dir_create_dir(g_defaults.dir.thumbnails);
|
||||
}
|
||||
|
||||
void content_push_to_history_playlist(bool do_push,
|
||||
@@ -751,7 +765,7 @@ void content_push_to_history_playlist(bool do_push,
|
||||
content_playlist_push(g_defaults.history,
|
||||
path,
|
||||
NULL,
|
||||
settings->libretro,
|
||||
settings->path.libretro,
|
||||
info->library_name,
|
||||
NULL,
|
||||
NULL);
|
||||
@@ -884,7 +898,7 @@ static bool content_load(content_ctx_info_t *info)
|
||||
event_cmd_ctl(EVENT_CMD_RESUME, NULL);
|
||||
event_cmd_ctl(EVENT_CMD_VIDEO_SET_ASPECT_RATIO, NULL);
|
||||
|
||||
check_defaults_dirs();
|
||||
check_default_dirs();
|
||||
|
||||
frontend_driver_process_args(rarch_argc_ptr, rarch_argv_ptr);
|
||||
frontend_driver_content_loaded();
|
||||
@@ -965,26 +979,22 @@ static bool dump_to_file_desperate(const void *data,
|
||||
{
|
||||
time_t time_;
|
||||
char timebuf[256];
|
||||
char application_data[PATH_MAX_LENGTH];
|
||||
char path[PATH_MAX_LENGTH];
|
||||
#if defined(_WIN32) && !defined(_XBOX)
|
||||
const char *base = getenv("APPDATA");
|
||||
#elif defined(__CELLOS_LV2__) || defined(_XBOX)
|
||||
const char *base = NULL;
|
||||
#else
|
||||
const char *base = getenv("HOME");
|
||||
#endif
|
||||
|
||||
if (!base)
|
||||
if (!fill_pathname_application_data(application_data,
|
||||
sizeof(application_data)))
|
||||
return false;
|
||||
|
||||
snprintf(path, sizeof(path), "%s/RetroArch-recovery-%u", base, type);
|
||||
snprintf(path, sizeof(path), "%s/RetroArch-recovery-%u",
|
||||
application_data, type);
|
||||
|
||||
time(&time_);
|
||||
|
||||
strftime(timebuf, sizeof(timebuf), "%Y-%m-%d-%H-%M-%S", localtime(&time_));
|
||||
strlcat(path, timebuf, sizeof(path));
|
||||
|
||||
if (!retro_write_file(path, data, size))
|
||||
if (!filestream_write_file(path, data, size))
|
||||
return false;
|
||||
|
||||
RARCH_WARN("Succeeded in saving RAM data to \"%s\".\n", path);
|
||||
@@ -1031,7 +1041,7 @@ static bool content_save_state(const char *path)
|
||||
ret = core_ctl(CORE_CTL_RETRO_SERIALIZE, &serial_info);
|
||||
|
||||
if (ret)
|
||||
ret = retro_write_file(path, data, info.size);
|
||||
ret = filestream_write_file(path, data, info.size);
|
||||
else
|
||||
{
|
||||
RARCH_ERR("%s \"%s\".\n",
|
||||
@@ -1062,7 +1072,7 @@ static bool content_load_state(const char *path)
|
||||
struct sram_block *blocks = NULL;
|
||||
settings_t *settings = config_get_ptr();
|
||||
global_t *global = global_get_ptr();
|
||||
bool ret = retro_read_file(path, &buf, &size);
|
||||
bool ret = filestream_read_file(path, &buf, &size);
|
||||
|
||||
RARCH_LOG("%s: \"%s\".\n",
|
||||
msg_hash_to_str(MSG_LOADING_STATE),
|
||||
@@ -1188,7 +1198,7 @@ static bool load_ram_file(void *data)
|
||||
if (mem_info.size == 0 || !mem_info.data)
|
||||
return false;
|
||||
|
||||
if (!retro_read_file(ram->path, &buf, &rc))
|
||||
if (!filestream_read_file(ram->path, &buf, &rc))
|
||||
return false;
|
||||
|
||||
if (rc > 0)
|
||||
@@ -1224,6 +1234,9 @@ static bool save_ram_file(ram_type_t *ram)
|
||||
{
|
||||
retro_ctx_memory_info_t mem_info;
|
||||
|
||||
if (!ram)
|
||||
return false;
|
||||
|
||||
mem_info.id = ram->type;
|
||||
|
||||
core_ctl(CORE_CTL_RETRO_GET_MEMORY, &mem_info);
|
||||
@@ -1231,7 +1244,7 @@ static bool save_ram_file(ram_type_t *ram)
|
||||
if (!mem_info.data || mem_info.size == 0)
|
||||
return false;
|
||||
|
||||
if (!retro_write_file(ram->path, mem_info.data, mem_info.size))
|
||||
if (!filestream_write_file(ram->path, mem_info.data, mem_info.size))
|
||||
{
|
||||
RARCH_ERR("%s.\n",
|
||||
msg_hash_to_str(MSG_FAILED_TO_SAVE_SRAM));
|
||||
@@ -1311,7 +1324,7 @@ static bool load_content_from_compressed_archive(
|
||||
RARCH_LOG("Compressed file in case of need_fullpath."
|
||||
" Now extracting to temporary directory.\n");
|
||||
|
||||
strlcpy(new_basedir, settings->cache_directory,
|
||||
strlcpy(new_basedir, settings->directory.cache,
|
||||
sizeof(new_basedir));
|
||||
|
||||
if (string_is_empty(new_basedir) || !path_is_directory(new_basedir))
|
||||
@@ -1527,8 +1540,8 @@ static bool init_content_file_extract(
|
||||
|
||||
if (!file_archive_extract_first_content_file(temp_content,
|
||||
sizeof(temp_content), valid_ext,
|
||||
*settings->cache_directory ?
|
||||
settings->cache_directory : NULL,
|
||||
*settings->directory.cache ?
|
||||
settings->directory.cache : NULL,
|
||||
new_path, sizeof(new_path)))
|
||||
{
|
||||
RARCH_ERR("Failed to extract content from zipped file: %s.\n",
|
||||
@@ -1609,7 +1622,7 @@ static bool init_content_file_set_attribs(
|
||||
*
|
||||
* Returns : true if successful, otherwise false.
|
||||
**/
|
||||
static bool content_init_file(struct string_list *temporary_content)
|
||||
static bool content_file_init(struct string_list *temporary_content)
|
||||
{
|
||||
unsigned i;
|
||||
struct retro_game_info *info = NULL;
|
||||
@@ -1658,9 +1671,31 @@ error:
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool content_ctl(enum content_ctl_state state, void *data)
|
||||
static bool content_file_free(struct string_list *temporary_content)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
if (!temporary_content)
|
||||
return false;
|
||||
|
||||
for (i = 0; i < temporary_content->size; i++)
|
||||
{
|
||||
const char *path = temporary_content->elems[i].data;
|
||||
|
||||
RARCH_LOG("%s: %s.\n",
|
||||
msg_hash_to_str(MSG_REMOVING_TEMPORARY_CONTENT_FILE), path);
|
||||
if (remove(path) < 0)
|
||||
RARCH_ERR("%s: %s.\n",
|
||||
msg_hash_to_str(MSG_FAILED_TO_REMOVE_TEMPORARY_FILE),
|
||||
path);
|
||||
}
|
||||
string_list_free(temporary_content);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool content_ctl(enum content_ctl_state state, void *data)
|
||||
{
|
||||
static const struct file_archive_file_backend *stream_backend = NULL;
|
||||
static struct string_list *temporary_content = NULL;
|
||||
static bool content_is_inited = false;
|
||||
@@ -1672,13 +1707,7 @@ bool content_ctl(enum content_ctl_state state, void *data)
|
||||
case CONTENT_CTL_LOAD_RAM_FILE:
|
||||
return load_ram_file(data);
|
||||
case CONTENT_CTL_SAVE_RAM_FILE:
|
||||
{
|
||||
ram_type_t *ram = (ram_type_t*)data;
|
||||
if (!ram)
|
||||
return false;
|
||||
save_ram_file(ram);
|
||||
}
|
||||
break;
|
||||
return save_ram_file((ram_type_t*)data);
|
||||
case CONTENT_CTL_DOES_NOT_NEED_CONTENT:
|
||||
return core_does_not_need_content;
|
||||
case CONTENT_CTL_SET_DOES_NOT_NEED_CONTENT:
|
||||
@@ -1722,7 +1751,7 @@ bool content_ctl(enum content_ctl_state state, void *data)
|
||||
temporary_content = string_list_new();
|
||||
if (!temporary_content)
|
||||
return false;
|
||||
if (content_init_file(temporary_content))
|
||||
if (content_file_init(temporary_content))
|
||||
{
|
||||
content_is_inited = true;
|
||||
return true;
|
||||
@@ -1730,22 +1759,7 @@ bool content_ctl(enum content_ctl_state state, void *data)
|
||||
content_ctl(CONTENT_CTL_DEINIT, NULL);
|
||||
return false;
|
||||
case CONTENT_CTL_TEMPORARY_FREE:
|
||||
if (!temporary_content)
|
||||
return false;
|
||||
|
||||
for (i = 0; i < temporary_content->size; i++)
|
||||
{
|
||||
const char *path = temporary_content->elems[i].data;
|
||||
|
||||
RARCH_LOG("%s: %s.\n",
|
||||
msg_hash_to_str(MSG_REMOVING_TEMPORARY_CONTENT_FILE), path);
|
||||
if (remove(path) < 0)
|
||||
RARCH_ERR("%s: %s.\n",
|
||||
msg_hash_to_str(MSG_FAILED_TO_REMOVE_TEMPORARY_FILE),
|
||||
path);
|
||||
}
|
||||
string_list_free(temporary_content);
|
||||
|
||||
content_file_free(temporary_content);
|
||||
temporary_content = NULL;
|
||||
break;
|
||||
case CONTENT_CTL_STREAM_INIT:
|
||||
|
||||
+6
-6
@@ -16,15 +16,15 @@
|
||||
*/
|
||||
|
||||
#include <file/file_path.h>
|
||||
#include <file/dir_list.h>
|
||||
#include <file/file_archive.h>
|
||||
#include <lists/dir_list.h>
|
||||
#include <file/archive_file.h>
|
||||
#include <compat/strl.h>
|
||||
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include "core_info.h"
|
||||
#include "configuration.h"
|
||||
#include "dir_list_special.h"
|
||||
#include "list_special.h"
|
||||
#include "config.def.h"
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@@ -181,8 +181,8 @@ static config_file_t *core_info_list_iterate(
|
||||
|
||||
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,
|
||||
fill_pathname_join(info_path, (*settings->path.libretro_info) ?
|
||||
settings->path.libretro_info : settings->directory.libretro,
|
||||
info_path_base, sizeof(info_path));
|
||||
|
||||
return config_file_new(info_path);
|
||||
@@ -702,7 +702,7 @@ bool core_info_ctl(enum core_info_state state, void *data)
|
||||
return false;
|
||||
|
||||
return core_info_list_update_missing_firmware(core_info_curr_list,
|
||||
info->path, info->system_directory);
|
||||
info->path, info->directory.system);
|
||||
}
|
||||
case CORE_INFO_CTL_FIND:
|
||||
{
|
||||
|
||||
+6
-1
@@ -20,6 +20,8 @@
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include <lists/string_list.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -87,7 +89,10 @@ typedef struct
|
||||
typedef struct core_info_ctx_firmware
|
||||
{
|
||||
const char *path;
|
||||
const char *system_directory;
|
||||
struct
|
||||
{
|
||||
const char *system;
|
||||
} directory;
|
||||
} core_info_ctx_firmware_t;
|
||||
|
||||
typedef struct core_info_ctx_find
|
||||
|
||||
+10
-23
@@ -17,12 +17,15 @@
|
||||
#include <string.h>
|
||||
|
||||
#include <file/config_file.h>
|
||||
#include <file/dir_list.h>
|
||||
#include <lists/dir_list.h>
|
||||
#include <lists/string_list.h>
|
||||
#include <compat/posix_string.h>
|
||||
#include <compat/strl.h>
|
||||
#include <retro_miscellaneous.h>
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include "libretro.h"
|
||||
|
||||
#include "core_options.h"
|
||||
|
||||
struct core_option
|
||||
@@ -77,9 +80,10 @@ void core_option_free(core_option_manager_t *opt)
|
||||
free(opt);
|
||||
}
|
||||
|
||||
void core_option_get(core_option_manager_t *opt, struct retro_variable *var)
|
||||
void core_option_get(core_option_manager_t *opt, void *data)
|
||||
{
|
||||
size_t i;
|
||||
struct retro_variable *var = (struct retro_variable*)data;
|
||||
|
||||
if (!opt)
|
||||
return;
|
||||
@@ -166,11 +170,12 @@ static bool parse_variable(core_option_manager_t *opt, size_t idx,
|
||||
* Returns: handle to new core manager handle, otherwise NULL.
|
||||
**/
|
||||
core_option_manager_t *core_option_new(const char *conf_path,
|
||||
const struct retro_variable *vars)
|
||||
const void *data)
|
||||
{
|
||||
const struct retro_variable *var;
|
||||
size_t size = 0;
|
||||
core_option_manager_t *opt = (core_option_manager_t*)
|
||||
const struct retro_variable *vars = (const struct retro_variable*)data;
|
||||
size_t size = 0;
|
||||
core_option_manager_t *opt = (core_option_manager_t*)
|
||||
calloc(1, sizeof(*opt));
|
||||
|
||||
if (!opt)
|
||||
@@ -324,24 +329,6 @@ const char *core_option_get_val(core_option_manager_t *opt, size_t idx)
|
||||
return option->vals->elems[option->index].data;
|
||||
}
|
||||
|
||||
/**
|
||||
* core_option_get_vals:
|
||||
* @opt : pointer to core option manager object.
|
||||
* @idx : idx of core option.
|
||||
*
|
||||
* Gets list of core option values from core option at index @idx.
|
||||
*
|
||||
* Returns: string list of core option values if successful, otherwise
|
||||
* NULL.
|
||||
**/
|
||||
struct string_list *core_option_get_vals(
|
||||
core_option_manager_t *opt, size_t idx)
|
||||
{
|
||||
if (!opt)
|
||||
return NULL;
|
||||
return opt->opts[idx].vals;
|
||||
}
|
||||
|
||||
void core_option_set_val(core_option_manager_t *opt,
|
||||
size_t idx, size_t val_idx)
|
||||
{
|
||||
|
||||
+2
-19
@@ -20,9 +20,6 @@
|
||||
#include <stddef.h>
|
||||
|
||||
#include <boolean.h>
|
||||
#include <string/string_list.h>
|
||||
|
||||
#include "libretro.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -40,7 +37,7 @@ typedef struct core_option_manager core_option_manager_t;
|
||||
* Returns: handle to new core manager handle, otherwise NULL.
|
||||
**/
|
||||
core_option_manager_t *core_option_new(const char *conf_path,
|
||||
const struct retro_variable *vars);
|
||||
const void *data);
|
||||
|
||||
/**
|
||||
* core_option_updated:
|
||||
@@ -85,8 +82,7 @@ bool core_option_flush_game_specific(
|
||||
**/
|
||||
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, void *data);
|
||||
|
||||
/**
|
||||
* core_option_size:
|
||||
@@ -122,19 +118,6 @@ const char *core_option_get_desc(core_option_manager_t *opt,
|
||||
const char *core_option_get_val(core_option_manager_t *opt,
|
||||
size_t idx);
|
||||
|
||||
/**
|
||||
* core_option_get_vals:
|
||||
* @opt : pointer to core option manager object.
|
||||
* @idx : idx of core option.
|
||||
*
|
||||
* Gets list of core option values from core option at index @idx.
|
||||
*
|
||||
* Returns: string list of core option values if successful, otherwise
|
||||
* NULL.
|
||||
**/
|
||||
struct string_list *core_option_get_vals(
|
||||
core_option_manager_t *opt, size_t idx);
|
||||
|
||||
void core_option_set_val(core_option_manager_t *opt,
|
||||
size_t idx, size_t val_idx);
|
||||
|
||||
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __CORE_TYPE_H
|
||||
#define __CORE_TYPE_H
|
||||
|
||||
enum rarch_core_type
|
||||
{
|
||||
CORE_TYPE_PLAIN = 0,
|
||||
CORE_TYPE_DUMMY,
|
||||
CORE_TYPE_FFMPEG,
|
||||
CORE_TYPE_IMAGEVIEWER
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -18,6 +18,7 @@ extern "C" {
|
||||
#include <libavformat/avformat.h>
|
||||
#include <libavcodec/avcodec.h>
|
||||
#include <libswscale/swscale.h>
|
||||
#include <libavutil/imgutils.h>
|
||||
#include <libavutil/time.h>
|
||||
#include <libavutil/opt.h>
|
||||
#include <libavdevice/avdevice.h>
|
||||
@@ -39,7 +40,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#include <rthreads/rthreads.h>
|
||||
#include <queues/fifo_buffer.h>
|
||||
#include <queues/fifo_queue.h>
|
||||
|
||||
#include "libretro.h"
|
||||
#ifdef RARCH_INTERNAL
|
||||
@@ -899,7 +900,7 @@ static bool init_media_info(void)
|
||||
#ifdef HAVE_SSA
|
||||
if (sctx[0])
|
||||
{
|
||||
size_t i;
|
||||
unsigned i;
|
||||
|
||||
ass = ass_library_init();
|
||||
ass_set_message_cb(ass, ass_msg_cb, NULL);
|
||||
@@ -914,7 +915,7 @@ static bool init_media_info(void)
|
||||
ass_set_fonts(ass_render, NULL, NULL, 1, NULL, 1);
|
||||
ass_set_hinting(ass_render, ASS_HINTING_LIGHT);
|
||||
|
||||
for (i = 0; i < subtitle_streams_num; i++)
|
||||
for (i = 0; i < (unsigned)subtitle_streams_num; i++)
|
||||
{
|
||||
ass_track[i] = ass_new_track(ass);
|
||||
ass_process_codec_private(ass_track[i], (char*)ass_extra_data[i],
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <assert.h>
|
||||
|
||||
#include <boolean.h>
|
||||
#include <file/dir_list.h>
|
||||
#include <lists/dir_list.h>
|
||||
#include <file/file_path.h>
|
||||
#include <compat/strl.h>
|
||||
|
||||
|
||||
@@ -30,12 +30,10 @@ 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
|
||||
|
||||
@@ -48,12 +46,11 @@ 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)
|
||||
$(CC) $(fpic) $(SHARED) $(INCLUDES) -o $@ $(OBJECTS) $(LIBS) -lm
|
||||
|
||||
%.o: %.c
|
||||
$(CC) -I../../libretro-common/include $(CFLAGS) -c -o $@ $<
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#define VK_PROTOTYPES
|
||||
#include "../../libretro_vulkan.h"
|
||||
#include "shaders/triangle.vert.inc"
|
||||
#include "shaders/triangle.frag.inc"
|
||||
@@ -17,6 +16,294 @@ static const struct retro_hw_render_interface_vulkan *vulkan;
|
||||
#define BASE_HEIGHT 240
|
||||
#define MAX_SYNC 8
|
||||
|
||||
/* We'll probably want a libretro common solution for this, but this will do for now. */
|
||||
#define VK_GET_DEVICE_PROC_ADDR(entrypoint) do { \
|
||||
vkcfp.vk##entrypoint = (PFN_vk##entrypoint) vulkan->get_device_proc_addr(vulkan->device, \
|
||||
"vk" #entrypoint); \
|
||||
} while(0)
|
||||
|
||||
#define VK_GET_INSTANCE_PROC_ADDR(entrypoint) do { \
|
||||
vkcfp.vk##entrypoint = (PFN_vk##entrypoint) vulkan->get_instance_proc_addr(vulkan->instance, \
|
||||
"vk" #entrypoint); \
|
||||
} while(0)
|
||||
|
||||
typedef struct vulkan_context_fp
|
||||
{
|
||||
/* Device */
|
||||
PFN_vkDeviceWaitIdle vkDeviceWaitIdle;
|
||||
|
||||
/* Device Memory */
|
||||
PFN_vkAllocateMemory vkAllocateMemory;
|
||||
PFN_vkFreeMemory vkFreeMemory;
|
||||
|
||||
/* Command Function Pointers */
|
||||
PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr;
|
||||
PFN_vkGetDeviceProcAddr vkGetDeviceProcAddr;
|
||||
|
||||
/* Buffers */
|
||||
PFN_vkCreateBuffer vkCreateBuffer;
|
||||
PFN_vkDestroyBuffer vkDestroyBuffer;
|
||||
|
||||
/* Fences */
|
||||
PFN_vkCreateFence vkCreateFence;
|
||||
PFN_vkDestroyFence vkDestroyFence;
|
||||
PFN_vkResetFences vkResetFences;
|
||||
PFN_vkWaitForFences vkWaitForFences;
|
||||
|
||||
/* Semaphores */
|
||||
PFN_vkCreateSemaphore vkCreateSemaphore;
|
||||
PFN_vkDestroySemaphore vkDestroySemaphore;
|
||||
|
||||
/* Images */
|
||||
PFN_vkCreateImage vkCreateImage;
|
||||
PFN_vkDestroyImage vkDestroyImage;
|
||||
PFN_vkGetImageSubresourceLayout vkGetImageSubresourceLayout;
|
||||
|
||||
/* Images (Resource Memory Association) */
|
||||
PFN_vkGetBufferMemoryRequirements vkGetBufferMemoryRequirements;
|
||||
PFN_vkBindBufferMemory vkBindBufferMemory;
|
||||
PFN_vkBindImageMemory vkBindImageMemory;
|
||||
|
||||
/* Image Views */
|
||||
PFN_vkCreateImageView vkCreateImageView;
|
||||
PFN_vkDestroyImageView vkDestroyImageView;
|
||||
|
||||
/* Image Views (Resource Memory Association) */
|
||||
PFN_vkGetImageMemoryRequirements vkGetImageMemoryRequirements;
|
||||
|
||||
/* Queues */
|
||||
PFN_vkGetDeviceQueue vkGetDeviceQueue;
|
||||
PFN_vkQueueWaitIdle vkQueueWaitIdle;
|
||||
|
||||
/* Pipelines */
|
||||
PFN_vkDestroyPipeline vkDestroyPipeline;
|
||||
PFN_vkCreateGraphicsPipelines vkCreateGraphicsPipelines;
|
||||
|
||||
/* Pipeline Layouts */
|
||||
PFN_vkCreatePipelineLayout vkCreatePipelineLayout;
|
||||
PFN_vkDestroyPipelineLayout vkDestroyPipelineLayout;
|
||||
|
||||
/* Pipeline Cache */
|
||||
PFN_vkCreatePipelineCache vkCreatePipelineCache;
|
||||
PFN_vkDestroyPipelineCache vkDestroyPipelineCache;
|
||||
|
||||
/* Pipeline Barriers */
|
||||
PFN_vkCmdPipelineBarrier vkCmdPipelineBarrier;
|
||||
|
||||
/* Descriptor pools */
|
||||
PFN_vkCreateDescriptorPool vkCreateDescriptorPool;
|
||||
PFN_vkDestroyDescriptorPool vkDestroyDescriptorPool;
|
||||
|
||||
/* Descriptor sets */
|
||||
PFN_vkAllocateDescriptorSets vkAllocateDescriptorSets;
|
||||
PFN_vkFreeDescriptorSets vkFreeDescriptorSets;
|
||||
PFN_vkCmdBindDescriptorSets vkCmdBindDescriptorSets;
|
||||
PFN_vkUpdateDescriptorSets vkUpdateDescriptorSets;
|
||||
|
||||
/* Descriptor Set Layout */
|
||||
PFN_vkCreateDescriptorSetLayout vkCreateDescriptorSetLayout;
|
||||
PFN_vkDestroyDescriptorSetLayout vkDestroyDescriptorSetLayout;
|
||||
|
||||
/* Command Buffers */
|
||||
PFN_vkCreateCommandPool vkCreateCommandPool;
|
||||
PFN_vkDestroyCommandPool vkDestroyCommandPool;
|
||||
PFN_vkBeginCommandBuffer vkBeginCommandBuffer;
|
||||
PFN_vkEndCommandBuffer vkEndCommandBuffer;
|
||||
PFN_vkResetCommandBuffer vkResetCommandBuffer;
|
||||
PFN_vkFreeCommandBuffers vkFreeCommandBuffers;
|
||||
PFN_vkAllocateCommandBuffers vkAllocateCommandBuffers;
|
||||
|
||||
/* Command Buffer Submission */
|
||||
PFN_vkQueueSubmit vkQueueSubmit;
|
||||
|
||||
/* Framebuffers */
|
||||
PFN_vkCreateFramebuffer vkCreateFramebuffer;
|
||||
PFN_vkDestroyFramebuffer vkDestroyFramebuffer;
|
||||
|
||||
/* Memory allocation */
|
||||
PFN_vkMapMemory vkMapMemory;
|
||||
PFN_vkUnmapMemory vkUnmapMemory;
|
||||
|
||||
/* Samplers */
|
||||
PFN_vkCreateSampler vkCreateSampler;
|
||||
PFN_vkDestroySampler vkDestroySampler;
|
||||
|
||||
/* Render Passes */
|
||||
PFN_vkCreateRenderPass vkCreateRenderPass;
|
||||
PFN_vkDestroyRenderPass vkDestroyRenderPass;
|
||||
|
||||
/* Image commands */
|
||||
PFN_vkCmdCopyImage vkCmdCopyImage;
|
||||
PFN_vkCmdClearColorImage vkCmdClearColorImage;
|
||||
|
||||
/* Pipeline commands */
|
||||
PFN_vkCmdBindPipeline vkCmdBindPipeline;
|
||||
|
||||
/* Vertex input descriptions */
|
||||
PFN_vkCmdBindVertexBuffers vkCmdBindVertexBuffers;
|
||||
|
||||
/* Render Pass commands */
|
||||
PFN_vkCmdBeginRenderPass vkCmdBeginRenderPass;
|
||||
PFN_vkCmdEndRenderPass vkCmdEndRenderPass;
|
||||
|
||||
/* Clear commands */
|
||||
PFN_vkCmdClearAttachments vkCmdClearAttachments;
|
||||
|
||||
/* Drawing commands */
|
||||
PFN_vkCmdDraw vkCmdDraw;
|
||||
|
||||
/* Fragment operations */
|
||||
PFN_vkCmdSetScissor vkCmdSetScissor;
|
||||
|
||||
/* Fixed-function vertex postprocessing */
|
||||
PFN_vkCmdSetViewport vkCmdSetViewport;
|
||||
|
||||
/* Shaders */
|
||||
PFN_vkCreateShaderModule vkCreateShaderModule;
|
||||
PFN_vkDestroyShaderModule vkDestroyShaderModule;
|
||||
|
||||
PFN_vkGetPhysicalDeviceProperties vkGetPhysicalDeviceProperties;
|
||||
PFN_vkGetPhysicalDeviceMemoryProperties vkGetPhysicalDeviceMemoryProperties;
|
||||
} vulkan_context_fp_t;
|
||||
|
||||
static vulkan_context_fp_t vkcfp;
|
||||
#define VKFUNC(sym) (vkcfp.sym)
|
||||
|
||||
static void load_device_symbols(void)
|
||||
{
|
||||
VK_GET_INSTANCE_PROC_ADDR(GetPhysicalDeviceProperties);
|
||||
VK_GET_INSTANCE_PROC_ADDR(GetPhysicalDeviceMemoryProperties);
|
||||
|
||||
/* Memory */
|
||||
VK_GET_DEVICE_PROC_ADDR(AllocateMemory);
|
||||
VK_GET_DEVICE_PROC_ADDR(FreeMemory);
|
||||
|
||||
/* Waiting */
|
||||
VK_GET_DEVICE_PROC_ADDR(DeviceWaitIdle);
|
||||
|
||||
/* Queues */
|
||||
VK_GET_DEVICE_PROC_ADDR(GetDeviceQueue);
|
||||
VK_GET_DEVICE_PROC_ADDR(QueueWaitIdle);
|
||||
VK_GET_DEVICE_PROC_ADDR(QueueSubmit);
|
||||
|
||||
/* Semaphores */
|
||||
VK_GET_DEVICE_PROC_ADDR(CreateSemaphore);
|
||||
VK_GET_DEVICE_PROC_ADDR(DestroySemaphore);
|
||||
|
||||
/* Buffers */
|
||||
VK_GET_DEVICE_PROC_ADDR(CreateBuffer);
|
||||
VK_GET_DEVICE_PROC_ADDR(DestroyBuffer);
|
||||
|
||||
/* Fences */
|
||||
VK_GET_DEVICE_PROC_ADDR(CreateFence);
|
||||
VK_GET_DEVICE_PROC_ADDR(DestroyFence);
|
||||
VK_GET_DEVICE_PROC_ADDR(ResetFences);
|
||||
VK_GET_DEVICE_PROC_ADDR(WaitForFences);
|
||||
|
||||
/* Images */
|
||||
VK_GET_DEVICE_PROC_ADDR(CreateImage);
|
||||
VK_GET_DEVICE_PROC_ADDR(DestroyImage);
|
||||
VK_GET_DEVICE_PROC_ADDR(GetImageSubresourceLayout);
|
||||
|
||||
/* Images (Resource Memory Association) */
|
||||
VK_GET_DEVICE_PROC_ADDR(GetBufferMemoryRequirements);
|
||||
VK_GET_DEVICE_PROC_ADDR(BindBufferMemory);
|
||||
VK_GET_DEVICE_PROC_ADDR(BindImageMemory);
|
||||
|
||||
/* Image Views */
|
||||
VK_GET_DEVICE_PROC_ADDR(CreateImageView);
|
||||
VK_GET_DEVICE_PROC_ADDR(DestroyImageView);
|
||||
|
||||
/* Resource Memory Associations */
|
||||
VK_GET_DEVICE_PROC_ADDR(GetImageMemoryRequirements);
|
||||
|
||||
/* Descriptor pools */
|
||||
VK_GET_DEVICE_PROC_ADDR(CreateDescriptorPool);
|
||||
VK_GET_DEVICE_PROC_ADDR(DestroyDescriptorPool);
|
||||
|
||||
/* Descriptor sets */
|
||||
VK_GET_DEVICE_PROC_ADDR(AllocateDescriptorSets);
|
||||
VK_GET_DEVICE_PROC_ADDR(FreeDescriptorSets);
|
||||
VK_GET_DEVICE_PROC_ADDR(UpdateDescriptorSets);
|
||||
|
||||
/* Descriptor Set Layout */
|
||||
VK_GET_DEVICE_PROC_ADDR(CreateDescriptorSetLayout);
|
||||
VK_GET_DEVICE_PROC_ADDR(DestroyDescriptorSetLayout);
|
||||
|
||||
/* Framebuffers */
|
||||
VK_GET_DEVICE_PROC_ADDR(CreateFramebuffer);
|
||||
VK_GET_DEVICE_PROC_ADDR(DestroyFramebuffer);
|
||||
VK_GET_DEVICE_PROC_ADDR(AllocateCommandBuffers);
|
||||
VK_GET_DEVICE_PROC_ADDR(FreeCommandBuffers);
|
||||
|
||||
/* Memory allocation */
|
||||
VK_GET_DEVICE_PROC_ADDR(MapMemory);
|
||||
VK_GET_DEVICE_PROC_ADDR(UnmapMemory);
|
||||
|
||||
/* Render Passes */
|
||||
VK_GET_DEVICE_PROC_ADDR(CreateRenderPass);
|
||||
VK_GET_DEVICE_PROC_ADDR(DestroyRenderPass);
|
||||
|
||||
/* Pipelines */
|
||||
VK_GET_DEVICE_PROC_ADDR(DestroyPipeline);
|
||||
VK_GET_DEVICE_PROC_ADDR(CreateGraphicsPipelines);
|
||||
|
||||
/* Shaders */
|
||||
VK_GET_DEVICE_PROC_ADDR(CreateShaderModule);
|
||||
VK_GET_DEVICE_PROC_ADDR(DestroyShaderModule);
|
||||
|
||||
/* Pipeline Layouts */
|
||||
VK_GET_DEVICE_PROC_ADDR(CreatePipelineLayout);
|
||||
VK_GET_DEVICE_PROC_ADDR(DestroyPipelineLayout);
|
||||
|
||||
/* Pipeline Cache */
|
||||
VK_GET_DEVICE_PROC_ADDR(CreatePipelineCache);
|
||||
VK_GET_DEVICE_PROC_ADDR(DestroyPipelineCache);
|
||||
|
||||
/* Command buffers */
|
||||
VK_GET_DEVICE_PROC_ADDR(CreateCommandPool);
|
||||
VK_GET_DEVICE_PROC_ADDR(DestroyCommandPool);
|
||||
VK_GET_DEVICE_PROC_ADDR(BeginCommandBuffer);
|
||||
VK_GET_DEVICE_PROC_ADDR(ResetCommandBuffer);
|
||||
VK_GET_DEVICE_PROC_ADDR(EndCommandBuffer);
|
||||
|
||||
/* Image commands */
|
||||
VK_GET_DEVICE_PROC_ADDR(CmdCopyImage);
|
||||
VK_GET_DEVICE_PROC_ADDR(CmdClearColorImage);
|
||||
|
||||
/* Vertex input descriptions */
|
||||
VK_GET_DEVICE_PROC_ADDR(CmdBindVertexBuffers);
|
||||
|
||||
/* Descriptor Set commands */
|
||||
VK_GET_DEVICE_PROC_ADDR(CmdBindDescriptorSets);
|
||||
|
||||
/* Fragment operations */
|
||||
VK_GET_DEVICE_PROC_ADDR(CmdSetScissor);
|
||||
|
||||
/* Render Pass commands */
|
||||
VK_GET_DEVICE_PROC_ADDR(CmdBeginRenderPass);
|
||||
VK_GET_DEVICE_PROC_ADDR(CmdEndRenderPass);
|
||||
|
||||
/* Samplers */
|
||||
VK_GET_DEVICE_PROC_ADDR(CreateSampler);
|
||||
VK_GET_DEVICE_PROC_ADDR(DestroySampler);
|
||||
|
||||
/* Fixed-function vertex postprocessing */
|
||||
VK_GET_DEVICE_PROC_ADDR(CmdSetViewport);
|
||||
|
||||
/* Clear commands */
|
||||
VK_GET_DEVICE_PROC_ADDR(CmdClearAttachments);
|
||||
|
||||
/* Pipeline */
|
||||
VK_GET_DEVICE_PROC_ADDR(CmdBindPipeline);
|
||||
|
||||
/* Pipeline Barriers */
|
||||
VK_GET_DEVICE_PROC_ADDR(CmdPipelineBarrier);
|
||||
|
||||
/* Drawing commands */
|
||||
VK_GET_DEVICE_PROC_ADDR(CmdDraw);
|
||||
}
|
||||
|
||||
struct buffer
|
||||
{
|
||||
VkBuffer buffer;
|
||||
@@ -167,10 +454,10 @@ static void update_ubo(void)
|
||||
tmp[15] = 1.0f;
|
||||
|
||||
float *mvp = NULL;
|
||||
vkMapMemory(vulkan->device, vk.ubo[vk.index].memory,
|
||||
VKFUNC(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);
|
||||
VKFUNC(vkUnmapMemory)(vulkan->device, vk.ubo[vk.index].memory);
|
||||
}
|
||||
|
||||
static void vulkan_test_render(void)
|
||||
@@ -181,12 +468,12 @@ static void vulkan_test_render(void)
|
||||
|
||||
VkCommandBufferBeginInfo begin_info = { VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO };
|
||||
begin_info.flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT;
|
||||
vkResetCommandBuffer(cmd, 0);
|
||||
vkBeginCommandBuffer(cmd, &begin_info);
|
||||
VKFUNC(vkResetCommandBuffer)(cmd, 0);
|
||||
VKFUNC(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.dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | VK_ACCESS_COLOR_ATTACHMENT_READ_BIT;
|
||||
prepare_rendering.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED;
|
||||
prepare_rendering.newLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
|
||||
prepare_rendering.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
|
||||
@@ -195,7 +482,7 @@ static void vulkan_test_render(void)
|
||||
prepare_rendering.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
|
||||
prepare_rendering.subresourceRange.levelCount = 1;
|
||||
prepare_rendering.subresourceRange.layerCount = 1;
|
||||
vkCmdPipelineBarrier(cmd,
|
||||
VKFUNC(vkCmdPipelineBarrier)(cmd,
|
||||
VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
|
||||
false,
|
||||
0, NULL,
|
||||
@@ -215,10 +502,10 @@ static void vulkan_test_render(void)
|
||||
rp_begin.renderArea.extent.height = BASE_HEIGHT;
|
||||
rp_begin.clearValueCount = 1;
|
||||
rp_begin.pClearValues = &clear_value;
|
||||
vkCmdBeginRenderPass(cmd, &rp_begin, VK_SUBPASS_CONTENTS_INLINE);
|
||||
VKFUNC(vkCmdBeginRenderPass)(cmd, &rp_begin, VK_SUBPASS_CONTENTS_INLINE);
|
||||
|
||||
vkCmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, vk.pipeline);
|
||||
vkCmdBindDescriptorSets(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS,
|
||||
VKFUNC(vkCmdBindPipeline)(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, vk.pipeline);
|
||||
VKFUNC(vkCmdBindDescriptorSets)(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS,
|
||||
vk.pipeline_layout, 0,
|
||||
1, &vk.desc_set[vk.index], 0, NULL);
|
||||
|
||||
@@ -229,20 +516,20 @@ static void vulkan_test_render(void)
|
||||
vp.height = BASE_HEIGHT;
|
||||
vp.minDepth = 0.0f;
|
||||
vp.maxDepth = 1.0f;
|
||||
vkCmdSetViewport(cmd, 0, 1, &vp);
|
||||
VKFUNC(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);
|
||||
VKFUNC(vkCmdSetScissor)(cmd, 0, 1, &scissor);
|
||||
|
||||
VkDeviceSize offset = 0;
|
||||
vkCmdBindVertexBuffers(cmd, 0, 1, &vk.vbo.buffer, &offset);
|
||||
VKFUNC(vkCmdBindVertexBuffers)(cmd, 0, 1, &vk.vbo.buffer, &offset);
|
||||
|
||||
vkCmdDraw(cmd, 3, 1, 0, 0);
|
||||
VKFUNC(vkCmdDraw)(cmd, 3, 1, 0, 0);
|
||||
|
||||
vkCmdEndRenderPass(cmd);
|
||||
VKFUNC(vkCmdEndRenderPass)(cmd);
|
||||
|
||||
VkImageMemoryBarrier prepare_presentation = { VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER };
|
||||
prepare_presentation.srcAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
|
||||
@@ -256,14 +543,14 @@ static void vulkan_test_render(void)
|
||||
prepare_presentation.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
|
||||
prepare_presentation.subresourceRange.levelCount = 1;
|
||||
prepare_presentation.subresourceRange.layerCount = 1;
|
||||
vkCmdPipelineBarrier(cmd, VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT,
|
||||
VKFUNC(vkCmdPipelineBarrier)(cmd, VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT,
|
||||
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
|
||||
false,
|
||||
0, NULL,
|
||||
0, NULL,
|
||||
1, &prepare_presentation);
|
||||
|
||||
vkEndCommandBuffer(cmd);
|
||||
VKFUNC(vkEndCommandBuffer)(cmd);
|
||||
}
|
||||
|
||||
static struct buffer create_buffer(const void *initial, size_t size, VkBufferUsageFlags usage)
|
||||
@@ -275,10 +562,10 @@ static struct buffer create_buffer(const void *initial, size_t size, VkBufferUsa
|
||||
info.usage = usage;
|
||||
info.size = size;
|
||||
|
||||
vkCreateBuffer(device, &info, NULL, &buffer.buffer);
|
||||
VKFUNC(vkCreateBuffer)(device, &info, NULL, &buffer.buffer);
|
||||
|
||||
VkMemoryRequirements mem_reqs;
|
||||
vkGetBufferMemoryRequirements(device, buffer.buffer, &mem_reqs);
|
||||
VKFUNC(vkGetBufferMemoryRequirements)(device, buffer.buffer, &mem_reqs);
|
||||
|
||||
VkMemoryAllocateInfo alloc = { VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO };
|
||||
alloc.allocationSize = mem_reqs.size;
|
||||
@@ -286,15 +573,15 @@ static struct buffer create_buffer(const void *initial, size_t size, VkBufferUsa
|
||||
alloc.memoryTypeIndex = find_memory_type_from_requirements(mem_reqs.memoryTypeBits,
|
||||
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT);
|
||||
|
||||
vkAllocateMemory(device, &alloc, NULL, &buffer.memory);
|
||||
vkBindBufferMemory(device, buffer.buffer, buffer.memory, 0);
|
||||
VKFUNC(vkAllocateMemory)(device, &alloc, NULL, &buffer.memory);
|
||||
VKFUNC(vkBindBufferMemory)(device, buffer.buffer, buffer.memory, 0);
|
||||
|
||||
if (initial)
|
||||
{
|
||||
void *ptr;
|
||||
vkMapMemory(device, buffer.memory, 0, size, 0, &ptr);
|
||||
VKFUNC(vkMapMemory)(device, buffer.memory, 0, size, 0, &ptr);
|
||||
memcpy(ptr, initial, size);
|
||||
vkUnmapMemory(device, buffer.memory);
|
||||
VKFUNC(vkUnmapMemory)(device, buffer.memory);
|
||||
}
|
||||
|
||||
return buffer;
|
||||
@@ -326,7 +613,7 @@ static VkShaderModule create_shader_module(const uint8_t *data, size_t size)
|
||||
VkShaderModule module;
|
||||
module_info.codeSize = size;
|
||||
module_info.pCode = (const uint32_t*)data;
|
||||
vkCreateShaderModule(vulkan->device, &module_info, NULL, &module);
|
||||
VKFUNC(vkCreateShaderModule)(vulkan->device, &module_info, NULL, &module);
|
||||
return module;
|
||||
}
|
||||
|
||||
@@ -348,19 +635,19 @@ static void init_descriptor(void)
|
||||
VkDescriptorSetLayoutCreateInfo set_layout_info = { VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO };
|
||||
set_layout_info.bindingCount = 1;
|
||||
set_layout_info.pBindings = &binding;
|
||||
vkCreateDescriptorSetLayout(device, &set_layout_info, NULL, &vk.set_layout);
|
||||
VKFUNC(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);
|
||||
VKFUNC(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);
|
||||
VKFUNC(vkCreateDescriptorPool)(device, &pool_info, NULL, &vk.desc_pool);
|
||||
|
||||
VkDescriptorSetAllocateInfo alloc_info = { VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO };
|
||||
alloc_info.descriptorPool = vk.desc_pool;
|
||||
@@ -368,7 +655,7 @@ static void init_descriptor(void)
|
||||
alloc_info.pSetLayouts = &vk.set_layout;
|
||||
for (unsigned i = 0; i < vk.num_swapchain_images; i++)
|
||||
{
|
||||
vkAllocateDescriptorSets(device, &alloc_info, &vk.desc_set[i]);
|
||||
VKFUNC(vkAllocateDescriptorSets)(device, &alloc_info, &vk.desc_set[i]);
|
||||
|
||||
VkWriteDescriptorSet write = { VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET };
|
||||
VkDescriptorBufferInfo buffer_info;
|
||||
@@ -383,7 +670,7 @@ static void init_descriptor(void)
|
||||
buffer_info.offset = 0;
|
||||
buffer_info.range = 16 * sizeof(float);
|
||||
|
||||
vkUpdateDescriptorSets(device, 1, &write, 0, NULL);
|
||||
VKFUNC(vkUpdateDescriptorSets)(device, 1, &write, 0, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -479,10 +766,10 @@ static void init_pipeline(void)
|
||||
pipe.renderPass = vk.render_pass;
|
||||
pipe.layout = vk.pipeline_layout;
|
||||
|
||||
vkCreateGraphicsPipelines(vulkan->device, vk.pipeline_cache, 1, &pipe, NULL, &vk.pipeline);
|
||||
VKFUNC(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);
|
||||
VKFUNC(vkDestroyShaderModule)(device, shader_stages[0].module, NULL);
|
||||
VKFUNC(vkDestroyShaderModule)(device, shader_stages[1].module, NULL);
|
||||
}
|
||||
|
||||
static void init_render_pass(VkFormat format)
|
||||
@@ -509,7 +796,7 @@ static void init_render_pass(VkFormat format)
|
||||
rp_info.pAttachments = &attachment;
|
||||
rp_info.subpassCount = 1;
|
||||
rp_info.pSubpasses = &subpass;
|
||||
vkCreateRenderPass(vulkan->device, &rp_info, NULL, &vk.render_pass);
|
||||
VKFUNC(vkCreateRenderPass)(vulkan->device, &rp_info, NULL, &vk.render_pass);
|
||||
}
|
||||
|
||||
static void init_swapchain(void)
|
||||
@@ -536,17 +823,17 @@ static void init_swapchain(void)
|
||||
image.mipLevels = 1;
|
||||
image.arrayLayers = 1;
|
||||
|
||||
vkCreateImage(device, &image, NULL, &vk.images[i].create_info.image);
|
||||
VKFUNC(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);
|
||||
VKFUNC(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);
|
||||
VKFUNC(vkAllocateMemory)(device, &alloc, NULL, &vk.image_memory[i]);
|
||||
VKFUNC(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;
|
||||
@@ -561,7 +848,7 @@ static void init_swapchain(void)
|
||||
vk.images[i].create_info.components.b = VK_COMPONENT_SWIZZLE_B;
|
||||
vk.images[i].create_info.components.a = VK_COMPONENT_SWIZZLE_A;
|
||||
|
||||
vkCreateImageView(device, &vk.images[i].create_info,
|
||||
VKFUNC(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;
|
||||
|
||||
@@ -573,7 +860,7 @@ static void init_swapchain(void)
|
||||
fb_info.height = BASE_HEIGHT;
|
||||
fb_info.layers = 1;
|
||||
|
||||
vkCreateFramebuffer(device, &fb_info, NULL, &vk.framebuffers[i]);
|
||||
VKFUNC(vkCreateFramebuffer)(device, &fb_info, NULL, &vk.framebuffers[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -587,18 +874,18 @@ static void init_command(void)
|
||||
|
||||
for (unsigned i = 0; i < vk.num_swapchain_images; i++)
|
||||
{
|
||||
vkCreateCommandPool(vulkan->device, &pool_info, NULL, &vk.cmd_pool[i]);
|
||||
VKFUNC(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]);
|
||||
VKFUNC(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);
|
||||
VKFUNC(vkGetPhysicalDeviceProperties)(vulkan->gpu, &vk.gpu_properties);
|
||||
VKFUNC(vkGetPhysicalDeviceMemoryProperties)(vulkan->gpu, &vk.memory_properties);
|
||||
|
||||
unsigned num_images = 0;
|
||||
uint32_t mask = vulkan->get_sync_index_mask(vulkan->handle);
|
||||
@@ -614,7 +901,7 @@ static void vulkan_test_init(void)
|
||||
init_descriptor();
|
||||
|
||||
VkPipelineCacheCreateInfo pipeline_cache_info = { VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO };
|
||||
vkCreatePipelineCache(vulkan->device, &pipeline_cache_info,
|
||||
VKFUNC(vkCreatePipelineCache)(vulkan->device, &pipeline_cache_info,
|
||||
NULL, &vk.pipeline_cache);
|
||||
|
||||
init_render_pass(VK_FORMAT_R8G8B8A8_UNORM);
|
||||
@@ -624,35 +911,38 @@ static void vulkan_test_init(void)
|
||||
|
||||
static void vulkan_test_deinit(void)
|
||||
{
|
||||
if (!vulkan)
|
||||
return;
|
||||
|
||||
VkDevice device = vulkan->device;
|
||||
vkDeviceWaitIdle(device);
|
||||
VKFUNC(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);
|
||||
VKFUNC(vkDestroyFramebuffer)(device, vk.framebuffers[i], NULL);
|
||||
VKFUNC(vkDestroyImageView)(device, vk.images[i].image_view, NULL);
|
||||
VKFUNC(vkFreeMemory)(device, vk.image_memory[i], NULL);
|
||||
VKFUNC(vkDestroyImage)(device, vk.images[i].create_info.image, NULL);
|
||||
|
||||
vkFreeMemory(device, vk.ubo[i].memory, NULL);
|
||||
vkDestroyBuffer(device, vk.ubo[i].buffer, NULL);
|
||||
VKFUNC(vkFreeMemory)(device, vk.ubo[i].memory, NULL);
|
||||
VKFUNC(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);
|
||||
VKFUNC(vkFreeDescriptorSets)(device, vk.desc_pool, vk.num_swapchain_images, vk.desc_set);
|
||||
VKFUNC(vkDestroyDescriptorPool)(device, vk.desc_pool, NULL);
|
||||
|
||||
vkDestroyRenderPass(device, vk.render_pass, NULL);
|
||||
vkDestroyPipeline(device, vk.pipeline, NULL);
|
||||
vkDestroyPipelineLayout(device, vk.pipeline_layout, NULL);
|
||||
VKFUNC(vkDestroyRenderPass)(device, vk.render_pass, NULL);
|
||||
VKFUNC(vkDestroyPipeline)(device, vk.pipeline, NULL);
|
||||
VKFUNC(vkDestroyPipelineLayout)(device, vk.pipeline_layout, NULL);
|
||||
|
||||
vkFreeMemory(device, vk.vbo.memory, NULL);
|
||||
vkDestroyBuffer(device, vk.vbo.buffer, NULL);
|
||||
vkDestroyPipelineCache(device, vk.pipeline_cache, NULL);
|
||||
VKFUNC(vkFreeMemory)(device, vk.vbo.memory, NULL);
|
||||
VKFUNC(vkDestroyBuffer)(device, vk.vbo.buffer, NULL);
|
||||
VKFUNC(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);
|
||||
VKFUNC(vkFreeCommandBuffers)(device, vk.cmd_pool[i], 1, &vk.cmd[i]);
|
||||
VKFUNC(vkDestroyCommandPool)(device, vk.cmd_pool[i], NULL);
|
||||
}
|
||||
|
||||
memset(&vk, 0, sizeof(vk));
|
||||
@@ -690,6 +980,16 @@ static void context_reset(void)
|
||||
fprintf(stderr, "Failed to get HW rendering interface!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (vulkan->interface_version != RETRO_HW_RENDER_INTERFACE_VULKAN_VERSION)
|
||||
{
|
||||
fprintf(stderr, "HW render interface mismatch, expected %u, got %u!\n",
|
||||
RETRO_HW_RENDER_INTERFACE_VULKAN_VERSION, vulkan->interface_version);
|
||||
vulkan = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
load_device_symbols();
|
||||
vulkan_test_init();
|
||||
}
|
||||
|
||||
@@ -704,7 +1004,7 @@ static void context_destroy(void)
|
||||
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_major = VK_MAKE_VERSION(1, 0, 6);
|
||||
hw_render.version_minor = 0;
|
||||
hw_render.context_reset = context_reset;
|
||||
hw_render.context_destroy = context_destroy;
|
||||
|
||||
@@ -0,0 +1,146 @@
|
||||
STATIC_LINKING := 0
|
||||
AR := ar
|
||||
|
||||
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
|
||||
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 := retropad
|
||||
LIBM = -lm
|
||||
|
||||
ifeq ($(ARCHFLAGS),)
|
||||
ifeq ($(archs),ppc)
|
||||
ARCHFLAGS = -arch ppc -arch ppc64
|
||||
else
|
||||
ARCHFLAGS = -arch i386 -arch x86_64
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(platform), osx)
|
||||
ifndef ($(NOUNIVERSAL))
|
||||
CFLAGS += $(ARCHFLAGS)
|
||||
LFLAGS += $(ARCHFLAGS)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(STATIC_LINKING), 1)
|
||||
EXT := a
|
||||
endif
|
||||
|
||||
ifeq ($(platform), unix)
|
||||
EXT ?= so
|
||||
TARGET := $(TARGET_NAME)_libretro.$(EXT)
|
||||
fpic := -fPIC
|
||||
SHARED := -shared -Wl,--version-script=link.T -Wl,--no-undefined
|
||||
else ifeq ($(platform), linux-portable)
|
||||
TARGET := $(TARGET_NAME)_libretro.$(EXT)
|
||||
fpic := -fPIC -nostdlib
|
||||
SHARED := -shared -Wl,--version-script=link.T
|
||||
LIBM :=
|
||||
else ifneq (,$(findstring osx,$(platform)))
|
||||
TARGET := $(TARGET_NAME)_libretro.dylib
|
||||
fpic := -fPIC
|
||||
SHARED := -dynamiclib
|
||||
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
|
||||
|
||||
DEFINES := -DIOS
|
||||
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 -Wl,--no-undefined
|
||||
else ifeq ($(platform), emscripten)
|
||||
TARGET := $(TARGET_NAME)_libretro_emscripten.bc
|
||||
fpic := -fPIC
|
||||
SHARED := -shared -Wl,--version-script=link.T -Wl,--no-undefined
|
||||
else ifeq ($(platform), vita)
|
||||
TARGET := $(TARGET_NAME)_vita.a
|
||||
CC = arm-vita-eabi-gcc
|
||||
AR = arm-vita-eabi-ar
|
||||
CFLAGS += -Wl,-q -Wall -O3
|
||||
STATIC_LINKING = 1
|
||||
else
|
||||
CC = gcc
|
||||
TARGET := $(TARGET_NAME)_libretro.dll
|
||||
SHARED := -shared -static-libgcc -static-libstdc++ -s -Wl,--version-script=link.T -Wl,--no-undefined
|
||||
endif
|
||||
|
||||
|
||||
LDFLAGS += $(LIBM)
|
||||
|
||||
ifeq ($(platform), win)
|
||||
LDFLAGS += -lws2_32
|
||||
endif
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
CFLAGS += -O0 -g
|
||||
else
|
||||
CFLAGS += -O3
|
||||
endif
|
||||
|
||||
OBJECTS := ../../libretro-common/net/net_compat.o ../../libretro-common/net/net_socket.o retropad.o
|
||||
CFLAGS += -I../../libretro-common/include -Wall -pedantic $(fpic)
|
||||
|
||||
ifneq (,$(findstring qnx,$(platform)))
|
||||
CFLAGS += -Wc,-std=c99
|
||||
else
|
||||
CFLAGS += -std=gnu99
|
||||
endif
|
||||
|
||||
CFLAGS += -I../../libretro-common/include
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
$(TARGET): $(OBJECTS)
|
||||
ifeq ($(STATIC_LINKING), 1)
|
||||
$(AR) rcs $@ $(OBJECTS)
|
||||
else
|
||||
$(CC) $(fpic) $(SHARED) $(INCLUDES) -o $@ $(OBJECTS) $(LDFLAGS)
|
||||
endif
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
clean:
|
||||
rm -f $(OBJECTS) $(TARGET)
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
APP_DIR := ../../src
|
||||
|
||||
LOCAL_MODULE := retro
|
||||
|
||||
ifeq ($(TARGET_ARCH),arm)
|
||||
LOCAL_CFLAGS += -DANDROID_ARM
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET_ARCH),x86)
|
||||
LOCAL_CFLAGS += -DANDROID_X86
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET_ARCH),mips)
|
||||
LOCAL_CFLAGS += -DANDROID_MIPS -D__mips__ -D__MIPSEL__
|
||||
endif
|
||||
|
||||
LOCAL_SRC_FILES += ../libretro-test.c
|
||||
LOCAL_CFLAGS += -O3 -std=gnu99 -ffast-math -funroll-loops
|
||||
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
@@ -0,0 +1 @@
|
||||
APP_ABI := all
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
global: retro_*;
|
||||
local: *;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,327 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2015 - Daniel De Matteis
|
||||
* Copyright (C) 2016 - Andrés Suárez
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
* To-do:
|
||||
* - Analog support
|
||||
* - Some sort of connection control, it only sends packets
|
||||
* but there is no acknoledgement of a connection o keepalives
|
||||
* - Send player name
|
||||
* - Render something on-screen maybe a gui to configure IP and port
|
||||
instead of the ridiculously long strings we're using now
|
||||
* - Allow changing IP address and port in runtime
|
||||
* - Support other platforms
|
||||
* - Input recording / Combos
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <net/net_compat.h>
|
||||
#include <net/net_socket.h>
|
||||
|
||||
#include <retro_miscellaneous.h>
|
||||
|
||||
#include "../../libretro.h"
|
||||
|
||||
#ifndef SOCKET_ERROR
|
||||
#define SOCKET_ERROR -1
|
||||
#endif
|
||||
|
||||
|
||||
struct retro_log_callback logger;
|
||||
retro_log_printf_t log_cb;
|
||||
static uint16_t *frame_buf;
|
||||
struct sockaddr_in si_other;
|
||||
int s, slen=sizeof(si_other);
|
||||
char message[64];
|
||||
char server[64];
|
||||
int port;
|
||||
int input_state = 0;
|
||||
|
||||
void retro_init(void)
|
||||
{
|
||||
frame_buf = (uint16_t*)calloc(320 * 240, sizeof(uint16_t));
|
||||
|
||||
log_cb(RETRO_LOG_INFO, "Initialising sockets...\n");
|
||||
network_init();
|
||||
}
|
||||
|
||||
void retro_deinit(void)
|
||||
{
|
||||
if (frame_buf)
|
||||
free(frame_buf);
|
||||
frame_buf = NULL;
|
||||
}
|
||||
|
||||
unsigned retro_api_version(void)
|
||||
{
|
||||
return RETRO_API_VERSION;
|
||||
}
|
||||
|
||||
void retro_set_controller_port_device(
|
||||
unsigned port, unsigned device)
|
||||
{
|
||||
(void)port;
|
||||
(void)device;
|
||||
}
|
||||
|
||||
void retro_get_system_info(
|
||||
struct retro_system_info *info)
|
||||
{
|
||||
memset(info, 0, sizeof(*info));
|
||||
info->library_name = "RetroPad Remote";
|
||||
info->library_version = "0.01";
|
||||
info->need_fullpath = false;
|
||||
info->valid_extensions = ""; /* Nothing. */
|
||||
}
|
||||
|
||||
void retro_get_system_av_info(
|
||||
struct retro_system_av_info *info)
|
||||
{
|
||||
info->timing.fps = 60.0;
|
||||
info->timing.sample_rate = 30000.0;
|
||||
|
||||
info->geometry.base_width = 320;
|
||||
info->geometry.base_height = 240;
|
||||
info->geometry.max_width = 320;
|
||||
info->geometry.max_height = 240;
|
||||
info->geometry.aspect_ratio = 4.0 / 3.0;
|
||||
}
|
||||
|
||||
static retro_video_refresh_t video_cb;
|
||||
static retro_audio_sample_t audio_cb;
|
||||
static retro_audio_sample_batch_t audio_batch_cb;
|
||||
static retro_environment_t environ_cb;
|
||||
static retro_input_poll_t input_poll_cb;
|
||||
static retro_input_state_t input_state_cb;
|
||||
|
||||
void update_input()
|
||||
{
|
||||
input_state = 0;
|
||||
input_poll_cb();
|
||||
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_B))
|
||||
input_state += 1;
|
||||
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_A))
|
||||
input_state += 2;
|
||||
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_SELECT))
|
||||
input_state += pow(2, 2);
|
||||
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_START))
|
||||
input_state += pow(2, 3);
|
||||
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_UP))
|
||||
input_state += pow(2, 4);
|
||||
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_DOWN))
|
||||
input_state += pow(2, 5);
|
||||
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_LEFT))
|
||||
input_state += pow(2, 6);
|
||||
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_RIGHT))
|
||||
input_state += pow(2, 7);
|
||||
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_Y))
|
||||
input_state += pow(2, 8);
|
||||
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_X))
|
||||
input_state += pow(2, 9);
|
||||
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_L))
|
||||
input_state += pow(2, 10);
|
||||
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_R))
|
||||
input_state += pow(2, 11);
|
||||
}
|
||||
|
||||
void retro_set_environment(retro_environment_t cb)
|
||||
{
|
||||
static const struct retro_variable vars[] = {
|
||||
{ "port", "Port; 55400|55401|55402|55403|55404|55405|55406|55407|55408|55409|55410|55411|55412|55413|55414|55415|55416|55417|55418|55419|55420" },
|
||||
{ "ip_octet1", "IP address part 1; 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|35|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124|125|126|127|128|129|130|131|132|133|135|135|136|137|138|139|140|141|142|143|144|145|146|147|148|149|150|151|152|153|154|155|156|157|158|159|160|161|162|163|164|165|166|167|168|169|170|171|172|173|174|175|176|177|178|179|180|181|182|183|184|185|186|187|188|189|190|191|192|193|194|195|196|197|198|199|200|201|202|203|204|205|206|207|208|209|210|211|212|213|214|215|216|217|218|219|220|221|222|223|224|225|226|227|228|229|230|231|232|233|235|235|236|237|238|239|240|241|242|243|244|245|246|247|248|249|250|251|252|253|254|255" },
|
||||
{ "ip_octet2", "IP address part 2; 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|35|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124|125|126|127|128|129|130|131|132|133|135|135|136|137|138|139|140|141|142|143|144|145|146|147|148|149|150|151|152|153|154|155|156|157|158|159|160|161|162|163|164|165|166|167|168|169|170|171|172|173|174|175|176|177|178|179|180|181|182|183|184|185|186|187|188|189|190|191|192|193|194|195|196|197|198|199|200|201|202|203|204|205|206|207|208|209|210|211|212|213|214|215|216|217|218|219|220|221|222|223|224|225|226|227|228|229|230|231|232|233|235|235|236|237|238|239|240|241|242|243|244|245|246|247|248|249|250|251|252|253|254|255" },
|
||||
{ "ip_octet3", "IP address part 3; 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|35|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124|125|126|127|128|129|130|131|132|133|135|135|136|137|138|139|140|141|142|143|144|145|146|147|148|149|150|151|152|153|154|155|156|157|158|159|160|161|162|163|164|165|166|167|168|169|170|171|172|173|174|175|176|177|178|179|180|181|182|183|184|185|186|187|188|189|190|191|192|193|194|195|196|197|198|199|200|201|202|203|204|205|206|207|208|209|210|211|212|213|214|215|216|217|218|219|220|221|222|223|224|225|226|227|228|229|230|231|232|233|235|235|236|237|238|239|240|241|242|243|244|245|246|247|248|249|250|251|252|253|254|255" },
|
||||
{ "ip_octet4", "IP address part 4; 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|35|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124|125|126|127|128|129|130|131|132|133|135|135|136|137|138|139|140|141|142|143|144|145|146|147|148|149|150|151|152|153|154|155|156|157|158|159|160|161|162|163|164|165|166|167|168|169|170|171|172|173|174|175|176|177|178|179|180|181|182|183|184|185|186|187|188|189|190|191|192|193|194|195|196|197|198|199|200|201|202|203|204|205|206|207|208|209|210|211|212|213|214|215|216|217|218|219|220|221|222|223|224|225|226|227|228|229|230|231|232|233|235|235|236|237|238|239|240|241|242|243|244|245|246|247|248|249|250|251|252|253|254|255" },
|
||||
|
||||
{ NULL, NULL },
|
||||
};
|
||||
cb(RETRO_ENVIRONMENT_SET_VARIABLES, (void*)vars);
|
||||
|
||||
enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_RGB565;
|
||||
|
||||
environ_cb = cb;
|
||||
bool no_content = true;
|
||||
cb(RETRO_ENVIRONMENT_SET_SUPPORT_NO_GAME, &no_content);
|
||||
|
||||
environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt);
|
||||
|
||||
if (cb(RETRO_ENVIRONMENT_GET_LOG_INTERFACE, &logger))
|
||||
log_cb = logger.log;
|
||||
}
|
||||
|
||||
static void check_variables(void)
|
||||
{
|
||||
struct retro_variable var, var2, var3, var4, port_var;
|
||||
var.key = "ip_octet1";
|
||||
var2.key = "ip_octet2";
|
||||
var3.key = "ip_octet3";
|
||||
var4.key = "ip_octet4";
|
||||
port_var.key = "port";
|
||||
|
||||
environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var);
|
||||
environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var2);
|
||||
environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var3);
|
||||
environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var4);
|
||||
environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &port_var);
|
||||
|
||||
snprintf(server, sizeof(server), "%s.%s.%s.%s", var.value, var2.value, var3.value, var4.value);
|
||||
port = atoi(port_var.value);
|
||||
}
|
||||
|
||||
void retro_set_audio_sample(retro_audio_sample_t cb)
|
||||
{
|
||||
audio_cb = cb;
|
||||
}
|
||||
|
||||
void retro_set_audio_sample_batch(
|
||||
retro_audio_sample_batch_t cb)
|
||||
{
|
||||
audio_batch_cb = cb;
|
||||
}
|
||||
|
||||
void retro_set_input_poll(retro_input_poll_t cb)
|
||||
{
|
||||
input_poll_cb = cb;
|
||||
}
|
||||
|
||||
void retro_set_input_state(retro_input_state_t cb)
|
||||
{
|
||||
input_state_cb = cb;
|
||||
}
|
||||
|
||||
void retro_set_video_refresh(retro_video_refresh_t cb)
|
||||
{
|
||||
video_cb = cb;
|
||||
}
|
||||
|
||||
void retro_reset(void)
|
||||
{}
|
||||
|
||||
void retro_run(void)
|
||||
{
|
||||
unsigned i;
|
||||
update_input();
|
||||
snprintf(message, sizeof(message), "%d", input_state);
|
||||
|
||||
/* send the message */
|
||||
if (sendto(s, message, strlen(message) , 0 , (struct sockaddr *) &si_other, slen)==-1)
|
||||
log_cb(RETRO_LOG_INFO, "Error sending data\n");
|
||||
|
||||
for (i = 0; i < 320 * 240; i++)
|
||||
frame_buf[i] = 4 << 5;
|
||||
video_cb(frame_buf, 320, 240, 640);
|
||||
}
|
||||
|
||||
bool retro_load_game(const struct retro_game_info *info)
|
||||
{
|
||||
(void)info;
|
||||
check_variables();
|
||||
|
||||
s = socket_create(
|
||||
"retropad",
|
||||
SOCKET_DOMAIN_INET,
|
||||
SOCKET_TYPE_DATAGRAM,
|
||||
SOCKET_PROTOCOL_UDP);
|
||||
|
||||
if (s == SOCKET_ERROR)
|
||||
log_cb(RETRO_LOG_INFO, "socket failed");
|
||||
|
||||
/* setup address structure */
|
||||
memset((char *) &si_other, 0, sizeof(si_other));
|
||||
|
||||
si_other.sin_family = AF_INET;
|
||||
si_other.sin_port = htons(port);
|
||||
#if defined(_WIN32) || defined(HAVE_SOCKET_LEGACY)
|
||||
si_other.sin_addr.S_un.S_addr = inet_addr(server);
|
||||
#else
|
||||
si_other.sin_addr.s_addr = inet_addr(server);
|
||||
|
||||
inet_aton(server , &si_other.sin_addr);
|
||||
#endif
|
||||
|
||||
log_cb(RETRO_LOG_INFO, "Server IP Address: %s\n" , server);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void retro_unload_game(void)
|
||||
{}
|
||||
|
||||
unsigned retro_get_region(void)
|
||||
{
|
||||
return RETRO_REGION_NTSC;
|
||||
}
|
||||
|
||||
bool retro_load_game_special(unsigned type,
|
||||
const struct retro_game_info *info, size_t num)
|
||||
{
|
||||
(void)type;
|
||||
(void)info;
|
||||
(void)num;
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t retro_serialize_size(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool retro_serialize(void *data, size_t size)
|
||||
{
|
||||
(void)data;
|
||||
(void)size;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool retro_unserialize(const void *data,
|
||||
size_t size)
|
||||
{
|
||||
(void)data;
|
||||
(void)size;
|
||||
return false;
|
||||
}
|
||||
|
||||
void *retro_get_memory_data(unsigned id)
|
||||
{
|
||||
(void)id;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
size_t retro_get_memory_size(unsigned id)
|
||||
{
|
||||
(void)id;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void retro_cheat_reset(void)
|
||||
{}
|
||||
|
||||
void retro_cheat_set(unsigned idx,
|
||||
bool enabled, const char *code)
|
||||
{
|
||||
(void)idx;
|
||||
(void)enabled;
|
||||
(void)code;
|
||||
}
|
||||
|
||||
|
||||
+4
-97
@@ -1,278 +1,185 @@
|
||||
|
||||
|
||||
ifeq ($(LIBRETRO), gambatte)
|
||||
APP_TITLE = Gambatte Libretro
|
||||
#APP_DESCRIPTION = Retroarch 3DS
|
||||
#APP_AUTHOR = Team Libretro
|
||||
APP_PRODUCT_CODE = RARCH-GAMBATTE
|
||||
APP_UNIQUE_ID = 0xBAC01
|
||||
APP_ICON = ctr/assets/gambatte.png
|
||||
#APP_BANNER = ctr/assets/libretro_banner.png
|
||||
#APP_AUDIO = ctr/assets/silent.wav
|
||||
|
||||
else ifeq ($(LIBRETRO), gpsp)
|
||||
APP_TITLE = gpSP Libretro
|
||||
#APP_DESCRIPTION = Retroarch 3DS
|
||||
#APP_AUTHOR = Team Libretro
|
||||
APP_PRODUCT_CODE = RARCH-GPSP
|
||||
APP_UNIQUE_ID = 0xBAC02
|
||||
APP_ICON = ctr/assets/gpsp.png
|
||||
#APP_BANNER = ctr/assets/libretro_banner.png
|
||||
#APP_AUDIO = ctr/assets/silent.wav
|
||||
APP_USE_SVCHAX = 1
|
||||
|
||||
else ifeq ($(LIBRETRO), fceumm)
|
||||
APP_TITLE = FCeumm Libretro
|
||||
#APP_DESCRIPTION = Retroarch 3DS
|
||||
#APP_AUTHOR = Team Libretro
|
||||
APP_PRODUCT_CODE = RARCH-FCEUMM
|
||||
APP_UNIQUE_ID = 0xBAC03
|
||||
APP_ICON = ctr/assets/fceumm.png
|
||||
#APP_BANNER = ctr/assets/libretro_banner.png
|
||||
#APP_AUDIO = ctr/assets/silent.wav
|
||||
|
||||
else ifeq ($(LIBRETRO), nestopia)
|
||||
APP_TITLE = Nestopia Libretro
|
||||
#APP_DESCRIPTION = Retroarch 3DS
|
||||
#APP_AUTHOR = Team Libretro
|
||||
APP_PRODUCT_CODE = RARCH-NESTOPIA
|
||||
APP_UNIQUE_ID = 0xBAC04
|
||||
APP_ICON = ctr/assets/nestopia.png
|
||||
#APP_BANNER = ctr/assets/libretro_banner.png
|
||||
#APP_AUDIO = ctr/assets/silent.wav
|
||||
|
||||
else ifeq ($(LIBRETRO), nxengine)
|
||||
APP_TITLE = NXengine Libretro
|
||||
#APP_DESCRIPTION = Retroarch 3DS
|
||||
#APP_AUTHOR = Team Libretro
|
||||
APP_PRODUCT_CODE = RARCH-NXENGINE
|
||||
APP_UNIQUE_ID = 0xBAC05
|
||||
APP_ICON = ctr/assets/nxengine.png
|
||||
#APP_BANNER = ctr/assets/libretro_banner.png
|
||||
#APP_AUDIO = ctr/assets/silent.wav
|
||||
|
||||
else ifeq ($(LIBRETRO), genesis_plus_gx)
|
||||
APP_TITLE = Genesis Plus GX Libretro
|
||||
#APP_DESCRIPTION = Retroarch 3DS
|
||||
#APP_AUTHOR = Team Libretro
|
||||
APP_PRODUCT_CODE = RARCH-GENPLUSGX
|
||||
APP_UNIQUE_ID = 0xBAC06
|
||||
APP_ICON = ctr/assets/genesis_plus_gx.png
|
||||
#APP_BANNER = ctr/assets/libretro_banner.png
|
||||
#APP_AUDIO = ctr/assets/silent.wav
|
||||
|
||||
else ifeq ($(LIBRETRO), catsfc)
|
||||
APP_TITLE = CATSFC Libretro
|
||||
#APP_DESCRIPTION = Retroarch 3DS
|
||||
#APP_AUTHOR = Team Libretro
|
||||
APP_PRODUCT_CODE = RARCH-CATSFC
|
||||
APP_UNIQUE_ID = 0xBAC07
|
||||
APP_ICON = ctr/assets/catsfc.png
|
||||
APP_BANNER = ctr/assets/catsfc_banner.png
|
||||
#APP_AUDIO = ctr/assets/silent.wav
|
||||
|
||||
else ifeq ($(LIBRETRO), mednafen_wswan)
|
||||
APP_TITLE = Mednafen wswan Libretro
|
||||
#APP_DESCRIPTION = Retroarch 3DS
|
||||
#APP_AUTHOR = Team Libretro
|
||||
APP_PRODUCT_CODE = RARCH-M-WSWAN
|
||||
APP_UNIQUE_ID = 0xBAC08
|
||||
APP_ICON = ctr/assets/mednafen_wswan.png
|
||||
#APP_BANNER = ctr/assets/libretro_banner.png
|
||||
#APP_AUDIO = ctr/assets/silent.wav
|
||||
|
||||
else ifeq ($(LIBRETRO), mednafen_vb)
|
||||
APP_TITLE = Mednafen VB Libretro
|
||||
#APP_DESCRIPTION = Retroarch 3DS
|
||||
#APP_AUTHOR = Team Libretro
|
||||
APP_PRODUCT_CODE = RARCH-M-VB
|
||||
APP_UNIQUE_ID = 0xBAC09
|
||||
APP_ICON = ctr/assets/mednafen_vb.png
|
||||
#APP_BANNER = ctr/assets/libretro_banner.png
|
||||
#APP_AUDIO = ctr/assets/silent.wav
|
||||
|
||||
else ifeq ($(LIBRETRO), mednafen_ngp)
|
||||
APP_TITLE = Mednafen NGP Libretro
|
||||
#APP_DESCRIPTION = Retroarch 3DS
|
||||
#APP_AUTHOR = Team Libretro
|
||||
APP_PRODUCT_CODE = RARCH-M-NGP
|
||||
APP_UNIQUE_ID = 0xBAC0A
|
||||
APP_ICON = ctr/assets/mednafen_ngp.png
|
||||
#APP_BANNER = ctr/assets/libretro_banner.png
|
||||
#APP_AUDIO = ctr/assets/silent.wav
|
||||
|
||||
else ifeq ($(LIBRETRO), 2048)
|
||||
APP_TITLE = 2048 Libretro
|
||||
#APP_DESCRIPTION = Retroarch 3DS
|
||||
#APP_AUTHOR = Team Libretro
|
||||
APP_PRODUCT_CODE = RARCH-2048
|
||||
APP_UNIQUE_ID = 0xBAC0B
|
||||
APP_ICON = ctr/assets/2048.png
|
||||
#APP_BANNER = ctr/assets/libretro_banner.png
|
||||
#APP_AUDIO = ctr/assets/silent.wav
|
||||
|
||||
else ifeq ($(LIBRETRO), picodrive)
|
||||
APP_TITLE = Picodrive Libretro
|
||||
#APP_DESCRIPTION = Retroarch 3DS
|
||||
#APP_AUTHOR = Team Libretro
|
||||
APP_PRODUCT_CODE = RARCH-PICODRIVE
|
||||
APP_UNIQUE_ID = 0xBAC0C
|
||||
APP_ICON = ctr/assets/picodrive.png
|
||||
APP_BANNER = ctr/assets/picodrive_banner.png
|
||||
#APP_AUDIO = ctr/assets/silent.wav
|
||||
APP_USE_SVCHAX = 1
|
||||
|
||||
else ifeq ($(LIBRETRO), snes9x_next)
|
||||
APP_TITLE = Snes9x Next Libretro
|
||||
#APP_DESCRIPTION = Retroarch 3DS
|
||||
#APP_AUTHOR = Team Libretro
|
||||
APP_PRODUCT_CODE = RARCH-SNES9XNEXT
|
||||
APP_UNIQUE_ID = 0xBAC0D
|
||||
APP_ICON = ctr/assets/snes9x_next.png
|
||||
#APP_BANNER = ctr/assets/libretro_banner.png
|
||||
#APP_AUDIO = ctr/assets/silent.wav
|
||||
|
||||
else ifeq ($(LIBRETRO), mgba)
|
||||
APP_TITLE = mGBA Libretro
|
||||
#APP_DESCRIPTION = Retroarch 3DS
|
||||
APP_AUTHOR = Jeffrey Pfau
|
||||
APP_PRODUCT_CODE = RARCH-MGBA
|
||||
APP_UNIQUE_ID = 0xBAC0E
|
||||
APP_ICON = ctr/assets/mgba.png
|
||||
#APP_BANNER = ctr/assets/libretro_banner.png
|
||||
#APP_AUDIO = ctr/assets/silent.wav
|
||||
|
||||
else ifeq ($(LIBRETRO), quicknes)
|
||||
APP_TITLE = QuickNES Libretro
|
||||
#APP_DESCRIPTION = Retroarch 3DS
|
||||
APP_AUTHOR = blargg, kode54
|
||||
APP_PRODUCT_CODE = RARCH-QUICKNES
|
||||
APP_UNIQUE_ID = 0xBAC0F
|
||||
APP_ICON = ctr/assets/quicknes.png
|
||||
#APP_BANNER = ctr/assets/libretro_banner.png
|
||||
#APP_AUDIO = ctr/assets/silent.wav
|
||||
|
||||
else ifeq ($(LIBRETRO), fb_alpha_neo)
|
||||
APP_TITLE = Neo Geo (FB Alpha)
|
||||
#APP_DESCRIPTION = Retroarch 3DS
|
||||
APP_AUTHOR = Team FB Alpha
|
||||
APP_PRODUCT_CODE = RARCH-FBANEOGEO
|
||||
APP_UNIQUE_ID = 0xBAC10
|
||||
APP_ICON = ctr/assets/fb_alpha_neo.png
|
||||
#APP_BANNER = ctr/assets/libretro_banner.png
|
||||
#APP_AUDIO = ctr/assets/silent.wav
|
||||
APP_SYSTEM_MODE = 80MB
|
||||
|
||||
else ifeq ($(LIBRETRO), fb_alpha_cps1)
|
||||
APP_TITLE = Final Burn Alpha - CPS-1
|
||||
#APP_DESCRIPTION = Retroarch 3DS
|
||||
APP_AUTHOR = Team FB Alpha
|
||||
APP_PRODUCT_CODE = RARCH-FBACPS1
|
||||
APP_UNIQUE_ID = 0xBAC11
|
||||
APP_ICON = ctr/assets/fb_alpha_cps1.png
|
||||
#APP_BANNER = ctr/assets/libretro_banner.png
|
||||
#APP_AUDIO = ctr/assets/silent.wav
|
||||
|
||||
else ifeq ($(LIBRETRO), fb_alpha_cps2)
|
||||
APP_TITLE = Final Burn Alpha - CPS-2
|
||||
#APP_DESCRIPTION = Retroarch 3DS
|
||||
APP_AUTHOR = Team FB Alpha
|
||||
APP_PRODUCT_CODE = RARCH-FBACPS2
|
||||
APP_UNIQUE_ID = 0xBAC12
|
||||
APP_ICON = ctr/assets/fb_alpha_cps2.png
|
||||
#APP_BANNER = ctr/assets/libretro_banner.png
|
||||
#APP_AUDIO = ctr/assets/silent.wav
|
||||
APP_SYSTEM_MODE = 80MB
|
||||
|
||||
else ifeq ($(LIBRETRO), catsfc_plus)
|
||||
APP_TITLE = CATSFC Plus Libretro
|
||||
#APP_DESCRIPTION = Retroarch 3DS
|
||||
#APP_AUTHOR = Team Libretro
|
||||
APP_PRODUCT_CODE = RARCH-CATSFCPLUS
|
||||
APP_UNIQUE_ID = 0xBAC13
|
||||
APP_ICON = ctr/assets/catsfc_plus.png
|
||||
#APP_BANNER = ctr/assets/libretro_banner.png
|
||||
#APP_AUDIO = ctr/assets/silent.wav
|
||||
|
||||
else ifeq ($(LIBRETRO), mednafen_pce_fast)
|
||||
APP_TITLE = Mednafen/Beetle PCE FAST
|
||||
#APP_DESCRIPTION = Retroarch 3DS
|
||||
APP_AUTHOR = Ryphecha
|
||||
APP_PRODUCT_CODE = RARCH-M-PCE-FAST
|
||||
APP_UNIQUE_ID = 0xBAC14
|
||||
APP_ICON = ctr/assets/mednafen_pce_fast.png
|
||||
#APP_BANNER = ctr/assets/libretro_banner.png
|
||||
#APP_AUDIO = ctr/assets/silent.wav
|
||||
|
||||
else ifeq ($(LIBRETRO), pcsx_rearmed)
|
||||
APP_TITLE = PCSX ReARMed
|
||||
#APP_DESCRIPTION = Retroarch 3DS
|
||||
APP_AUTHOR = PCSX Team, notaz, Exophase
|
||||
APP_PRODUCT_CODE = RARCH-PCSXRARMD
|
||||
APP_UNIQUE_ID = 0xBAC15
|
||||
APP_ICON = ctr/assets/pcsx_rearmed.png
|
||||
#APP_BANNER = ctr/assets/libretro_banner.png
|
||||
#APP_AUDIO = ctr/assets/silent.wav
|
||||
|
||||
APP_USE_SVCHAX = 1
|
||||
|
||||
else ifeq ($(LIBRETRO), fmsx)
|
||||
APP_TITLE = fMSX
|
||||
#APP_DESCRIPTION = Retroarch 3DS
|
||||
APP_AUTHOR = Marat Fayzullin
|
||||
APP_PRODUCT_CODE = RARCH-FMSX
|
||||
APP_UNIQUE_ID = 0xBAC16
|
||||
APP_ICON = ctr/assets/fmsx.png
|
||||
#APP_BANNER = ctr/assets/libretro_banner.png
|
||||
#APP_AUDIO = ctr/assets/silent.wav
|
||||
|
||||
else ifeq ($(LIBRETRO), fb_alpha)
|
||||
APP_TITLE = Final Burn Alpha
|
||||
#APP_DESCRIPTION = Retroarch 3DS
|
||||
APP_AUTHOR = Team FB Alpha
|
||||
APP_PRODUCT_CODE = RARCH-FBA
|
||||
APP_UNIQUE_ID = 0xBAC17
|
||||
#APP_ICON = ctr/assets/default.png
|
||||
#APP_BANNER = ctr/assets/libretro_banner.png
|
||||
#APP_AUDIO = ctr/assets/silent.wav
|
||||
APP_BIG_TEXT_SECTION = 1
|
||||
|
||||
else ifeq ($(LIBRETRO), mame2003)
|
||||
APP_TITLE = MAME-2003
|
||||
#APP_DESCRIPTION = Retroarch 3DS
|
||||
#APP_AUTHOR = Team Libretro
|
||||
APP_PRODUCT_CODE = RARCH-MAME2003
|
||||
APP_UNIQUE_ID = 0xBAC18
|
||||
APP_ICON = ctr/assets/mame.png
|
||||
#APP_BANNER = ctr/assets/libretro_banner.png
|
||||
#APP_AUDIO = ctr/assets/silent.wav
|
||||
APP_BIG_TEXT_SECTION = 1
|
||||
|
||||
else ifeq ($(LIBRETRO), mame2000)
|
||||
APP_TITLE = MAME-2000
|
||||
#APP_DESCRIPTION = Retroarch 3DS
|
||||
#APP_AUTHOR = Team Libretro
|
||||
APP_PRODUCT_CODE = RARCH-MAME2000
|
||||
APP_UNIQUE_ID = 0xBAC19
|
||||
APP_ICON = ctr/assets/mame.png
|
||||
#APP_BANNER = ctr/assets/libretro_banner.png
|
||||
#APP_AUDIO = ctr/assets/silent.wav
|
||||
APP_BIG_TEXT_SECTION = 1
|
||||
|
||||
else ifeq ($(LIBRETRO), pocketsnes)
|
||||
APP_TITLE = Pocket Snes
|
||||
#APP_DESCRIPTION = Retroarch 3DS
|
||||
APP_AUTHOR = various
|
||||
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
|
||||
|
||||
endif
|
||||
+424
-62
@@ -1,8 +1,385 @@
|
||||
|
||||
#include <3ds.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <malloc.h>
|
||||
|
||||
static void svchax_gspwn(u32 dst, u32 src, u32 size, u8* flush_buffer)
|
||||
#define CURRENT_KTHREAD 0xFFFF9000
|
||||
#define CURRENT_KPROCESS 0xFFFF9004
|
||||
#define CURRENT_KPROCESS_HANDLE 0xFFFF8001
|
||||
#define RESOURCE_LIMIT_THREADS 0x2
|
||||
|
||||
#define MCH2_THREAD_COUNT_MAX 0x20
|
||||
#define MCH2_THREAD_STACKS_SIZE 0x1000
|
||||
|
||||
#define SVC_ACL_OFFSET(svc_id) (((svc_id) >> 5) << 2)
|
||||
#define SVC_ACL_MASK(svc_id) (0x1 << ((svc_id) & 0x1F))
|
||||
#define THREAD_PAGE_ACL_OFFSET 0xF38
|
||||
|
||||
u32 __ctr_svchax = 0;
|
||||
u32 __ctr_svchax_srv = 0;
|
||||
|
||||
extern void* __service_ptr;
|
||||
extern Handle gspEvents[GSPGPU_EVENT_MAX];
|
||||
|
||||
typedef u32(*backdoor_fn)(u32 arg0, u32 arg1);
|
||||
|
||||
__attribute((naked))
|
||||
static u32 svc_7b(backdoor_fn entry_fn, ...) // can pass up to two arguments to entry_fn(...)
|
||||
{
|
||||
__asm__ volatile(
|
||||
"push {r0, r1, r2} \n\t"
|
||||
"mov r3, sp \n\t"
|
||||
"add r0, pc, #12 \n\t"
|
||||
"svc 0x7B \n\t"
|
||||
"add sp, sp, #8 \n\t"
|
||||
"ldr r0, [sp], #4 \n\t"
|
||||
"bx lr \n\t"
|
||||
"cpsid aif \n\t"
|
||||
"ldr r2, [r3], #4 \n\t"
|
||||
"ldmfd r3!, {r0, r1} \n\t"
|
||||
"push {r3, lr} \n\t"
|
||||
"blx r2 \n\t"
|
||||
"pop {r3, lr} \n\t"
|
||||
"str r0, [r3, #-4]! \n\t"
|
||||
"bx lr \n\t");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void k_enable_all_svcs(u32 isNew3DS)
|
||||
{
|
||||
u32* thread_ACL = *(*(u32***)CURRENT_KTHREAD + 0x22) - 0x6;
|
||||
u32* process_ACL = *(u32**)CURRENT_KPROCESS + (isNew3DS ? 0x24 : 0x22);
|
||||
|
||||
memset(thread_ACL, 0xFF, 0x10);
|
||||
memset(process_ACL, 0xFF, 0x10);
|
||||
}
|
||||
|
||||
static u32 k_read_kaddr(u32* kaddr)
|
||||
{
|
||||
return *kaddr;
|
||||
}
|
||||
|
||||
static u32 read_kaddr(u32 kaddr)
|
||||
{
|
||||
return svc_7b((backdoor_fn)k_read_kaddr, kaddr);
|
||||
}
|
||||
|
||||
static u32 k_write_kaddr(u32* kaddr, u32 val)
|
||||
{
|
||||
*kaddr = val;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void write_kaddr(u32 kaddr, u32 val)
|
||||
{
|
||||
svc_7b((backdoor_fn)k_write_kaddr, kaddr, val);
|
||||
}
|
||||
|
||||
__attribute__((naked))
|
||||
static u32 get_thread_page(void)
|
||||
{
|
||||
__asm__ volatile(
|
||||
"sub r0, sp, #8 \n\t"
|
||||
"mov r1, #1 \n\t"
|
||||
"mov r2, #0 \n\t"
|
||||
"svc 0x2A \n\t"
|
||||
"mov r0, r1, LSR#12 \n\t"
|
||||
"mov r0, r0, LSL#12 \n\t"
|
||||
"bx lr \n\t");
|
||||
return 0;
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Handle started_event;
|
||||
Handle lock;
|
||||
volatile u32 target_kaddr;
|
||||
volatile u32 target_val;
|
||||
} mch2_thread_args_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u32* stack_top;
|
||||
Handle handle;
|
||||
bool keep;
|
||||
mch2_thread_args_t args;
|
||||
} mch2_thread_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u32 old_cpu_time_limit;
|
||||
u8 isNew3DS;
|
||||
u32 kernel_fcram_mapping_offset;
|
||||
|
||||
Handle arbiter;
|
||||
volatile u32 alloc_address;
|
||||
volatile u32 alloc_size;
|
||||
u8* flush_buffer;
|
||||
|
||||
Handle dummy_threads_lock;
|
||||
Handle target_threads_lock;
|
||||
Handle main_thread_lock;
|
||||
u32* thread_page_va;
|
||||
u32 thread_page_kva;
|
||||
|
||||
u32 threads_limit;
|
||||
Handle alloc_thread;
|
||||
Handle poll_thread;
|
||||
mch2_thread_t threads[MCH2_THREAD_COUNT_MAX];
|
||||
} mch2_vars_t;
|
||||
|
||||
static void alloc_thread_entry(mch2_vars_t* mch2)
|
||||
{
|
||||
u32 tmp;
|
||||
|
||||
svcControlMemory(&tmp, mch2->alloc_address, 0x0, mch2->alloc_size, MEMOP_ALLOC, MEMPERM_READ | MEMPERM_WRITE);
|
||||
svcExitThread();
|
||||
}
|
||||
|
||||
static void dummy_thread_entry(Handle lock)
|
||||
{
|
||||
svcWaitSynchronization(lock, U64_MAX);
|
||||
svcExitThread();
|
||||
}
|
||||
|
||||
static void check_tls_thread_entry(bool* keep)
|
||||
{
|
||||
*keep = !((u32)getThreadLocalStorage() & 0xFFF);
|
||||
svcExitThread();
|
||||
}
|
||||
|
||||
static void target_thread_entry(mch2_thread_args_t* args)
|
||||
{
|
||||
svcSignalEvent(args->started_event);
|
||||
svcWaitSynchronization(args->lock, U64_MAX);
|
||||
|
||||
if (args->target_kaddr)
|
||||
write_kaddr(args->target_kaddr, args->target_val);
|
||||
|
||||
svcExitThread();
|
||||
}
|
||||
|
||||
static u32 get_first_free_basemem_page(bool isNew3DS)
|
||||
{
|
||||
s64 v1;
|
||||
int memused_base;
|
||||
int memused_base_linear; // guessed
|
||||
|
||||
memused_base = osGetMemRegionUsed(MEMREGION_BASE);
|
||||
|
||||
svcGetSystemInfo(&v1, 2, 0);
|
||||
memused_base_linear = 0x6C000 + v1 +
|
||||
(osGetKernelVersion() > SYSTEM_VERSION(2, 49, 0) ? (isNew3DS ? 0x2000 : 0x1000) : 0x0);
|
||||
|
||||
return (osGetKernelVersion() > SYSTEM_VERSION(2, 40, 0) ? 0xE0000000 : 0xF0000000) // kernel FCRAM mapping
|
||||
+ (isNew3DS ? 0x10000000 : 0x08000000) // FCRAM size
|
||||
- (memused_base - memused_base_linear) // memory usage for pages allocated without the MEMOP_LINEAR flag
|
||||
- 0x1000; // skip to the start addr of the next free page
|
||||
|
||||
}
|
||||
|
||||
static u32 get_threads_limit(void)
|
||||
{
|
||||
Handle resource_limit_handle;
|
||||
s64 thread_limit_current;
|
||||
s64 thread_limit_max;
|
||||
u32 thread_limit_name = RESOURCE_LIMIT_THREADS;
|
||||
|
||||
svcGetResourceLimit(&resource_limit_handle, CURRENT_KPROCESS_HANDLE);
|
||||
svcGetResourceLimitCurrentValues(&thread_limit_current, resource_limit_handle, &thread_limit_name, 1);
|
||||
svcGetResourceLimitLimitValues(&thread_limit_max, resource_limit_handle, &thread_limit_name, 1);
|
||||
svcCloseHandle(resource_limit_handle);
|
||||
|
||||
if (thread_limit_max > MCH2_THREAD_COUNT_MAX)
|
||||
thread_limit_max = MCH2_THREAD_COUNT_MAX;
|
||||
|
||||
return thread_limit_max - thread_limit_current;
|
||||
}
|
||||
|
||||
static void do_memchunkhax2(void)
|
||||
{
|
||||
static u8 flush_buffer[0x8000];
|
||||
static u8 thread_stacks[MCH2_THREAD_STACKS_SIZE];
|
||||
|
||||
int i;
|
||||
u32 tmp;
|
||||
mch2_vars_t mch2 = {0};
|
||||
|
||||
mch2.flush_buffer = flush_buffer;
|
||||
mch2.threads_limit = get_threads_limit();
|
||||
mch2.kernel_fcram_mapping_offset = (osGetKernelVersion() > SYSTEM_VERSION(2, 40, 0)) ? 0xC0000000 : 0xD0000000;
|
||||
|
||||
for (i = 0; i < MCH2_THREAD_COUNT_MAX; i++)
|
||||
mch2.threads[i].stack_top = (u32*)((u32)thread_stacks + (i + 1) * (MCH2_THREAD_STACKS_SIZE / MCH2_THREAD_COUNT_MAX));
|
||||
|
||||
aptOpenSession();
|
||||
APT_CheckNew3DS(&mch2.isNew3DS);
|
||||
APT_GetAppCpuTimeLimit(&mch2.old_cpu_time_limit);
|
||||
APT_SetAppCpuTimeLimit(5);
|
||||
aptCloseSession();
|
||||
|
||||
for (i = 0; i < mch2.threads_limit; i++)
|
||||
{
|
||||
svcCreateThread(&mch2.threads[i].handle, (ThreadFunc)check_tls_thread_entry, (u32)&mch2.threads[i].keep,
|
||||
mch2.threads[i].stack_top, 0x18, 0);
|
||||
svcWaitSynchronization(mch2.threads[i].handle, U64_MAX);
|
||||
}
|
||||
|
||||
for (i = 0; i < mch2.threads_limit; i++)
|
||||
if (!mch2.threads[i].keep)
|
||||
svcCloseHandle(mch2.threads[i].handle);
|
||||
|
||||
svcCreateEvent(&mch2.dummy_threads_lock, 1);
|
||||
svcClearEvent(mch2.dummy_threads_lock);
|
||||
|
||||
for (i = 0; i < mch2.threads_limit; i++)
|
||||
if (!mch2.threads[i].keep)
|
||||
svcCreateThread(&mch2.threads[i].handle, (ThreadFunc)dummy_thread_entry, mch2.dummy_threads_lock,
|
||||
mch2.threads[i].stack_top, 0x3F - i, 0);
|
||||
|
||||
svcSignalEvent(mch2.dummy_threads_lock);
|
||||
|
||||
for (i = mch2.threads_limit - 1; i >= 0; i--)
|
||||
if (!mch2.threads[i].keep)
|
||||
{
|
||||
svcWaitSynchronization(mch2.threads[i].handle, U64_MAX);
|
||||
svcCloseHandle(mch2.threads[i].handle);
|
||||
mch2.threads[i].handle = 0;
|
||||
}
|
||||
|
||||
svcCloseHandle(mch2.dummy_threads_lock);
|
||||
|
||||
u32 fragmented_address = 0;
|
||||
|
||||
mch2.arbiter = __sync_get_arbiter();
|
||||
|
||||
u32 linear_buffer;
|
||||
svcControlMemory(&linear_buffer, 0, 0, 0x1000, MEMOP_ALLOC_LINEAR, MEMPERM_READ | MEMPERM_WRITE);
|
||||
|
||||
u32 linear_size = 0xF000;
|
||||
u32 skip_pages = 2;
|
||||
mch2.alloc_size = ((((linear_size - (skip_pages << 12)) + 0x1000) >> 13) << 12);
|
||||
u32 mem_free = osGetMemRegionFree(MEMREGION_APPLICATION);
|
||||
|
||||
u32 fragmented_size = mem_free - linear_size;
|
||||
extern u32 __heapBase;
|
||||
extern u32 __heap_size;
|
||||
fragmented_address = __heapBase + __heap_size;
|
||||
u32 linear_address;
|
||||
mch2.alloc_address = fragmented_address + fragmented_size;
|
||||
|
||||
svcControlMemory(&linear_address, 0x0, 0x0, linear_size, MEMOP_ALLOC_LINEAR,
|
||||
MEMPERM_READ | MEMPERM_WRITE);
|
||||
|
||||
if (fragmented_size)
|
||||
svcControlMemory(&tmp, (u32)fragmented_address, 0x0, fragmented_size, MEMOP_ALLOC,
|
||||
MEMPERM_READ | MEMPERM_WRITE);
|
||||
|
||||
if (skip_pages)
|
||||
svcControlMemory(&tmp, (u32)linear_address, 0x0, (skip_pages << 12), MEMOP_FREE, MEMPERM_DONTCARE);
|
||||
|
||||
for (i = skip_pages; i < (linear_size >> 12) ; i += 2)
|
||||
svcControlMemory(&tmp, (u32)linear_address + (i << 12), 0x0, 0x1000, MEMOP_FREE, MEMPERM_DONTCARE);
|
||||
|
||||
u32 alloc_address_kaddr = osConvertVirtToPhys((void*)linear_address) + mch2.kernel_fcram_mapping_offset;
|
||||
|
||||
mch2.thread_page_kva = get_first_free_basemem_page(mch2.isNew3DS) - 0x10000; // skip down 16 pages
|
||||
((u32*)linear_buffer)[0] = 1;
|
||||
((u32*)linear_buffer)[1] = mch2.thread_page_kva;
|
||||
((u32*)linear_buffer)[2] = alloc_address_kaddr + (((mch2.alloc_size >> 12) - 3) << 13) + (skip_pages << 12);
|
||||
|
||||
u32 dst_memchunk = linear_address + (((mch2.alloc_size >> 12) - 2) << 13) + (skip_pages << 12);
|
||||
|
||||
memcpy(flush_buffer, flush_buffer + 0x4000, 0x4000);
|
||||
|
||||
GSPGPU_InvalidateDataCache((void*)dst_memchunk, 16);
|
||||
GSPGPU_FlushDataCache((void*)linear_buffer, 16);
|
||||
memcpy(flush_buffer, flush_buffer + 0x4000, 0x4000);
|
||||
svcClearEvent(gspEvents[GSPGPU_EVENT_PPF]);
|
||||
|
||||
svcCreateThread(&mch2.alloc_thread, (ThreadFunc)alloc_thread_entry, (u32)&mch2,
|
||||
mch2.threads[MCH2_THREAD_COUNT_MAX - 1].stack_top, 0x3F, 1);
|
||||
|
||||
while ((u32) svcArbitrateAddress(mch2.arbiter, mch2.alloc_address, ARBITRATION_WAIT_IF_LESS_THAN_TIMEOUT, 0,
|
||||
0) == 0xD9001814);
|
||||
|
||||
GX_TextureCopy((void*)linear_buffer, 0, (void*)dst_memchunk, 0, 16, 8);
|
||||
memcpy(flush_buffer, flush_buffer + 0x4000, 0x4000);
|
||||
svcWaitSynchronization(gspEvents[GSPGPU_EVENT_PPF], U64_MAX);
|
||||
|
||||
svcWaitSynchronization(mch2.alloc_thread, U64_MAX);
|
||||
svcCloseHandle(mch2.alloc_thread);
|
||||
|
||||
u32* mapped_page = (u32*)(mch2.alloc_address + mch2.alloc_size - 0x1000);
|
||||
|
||||
volatile u32* thread_ACL = &mapped_page[THREAD_PAGE_ACL_OFFSET >> 2];
|
||||
|
||||
svcCreateEvent(&mch2.main_thread_lock, 0);
|
||||
svcCreateEvent(&mch2.target_threads_lock, 1);
|
||||
svcClearEvent(mch2.target_threads_lock);
|
||||
|
||||
for (i = 0; i < mch2.threads_limit; i++)
|
||||
{
|
||||
if (mch2.threads[i].keep)
|
||||
continue;
|
||||
|
||||
mch2.threads[i].args.started_event = mch2.main_thread_lock;
|
||||
mch2.threads[i].args.lock = mch2.target_threads_lock;
|
||||
mch2.threads[i].args.target_kaddr = 0;
|
||||
|
||||
thread_ACL[0] = 0;
|
||||
GSPGPU_FlushDataCache((void*)thread_ACL, 16);
|
||||
GSPGPU_InvalidateDataCache((void*)thread_ACL, 16);
|
||||
|
||||
svcClearEvent(mch2.main_thread_lock);
|
||||
svcCreateThread(&mch2.threads[i].handle, (ThreadFunc)target_thread_entry, (u32)&mch2.threads[i].args,
|
||||
mch2.threads[i].stack_top, 0x18, 0);
|
||||
svcWaitSynchronization(mch2.main_thread_lock, U64_MAX);
|
||||
|
||||
if (thread_ACL[0])
|
||||
{
|
||||
thread_ACL[SVC_ACL_OFFSET(0x7B) >> 2] = SVC_ACL_MASK(0x7B);
|
||||
GSPGPU_FlushDataCache((void*)thread_ACL, 16);
|
||||
GSPGPU_InvalidateDataCache((void*)thread_ACL, 16);
|
||||
mch2.threads[i].args.target_kaddr = get_thread_page() + THREAD_PAGE_ACL_OFFSET + SVC_ACL_OFFSET(0x7B);
|
||||
mch2.threads[i].args.target_val = SVC_ACL_MASK(0x7B);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
svcSignalEvent(mch2.target_threads_lock);
|
||||
|
||||
for (i = 0; i < mch2.threads_limit; i++)
|
||||
{
|
||||
if (!mch2.threads[i].handle)
|
||||
continue;
|
||||
|
||||
if (!mch2.threads[i].keep)
|
||||
svcWaitSynchronization(mch2.threads[i].handle, U64_MAX);
|
||||
|
||||
svcCloseHandle(mch2.threads[i].handle);
|
||||
}
|
||||
|
||||
svcCloseHandle(mch2.target_threads_lock);
|
||||
svcCloseHandle(mch2.main_thread_lock);
|
||||
|
||||
svcControlMemory(&tmp, mch2.alloc_address, 0, mch2.alloc_size, MEMOP_FREE, MEMPERM_DONTCARE);
|
||||
write_kaddr(alloc_address_kaddr + linear_size - 0x3000 + 0x4, alloc_address_kaddr + linear_size - 0x1000);
|
||||
svcControlMemory(&tmp, (u32)fragmented_address, 0x0, fragmented_size, MEMOP_FREE, MEMPERM_DONTCARE);
|
||||
|
||||
for (i = 1 + skip_pages; i < (linear_size >> 12) ; i += 2)
|
||||
svcControlMemory(&tmp, (u32)linear_address + (i << 12), 0x0, 0x1000, MEMOP_FREE, MEMPERM_DONTCARE);
|
||||
|
||||
svcControlMemory(&tmp, linear_buffer, 0, 0x1000, MEMOP_FREE, MEMPERM_DONTCARE);
|
||||
|
||||
aptOpenSession();
|
||||
APT_SetAppCpuTimeLimit(mch2.old_cpu_time_limit);
|
||||
aptCloseSession();
|
||||
}
|
||||
|
||||
|
||||
static void gspwn(u32 dst, u32 src, u32 size, u8* flush_buffer)
|
||||
{
|
||||
extern Handle gspEvents[GSPGPU_EVENT_MAX];
|
||||
|
||||
@@ -12,7 +389,7 @@ static void svchax_gspwn(u32 dst, u32 src, u32 size, u8* flush_buffer)
|
||||
memcpy(flush_buffer, flush_buffer + 0x4000, 0x4000);
|
||||
|
||||
svcClearEvent(gspEvents[GSPGPU_EVENT_PPF]);
|
||||
GX_TextureCopy((void*)src, 0, (void*)dst, 0, size, 8);
|
||||
GX_TextureCopy((void*)src, 0, (void*)dst, 0, size, 8);
|
||||
svcWaitSynchronization(gspEvents[GSPGPU_EVENT_PPF], U64_MAX);
|
||||
|
||||
memcpy(flush_buffer, flush_buffer + 0x4000, 0x4000);
|
||||
@@ -31,7 +408,7 @@ static void svchax_gspwn(u32 dst, u32 src, u32 size, u8* flush_buffer)
|
||||
// X-X--X-X
|
||||
// X-XXXX-X
|
||||
|
||||
static void memchunkhax_write_pair(u32 val1, u32 val2)
|
||||
static void memchunkhax1_write_pair(u32 val1, u32 val2)
|
||||
{
|
||||
u32 linear_buffer;
|
||||
u8* flush_buffer;
|
||||
@@ -52,25 +429,25 @@ static void memchunkhax_write_pair(u32 val1, u32 val2)
|
||||
svcControlMemory(&tmp, linear_buffer + 0x6000, 0, 0x1000, MEMOP_FREE, 0);
|
||||
|
||||
next_ptr1 = (u32*)(linear_buffer + 0x0004);
|
||||
svchax_gspwn(linear_buffer + 0x0000, linear_buffer + 0x1000, 16, flush_buffer);
|
||||
gspwn(linear_buffer + 0x0000, linear_buffer + 0x1000, 16, flush_buffer);
|
||||
|
||||
next_ptr3 = (u32*)(linear_buffer + 0x2004);
|
||||
prev_ptr3 = (u32*)(linear_buffer + 0x2008);
|
||||
svchax_gspwn(linear_buffer + 0x2000, linear_buffer + 0x3000, 16, flush_buffer);
|
||||
gspwn(linear_buffer + 0x2000, linear_buffer + 0x3000, 16, flush_buffer);
|
||||
|
||||
prev_ptr6 = (u32*)(linear_buffer + 0x5008);
|
||||
svchax_gspwn(linear_buffer + 0x5000, linear_buffer + 0x6000, 16, flush_buffer);
|
||||
gspwn(linear_buffer + 0x5000, linear_buffer + 0x6000, 16, flush_buffer);
|
||||
|
||||
*next_ptr1 = *next_ptr3;
|
||||
*prev_ptr6 = *prev_ptr3;
|
||||
|
||||
*prev_ptr3 = val1 - 4;
|
||||
*next_ptr3 = val2;
|
||||
svchax_gspwn(linear_buffer + 0x3000, linear_buffer + 0x2000, 16, flush_buffer);
|
||||
gspwn(linear_buffer + 0x3000, linear_buffer + 0x2000, 16, flush_buffer);
|
||||
svcControlMemory(&tmp, 0, 0, 0x2000, MEMOP_ALLOC_LINEAR, MEMPERM_READ | MEMPERM_WRITE);
|
||||
|
||||
svchax_gspwn(linear_buffer + 0x1000, linear_buffer + 0x0000, 16, flush_buffer);
|
||||
svchax_gspwn(linear_buffer + 0x6000, linear_buffer + 0x5000, 16, flush_buffer);
|
||||
gspwn(linear_buffer + 0x1000, linear_buffer + 0x0000, 16, flush_buffer);
|
||||
gspwn(linear_buffer + 0x6000, linear_buffer + 0x5000, 16, flush_buffer);
|
||||
|
||||
svcControlMemory(&tmp, linear_buffer + 0x0000, 0, 0x1000, MEMOP_FREE, 0);
|
||||
svcControlMemory(&tmp, linear_buffer + 0x2000, 0, 0x4000, MEMOP_FREE, 0);
|
||||
@@ -78,68 +455,53 @@ static void memchunkhax_write_pair(u32 val1, u32 val2)
|
||||
|
||||
}
|
||||
|
||||
|
||||
static inline u32 get_7B_access_ctrl_ptr(void)
|
||||
static void do_memchunkhax1(void)
|
||||
{
|
||||
register u32 r0 __asm__("r0");
|
||||
__asm__ volatile (
|
||||
"sub r0, sp, #8 \n\t"
|
||||
"mov r1, #1 \n\t"
|
||||
"mov r2, #0 \n\t"
|
||||
"svc 0x2A \n\t"
|
||||
"orr r0, r1, #0xF00 \n\t"
|
||||
"bic r0, r0, #0x0FF \n\t"
|
||||
"add r0, r0, #0x044 \n\t"
|
||||
:::"r0","r1","r2");
|
||||
return r0;
|
||||
u32 saved_vram_value = *(u32*)0x1F000008;
|
||||
|
||||
// 0x1F000000 contains the enable bit for svc 0x7B
|
||||
memchunkhax1_write_pair(get_thread_page() + THREAD_PAGE_ACL_OFFSET + SVC_ACL_OFFSET(0x7B), 0x1F000000);
|
||||
|
||||
write_kaddr(0x1F000008, saved_vram_value);
|
||||
}
|
||||
|
||||
static u32 saved_vram_value;
|
||||
|
||||
static s32 k_restore_vram_value(void)
|
||||
Result svchax_init(bool patch_srv)
|
||||
{
|
||||
__asm__ volatile("cpsid aif \n\t");
|
||||
u8 isNew3DS;
|
||||
aptOpenSession();
|
||||
APT_CheckNew3DS(&isNew3DS);
|
||||
aptCloseSession();
|
||||
|
||||
*(u32*)0x1F000008 = saved_vram_value;
|
||||
u32 kver = osGetKernelVersion();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static s32 k_enable_all_svc(void)
|
||||
{
|
||||
__asm__ volatile("cpsid aif");
|
||||
|
||||
u32* svc_access_control = *(*(u32***)0xFFFF9000 + 0x22) - 0x6;
|
||||
|
||||
svc_access_control[0]=0xFFFFFFFE;
|
||||
svc_access_control[1]=0xFFFFFFFF;
|
||||
svc_access_control[2]=0xFFFFFFFF;
|
||||
svc_access_control[3]=0x3FFFFFFF;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
u32 __ctr_svchax = 0;
|
||||
|
||||
void svchax_init(void)
|
||||
{
|
||||
extern void* __service_ptr;
|
||||
|
||||
if (__ctr_svchax)
|
||||
return;
|
||||
|
||||
if(__service_ptr)
|
||||
if (!__ctr_svchax)
|
||||
{
|
||||
if((*(u8*)0x1FF80002 > 0x2F) || (*(u8*)0x1FF80003 != 0x2))
|
||||
return;
|
||||
if (__service_ptr)
|
||||
{
|
||||
if (kver > SYSTEM_VERSION(2, 50, 11))
|
||||
return -1;
|
||||
else if (kver > SYSTEM_VERSION(2, 46, 0))
|
||||
do_memchunkhax2();
|
||||
else
|
||||
do_memchunkhax1();
|
||||
}
|
||||
|
||||
saved_vram_value = *(u32*)0x1F000008;
|
||||
memchunkhax_write_pair(get_7B_access_ctrl_ptr(), 0x1F000000);
|
||||
svcBackdoor(k_restore_vram_value);
|
||||
svc_7b((backdoor_fn)k_enable_all_svcs, isNew3DS);
|
||||
|
||||
__ctr_svchax = 1;
|
||||
}
|
||||
|
||||
svcBackdoor(k_enable_all_svc);
|
||||
if (patch_srv && !__ctr_svchax_srv)
|
||||
{
|
||||
u32 PID_kaddr = read_kaddr(CURRENT_KPROCESS) + (isNew3DS ? 0xBC : (kver > SYSTEM_VERSION(2, 40, 0)) ? 0xB4 : 0xAC);
|
||||
u32 old_PID = read_kaddr(PID_kaddr);
|
||||
write_kaddr(PID_kaddr, 0);
|
||||
srvExit();
|
||||
srvInit();
|
||||
write_kaddr(PID_kaddr, old_PID);
|
||||
|
||||
__ctr_svchax = 1;
|
||||
__ctr_svchax_srv = 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
+77
-75
@@ -5,6 +5,7 @@
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include "ctr_debug.h"
|
||||
|
||||
#define CTR_APPMEMALLOC_PTR ((u32*)0x1FF80040)
|
||||
@@ -33,7 +34,7 @@ void __system_allocateHeaps();
|
||||
void __system_initArgv();
|
||||
|
||||
void __ctru_exit(int rc);
|
||||
int __libctru_gtod(struct _reent *ptr, struct timeval *tp, struct timezone *tz);
|
||||
int __libctru_gtod(struct _reent* ptr, struct timeval* tp, struct timezone* tz);
|
||||
void (*__system_retAddr)(void);
|
||||
extern void* __service_ptr;
|
||||
|
||||
@@ -44,24 +45,25 @@ Result __sync_init(void) __attribute__((weak));
|
||||
|
||||
void __attribute__((weak)) __libctru_init(void (*retAddr)(void))
|
||||
{
|
||||
// Store the return address
|
||||
__system_retAddr = envIsHomebrew() ? retAddr : NULL;
|
||||
// Store the return address
|
||||
__system_retAddr = envIsHomebrew() ? retAddr : NULL;
|
||||
|
||||
// Initialize the synchronization subsystem
|
||||
__sync_init();
|
||||
// Initialize the synchronization subsystem
|
||||
__sync_init();
|
||||
|
||||
// Initialize newlib support system calls
|
||||
__system_initSyscalls();
|
||||
// Initialize newlib support system calls
|
||||
__system_initSyscalls();
|
||||
|
||||
// Allocate application and linear heaps
|
||||
__system_allocateHeaps();
|
||||
// Allocate application and linear heaps
|
||||
__system_allocateHeaps();
|
||||
|
||||
// Build argc/argv if present
|
||||
__system_initArgv();
|
||||
// Build argc/argv if present
|
||||
__system_initArgv();
|
||||
|
||||
}
|
||||
void __system_allocateHeaps() {
|
||||
u32 tmp=0;
|
||||
void __system_allocateHeaps()
|
||||
{
|
||||
u32 tmp = 0;
|
||||
|
||||
MemInfo stack_memInfo;
|
||||
PageInfo stack_pageInfo;
|
||||
@@ -72,7 +74,7 @@ void __system_allocateHeaps() {
|
||||
|
||||
__stacksize__ += 0xFFF;
|
||||
__stacksize__ &= ~0xFFF;
|
||||
__stack_size_extra = __stacksize__ > stack_memInfo.size ? __stacksize__ - stack_memInfo.size: 0;
|
||||
__stack_size_extra = __stacksize__ > stack_memInfo.size ? __stacksize__ - stack_memInfo.size : 0;
|
||||
__stack_bottom = stack_memInfo.base_addr - __stack_size_extra;
|
||||
|
||||
if (__stack_size_extra)
|
||||
@@ -81,13 +83,13 @@ void __system_allocateHeaps() {
|
||||
memset((void*)__stack_bottom, 0xFC, __stack_size_extra);
|
||||
}
|
||||
|
||||
// setup the application heap
|
||||
__heapBase = 0x08000000;
|
||||
// setup the application heap
|
||||
__heapBase = 0x08000000;
|
||||
__heap_size = 0;
|
||||
|
||||
// Allocate the linear heap
|
||||
svcControlMemory(&__linear_heap, 0x0, 0x0, __linear_heap_size, MEMOP_ALLOC_LINEAR, MEMPERM_READ | MEMPERM_WRITE);
|
||||
// Set up newlib heap
|
||||
// Allocate the linear heap
|
||||
svcControlMemory(&__linear_heap, 0x0, 0x0, __linear_heap_size, MEMOP_ALLOC_LINEAR, MEMPERM_READ | MEMPERM_WRITE);
|
||||
// Set up newlib heap
|
||||
extern char* fake_heap_end;
|
||||
fake_heap_end = (char*)0x13F00000;
|
||||
|
||||
@@ -98,32 +100,32 @@ Result __sync_fini(void) __attribute__((weak));
|
||||
extern char** __system_argv;
|
||||
void __attribute__((noreturn)) __libctru_exit(int rc)
|
||||
{
|
||||
u32 tmp=0;
|
||||
u32 tmp = 0;
|
||||
|
||||
if(__system_argv)
|
||||
if (__system_argv)
|
||||
free(__system_argv);
|
||||
|
||||
// Unmap the linear heap
|
||||
svcControlMemory(&tmp, __linear_heap, 0x0, __linear_heap_size, MEMOP_FREE, 0x0);
|
||||
// Unmap the linear heap
|
||||
svcControlMemory(&tmp, __linear_heap, 0x0, __linear_heap_size, MEMOP_FREE, 0x0);
|
||||
|
||||
// Unmap the application heap
|
||||
svcControlMemory(&tmp, __heapBase, 0x0, __heap_size, MEMOP_FREE, 0x0);
|
||||
// Unmap the application heap
|
||||
svcControlMemory(&tmp, __heapBase, 0x0, __heap_size, MEMOP_FREE, 0x0);
|
||||
|
||||
if (__stack_size_extra)
|
||||
svcControlMemory(&tmp, __stack_bottom, 0x0, __stack_size_extra, MEMOP_FREE, 0x0);
|
||||
|
||||
// Close some handles
|
||||
envDestroyHandles();
|
||||
// Close some handles
|
||||
envDestroyHandles();
|
||||
|
||||
if (__sync_fini)
|
||||
__sync_fini();
|
||||
__sync_fini();
|
||||
|
||||
// Jump to the loader if it provided a callback
|
||||
if (__system_retAddr)
|
||||
__system_retAddr();
|
||||
// Jump to the loader if it provided a callback
|
||||
if (__system_retAddr)
|
||||
__system_retAddr();
|
||||
|
||||
// Since above did not jump, end this process
|
||||
svcExitProcess();
|
||||
// Since above did not jump, end this process
|
||||
svcExitProcess();
|
||||
}
|
||||
|
||||
#include <3ds/types.h>
|
||||
@@ -135,50 +137,48 @@ int __system_argc;
|
||||
char** __system_argv;
|
||||
extern const char* __system_arglist;
|
||||
|
||||
//extern char* fake_heap_start;
|
||||
extern char* fake_heap_end;
|
||||
|
||||
void __system_initArgv()
|
||||
{
|
||||
int i;
|
||||
const char* temp = __system_arglist;
|
||||
int i;
|
||||
struct
|
||||
{
|
||||
u32 argc;
|
||||
char args[];
|
||||
}*arg_struct = (void*)__system_arglist;
|
||||
|
||||
// Check if the argument list is present
|
||||
if (!temp)
|
||||
return;
|
||||
__system_argc = 0;
|
||||
|
||||
// Retrieve argc
|
||||
__system_argc = *(u32*)temp;
|
||||
temp += sizeof(u32);
|
||||
if (arg_struct)
|
||||
__system_argc = arg_struct->argc;
|
||||
|
||||
// Find the end of the argument data
|
||||
for (i = 0; i < __system_argc; i ++)
|
||||
{
|
||||
for (; *temp; temp ++);
|
||||
temp ++;
|
||||
}
|
||||
if (__system_argc)
|
||||
{
|
||||
__system_argv = (char**) malloc((__system_argc + 1) * sizeof(char**));
|
||||
__system_argv[0] = arg_struct->args;
|
||||
for (i = 1; i < __system_argc; i++)
|
||||
__system_argv[i] = __system_argv[i - 1] + strlen(__system_argv[i - 1]) + 1;
|
||||
|
||||
// Reserve heap memory for argv data
|
||||
u32 argSize = temp - __system_arglist - sizeof(u32);
|
||||
// __system_argv = (char**)fake_heap_start;
|
||||
// fake_heap_start += sizeof(char**)*(__system_argc + 1);
|
||||
// char* argCopy = fake_heap_start;
|
||||
// fake_heap_start += argSize;
|
||||
|
||||
__system_argv = malloc(sizeof(char**)*(__system_argc + 1) + argSize);
|
||||
char* argCopy = (char*)__system_argv + sizeof(char**)*(__system_argc + 1);
|
||||
|
||||
|
||||
// Fill argv array
|
||||
memcpy(argCopy, &__system_arglist[4], argSize);
|
||||
temp = argCopy;
|
||||
for (i = 0; i < __system_argc; i ++)
|
||||
{
|
||||
__system_argv[i] = (char*)temp;
|
||||
for (; *temp; temp ++);
|
||||
temp ++;
|
||||
}
|
||||
__system_argv[__system_argc] = NULL;
|
||||
i = __system_argc - 1;
|
||||
__system_argc = 1;
|
||||
while (i)
|
||||
{
|
||||
if(__system_argv[i] && isalnum(__system_argv[i][0])
|
||||
&& strncmp(__system_argv[i], "3dslink:/", 9))
|
||||
{
|
||||
__system_argv[1] = __system_argv[i];
|
||||
__system_argc = 2;
|
||||
break;
|
||||
}
|
||||
i--;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
__system_argc = 1;
|
||||
__system_argv = (char**) malloc(sizeof(char**) * 2);
|
||||
__system_argv[0] = "sdmc:/retroarch/retroarch";
|
||||
}
|
||||
__system_argv[__system_argc] = NULL;
|
||||
}
|
||||
|
||||
void initSystem(void (*retAddr)(void))
|
||||
@@ -195,7 +195,8 @@ void __attribute__((noreturn)) __ctru_exit(int rc)
|
||||
__libctru_exit(rc);
|
||||
}
|
||||
|
||||
typedef union{
|
||||
typedef union
|
||||
{
|
||||
struct
|
||||
{
|
||||
unsigned description : 10;
|
||||
@@ -205,7 +206,7 @@ typedef union{
|
||||
unsigned level : 5;
|
||||
};
|
||||
Result val;
|
||||
}ctr_result_value;
|
||||
} ctr_result_value;
|
||||
|
||||
void dump_result_value(Result val)
|
||||
{
|
||||
@@ -225,7 +226,7 @@ void wait_for_input(void)
|
||||
printf("\n\nPress Start.\n\n");
|
||||
fflush(stdout);
|
||||
|
||||
while(aptMainLoop())
|
||||
while (aptMainLoop())
|
||||
{
|
||||
u32 kDown;
|
||||
|
||||
@@ -238,6 +239,7 @@ void wait_for_input(void)
|
||||
|
||||
if (kDown & KEY_SELECT)
|
||||
exit(0);
|
||||
|
||||
#if 0
|
||||
select_pressed = true;
|
||||
#endif
|
||||
@@ -249,7 +251,7 @@ void wait_for_input(void)
|
||||
|
||||
long sysconf(int name)
|
||||
{
|
||||
switch(name)
|
||||
switch (name)
|
||||
{
|
||||
case _SC_NPROCESSORS_ONLN:
|
||||
return 2;
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
|
||||
#include <retro_endianness.h>
|
||||
|
||||
#include "dir_list_special.h"
|
||||
#include "list_special.h"
|
||||
#include "database_info.h"
|
||||
#include "msg_hash.h"
|
||||
#include "verbosity.h"
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#include <file/file_archive.h>
|
||||
#include <file/archive_file.h>
|
||||
|
||||
#include "libretro-db/libretrodb.h"
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ struct defaults
|
||||
char remap[PATH_MAX_LENGTH];
|
||||
char cache[PATH_MAX_LENGTH];
|
||||
char wallpapers[PATH_MAX_LENGTH];
|
||||
char thumbnails[PATH_MAX_LENGTH];
|
||||
char database[PATH_MAX_LENGTH];
|
||||
char cursor[PATH_MAX_LENGTH];
|
||||
char cheats[PATH_MAX_LENGTH];
|
||||
@@ -67,6 +68,7 @@ struct defaults
|
||||
int out_latency;
|
||||
float video_refresh_rate;
|
||||
bool video_threaded_enable;
|
||||
char menu[PATH_MAX_LENGTH];
|
||||
} settings;
|
||||
|
||||
#ifndef IS_SALAMANDER
|
||||
|
||||
@@ -20,8 +20,6 @@
|
||||
#if defined(HAVE_D3D9)
|
||||
/* Direct3D 9 */
|
||||
#include <d3d9.h>
|
||||
#include <d3dx9.h>
|
||||
#include <d3dx9core.h>
|
||||
|
||||
#define LPDIRECT3D LPDIRECT3D9
|
||||
#define LPDIRECT3DDEVICE LPDIRECT3DDEVICE9
|
||||
|
||||
Vendored
+1
-1
Submodule deps/glslang/glslang updated: f2d8a5c53f...5ace09a75b.
Vendored
+2
-1
@@ -356,7 +356,8 @@ bool glslang::compile_spirv(const string &source, Stage stage, std::vector<uint3
|
||||
shader.setStrings(&src, 1);
|
||||
|
||||
string msg;
|
||||
if (!shader.preprocess(&process.GetResources(), 100, ENoProfile, false, false, EShMsgDefault, &msg, TShader::ForbidInclude()))
|
||||
auto forbid_include = TShader::ForbidInclude();
|
||||
if (!shader.preprocess(&process.GetResources(), 100, ENoProfile, false, false, EShMsgDefault, &msg, forbid_include))
|
||||
{
|
||||
fprintf(stderr, "%s\n", msg.c_str());
|
||||
return {};
|
||||
|
||||
Vendored
-7499
File diff suppressed because it is too large.
Load diff
Vendored
-357
@@ -1,357 +0,0 @@
|
||||
/* 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 */
|
||||
Vendored
-2
@@ -1,2 +0,0 @@
|
||||
#!/bin/sh
|
||||
bison --defines=glslang_tab.cpp.h -o glslang_tab.cpp -t glslang/glslang/MachineIndependent/glslang.y
|
||||
+1
Submodule deps/spir2cross added at 0ae2bcc3d0.
Vendored
-43
@@ -1,43 +0,0 @@
|
||||
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)
|
||||
Vendored
-17
@@ -1,17 +0,0 @@
|
||||
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.
|
||||
Vendored
-89
@@ -1,89 +0,0 @@
|
||||
# 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);
|
||||
```
|
||||

|
||||
|
||||
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
+19498
File diff suppressed because it is too large.
Load diff
Vendored
-545
@@ -1,545 +0,0 @@
|
||||
/* 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
|
||||
Vendored
-3218
File diff suppressed because it is too large.
Load diff
Vendored
-14266
File diff suppressed because it is too large.
Load diff
Vendored
-2017
File diff suppressed because it is too large.
Load diff
@@ -1,78 +0,0 @@
|
||||
/* 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.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <file/dir_list.h>
|
||||
|
||||
#include "dir_list_special.h"
|
||||
#include "frontend/frontend_driver.h"
|
||||
#include "configuration.h"
|
||||
#include "core_info.h"
|
||||
|
||||
struct string_list *dir_list_new_special(const char *input_dir,
|
||||
enum dir_list_type type, const char *filter)
|
||||
{
|
||||
char ext_name[PATH_MAX_LENGTH];
|
||||
const char *dir = NULL;
|
||||
const char *exts = NULL;
|
||||
bool include_dirs = false;
|
||||
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
(void)input_dir;
|
||||
(void)settings;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case DIR_LIST_CORES:
|
||||
dir = settings->libretro_directory;
|
||||
|
||||
if (!frontend_driver_get_core_extension(ext_name, sizeof(ext_name)))
|
||||
return NULL;
|
||||
|
||||
exts = ext_name;
|
||||
break;
|
||||
case DIR_LIST_CORE_INFO:
|
||||
{
|
||||
core_info_list_t *list = NULL;
|
||||
core_info_ctl(CORE_INFO_CTL_LIST_GET, &list);
|
||||
|
||||
dir = input_dir;
|
||||
exts = list->all_ext;
|
||||
}
|
||||
break;
|
||||
case DIR_LIST_SHADERS:
|
||||
dir = settings->video.shader_dir;
|
||||
exts = "cg|cgp|glsl|glslp|slang|slangp";
|
||||
break;
|
||||
case DIR_LIST_COLLECTIONS:
|
||||
dir = settings->playlist_directory;
|
||||
exts = "lpl";
|
||||
break;
|
||||
case DIR_LIST_DATABASES:
|
||||
dir = settings->content_database;
|
||||
exts = "rdb";
|
||||
break;
|
||||
case DIR_LIST_PLAIN:
|
||||
dir = input_dir;
|
||||
exts = filter;
|
||||
break;
|
||||
case DIR_LIST_NONE:
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return dir_list_new(dir, exts, include_dirs, type == DIR_LIST_CORE_INFO);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
RARCH_VERSION=1.3.0
|
||||
RARCH_VERSION=1.3.4
|
||||
PLATFORM=$1
|
||||
SALAMANDER=no
|
||||
MAKEFILE_GRIFFIN=no
|
||||
|
||||
@@ -288,10 +288,6 @@ static void menu_update_libretro_info(void)
|
||||
if (!info)
|
||||
return;
|
||||
|
||||
#ifndef HAVE_DYNAMIC
|
||||
retro_get_system_info(info);
|
||||
#endif
|
||||
|
||||
event_cmd_ctl(EVENT_CMD_CORE_INFO_INIT, NULL);
|
||||
event_cmd_ctl(EVENT_CMD_LOAD_CORE_PERSIST, NULL);
|
||||
}
|
||||
@@ -342,7 +338,10 @@ static void init_drivers(int flags)
|
||||
}
|
||||
|
||||
if (flags & DRIVER_AUDIO)
|
||||
{
|
||||
audio_driver_ctl(RARCH_AUDIO_CTL_INIT, NULL);
|
||||
audio_driver_ctl(RARCH_AUDIO_CTL_DEVICES_LIST_NEW, NULL);
|
||||
}
|
||||
|
||||
/* Only initialize camera driver if we're ever going to use it. */
|
||||
if ((flags & DRIVER_CAMERA) && camera_driver_ctl(RARCH_CAMERA_CTL_IS_ACTIVE, NULL))
|
||||
@@ -447,6 +446,11 @@ bool driver_ctl(enum driver_ctl_state state, void *data)
|
||||
uninit_drivers(*flags);
|
||||
}
|
||||
break;
|
||||
case RARCH_DRIVER_CTL_UNINIT_ALL:
|
||||
{
|
||||
int flags = DRIVERS_CMD_ALL;
|
||||
return driver_ctl(RARCH_DRIVER_CTL_UNINIT, &flags);
|
||||
}
|
||||
case RARCH_DRIVER_CTL_INIT:
|
||||
{
|
||||
int *flags = (int*)data;
|
||||
@@ -455,6 +459,11 @@ bool driver_ctl(enum driver_ctl_state state, void *data)
|
||||
init_drivers(*flags);
|
||||
}
|
||||
break;
|
||||
case RARCH_DRIVER_CTL_INIT_ALL:
|
||||
{
|
||||
int flags = DRIVERS_CMD_ALL;
|
||||
return driver_ctl(RARCH_DRIVER_CTL_INIT, &flags);
|
||||
}
|
||||
case RARCH_DRIVER_CTL_INIT_PRE:
|
||||
audio_driver_ctl(RARCH_AUDIO_CTL_FIND_DRIVER, NULL);
|
||||
video_driver_ctl(RARCH_DISPLAY_CTL_FIND_DRIVER, NULL);
|
||||
|
||||
@@ -28,61 +28,12 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "input/input_defines.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define AUDIO_CHUNK_SIZE_BLOCKING 512
|
||||
|
||||
/* So we don't get complete line-noise when fast-forwarding audio. */
|
||||
#define AUDIO_CHUNK_SIZE_NONBLOCKING 2048
|
||||
|
||||
#define AUDIO_MAX_RATIO 16
|
||||
|
||||
/* Specialized _MOUSE that targets the full screen regardless of viewport.
|
||||
*/
|
||||
#define RARCH_DEVICE_MOUSE_SCREEN (RETRO_DEVICE_MOUSE | 0x10000)
|
||||
|
||||
/* Specialized _POINTER that targets the full screen regardless of viewport.
|
||||
* Should not be used by a libretro implementation as coordinates returned
|
||||
* make no sense.
|
||||
*
|
||||
* It is only used internally for overlays. */
|
||||
#define RARCH_DEVICE_POINTER_SCREEN (RETRO_DEVICE_POINTER | 0x10000)
|
||||
|
||||
#define RARCH_DEVICE_ID_POINTER_BACK (RETRO_DEVICE_ID_POINTER_PRESSED | 0x10000)
|
||||
|
||||
/* libretro has 16 buttons from 0-15 (libretro.h)
|
||||
* Analog binds use RETRO_DEVICE_ANALOG, but we follow the same scheme
|
||||
* internally in RetroArch for simplicity, so they are mapped into [16, 23].
|
||||
*/
|
||||
#define RARCH_FIRST_CUSTOM_BIND 16
|
||||
#define RARCH_FIRST_META_KEY RARCH_CUSTOM_BIND_LIST_END
|
||||
|
||||
#define AXIS_NEG(x) (((uint32_t)(x) << 16) | UINT16_C(0xFFFF))
|
||||
#define AXIS_POS(x) ((uint32_t)(x) | UINT32_C(0xFFFF0000))
|
||||
#define AXIS_NONE UINT32_C(0xFFFFFFFF)
|
||||
#define AXIS_DIR_NONE UINT16_C(0xFFFF)
|
||||
|
||||
#define AXIS_NEG_GET(x) (((uint32_t)(x) >> 16) & UINT16_C(0xFFFF))
|
||||
#define AXIS_POS_GET(x) ((uint32_t)(x) & UINT16_C(0xFFFF))
|
||||
|
||||
#define NO_BTN UINT16_C(0xFFFF)
|
||||
|
||||
#define HAT_UP_SHIFT 15
|
||||
#define HAT_DOWN_SHIFT 14
|
||||
#define HAT_LEFT_SHIFT 13
|
||||
#define HAT_RIGHT_SHIFT 12
|
||||
#define HAT_UP_MASK (1 << HAT_UP_SHIFT)
|
||||
#define HAT_DOWN_MASK (1 << HAT_DOWN_SHIFT)
|
||||
#define HAT_LEFT_MASK (1 << HAT_LEFT_SHIFT)
|
||||
#define HAT_RIGHT_MASK (1 << HAT_RIGHT_SHIFT)
|
||||
#define HAT_MAP(x, hat) ((x & ((1 << 12) - 1)) | hat)
|
||||
|
||||
#define HAT_MASK (HAT_UP_MASK | HAT_DOWN_MASK | HAT_LEFT_MASK | HAT_RIGHT_MASK)
|
||||
#define GET_HAT_DIR(x) (x & HAT_MASK)
|
||||
#define GET_HAT(x) (x & (~HAT_MASK))
|
||||
|
||||
#define DRIVERS_CMD_ALL \
|
||||
( DRIVER_AUDIO \
|
||||
| DRIVER_VIDEO \
|
||||
@@ -152,14 +103,6 @@ enum
|
||||
RARCH_BIND_LIST_END_NULL
|
||||
};
|
||||
|
||||
enum analog_dpad_mode
|
||||
{
|
||||
ANALOG_DPAD_NONE = 0,
|
||||
ANALOG_DPAD_LSTICK,
|
||||
ANALOG_DPAD_RSTICK,
|
||||
ANALOG_DPAD_LAST
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
DRIVER_AUDIO = 1 << 0,
|
||||
@@ -179,10 +122,15 @@ enum driver_ctl_state
|
||||
* @data is a bitmask which determines
|
||||
* which drivers get deinitialized. */
|
||||
RARCH_DRIVER_CTL_UNINIT,
|
||||
|
||||
RARCH_DRIVER_CTL_UNINIT_ALL,
|
||||
|
||||
/* Initializes drivers.
|
||||
* @data is a bitmask which determines
|
||||
* which drivers get initialized. */
|
||||
RARCH_DRIVER_CTL_INIT,
|
||||
|
||||
RARCH_DRIVER_CTL_INIT_ALL,
|
||||
/* Attempts to find a default driver for
|
||||
* all driver types.
|
||||
*
|
||||
|
||||
@@ -29,7 +29,9 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "dynamic.h"
|
||||
#include "command_event.h"
|
||||
|
||||
#include "audio/audio_driver.h"
|
||||
#include "camera/camera_driver.h"
|
||||
#include "location/location_driver.h"
|
||||
@@ -113,7 +115,23 @@ libretro_find_controller_description(
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef HAVE_DYNAMIC
|
||||
/**
|
||||
* libretro_free_system_info:
|
||||
* @info : Pointer to system info information.
|
||||
*
|
||||
* Frees system information.
|
||||
**/
|
||||
void libretro_free_system_info(struct retro_system_info *info)
|
||||
{
|
||||
if (!info)
|
||||
return;
|
||||
|
||||
free((void*)info->library_name);
|
||||
free((void*)info->library_version);
|
||||
free((void*)info->valid_extensions);
|
||||
memset(info, 0, sizeof(*info));
|
||||
}
|
||||
|
||||
static bool *load_no_content_hook;
|
||||
|
||||
static bool environ_cb_get_system_info(unsigned cmd, void *data)
|
||||
@@ -131,6 +149,42 @@ static bool environ_cb_get_system_info(unsigned cmd, void *data)
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifndef HAVE_DYNAMIC
|
||||
bool libretro_get_system_info_static(struct retro_system_info *info,
|
||||
bool *load_no_content)
|
||||
{
|
||||
struct retro_system_info dummy_info = {0};
|
||||
|
||||
if (load_no_content)
|
||||
{
|
||||
load_no_content_hook = load_no_content;
|
||||
|
||||
/* load_no_content gets set in this callback. */
|
||||
retro_set_environment(environ_cb_get_system_info);
|
||||
|
||||
/* It's possible that we just set get_system_info callback
|
||||
* to the currently running core.
|
||||
*
|
||||
* Make sure we reset it to the actual environment callback.
|
||||
* Ignore any environment callbacks here in case we're running
|
||||
* on the non-current core. */
|
||||
ignore_environment_cb = true;
|
||||
retro_set_environment(rarch_environment_cb);
|
||||
ignore_environment_cb = false;
|
||||
}
|
||||
|
||||
retro_get_system_info(&dummy_info);
|
||||
memcpy(info, &dummy_info, sizeof(*info));
|
||||
|
||||
info->library_name = strdup(dummy_info.library_name);
|
||||
info->library_version = strdup(dummy_info.library_version);
|
||||
if (dummy_info.valid_extensions)
|
||||
info->valid_extensions = strdup(dummy_info.valid_extensions);
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_DYNAMIC
|
||||
/**
|
||||
* libretro_get_environment_info:
|
||||
* @func : Function pointer for get_environment_info.
|
||||
@@ -238,22 +292,6 @@ bool libretro_get_system_info(const char *path,
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* libretro_free_system_info:
|
||||
* @info : Pointer to system info information.
|
||||
*
|
||||
* Frees system information.
|
||||
**/
|
||||
void libretro_free_system_info(struct retro_system_info *info)
|
||||
{
|
||||
if (!info)
|
||||
return;
|
||||
|
||||
free((void*)info->library_name);
|
||||
free((void*)info->library_version);
|
||||
free((void*)info->valid_extensions);
|
||||
memset(info, 0, sizeof(*info));
|
||||
}
|
||||
static void load_dynamic_core(void)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
@@ -271,7 +309,7 @@ static void load_dynamic_core(void)
|
||||
retro_fail(1, "init_libretro_sym()");
|
||||
}
|
||||
|
||||
if (!*settings->libretro)
|
||||
if (!*settings->path.libretro)
|
||||
{
|
||||
RARCH_ERR("RetroArch is built for dynamic libretro cores, but "
|
||||
"libretro_path is not set. Cannot continue.\n");
|
||||
@@ -281,15 +319,15 @@ static void load_dynamic_core(void)
|
||||
/* Need to use absolute path for this setting. It can be
|
||||
* saved to content history, and a relative path would
|
||||
* break in that scenario. */
|
||||
path_resolve_realpath(settings->libretro, sizeof(settings->libretro));
|
||||
path_resolve_realpath(settings->path.libretro, sizeof(settings->path.libretro));
|
||||
|
||||
RARCH_LOG("Loading dynamic libretro core from: \"%s\"\n",
|
||||
settings->libretro);
|
||||
lib_handle = dylib_load(settings->libretro);
|
||||
settings->path.libretro);
|
||||
lib_handle = dylib_load(settings->path.libretro);
|
||||
if (!lib_handle)
|
||||
{
|
||||
RARCH_ERR("Failed to open libretro core: \"%s\"\n",
|
||||
settings->libretro);
|
||||
settings->path.libretro);
|
||||
RARCH_ERR("Error(s): %s\n", dylib_error());
|
||||
retro_fail(1, "load_dynamic()");
|
||||
}
|
||||
@@ -538,6 +576,7 @@ void uninit_libretro_sym(struct retro_core_t *current_core)
|
||||
|
||||
runloop_ctl(RUNLOOP_CTL_CORE_OPTIONS_DEINIT, NULL);
|
||||
runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_FREE, NULL);
|
||||
runloop_ctl(RUNLOOP_CTL_FRAME_TIME_FREE, NULL);
|
||||
camera_driver_ctl(RARCH_CAMERA_CTL_UNSET_ACTIVE, NULL);
|
||||
location_driver_ctl(RARCH_LOCATION_CTL_UNSET_ACTIVE, NULL);
|
||||
|
||||
@@ -676,7 +715,7 @@ bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
break;
|
||||
|
||||
case RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY:
|
||||
if (string_is_empty(settings->system_directory))
|
||||
if (string_is_empty(settings->directory.system))
|
||||
{
|
||||
char *fullpath = NULL;
|
||||
runloop_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath);
|
||||
@@ -692,9 +731,9 @@ bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
}
|
||||
else
|
||||
{
|
||||
*(const char**)data = settings->system_directory;
|
||||
*(const char**)data = settings->directory.system;
|
||||
RARCH_LOG("Environ SYSTEM_DIRECTORY: \"%s\".\n",
|
||||
settings->system_directory);
|
||||
settings->directory.system);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -835,7 +874,7 @@ bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
}
|
||||
}
|
||||
|
||||
global->has_set.input_descriptors = true;
|
||||
core_ctl(CORE_CTL_SET_INPUT_DESCRIPTORS, NULL);
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -969,7 +1008,7 @@ bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
const char **path = (const char**)data;
|
||||
*path = NULL;
|
||||
#ifdef HAVE_DYNAMIC
|
||||
*path = settings->libretro;
|
||||
*path = settings->path.libretro;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
@@ -1088,10 +1127,10 @@ bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
{
|
||||
const char **dir = (const char**)data;
|
||||
|
||||
*dir = *settings->core_assets_directory ?
|
||||
settings->core_assets_directory : NULL;
|
||||
*dir = *settings->directory.core_assets ?
|
||||
settings->directory.core_assets : NULL;
|
||||
RARCH_LOG("Environ CORE_ASSETS_DIRECTORY: \"%s\".\n",
|
||||
settings->core_assets_directory);
|
||||
settings->directory.core_assets);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,20 +19,13 @@
|
||||
|
||||
#include <boolean.h>
|
||||
|
||||
#include "core_type.h"
|
||||
#include "libretro.h"
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
enum rarch_core_type
|
||||
{
|
||||
CORE_TYPE_PLAIN = 0,
|
||||
CORE_TYPE_DUMMY,
|
||||
CORE_TYPE_FFMPEG,
|
||||
CORE_TYPE_IMAGEVIEWER
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -72,6 +65,21 @@ void libretro_get_environment_info(void (*)(retro_environment_t),
|
||||
**/
|
||||
bool libretro_get_system_info(const char *path,
|
||||
struct retro_system_info *info, bool *load_no_content);
|
||||
#else
|
||||
/**
|
||||
* libretro_get_system_info_static:
|
||||
* @info : System info information.
|
||||
* @load_no_content : If true, core should be able to auto-start
|
||||
* without any content loaded.
|
||||
*
|
||||
* Gets system info from the current statically linked libretro library.
|
||||
* The struct returned must be freed as strings are allocated dynamically.
|
||||
*
|
||||
* Returns: true (1) if successful, otherwise false (0).
|
||||
**/
|
||||
bool libretro_get_system_info_static(struct retro_system_info *info,
|
||||
bool *load_no_content);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* libretro_free_system_info:
|
||||
@@ -80,7 +88,6 @@ bool libretro_get_system_info(const char *path,
|
||||
* Frees system information.
|
||||
**/
|
||||
void libretro_free_system_info(struct retro_system_info *info);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* libretro_get_current_core_pathname:
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <boolean.h>
|
||||
#include <string.h>
|
||||
@@ -137,6 +141,53 @@ void fill_pathname_abbreviate_special(char *out_path,
|
||||
retro_assert(strlcpy(out_path, in_path, size) < size);
|
||||
}
|
||||
|
||||
bool fill_pathname_application_data(char *s, size_t len)
|
||||
{
|
||||
#if defined(_WIN32) && !defined(_XBOX)
|
||||
const char *appdata = getenv("APPDATA");
|
||||
|
||||
if (appdata)
|
||||
{
|
||||
strlcpy(s, appdata, len);
|
||||
return true;
|
||||
}
|
||||
|
||||
#elif defined(OSX)
|
||||
const char *appdata = getenv("HOME");
|
||||
|
||||
if (appdata)
|
||||
{
|
||||
fill_pathname_join(s, appdata,
|
||||
"Library/Application Support/RetroArch", len);
|
||||
return true;
|
||||
}
|
||||
#elif !defined(RARCH_CONSOLE)
|
||||
const char *xdg = getenv("XDG_CONFIG_HOME");
|
||||
const char *appdata = getenv("HOME");
|
||||
|
||||
/* XDG_CONFIG_HOME falls back to $HOME/.config. */
|
||||
if (xdg)
|
||||
{
|
||||
fill_pathname_join(s, xdg, "retroarch", len);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (appdata)
|
||||
{
|
||||
#ifdef __HAIKU__
|
||||
fill_pathname_join(s, appdata,
|
||||
"config/settings/retroarch/", len);
|
||||
#else
|
||||
fill_pathname_join(s, appdata,
|
||||
".config/retroarch/", len);
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
#if !defined(RARCH_CONSOLE)
|
||||
void fill_pathname_application_path(char *s, size_t len)
|
||||
{
|
||||
|
||||
@@ -14,25 +14,14 @@
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _DIR_LIST_SPECIAL_H
|
||||
#define _DIR_LIST_SPECIAL_H
|
||||
#ifndef _FILE_PATH_SPECIAL_H
|
||||
#define _FILE_PATH_SPECIAL_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#include <string/string_list.h>
|
||||
#include <boolean.h>
|
||||
|
||||
enum dir_list_type
|
||||
{
|
||||
DIR_LIST_NONE = 0,
|
||||
DIR_LIST_CORES,
|
||||
DIR_LIST_CORE_INFO,
|
||||
DIR_LIST_DATABASES,
|
||||
DIR_LIST_COLLECTIONS,
|
||||
DIR_LIST_PLAIN,
|
||||
DIR_LIST_SHADERS
|
||||
};
|
||||
|
||||
struct string_list *dir_list_new_special(const char *input_dir,
|
||||
enum dir_list_type type, const char *filter);
|
||||
bool fill_pathname_application_data(char *s, size_t len);
|
||||
|
||||
#endif
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#include <file/file_path.h>
|
||||
#ifndef IS_SALAMANDER
|
||||
#include <file/file_list.h>
|
||||
#include <lists/file_list.h>
|
||||
#endif
|
||||
|
||||
#include "../frontend_driver.h"
|
||||
@@ -74,33 +74,14 @@ static void frontend_ctr_get_environment_settings(int *argc, char *argv[],
|
||||
"system", sizeof(g_defaults.dir.system));
|
||||
fill_pathname_join(g_defaults.dir.playlist, g_defaults.dir.core,
|
||||
"playlists", sizeof(g_defaults.dir.playlist));
|
||||
fill_pathname_join(g_defaults.dir.menu_config, g_defaults.dir.port,
|
||||
"config", sizeof(g_defaults.dir.menu_config));
|
||||
fill_pathname_join(g_defaults.dir.remap, g_defaults.dir.port,
|
||||
"remaps", sizeof(g_defaults.dir.remap));
|
||||
"config/remaps", sizeof(g_defaults.dir.remap));
|
||||
fill_pathname_join(g_defaults.dir.video_filter, g_defaults.dir.port,
|
||||
"filters", sizeof(g_defaults.dir.remap));
|
||||
fill_pathname_join(g_defaults.path.config, g_defaults.dir.port,
|
||||
"retroarch.cfg", sizeof(g_defaults.path.config));
|
||||
|
||||
#ifndef IS_SALAMANDER
|
||||
/* clean-up argc/argv */
|
||||
if(*argc)
|
||||
{
|
||||
int i = *argc - 1;
|
||||
*argc = 0;
|
||||
while (i)
|
||||
{
|
||||
if(argv[i] && isalnum(argv[i][0])
|
||||
&& strncmp(argv[i], "3dslink:/", 9))
|
||||
{
|
||||
argv[1] = argv[i];
|
||||
argv[2] = NULL;
|
||||
*argc = 2;
|
||||
break;
|
||||
}
|
||||
i--;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void frontend_ctr_deinit(void *data)
|
||||
@@ -130,9 +111,14 @@ static void frontend_ctr_deinit(void *data)
|
||||
svcCloseHandle(lcd_handle);
|
||||
}
|
||||
|
||||
u32 parallax_layer_reg_state = (*(float*)0x1FF81080 == 0.0)? 0x0 : 0x00010001;
|
||||
GSPGPU_WriteHWRegs(0x202000, ¶llax_layer_reg_state, 4);
|
||||
|
||||
cfguExit();
|
||||
ndspExit();
|
||||
csndExit();
|
||||
gfxTopRightFramebuffers[0] = NULL;
|
||||
gfxTopRightFramebuffers[1] = NULL;
|
||||
gfxExit();
|
||||
#endif
|
||||
}
|
||||
@@ -192,7 +178,10 @@ static void ctr_check_dspfirm(void)
|
||||
}
|
||||
}
|
||||
|
||||
void svchax_init(void);
|
||||
__attribute__((weak)) Result svchax_init(bool patch_srv);
|
||||
__attribute__((weak)) u32 __ctr_patch_services;
|
||||
|
||||
void gfxSetFramebufferInfo(gfxScreen_t screen, u8 id);
|
||||
|
||||
static void frontend_ctr_init(void *data)
|
||||
{
|
||||
@@ -202,16 +191,38 @@ static void frontend_ctr_init(void *data)
|
||||
|
||||
*verbose = true;
|
||||
|
||||
#if 0
|
||||
APT_SetAppCpuTimeLimit(NULL, 80);
|
||||
#endif
|
||||
gfxInit(GSP_BGR8_OES,GSP_RGB565_OES,false);
|
||||
gfxSet3D(false);
|
||||
|
||||
u32 topSize = 400 * 240 * 3;
|
||||
u32 bottomSize = 320 * 240 * 2;
|
||||
linearFree(gfxTopLeftFramebuffers[0]);
|
||||
linearFree(gfxTopLeftFramebuffers[1]);
|
||||
linearFree(gfxBottomFramebuffers[0]);
|
||||
linearFree(gfxBottomFramebuffers[1]);
|
||||
linearFree(gfxTopRightFramebuffers[0]);
|
||||
linearFree(gfxTopRightFramebuffers[1]);
|
||||
|
||||
gfxTopLeftFramebuffers[0]=linearAlloc(topSize * 2);
|
||||
gfxTopRightFramebuffers[0] = gfxTopLeftFramebuffers[0] + topSize;
|
||||
|
||||
gfxTopLeftFramebuffers[1]=linearAlloc(topSize * 2);
|
||||
gfxTopRightFramebuffers[1] = gfxTopLeftFramebuffers[1] + topSize;
|
||||
|
||||
gfxBottomFramebuffers[0]=linearAlloc(bottomSize);
|
||||
gfxBottomFramebuffers[1]=linearAlloc(bottomSize);
|
||||
|
||||
gfxSetFramebufferInfo(GFX_TOP, 0);
|
||||
gfxSetFramebufferInfo(GFX_BOTTOM, 0);
|
||||
|
||||
gfxSet3D(true);
|
||||
consoleInit(GFX_BOTTOM, NULL);
|
||||
|
||||
/* enable access to all service calls when possible. */
|
||||
osSetSpeedupEnable(false);
|
||||
svchax_init();
|
||||
if(svchax_init)
|
||||
{
|
||||
osSetSpeedupEnable(false);
|
||||
svchax_init(__ctr_patch_services);
|
||||
}
|
||||
osSetSpeedupEnable(true);
|
||||
|
||||
audio_driver_t* dsp_audio_driver = &audio_ctr_dsp;
|
||||
@@ -247,7 +258,7 @@ static int frontend_ctr_parse_drive_list(void *data)
|
||||
if (!list)
|
||||
return -1;
|
||||
|
||||
menu_entries_push(list,
|
||||
menu_entries_add(list,
|
||||
"sdmc:/", "", MENU_FILE_DIRECTORY, 0, 0);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -46,9 +46,11 @@
|
||||
#include <rhash.h>
|
||||
|
||||
#include "../frontend_driver.h"
|
||||
#include "../../ui/ui_companion_driver.h"
|
||||
#include "../../file_path_special.h"
|
||||
#include "../../defaults.h"
|
||||
#include "../../general.h"
|
||||
#include "../../verbosity.h"
|
||||
#include "../../ui/ui_companion_driver.h"
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
#include "../../menu/menu_driver.h"
|
||||
@@ -359,36 +361,46 @@ static void frontend_darwin_get_environment_settings(int *argc, char *argv[],
|
||||
fill_pathname_join(g_defaults.dir.core_assets, home_dir_buf, "downloads", sizeof(g_defaults.dir.core_assets));
|
||||
fill_pathname_join(g_defaults.dir.assets, home_dir_buf, "assets", sizeof(g_defaults.dir.assets));
|
||||
fill_pathname_join(g_defaults.dir.system, home_dir_buf, "system", sizeof(g_defaults.dir.system));
|
||||
fill_pathname_join(g_defaults.dir.menu_config, home_dir_buf, "configs", sizeof(g_defaults.dir.menu_config));
|
||||
fill_pathname_join(g_defaults.dir.menu_config, home_dir_buf, "config", sizeof(g_defaults.dir.menu_config));
|
||||
fill_pathname_join(g_defaults.path.config, g_defaults.dir.menu_config, "retroarch.cfg", sizeof(g_defaults.path.config));
|
||||
fill_pathname_join(g_defaults.dir.remap, g_defaults.dir.menu_config, "remaps", sizeof(g_defaults.dir.remap));
|
||||
fill_pathname_join(g_defaults.dir.database, home_dir_buf, "database/rdb", sizeof(g_defaults.dir.database));
|
||||
fill_pathname_join(g_defaults.dir.cursor, home_dir_buf, "database/cursors", sizeof(g_defaults.dir.cursor));
|
||||
fill_pathname_join(g_defaults.dir.cheats, home_dir_buf, "cht", sizeof(g_defaults.dir.cheats));
|
||||
fill_pathname_join(g_defaults.dir.thumbnails, home_dir_buf, "thumbnails", sizeof(g_defaults.dir.thumbnails));
|
||||
fill_pathname_join(g_defaults.dir.sram, home_dir_buf, "saves", sizeof(g_defaults.dir.sram));
|
||||
fill_pathname_join(g_defaults.dir.savestate, home_dir_buf, "states", sizeof(g_defaults.dir.savestate));
|
||||
fill_pathname_join(g_defaults.dir.remap, home_dir_buf, "remaps", sizeof(g_defaults.dir.remap));
|
||||
fill_pathname_join(g_defaults.dir.menu_config, home_dir_buf, "config", sizeof(g_defaults.dir.menu_config));
|
||||
#if defined(IOS)
|
||||
fill_pathname_join(g_defaults.dir.playlist, home_dir_buf, "playlists", sizeof(g_defaults.dir.playlist));
|
||||
#endif
|
||||
#if defined(OSX)
|
||||
char application_data[PATH_MAX_LENGTH];
|
||||
|
||||
fill_pathname_application_data(application_data, sizeof(application_data));
|
||||
|
||||
#ifdef HAVE_CG
|
||||
fill_pathname_join(g_defaults.dir.shader, home_dir_buf, "shaders_cg", sizeof(g_defaults.dir.shader));
|
||||
#endif
|
||||
fill_pathname_join(g_defaults.dir.audio_filter, home_dir_buf, "audio_filters", sizeof(g_defaults.dir.audio_filter));
|
||||
fill_pathname_join(g_defaults.dir.video_filter, home_dir_buf, "video_filters", sizeof(g_defaults.dir.video_filter));
|
||||
fill_pathname_join(g_defaults.dir.playlist, home_dir_buf, "playlists", sizeof(g_defaults.dir.playlist));
|
||||
fill_pathname_join(g_defaults.dir.playlist, application_data, "playlists", sizeof(g_defaults.dir.playlist));
|
||||
fill_pathname_join(g_defaults.dir.thumbnails, application_data, "thumbnails", sizeof(g_defaults.dir.thumbnails));
|
||||
fill_pathname_join(g_defaults.dir.menu_config, application_data, "config", sizeof(g_defaults.dir.menu_config));
|
||||
fill_pathname_join(g_defaults.path.config, g_defaults.dir.menu_config, "retroarch.cfg", sizeof(g_defaults.path.config));
|
||||
fill_pathname_join(g_defaults.dir.remap, g_defaults.dir.menu_config, "remaps", sizeof(g_defaults.dir.remap));
|
||||
fill_pathname_join(g_defaults.dir.core_assets, application_data, "downloads", sizeof(g_defaults.dir.core_assets));
|
||||
fill_pathname_join(g_defaults.dir.screenshot, application_data, "screenshots", sizeof(g_defaults.dir.screenshot));
|
||||
#if defined(RELEASE_BUILD)
|
||||
fill_pathname_join(g_defaults.dir.remap, bundle_path_buf, "Contents/Resources/remaps", sizeof(g_defaults.dir.remap));
|
||||
fill_pathname_join(g_defaults.dir.playlist, bundle_path_buf, "Contents/Resources/playlists", sizeof(g_defaults.dir.playlist));
|
||||
fill_pathname_join(g_defaults.dir.shader, bundle_path_buf, "Contents/Resources/shaders", sizeof(g_defaults.dir.shader));
|
||||
fill_pathname_join(g_defaults.dir.core, bundle_path_buf, "Contents/Resources/cores", sizeof(g_defaults.dir.core));
|
||||
fill_pathname_join(g_defaults.dir.core_info, bundle_path_buf, "Contents/Resources/info", sizeof(g_defaults.dir.core_info));
|
||||
fill_pathname_join(g_defaults.dir.overlay, bundle_path_buf, "Contents/Resources/overlays", sizeof(g_defaults.dir.overlay));
|
||||
fill_pathname_join(g_defaults.dir.autoconfig, bundle_path_buf, "Contents/Resources/autoconfig", sizeof(g_defaults.dir.autoconfig));
|
||||
fill_pathname_join(g_defaults.dir.core_assets, bundle_path_buf, "Contents/Resources/downloads", sizeof(g_defaults.dir.core_assets));
|
||||
fill_pathname_join(g_defaults.dir.assets, bundle_path_buf, "Contents/Resources/assets", sizeof(g_defaults.dir.assets));
|
||||
fill_pathname_join(g_defaults.dir.menu_config, bundle_path_buf, "Contents/Resources/configs", sizeof(g_defaults.dir.menu_config));
|
||||
fill_pathname_join(g_defaults.path.config, g_defaults.dir.menu_config, "retroarch.cfg", sizeof(g_defaults.path.config));
|
||||
fill_pathname_join(g_defaults.dir.database, bundle_path_buf, "Contents/Resources/database/rdb", sizeof(g_defaults.dir.database));
|
||||
fill_pathname_join(g_defaults.dir.cursor, bundle_path_buf, "Contents/Resources/database/cursors", sizeof(g_defaults.dir.cursor));
|
||||
fill_pathname_join(g_defaults.dir.cheats, bundle_path_buf, "Contents/Resources/cht", sizeof(g_defaults.dir.cheats));
|
||||
fill_pathname_join(g_defaults.dir.shader, bundle_path_buf, "Contents/Resources/shaders", sizeof(g_defaults.dir.shader));
|
||||
fill_pathname_join(g_defaults.dir.core, bundle_path_buf, "Contents/Resources/cores", sizeof(g_defaults.dir.core));
|
||||
fill_pathname_join(g_defaults.dir.core_info, bundle_path_buf, "Contents/Resources/info", sizeof(g_defaults.dir.core_info));
|
||||
fill_pathname_join(g_defaults.dir.overlay, bundle_path_buf, "Contents/Resources/overlays", sizeof(g_defaults.dir.overlay));
|
||||
fill_pathname_join(g_defaults.dir.autoconfig, bundle_path_buf, "Contents/Resources/autoconfig", sizeof(g_defaults.dir.autoconfig));
|
||||
fill_pathname_join(g_defaults.dir.assets, bundle_path_buf, "Contents/Resources/assets", sizeof(g_defaults.dir.assets));
|
||||
fill_pathname_join(g_defaults.dir.database, bundle_path_buf, "Contents/Resources/database/rdb", sizeof(g_defaults.dir.database));
|
||||
fill_pathname_join(g_defaults.dir.cursor, bundle_path_buf, "Contents/Resources/database/cursors", sizeof(g_defaults.dir.cursor));
|
||||
fill_pathname_join(g_defaults.dir.cheats, bundle_path_buf, "Contents/Resources/cht", sizeof(g_defaults.dir.cheats));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -408,8 +420,8 @@ static void frontend_darwin_get_environment_settings(int *argc, char *argv[],
|
||||
|
||||
RARCH_LOG("Assets ZIP found at [%s], setting up bundle assets extraction...\n", assets_zip_path);
|
||||
RARCH_LOG("Extraction dir will be: %s\n", home_dir_buf);
|
||||
strlcpy(settings->bundle_assets_src_path, assets_zip_path, sizeof(settings->bundle_assets_src_path));
|
||||
strlcpy(settings->bundle_assets_dst_path, home_dir_buf, sizeof(settings->bundle_assets_dst_path));
|
||||
strlcpy(settings->path.bundle_assets_src, assets_zip_path, sizeof(settings->path.bundle_assets_src));
|
||||
strlcpy(settings->path.bundle_assets_dst, home_dir_buf, sizeof(settings->path.bundle_assets_dst));
|
||||
settings->bundle_assets_extract_version_current = 130; /* TODO/FIXME: Just hardcode this for now */
|
||||
}
|
||||
#endif
|
||||
@@ -635,9 +647,9 @@ static int frontend_darwin_parse_drive_list(void *data)
|
||||
|
||||
CFSearchPathForDirectoriesInDomains(CFDocumentDirectory, CFUserDomainMask, 1, home_dir_buf, sizeof(home_dir_buf));
|
||||
|
||||
menu_entries_push(list,
|
||||
menu_entries_add(list,
|
||||
home_dir_buf, "", MENU_FILE_DIRECTORY, 0, 0);
|
||||
menu_entries_push(list, "/", "",
|
||||
menu_entries_add(list, "/", "",
|
||||
MENU_FILE_DIRECTORY, 0, 0);
|
||||
|
||||
ret = 0;
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#include <file/config_file.h>
|
||||
|
||||
#include "../../defaults.h"
|
||||
#include "../../general.h"
|
||||
#include "../../content.h"
|
||||
#include "../frontend.h"
|
||||
|
||||
Loaded 100 of 466 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user