Compare commits
770 Commits
Author | SHA1 | Date | |
---|---|---|---|
402f05b8ef | |||
fb27042e01 | |||
69a9de33d3 | |||
bba51c2eeb | |||
fc26189fe1 | |||
a40c90e7dd | |||
f864a49014 | |||
ecbf303266 | |||
b3bf05356b | |||
cb4b58052f | |||
f8cdd5f484 | |||
22202be394 | |||
17ba217940 | |||
aae4595bdb | |||
880fd3cfcb | |||
f679f25e08 | |||
c2709b3bdd | |||
2b6e81deea | |||
7271f1b18e | |||
5fda543f84 | |||
95c06de4c1 | |||
49c63ea077 | |||
531da8a1c0 | |||
5cbdfbc7a4 | |||
e0544dd9c7 | |||
aa784c3e5e | |||
9205077590 | |||
0ed40c7175 | |||
40d47b7aa2 | |||
ec0bb74968 | |||
42f7f98666 | |||
95bad6995c | |||
3d42995822 | |||
9095941fd1 | |||
ba71141bdc | |||
0a0675a7f6 | |||
a7c6e6a8cf | |||
0bc8151c7e | |||
40c17673f5 | |||
a8950d6ac4 | |||
162798b026 | |||
1b28ecd63e | |||
895d9b53bc | |||
0e06aace45 | |||
adf4ebcd60 | |||
470a8031a4 | |||
5440d4ad5c | |||
dde208b480 | |||
4c3d2d5d75 | |||
fab11ba3f1 | |||
332891b5ff | |||
7df4fcada7 | |||
d6698680be | |||
e5c9838b0b | |||
f8ec878796 | |||
9ff21f9ab6 | |||
aa021085cf | |||
1f5d881860 | |||
1f664100bd | |||
1f5e1ffa80 | |||
264438ff19 | |||
3b8ac1641a | |||
4250732353 | |||
4d1579acbf | |||
6279f5e430 | |||
b7d2bff6aa | |||
7c327fecb3 | |||
cc1a933a2f | |||
dd574146fb | |||
2c94ac455e | |||
e18d258fa0 | |||
36f10df775 | |||
680e548022 | |||
21c4176157 | |||
3b4ff2d6d9 | |||
12504f280c | |||
250fc51374 | |||
206e0882c2 | |||
609abc8b9b | |||
cee7121058 | |||
cd124bda58 | |||
9f12e50a54 | |||
097562bc6c | |||
db4242c5dc | |||
4dd77316f7 | |||
3f98369a17 | |||
c26aeefe03 | |||
666e05f5cb | |||
8d9d508dc7 | |||
e27f5522e2 | |||
add2a9d151 | |||
9e50dd99d7 | |||
0dec91bb42 | |||
d9b63353b0 | |||
eabd0ec93f | |||
138d5dc64a | |||
3e68a87d63 | |||
69b6ef7a4a | |||
40e87c634e | |||
79d1c190db | |||
2bc88467eb | |||
baf8752e74 | |||
d5e4378aea | |||
6dbcdfea47 | |||
c5258cf082 | |||
5c89e22bb9 | |||
11ecff2ff0 | |||
4c3f09644a | |||
e187a8870a | |||
a64fee29dc | |||
9ef94c8292 | |||
915d6d044c | |||
a4780ab33b | |||
a947a45d81 | |||
9db73f74cf | |||
a1efd87c45 | |||
49be977588 | |||
c95be55091 | |||
63dedbda86 | |||
c532118d94 | |||
52d6f2e656 | |||
c9bc4eaf58 | |||
3249f8ff41 | |||
1b41b285ac | |||
f5a6f45b27 | |||
210557951b | |||
4c2d9ff3ff | |||
8198b99935 | |||
460f96967d | |||
7ca779a26d | |||
b5032b3c91 | |||
f0a3dff136 | |||
f659dcb9d8 | |||
a34fb0e939 | |||
21ce8a9b80 | |||
9ecbee8032 | |||
80519af67d | |||
26e30faff3 | |||
0992310b76 | |||
009c1101d2 | |||
ba95ee54ab | |||
4ce4299ca2 | |||
17620d18db | |||
9f1cf6458c | |||
67b4e63cff | |||
c05c688ee8 | |||
b2623dc27d | |||
5131b71437 | |||
7870423671 | |||
b72916fbc1 | |||
da073fce61 | |||
1fc90e57d2 | |||
eafcc314a9 | |||
6e9bd4de13 | |||
05a41b31bc | |||
eed17f963e | |||
c09c0c002d | |||
d56d335c0b | |||
23c844b2aa | |||
81691b9e37 | |||
2dc422bc14 | |||
a80fa5e33f | |||
954e995321 | |||
dad9ab6bb6 | |||
f0562b9c75 | |||
b8556530f2 | |||
4f3af839be | |||
155736c986 | |||
dba908dc78 | |||
ecee34a50c | |||
9b5a0c3889 | |||
80b4972139 | |||
5d85468302 | |||
9b1cc2cec6 | |||
e691622f0a | |||
f663a5cd38 | |||
f7c2e867f4 | |||
cedd200745 | |||
58207685c0 | |||
095ad923ad | |||
f07ae7d53f | |||
c308f09722 | |||
f1eef29409 | |||
1f8d66db7c | |||
c3a5716a95 | |||
1f1e2a7f03 | |||
e54f9dc4b4 | |||
edfd4d70c0 | |||
fc43aecbbd | |||
58d7a1fe97 | |||
7aa430f1a5 | |||
6bf460e104 | |||
efb135b74c | |||
a707842e14 | |||
a5a9b9bc8b | |||
17078ad929 | |||
32450d45de | |||
ed7a0474c6 | |||
fe9c49949a | |||
052b23c83c | |||
e4f68592c3 | |||
1dcd44b94f | |||
61b1ce252f | |||
5f38086f94 | |||
7bae440d3a | |||
f1943fd0b6 | |||
ec8d4f3af5 | |||
b3f0978869 | |||
f614d2c435 | |||
40c9416097 | |||
618c8edc79 | |||
99fc4fa61b | |||
f6d5499a16 | |||
26bf13a65d | |||
96cf242bcf | |||
59755818ef | |||
f8beeeb7d3 | |||
cb250162cb | |||
7528f94536 | |||
43081c16c4 | |||
780627e7b0 | |||
9044cb38d1 | |||
a53cfdab78 | |||
c7f9962dde | |||
296c4a3d01 | |||
e7cf4e6eaf | |||
a1a4771ac1 | |||
2fd819613f | |||
ad6ff6ce99 | |||
dc30d94852 | |||
4f293f8cbe | |||
32a1cd83fd | |||
e3d0ccf8d5 | |||
c14844d12c | |||
7fea26e97e | |||
7b7f62c776 | |||
423dbc8888 | |||
6adf15e479 | |||
2747f12591 | |||
a47824f961 | |||
8474d52778 | |||
dd7a924596 | |||
a76eaf9a9a | |||
009e6bcd1b | |||
eb2cc159fa | |||
bb89e36fd8 | |||
de3134adbe | |||
36d53819a4 | |||
ae4324032a | |||
f449895e6d | |||
410be95ab6 | |||
cff9046fc7 | |||
86fd0643c2 | |||
43a83a401e | |||
f0e27a23a5 | |||
e68650237d | |||
1faff14e73 | |||
784cf9d594 | |||
64263c5218 | |||
065c4e520d | |||
139a930407 | |||
719dc97bbd | |||
41bba5310a | |||
8071c8c8c0 | |||
b402b4e7f6 | |||
93df366b2c | |||
cd3a15aea5 | |||
070136b3f7 | |||
08ab47c6c0 | |||
85faa9d8fa | |||
dca5b14493 | |||
4d2c8e2a44 | |||
8fa248ceb4 | |||
30862b5ffd | |||
9f57747c57 | |||
fe29a2ff6e | |||
e9a173e00c | |||
a11784fcbf | |||
fd36c8deca | |||
70638340b3 | |||
4b495f3333 | |||
934b5a64e5 | |||
cee667b491 | |||
94a64f2aea | |||
2355c2af62 | |||
5e0f8e8738 | |||
d16288a2a8 | |||
600f86dc7b | |||
7210c17c5e | |||
a16854e55a | |||
3e455a90a1 | |||
e4413542b2 | |||
8c720783f5 | |||
8734ea9dd4 | |||
c586e6d2b7 | |||
3a4eeb77fe | |||
51b3953cfc | |||
610eecc1c1 | |||
492056abf6 | |||
ee6e682ab4 | |||
6f60e102a2 | |||
eeb2af9953 | |||
550747eac6 | |||
3ffceab1fb | |||
b9f2a96595 | |||
cbaa845f5d | |||
9e2681f2d7 | |||
81fae0d1a6 | |||
38519f3b9a | |||
7f27aabbd0 | |||
e876c43ce9 | |||
8639245533 | |||
d6b86a6629 | |||
8f2b7b5b8e | |||
fc4b7cba2c | |||
08831eecf7 | |||
c6a139a6e7 | |||
02714a1291 | |||
09c9686498 | |||
b6614c6ad5 | |||
b1d4b174a6 | |||
2b23463daa | |||
9dfe81770a | |||
52c115a1f8 | |||
e20abbf9cc | |||
76671d63d4 | |||
3d1a0bf374 | |||
c20f3fbebd | |||
0d3b82477e | |||
470be03c2f | |||
c963b3c804 | |||
a4fdfb5f94 | |||
37d27c4c99 | |||
f906eb06c2 | |||
219f63ff4e | |||
1cca3e99ab | |||
55a23e5ec8 | |||
479d1fd8b0 | |||
cb70e7bb30 | |||
c200a7b7c6 | |||
6268170a10 | |||
ee0f9b03a4 | |||
f93c5f006a | |||
295fbd0542 | |||
d7310d7a1c | |||
8c50943a2e | |||
ec4cd57ccf | |||
5a085cba0f | |||
1a1d33a018 | |||
0fbcd630bc | |||
f4d731ae20 | |||
8ac53c66b4 | |||
0f50de72be | |||
df758eddd1 | |||
5f32a8ed94 | |||
535fbec675 | |||
6fe88115a3 | |||
475fa4d390 | |||
edf7e628ca | |||
ba5c0cf5d8 | |||
403e67d983 | |||
c6f1908e0f | |||
851d81d24a | |||
459c4caeba | |||
539b22ef7b | |||
872f036d64 | |||
dca96122bf | |||
e752959109 | |||
cf01664698 | |||
b283a4adcd | |||
8428bb6541 | |||
9a0330f7f8 | |||
57fc996337 | |||
1f3b860f06 | |||
abe3c02ab4 | |||
45b417b2b4 | |||
d076339e3e | |||
837836431d | |||
9f555db5cd | |||
bf7fa60dfc | |||
752b93d3b7 | |||
f23b2878cc | |||
e211c3f00a | |||
d3709a753f | |||
ab676d58ea | |||
2372c194f1 | |||
40311310d1 | |||
dde9bb5c69 | |||
266338a7c9 | |||
90156eea4c | |||
071c01c235 | |||
de06ffb0f7 | |||
8a7de35e3f | |||
121296834a | |||
bbb24d8c7e | |||
4da44e09cb | |||
ae13f0ab4d | |||
a2a35f1be6 | |||
aedfadaaf7 | |||
5c0fb0cec3 | |||
17a1cab5d2 | |||
73aed239c3 | |||
9ac66336a2 | |||
4965681e06 | |||
3868a00206 | |||
933e5144a9 | |||
73a42c85c4 | |||
39ba11054b | |||
c250e3392c | |||
e56b069081 | |||
204c031fef | |||
d9053bbe37 | |||
c25e8427aa | |||
21a081b185 | |||
b540ea80d1 | |||
d692a9b83e | |||
9677ddaa5d | |||
ce92e8cd04 | |||
456fc04007 | |||
458452279c | |||
817b89767a | |||
3fb583c98c | |||
d2686e0a5b | |||
4905101df1 | |||
8750b90a7f | |||
af01100050 | |||
c0821fee1f | |||
a5c2aead67 | |||
d41c95dcff | |||
fbf2b09706 | |||
1fc0f569de | |||
dff138229c | |||
472119c8da | |||
1865ea87e5 | |||
18b61aff59 | |||
cb22629ac1 | |||
6f0f99ee2b | |||
70f2da8fdf | |||
5d3ef7761b | |||
476b4683cf | |||
5fb5079730 | |||
3fbacd0f49 | |||
7aa6abc120 | |||
548bfd60a2 | |||
65778a6b78 | |||
f4e879a1e6 | |||
a1ddaa2736 | |||
008286b79f | |||
a0c77f8d11 | |||
ece36b274d | |||
f3cc2e5703 | |||
5a39d3c4a1 | |||
cc51a03af9 | |||
567c64e149 | |||
36f00985d3 | |||
748d87adcc | |||
0fd47ff490 | |||
f088c3d344 | |||
905a191e28 | |||
ab0491817e | |||
5de6ae426e | |||
69ced3a6e8 | |||
2e43d01d36 | |||
7373ec5792 | |||
de162a648b | |||
131baebe2a | |||
187372cbde | |||
022d495335 | |||
c1372ed775 | |||
a16682cfd3 | |||
7c53b69c30 | |||
33a4d7d1ba | |||
391e08dd27 | |||
b5cf8b8af9 | |||
55043c8afc | |||
5d73a9f5fc | |||
2c9ab5e45f | |||
d536cc8ae6 | |||
d751da84f9 | |||
11aae9cfbc | |||
b96794e72b | |||
f1d1670b0b | |||
b8de72de8f | |||
eebc39228d | |||
9daf029f35 | |||
51a27032f0 | |||
a6a67a2b7a | |||
c6d05301aa | |||
647de4cd31 | |||
f82309fa2d | |||
7d8e198c33 | |||
3d98e1361b | |||
141cf61ff7 | |||
3fe3598d41 | |||
59cdf310bd | |||
4e34170a84 | |||
d540af5dc0 | |||
f7c7b66fc0 | |||
28ba55598d | |||
9719b6a112 | |||
f70236f947 | |||
eafadf10c7 | |||
9b06ee7736 | |||
baba2c2467 | |||
286e5d39b2 | |||
dc529c1181 | |||
c7cf1cbc35 | |||
d8e487d018 | |||
5fdc46ac7f | |||
1e5b45f580 | |||
62585755fd | |||
56621615b1 | |||
2099a3e84b | |||
7d26e4ac7b | |||
8d41402fa6 | |||
5af8ce7c38 | |||
77c4291c34 | |||
6e92b7a378 | |||
9b852c7481 | |||
c40c3905e2 | |||
a6cd044f0f | |||
f5a1de6ac5 | |||
2aeb5b00e3 | |||
60ba7b71f2 | |||
7c1d2bbb98 | |||
beacf8c1c8 | |||
0dbe45ae37 | |||
2b50e52e48 | |||
49eadbc209 | |||
2df16ded9b | |||
e43390c723 | |||
5af1327068 | |||
88a8d1e567 | |||
bf77d1cab9 | |||
1ca0517c99 | |||
599d485bff | |||
60e16c15b6 | |||
2068445939 | |||
a4fc9f8050 | |||
5437d6cb13 | |||
7539e26144 | |||
1c3697b6a4 | |||
81f848e54f | |||
358a781639 | |||
45ce540b9b | |||
96bf7f8522 | |||
33e673ceb8 | |||
9c2500de5f | |||
dbe43c1719 | |||
f502cfaf62 | |||
1fd5cf2b4a | |||
814f75142e | |||
4c0eb91d7e | |||
da75a9a6ea | |||
41790aa743 | |||
0cb1e926b5 | |||
6f0395538b | |||
b9f1ff3c77 | |||
a77af4c5e9 | |||
fbcf802fbc | |||
c3c41fa4bb | |||
356e480bf5 | |||
8e119a1e96 | |||
e05bf90af6 | |||
66f16f4392 | |||
729ff5337c | |||
2492e7e808 | |||
36172ab43b | |||
4d69286a9c | |||
1529e6cf0d | |||
f468db7602 | |||
c5f1d1749a | |||
7dd69f2d0e | |||
c646638680 | |||
65f2a82b97 | |||
93dd6d525a | |||
96d4ad952c | |||
6a07f80b76 | |||
22214ac664 | |||
45e520a27c | |||
5b5810a46a | |||
619ac86bd0 | |||
7a1ab71c73 | |||
dc4ba3993b | |||
81f1a4dc31 | |||
c64524a240 | |||
db45688aa8 | |||
c6d82209ab | |||
ee1825219b | |||
7baa08dcb4 | |||
408bd63b08 | |||
df99257d7f | |||
f3835dc78b | |||
51bb8707ef | |||
5ff5fe47ba | |||
38275f9056 | |||
67cbdc3a6a | |||
131b43170e | |||
730d2f4b9b | |||
f6a7309b14 | |||
472a621589 | |||
311c2661b8 | |||
a92e2028cb | |||
6922862db8 | |||
6592d64751 | |||
8001c832d9 | |||
87919b193c | |||
8de033e60e | |||
90432946ac | |||
9bad71afbf | |||
923089a298 | |||
d9aa15eb24 | |||
12c89a61f9 | |||
f5235fff29 | |||
eba682b767 | |||
b994dafe7a | |||
54421760c3 | |||
88a0e720cb | |||
53cc9e0561 | |||
7defc59b9d | |||
951700fdd8 | |||
eb6430f103 | |||
80a879cb44 | |||
2197f41506 | |||
c8f9292bab | |||
0ec933a615 | |||
2135b6a51a | |||
00e35d9bf6 | |||
6dfb6ccf8c | |||
e87e8b012c | |||
e8f1ca8427 | |||
ad47bd2d4e | |||
a5ff0024fb | |||
f9661a54d2 | |||
66e7fdb871 | |||
2bb9b33da1 | |||
1080f64df9 | |||
c48a75979f | |||
842cb26ba5 | |||
e235d5e7bb | |||
ed0b10c81f | |||
f92650fcff | |||
712361f6e1 | |||
2232e4ae87 | |||
14ce9e1567 | |||
952d013c67 | |||
46c8129bf5 | |||
8cfec5de4b | |||
37b6e081da | |||
3c3bcd82fe | |||
a00c59a46c | |||
1825bd87b4 | |||
62f8ceb60b | |||
1a888ae087 | |||
84d0ca5645 | |||
31b8d413d5 | |||
6e02cac952 | |||
3a3380fa25 | |||
2d252db0a7 | |||
7f8a3541eb | |||
b34de74f81 | |||
5811d121df | |||
6eb85e846f | |||
c5bddfeab8 | |||
70ec5def9c | |||
7853faa334 | |||
b7fb474bfe | |||
2fa6413ed8 | |||
4523a73f75 | |||
f4c47f3c9a | |||
7d9a5feccb | |||
14ae4e276f | |||
3af42d6c7e | |||
bccf5e8b5a | |||
d86a116e1e | |||
4c2ab880ef | |||
bc5bb4459e | |||
55e97959b9 | |||
f7ef6364b7 | |||
b46b63e06a | |||
594246ea47 | |||
d21b403886 | |||
5afd521c5a | |||
0c66d71fe8 | |||
bdc4fa81f2 | |||
625f5fb88a | |||
2382717600 | |||
30ee70a9bc | |||
232b1012b0 | |||
e747f5cd83 | |||
8aff17a93c | |||
f2a41b7a1c | |||
c881cd2d14 | |||
68f9091870 | |||
99ffc061d3 | |||
d987cacfb7 | |||
851f56b08a | |||
b1bd6a50b5 | |||
70895bdb04 | |||
830cbf91bb | |||
9a9349f0f4 | |||
46cc7b55f0 | |||
dd8f97ab9e | |||
633c5ec330 | |||
a3e7bb8eb4 | |||
2073ba2919 | |||
d03124a992 | |||
59490d54b5 | |||
e546e5933f | |||
0c87bf9ea4 | |||
9827dc35e1 | |||
448723d3b3 | |||
89294b7772 | |||
7b9c4757dd | |||
b8fc97adf2 | |||
c1a7b5bcdb | |||
be1c375589 | |||
378d19f87a | |||
f59f65ec4f | |||
7bc4971cf9 | |||
3551c18902 | |||
deb99d2cae | |||
9ba73ffbe5 | |||
43b4b34376 | |||
92ca1cb0cb | |||
50d7ecf76d | |||
42a2a80b87 | |||
54deded929 | |||
39bdf6d41e | |||
074190e03c | |||
256514c7c9 | |||
556be08c4e | |||
1cbca5eecb | |||
95017b8c66 | |||
4a892fbdc9 | |||
9eb5b7a10d | |||
d64594ec74 | |||
6a1a03566a | |||
13f5294aa3 | |||
9444b4a647 | |||
610fc84f3e | |||
247d26b4b5 | |||
43ebd7a9bb | |||
26a881176e | |||
e44a43c7e1 | |||
3139a85a2b | |||
a4e8bea866 | |||
6a9e9b5360 | |||
952f6f8a65 | |||
d04ba51bb0 | |||
55ee261363 | |||
4e3a34412e | |||
3f4fb8f73a | |||
56c56aa34d | |||
d4b960d348 | |||
b2a225558d | |||
0ef0fc044a | |||
04bd87ed5a | |||
5158cdb308 | |||
1402d8391d | |||
e3b36db71c | |||
ba0171d054 | |||
d1146a5af2 | |||
79408b68c3 | |||
d461d4f68b | |||
b45d30acf8 | |||
df70442c46 | |||
e2ffa5a125 | |||
73feac5819 | |||
e5ad1dfa48 |
@ -63,6 +63,10 @@ dotnet_code_quality_unused_parameters = all:suggestion
|
|||||||
|
|
||||||
#### C# Coding Conventions ####
|
#### C# Coding Conventions ####
|
||||||
|
|
||||||
|
# Namespace preferences
|
||||||
|
csharp_style_namespace_declarations = block_scoped:warning
|
||||||
|
resharper_csharp_namespace_body = block_scoped
|
||||||
|
|
||||||
# var preferences
|
# var preferences
|
||||||
csharp_style_var_elsewhere = false:silent
|
csharp_style_var_elsewhere = false:silent
|
||||||
csharp_style_var_for_built_in_types = false:silent
|
csharp_style_var_for_built_in_types = false:silent
|
||||||
@ -89,6 +93,7 @@ csharp_style_conditional_delegate_call = true:suggestion
|
|||||||
# Modifier preferences
|
# Modifier preferences
|
||||||
csharp_prefer_static_local_function = true:suggestion
|
csharp_prefer_static_local_function = true:suggestion
|
||||||
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:silent
|
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:silent
|
||||||
|
csharp_style_prefer_readonly_struct = true
|
||||||
|
|
||||||
# Code-block preferences
|
# Code-block preferences
|
||||||
csharp_prefer_braces = true:silent
|
csharp_prefer_braces = true:silent
|
||||||
|
61
.gitattributes
vendored
61
.gitattributes
vendored
@ -1,63 +1,4 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
# Set default behavior to automatically normalize line endings.
|
# Set default behavior to automatically normalize line endings.
|
||||||
###############################################################################
|
###############################################################################
|
||||||
* text=auto
|
* text=auto eol=lf
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
# Set default behavior for command prompt diff.
|
|
||||||
#
|
|
||||||
# This is need for earlier builds of msysgit that does not have it on by
|
|
||||||
# default for csharp files.
|
|
||||||
# Note: This is only used by command line
|
|
||||||
###############################################################################
|
|
||||||
#*.cs diff=csharp
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
# Set the merge driver for project and solution files
|
|
||||||
#
|
|
||||||
# Merging from the command prompt will add diff markers to the files if there
|
|
||||||
# are conflicts (Merging from VS is not affected by the settings below, in VS
|
|
||||||
# the diff markers are never inserted). Diff markers may cause the following
|
|
||||||
# file extensions to fail to load in VS. An alternative would be to treat
|
|
||||||
# these files as binary and thus will always conflict and require user
|
|
||||||
# intervention with every merge. To do so, just uncomment the entries below
|
|
||||||
###############################################################################
|
|
||||||
#*.sln merge=binary
|
|
||||||
#*.csproj merge=binary
|
|
||||||
#*.vbproj merge=binary
|
|
||||||
#*.vcxproj merge=binary
|
|
||||||
#*.vcproj merge=binary
|
|
||||||
#*.dbproj merge=binary
|
|
||||||
#*.fsproj merge=binary
|
|
||||||
#*.lsproj merge=binary
|
|
||||||
#*.wixproj merge=binary
|
|
||||||
#*.modelproj merge=binary
|
|
||||||
#*.sqlproj merge=binary
|
|
||||||
#*.wwaproj merge=binary
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
# behavior for image files
|
|
||||||
#
|
|
||||||
# image files are treated as binary by default.
|
|
||||||
###############################################################################
|
|
||||||
#*.jpg binary
|
|
||||||
#*.png binary
|
|
||||||
#*.gif binary
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
# diff behavior for common document formats
|
|
||||||
#
|
|
||||||
# Convert binary document formats to text before diffing them. This feature
|
|
||||||
# is only available from the command line. Turn it on by uncommenting the
|
|
||||||
# entries below.
|
|
||||||
###############################################################################
|
|
||||||
#*.doc diff=astextplain
|
|
||||||
#*.DOC diff=astextplain
|
|
||||||
#*.docx diff=astextplain
|
|
||||||
#*.DOCX diff=astextplain
|
|
||||||
#*.dot diff=astextplain
|
|
||||||
#*.DOT diff=astextplain
|
|
||||||
#*.pdf diff=astextplain
|
|
||||||
#*.PDF diff=astextplain
|
|
||||||
#*.rtf diff=astextplain
|
|
||||||
#*.RTF diff=astextplain
|
|
||||||
|
43
.github/ISSUE_TEMPLATE/bug_report.md
vendored
43
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@ -1,43 +0,0 @@
|
|||||||
---
|
|
||||||
name: Bug Report
|
|
||||||
about: Something doesn't work correctly in Ryujinx.
|
|
||||||
#assignees:
|
|
||||||
---
|
|
||||||
|
|
||||||
## Bug Report
|
|
||||||
|
|
||||||
[ If any section does not apply, replace its contents with "N/A". ]</br>
|
|
||||||
[ Lines between [ ] (square brackets) should be removed before posting. ]
|
|
||||||
|
|
||||||
### What's the issue you encountered?
|
|
||||||
|
|
||||||
[ Describe the issue in detail and what you were doing beforehand. ]</br>
|
|
||||||
[ Did you make any changes related to Ryujinx itself? ]</br>
|
|
||||||
[ If so, make sure to include details relating to what exactly you changed. ]
|
|
||||||
|
|
||||||
### How can the issue be reproduced?
|
|
||||||
|
|
||||||
[ Include a detailed step by step process for recreating your issue. ]
|
|
||||||
|
|
||||||
### Log file
|
|
||||||
|
|
||||||
[ Logs files can be found under ``Logs`` folder in Ryujinx program folder. ]</br>
|
|
||||||
[ If you don't include a crash report in instances of crash related issues, we will ask you one to provide one. ]
|
|
||||||
|
|
||||||
### Environment?
|
|
||||||
|
|
||||||
- Ryujinx version: 1.0.X</br>
|
|
||||||
[ Replace X's with the Ryujinx version at time of crash. ]
|
|
||||||
- Game version: X.X.X</br>
|
|
||||||
[ Replace X's with the game version at time of crash. ]
|
|
||||||
- System Specs:
|
|
||||||
- OS: *(e.g. Windows 10)*
|
|
||||||
- CPU: *(e.g. i7-6700)*
|
|
||||||
- GPU: *(e.g. NVIDIA RTX 2070)*
|
|
||||||
- RAM: *(e.g. 16GB)*
|
|
||||||
- Applied Mods : [ Yes (Which ones) / No ]
|
|
||||||
|
|
||||||
### Additional context?
|
|
||||||
|
|
||||||
Additional info about your environment:</br>
|
|
||||||
[ Any other information relevant to your issue. ]
|
|
86
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
86
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
name: Bug Report
|
||||||
|
description: File a bug report
|
||||||
|
title: "[Bug]"
|
||||||
|
labels: bug
|
||||||
|
body:
|
||||||
|
- type: textarea
|
||||||
|
id: issue
|
||||||
|
attributes:
|
||||||
|
label: Description of the issue
|
||||||
|
description: What's the issue you encountered?
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: repro
|
||||||
|
attributes:
|
||||||
|
label: Reproduction steps
|
||||||
|
description: How can the issue be reproduced?
|
||||||
|
placeholder: Describe each step as precisely as possible
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: log
|
||||||
|
attributes:
|
||||||
|
label: Log file
|
||||||
|
description: A log file will help our developers to better diagnose and fix the issue.
|
||||||
|
placeholder: Logs files can be found under "Logs" folder in Ryujinx program folder. You can drag and drop the log on to the text area
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: input
|
||||||
|
id: os
|
||||||
|
attributes:
|
||||||
|
label: OS
|
||||||
|
placeholder: "e.g. Windows 10"
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: input
|
||||||
|
id: ryujinx-version
|
||||||
|
attributes:
|
||||||
|
label: Ryujinx version
|
||||||
|
placeholder: "e.g. 1.0.470"
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: input
|
||||||
|
id: game-version
|
||||||
|
attributes:
|
||||||
|
label: Game version
|
||||||
|
placeholder: "e.g. 1.1.1"
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
- type: input
|
||||||
|
id: cpu
|
||||||
|
attributes:
|
||||||
|
label: CPU
|
||||||
|
placeholder: "e.g. i7-6700"
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
- type: input
|
||||||
|
id: gpu
|
||||||
|
attributes:
|
||||||
|
label: GPU
|
||||||
|
placeholder: "e.g. NVIDIA RTX 2070"
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
- type: input
|
||||||
|
id: ram
|
||||||
|
attributes:
|
||||||
|
label: RAM
|
||||||
|
placeholder: "e.g. 16GB"
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
- type: textarea
|
||||||
|
id: mods
|
||||||
|
attributes:
|
||||||
|
label: List of applied mods
|
||||||
|
placeholder: You can list applied mods here.
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
- type: textarea
|
||||||
|
id: additional-context
|
||||||
|
attributes:
|
||||||
|
label: Additional context?
|
||||||
|
description: |
|
||||||
|
- Additional info about your environment:
|
||||||
|
- Any other information relevant to your issue.
|
||||||
|
validations:
|
||||||
|
required: false
|
34
.github/ISSUE_TEMPLATE/feature_request.md
vendored
34
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@ -1,34 +0,0 @@
|
|||||||
---
|
|
||||||
name: Feature Request
|
|
||||||
about: Suggest a new feature for Ryujinx.
|
|
||||||
#assignees:
|
|
||||||
---
|
|
||||||
|
|
||||||
## Feature Request
|
|
||||||
|
|
||||||
[ If any section does not apply, replace its contents with "N/A". ]</br>
|
|
||||||
[ If you do not have the information needed for a section, replace its contents with "Unknown". ]</br>
|
|
||||||
[ Lines between [ ] (square brackets) are to be removed before posting. ]</br>
|
|
||||||
|
|
||||||
[ Please search for existing [feature requests](https://github.com/Ryujinx/Ryujinx/issues) before you make your own request. ]</br>
|
|
||||||
[ Duplicate requests will be marked as such and you will be referred to the original request. ]
|
|
||||||
|
|
||||||
### What feature are you suggesting?
|
|
||||||
#### Overview:
|
|
||||||
- [ Include the basic, high-level concepts for this feature here. ]
|
|
||||||
|
|
||||||
#### Smaller Details:
|
|
||||||
- [ These may include specific methods of implementation etc. ]
|
|
||||||
|
|
||||||
#### Nature of Request:
|
|
||||||
[ Remove all that do not apply to your request. ]
|
|
||||||
- Addition
|
|
||||||
- [ Ex: Addition of certain original features or features from other community projects. ]
|
|
||||||
- [ If you are suggesting porting features or including features from other projects, include what license they are distributed under and what, if any libraries those project use. ]
|
|
||||||
- Change
|
|
||||||
- Removal
|
|
||||||
- [Ex: Removal of certain features or implementation due to a specific issue/bug or because of low quality code, etc.]
|
|
||||||
|
|
||||||
### Why would this feature be useful?
|
|
||||||
[ If this is a feature for an end-user, how does it benefit the end-user? ]</br>
|
|
||||||
[ If this feature is for developers, what does it add to Ryujinx that did not already exist? ]
|
|
30
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
Normal file
30
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
name: Feature Request
|
||||||
|
description: Suggest a new feature for Ryujinx.
|
||||||
|
title: "[Feature Request]"
|
||||||
|
body:
|
||||||
|
- type: textarea
|
||||||
|
id: overview
|
||||||
|
attributes:
|
||||||
|
label: Overview
|
||||||
|
description: Include the basic, high-level concepts for this feature here.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: details
|
||||||
|
attributes:
|
||||||
|
label: Smaller details
|
||||||
|
description: These may include specific methods of implementation etc.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: request
|
||||||
|
attributes:
|
||||||
|
label: Nature of request
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: feature
|
||||||
|
attributes:
|
||||||
|
label: Why would this feature be useful?
|
||||||
|
validations:
|
||||||
|
required: true
|
@ -1,34 +0,0 @@
|
|||||||
---
|
|
||||||
name: Missing CPU Instruction
|
|
||||||
about: CPU Instruction is missing in Ryujinx.
|
|
||||||
#assignees:
|
|
||||||
---
|
|
||||||
|
|
||||||
## Missing CPU Instruction
|
|
||||||
|
|
||||||
[ If any section does not apply, replace its contents with "N/A". ]</br>
|
|
||||||
[ If you do not have the information needed for a section, replace its contents with "Unknown". ]</br>
|
|
||||||
[ Lines between [ ] (square brackets) are to be removed before posting. ]
|
|
||||||
|
|
||||||
[ Please search for existing [missing CPU instruction](https://github.com/Ryujinx/Ryujinx/issues) before you make your own issue. ]</br>
|
|
||||||
[ See the following [issue](https://github.com/Ryujinx/Ryujinx/issues/1405) as an example ]</br>
|
|
||||||
[ Duplicate issue will be marked as such and you will be referred to the original request. ]
|
|
||||||
|
|
||||||
### What CPU instruction is missing?
|
|
||||||
|
|
||||||
Requires the *INSTRUCTION* instruction.</br>
|
|
||||||
[ Replace *INSTRUCTION* by the instruction name, e.g. VADDL.U16 ]
|
|
||||||
|
|
||||||
```
|
|
||||||
*
|
|
||||||
```
|
|
||||||
[ Add the undefined instruction error message in the above code block ]
|
|
||||||
|
|
||||||
### Instruction name
|
|
||||||
```
|
|
||||||
*
|
|
||||||
```
|
|
||||||
[ Include the name from [armconverter.com](https://armconverter.com/?disasm) or [shell-storm.org](http://shell-storm.org/online/Online-Assembler-and-Disassembler/?arch=arm64&endianness=big&dis_with_raw=True&dis_with_ins=True) in the above code block ]
|
|
||||||
|
|
||||||
### Required by:
|
|
||||||
[ Add our (games list database)[https://github.com/Ryujinx/Ryujinx-Games-List/issues] links of games who require this instruction ]
|
|
26
.github/ISSUE_TEMPLATE/missing_cpu_instruction.yml
vendored
Normal file
26
.github/ISSUE_TEMPLATE/missing_cpu_instruction.yml
vendored
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
name: Missing CPU Instruction
|
||||||
|
description: CPU Instruction is missing in Ryujinx.
|
||||||
|
title: "[CPU]"
|
||||||
|
labels: [cpu, not-implemented]
|
||||||
|
body:
|
||||||
|
- type: textarea
|
||||||
|
id: instruction
|
||||||
|
attributes:
|
||||||
|
label: CPU instruction
|
||||||
|
description: What CPU instruction is missing?
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: name
|
||||||
|
attributes:
|
||||||
|
label: Instruction name
|
||||||
|
description: Include the name from [armconverter.com](https://armconverter.com/?disasm) or [shell-storm.org](http://shell-storm.org/online/Online-Assembler-and-Disassembler/?arch=arm64&endianness=big&dis_with_raw=True&dis_with_ins=True) in the above code block
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: required
|
||||||
|
attributes:
|
||||||
|
label: Required by
|
||||||
|
description: Add links to the [compatibility list page(s)](https://github.com/Ryujinx/Ryujinx-Games-List/issues) of the game(s) that require this instruction.
|
||||||
|
validations:
|
||||||
|
required: true
|
35
.github/ISSUE_TEMPLATE/missing_service_call.md
vendored
35
.github/ISSUE_TEMPLATE/missing_service_call.md
vendored
@ -1,35 +0,0 @@
|
|||||||
---
|
|
||||||
name: Missing Service Call
|
|
||||||
about: Service call is missing in Ryujinx.
|
|
||||||
#assignees:
|
|
||||||
---
|
|
||||||
|
|
||||||
## Missing Service Call
|
|
||||||
|
|
||||||
[ If any section does not apply, replace its contents with "N/A". ]</br>
|
|
||||||
[ If you do not have the information needed for a section, replace its contents with "Unknown". ]</br>
|
|
||||||
[ Lines between [ ] (square brackets) are to be removed before posting. ]
|
|
||||||
|
|
||||||
[ Please search for existing [missing service call](https://github.com/Ryujinx/Ryujinx/issues) before you make your own issue. ]</br>
|
|
||||||
[ See the following [issue](https://github.com/Ryujinx/Ryujinx/issues/1431) as an example ]</br>
|
|
||||||
[ Duplicate issue will be marked as such and you will be referred to the original request. ]
|
|
||||||
|
|
||||||
### What service call is missing?
|
|
||||||
|
|
||||||
*SERVICE* *INTERFACE*: *NUMBER* (*NAME*) is not implemented.</br>
|
|
||||||
[ Replace *SERVICE* by the service name, e.g. appletAE ]</br>
|
|
||||||
[ Replace *INTERFACE* by the interface name, e.g. IAllSystemAppletProxiesService ]</br>
|
|
||||||
[ Replace *NUMBER* by the call number, e.g. 100 ]</br>
|
|
||||||
[ Replace *NAME* by the call name, e.g. OpenSystemAppletProxy ]</br>
|
|
||||||
[ e.g. appletAE IAllSystemAppletProxiesService: 100 (OpenSystemAppletProxy) ]
|
|
||||||
|
|
||||||
[ Add related links to the specific call from [Switchbrew](https://switchbrew.org/w/index.php?title=Services_API) and/or [SwIPC](https://reswitched.github.io/SwIPC/) ]
|
|
||||||
|
|
||||||
### Service description
|
|
||||||
```
|
|
||||||
*
|
|
||||||
```
|
|
||||||
[ Include the description/explanation from [Switchbrew](https://switchbrew.org/w/index.php?title=Services_API) and/or [SwIPC](https://reswitched.github.io/SwIPC/) in the above code block ]
|
|
||||||
|
|
||||||
### Required by:
|
|
||||||
[ Add our (games list database)[https://github.com/Ryujinx/Ryujinx-Games-List/issues] links of games who require this call ]
|
|
25
.github/ISSUE_TEMPLATE/missing_service_call.yml
vendored
Normal file
25
.github/ISSUE_TEMPLATE/missing_service_call.yml
vendored
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
name: Missing Service Call
|
||||||
|
description: Service call is missing in Ryujinx.
|
||||||
|
labels: not-implemented
|
||||||
|
body:
|
||||||
|
- type: textarea
|
||||||
|
id: instruction
|
||||||
|
attributes:
|
||||||
|
label: Service call
|
||||||
|
description: What service call is missing?
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: name
|
||||||
|
attributes:
|
||||||
|
label: Service description
|
||||||
|
description: Include the description/explanation from [Switchbrew](https://switchbrew.org/w/index.php?title=Services_API) and/or [SwIPC](https://reswitched.github.io/SwIPC/) in the above code block
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: required
|
||||||
|
attributes:
|
||||||
|
label: Required by
|
||||||
|
description: Add links to the [compatibility list page(s)](https://github.com/Ryujinx/Ryujinx-Games-List/issues) of the game(s) that require this service.
|
||||||
|
validations:
|
||||||
|
required: true
|
24
.github/dependabot.yml
vendored
Normal file
24
.github/dependabot.yml
vendored
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
labels:
|
||||||
|
- "infra"
|
||||||
|
reviewers:
|
||||||
|
- marysaka
|
||||||
|
commit-message:
|
||||||
|
prefix: "ci"
|
||||||
|
|
||||||
|
- package-ecosystem: nuget
|
||||||
|
directory: /
|
||||||
|
open-pull-requests-limit: 5
|
||||||
|
schedule:
|
||||||
|
interval: daily
|
||||||
|
labels:
|
||||||
|
- "infra"
|
||||||
|
reviewers:
|
||||||
|
- marysaka
|
||||||
|
commit-message:
|
||||||
|
prefix: nuget
|
123
.github/workflows/build.yml
vendored
123
.github/workflows/build.yml
vendored
@ -18,10 +18,16 @@ on:
|
|||||||
- '*.yml'
|
- '*.yml'
|
||||||
- 'README.md'
|
- 'README.md'
|
||||||
|
|
||||||
|
env:
|
||||||
|
POWERSHELL_TELEMETRY_OPTOUT: 1
|
||||||
|
DOTNET_CLI_TELEMETRY_OPTOUT: 1
|
||||||
|
RYUJINX_BASE_VERSION: "1.1.0"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: ${{ matrix.os }} (${{ matrix.configuration }})
|
name: ${{ matrix.OS_NAME }} (${{ matrix.configuration }})
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
timeout-minutes: 35
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, macOS-latest, windows-latest]
|
os: [ubuntu-latest, macOS-latest, windows-latest]
|
||||||
@ -33,50 +39,117 @@ jobs:
|
|||||||
RELEASE_ZIP_OS_NAME: linux_x64
|
RELEASE_ZIP_OS_NAME: linux_x64
|
||||||
|
|
||||||
- os: macOS-latest
|
- os: macOS-latest
|
||||||
OS_NAME: MacOS x64
|
OS_NAME: macOS x64
|
||||||
DOTNET_RUNTIME_IDENTIFIER: osx-x64
|
DOTNET_RUNTIME_IDENTIFIER: osx-x64
|
||||||
RELEASE_ZIP_OS_NAME: osx_x64
|
RELEASE_ZIP_OS_NAME: osx_x64
|
||||||
|
|
||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
OS_NAME: Windows x64
|
OS_NAME: Windows x64
|
||||||
DOTNET_RUNTIME_IDENTIFIER: win-x64
|
DOTNET_RUNTIME_IDENTIFIER: win10-x64
|
||||||
RELEASE_ZIP_OS_NAME: win_x64
|
RELEASE_ZIP_OS_NAME: win_x64
|
||||||
|
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
env:
|
|
||||||
POWERSHELL_TELEMETRY_OPTOUT: 1
|
|
||||||
DOTNET_CLI_TELEMETRY_OPTOUT: 1
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-dotnet@v1
|
|
||||||
|
- uses: actions/setup-dotnet@v3
|
||||||
with:
|
with:
|
||||||
dotnet-version: 6.0.x
|
global-json-file: global.json
|
||||||
- name: Ensure NuGet Source
|
|
||||||
uses: fabriciomurta/ensure-nuget-source@v1
|
|
||||||
- name: Get git short hash
|
- name: Get git short hash
|
||||||
id: git_short_hash
|
id: git_short_hash
|
||||||
run: echo "::set-output name=result::$(git rev-parse --short "${{ github.sha }}")"
|
run: echo "result=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT
|
||||||
- name: Clear
|
shell: bash
|
||||||
run: dotnet clean && dotnet nuget locals all --clear
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: dotnet build -c "${{ matrix.configuration }}" /p:Version="1.1.0" /p:SourceRevisionId="${{ steps.git_short_hash.outputs.result }}" /p:ExtraDefineConstants=DISABLE_UPDATER
|
run: dotnet build -c "${{ matrix.configuration }}" -p:Version="${{ env.RYUJINX_BASE_VERSION }}" -p:SourceRevisionId="${{ steps.git_short_hash.outputs.result }}" -p:ExtraDefineConstants=DISABLE_UPDATER
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: dotnet test -c "${{ matrix.configuration }}"
|
run: dotnet test --no-build -c "${{ matrix.configuration }}"
|
||||||
|
|
||||||
- name: Publish Ryujinx
|
- name: Publish Ryujinx
|
||||||
run: dotnet publish -c "${{ matrix.configuration }}" -r "${{ matrix.DOTNET_RUNTIME_IDENTIFIER }}" -o ./publish /p:Version="1.1.0" /p:DebugType=embedded /p:SourceRevisionId="${{ steps.git_short_hash.outputs.result }}" /p:ExtraDefineConstants=DISABLE_UPDATER Ryujinx --self-contained
|
run: dotnet publish -c "${{ matrix.configuration }}" -r "${{ matrix.DOTNET_RUNTIME_IDENTIFIER }}" -o ./publish -p:Version="${{ env.RYUJINX_BASE_VERSION }}" -p:DebugType=embedded -p:SourceRevisionId="${{ steps.git_short_hash.outputs.result }}" -p:ExtraDefineConstants=DISABLE_UPDATER src/Ryujinx --self-contained true
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request' && matrix.os != 'macOS-latest'
|
||||||
|
|
||||||
- name: Publish Ryujinx.Headless.SDL2
|
- name: Publish Ryujinx.Headless.SDL2
|
||||||
run: dotnet publish -c "${{ matrix.configuration }}" -r "${{ matrix.DOTNET_RUNTIME_IDENTIFIER }}" -o ./publish_sdl2_headless /p:Version="1.1.0" /p:DebugType=embedded /p:SourceRevisionId="${{ steps.git_short_hash.outputs.result }}" /p:ExtraDefineConstants=DISABLE_UPDATER Ryujinx.Headless.SDL2 --self-contained
|
run: dotnet publish -c "${{ matrix.configuration }}" -r "${{ matrix.DOTNET_RUNTIME_IDENTIFIER }}" -o ./publish_sdl2_headless -p:Version="${{ env.RYUJINX_BASE_VERSION }}" -p:DebugType=embedded -p:SourceRevisionId="${{ steps.git_short_hash.outputs.result }}" -p:ExtraDefineConstants=DISABLE_UPDATER src/Ryujinx.Headless.SDL2 --self-contained true
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request' && matrix.os != 'macOS-latest'
|
||||||
|
|
||||||
|
- name: Publish Ryujinx.Ava
|
||||||
|
run: dotnet publish -c "${{ matrix.configuration }}" -r "${{ matrix.DOTNET_RUNTIME_IDENTIFIER }}" -o ./publish_ava -p:Version="${{ env.RYUJINX_BASE_VERSION }}" -p:DebugType=embedded -p:SourceRevisionId="${{ steps.git_short_hash.outputs.result }}" -p:ExtraDefineConstants=DISABLE_UPDATER src/Ryujinx.Ava --self-contained true
|
||||||
|
if: github.event_name == 'pull_request' && matrix.os != 'macOS-latest'
|
||||||
|
|
||||||
|
- name: Set executable bit
|
||||||
|
run: |
|
||||||
|
chmod +x ./publish/Ryujinx ./publish/Ryujinx.sh
|
||||||
|
chmod +x ./publish_sdl2_headless/Ryujinx.Headless.SDL2 ./publish_sdl2_headless/Ryujinx.sh
|
||||||
|
chmod +x ./publish_ava/Ryujinx.Ava ./publish_ava/Ryujinx.sh
|
||||||
|
if: github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest'
|
||||||
|
|
||||||
- name: Upload Ryujinx artifact
|
- name: Upload Ryujinx artifact
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ryujinx-${{ matrix.configuration }}-1.0.0+${{ steps.git_short_hash.outputs.result }}-${{ matrix.RELEASE_ZIP_OS_NAME }}
|
name: ryujinx-${{ matrix.configuration }}-${{ env.RYUJINX_BASE_VERSION }}+${{ steps.git_short_hash.outputs.result }}-${{ matrix.RELEASE_ZIP_OS_NAME }}
|
||||||
path: publish
|
path: publish
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request' && matrix.os != 'macOS-latest'
|
||||||
|
|
||||||
- name: Upload Ryujinx.Headless.SDL2 artifact
|
- name: Upload Ryujinx.Headless.SDL2 artifact
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ryujinx-headless-sdl2-${{ matrix.configuration }}-1.0.0+${{ steps.git_short_hash.outputs.result }}-${{ matrix.RELEASE_ZIP_OS_NAME }}
|
name: sdl2-ryujinx-headless-${{ matrix.configuration }}-${{ env.RYUJINX_BASE_VERSION }}+${{ steps.git_short_hash.outputs.result }}-${{ matrix.RELEASE_ZIP_OS_NAME }}
|
||||||
path: publish_sdl2_headless
|
path: publish_sdl2_headless
|
||||||
|
if: github.event_name == 'pull_request' && matrix.os != 'macOS-latest'
|
||||||
|
|
||||||
|
- name: Upload Ryujinx.Ava artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: ava-ryujinx-${{ matrix.configuration }}-${{ env.RYUJINX_BASE_VERSION }}+${{ steps.git_short_hash.outputs.result }}-${{ matrix.RELEASE_ZIP_OS_NAME }}
|
||||||
|
path: publish_ava
|
||||||
|
if: github.event_name == 'pull_request' && matrix.os != 'macOS-latest'
|
||||||
|
|
||||||
|
build_macos:
|
||||||
|
name: macOS Universal (${{ matrix.configuration }})
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 35
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
configuration: [ Debug, Release ]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- uses: actions/setup-dotnet@v3
|
||||||
|
with:
|
||||||
|
global-json-file: global.json
|
||||||
|
|
||||||
|
- name: Setup LLVM 14
|
||||||
|
run: |
|
||||||
|
wget https://apt.llvm.org/llvm.sh
|
||||||
|
chmod +x llvm.sh
|
||||||
|
sudo ./llvm.sh 14
|
||||||
|
|
||||||
|
- name: Install rcodesign
|
||||||
|
run: |
|
||||||
|
mkdir -p $HOME/.bin
|
||||||
|
gh release download -R indygreg/apple-platform-rs -O apple-codesign.tar.gz -p 'apple-codesign-*-x86_64-unknown-linux-musl.tar.gz'
|
||||||
|
tar -xzvf apple-codesign.tar.gz --wildcards '*/rcodesign' --strip-components=1
|
||||||
|
rm apple-codesign.tar.gz
|
||||||
|
mv rcodesign $HOME/.bin/
|
||||||
|
echo "$HOME/.bin" >> $GITHUB_PATH
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Get git short hash
|
||||||
|
id: git_short_hash
|
||||||
|
run: echo "result=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Publish macOS
|
||||||
|
run: |
|
||||||
|
./distribution/macos/create_macos_build.sh . publish_tmp publish_ava ./distribution/macos/entitlements.xml "${{ env.RYUJINX_BASE_VERSION }}" "${{ steps.git_short_hash.outputs.result }}" "${{ matrix.configuration }}" "-p:ExtraDefineConstants=DISABLE_UPDATER"
|
||||||
|
|
||||||
|
- name: Upload Ryujinx.Ava artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: ava-ryujinx-${{ matrix.configuration }}-${{ env.RYUJINX_BASE_VERSION }}+${{ steps.git_short_hash.outputs.result }}-macos_universal
|
||||||
|
path: "publish_ava/*.tar.gz"
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
172
.github/workflows/flatpak.yml
vendored
Normal file
172
.github/workflows/flatpak.yml
vendored
Normal file
@ -0,0 +1,172 @@
|
|||||||
|
name: Flatpak release job
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
ryujinx_version:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
|
||||||
|
concurrency: flatpak-release
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
timeout-minutes: 35
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
env:
|
||||||
|
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
|
||||||
|
GIT_COMMITTER_NAME: "RyujinxBot"
|
||||||
|
GIT_COMMITTER_EMAIL: "61127645+RyujinxBot@users.noreply.github.com"
|
||||||
|
RYUJINX_PROJECT_FILE: "src/Ryujinx/Ryujinx.csproj"
|
||||||
|
NUGET_SOURCES_DESTDIR: "nuget-sources"
|
||||||
|
RYUJINX_VERSION: "${{ inputs.ryujinx_version }}"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
path: Ryujinx
|
||||||
|
|
||||||
|
- uses: actions/setup-dotnet@v3
|
||||||
|
with:
|
||||||
|
global-json-file: Ryujinx/global.json
|
||||||
|
|
||||||
|
- name: Get version info
|
||||||
|
id: version_info
|
||||||
|
working-directory: Ryujinx
|
||||||
|
run: |
|
||||||
|
echo "git_hash=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
repository: flathub/org.ryujinx.Ryujinx
|
||||||
|
token: ${{ secrets.RYUJINX_BOT_PAT }}
|
||||||
|
submodules: recursive
|
||||||
|
path: flathub
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: python -m pip install PyYAML lxml
|
||||||
|
|
||||||
|
- name: Restore Nuget packages
|
||||||
|
run: dotnet restore Ryujinx/${{ env.RYUJINX_PROJECT_FILE }}
|
||||||
|
|
||||||
|
- name: Generate nuget_sources.json
|
||||||
|
shell: python
|
||||||
|
run: |
|
||||||
|
from pathlib import Path
|
||||||
|
import base64
|
||||||
|
import binascii
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
|
||||||
|
sources = []
|
||||||
|
|
||||||
|
for path in Path(os.environ['NUGET_PACKAGES']).glob('**/*.nupkg.sha512'):
|
||||||
|
name = path.parent.parent.name
|
||||||
|
version = path.parent.name
|
||||||
|
filename = '{}.{}.nupkg'.format(name, version)
|
||||||
|
url = 'https://api.nuget.org/v3-flatcontainer/{}/{}/{}'.format(name, version, filename)
|
||||||
|
|
||||||
|
with path.open() as fp:
|
||||||
|
sha512 = binascii.hexlify(base64.b64decode(fp.read())).decode('ascii')
|
||||||
|
|
||||||
|
sources.append({
|
||||||
|
'type': 'file',
|
||||||
|
'url': url,
|
||||||
|
'sha512': sha512,
|
||||||
|
'dest': os.environ['NUGET_SOURCES_DESTDIR'],
|
||||||
|
'dest-filename': filename,
|
||||||
|
})
|
||||||
|
|
||||||
|
with open('flathub/nuget_sources.json', 'w') as fp:
|
||||||
|
json.dump(sources, fp, indent=4)
|
||||||
|
|
||||||
|
- name: Update flatpak metadata
|
||||||
|
id: metadata
|
||||||
|
env:
|
||||||
|
RYUJINX_GIT_HASH: ${{ steps.version_info.outputs.git_hash }}
|
||||||
|
shell: python
|
||||||
|
run: |
|
||||||
|
import hashlib
|
||||||
|
import hmac
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
import yaml
|
||||||
|
from datetime import datetime
|
||||||
|
from lxml import etree
|
||||||
|
|
||||||
|
|
||||||
|
# Ensure we don't destroy multiline strings
|
||||||
|
def str_presenter(dumper, data):
|
||||||
|
if len(data.splitlines()) > 1:
|
||||||
|
return dumper.represent_scalar("tag:yaml.org,2002:str", data, style="|")
|
||||||
|
return dumper.represent_scalar("tag:yaml.org,2002:str", data)
|
||||||
|
|
||||||
|
|
||||||
|
yaml.representer.SafeRepresenter.add_representer(str, str_presenter)
|
||||||
|
|
||||||
|
yaml_file = "flathub/org.ryujinx.Ryujinx.yml"
|
||||||
|
xml_file = "flathub/org.ryujinx.Ryujinx.appdata.xml"
|
||||||
|
|
||||||
|
with open(yaml_file, "r") as f:
|
||||||
|
data = yaml.safe_load(f)
|
||||||
|
|
||||||
|
for source in data["modules"][0]["sources"]:
|
||||||
|
if type(source) is str:
|
||||||
|
continue
|
||||||
|
if (
|
||||||
|
source["type"] == "git"
|
||||||
|
and source["url"] == "https://github.com/Ryujinx/Ryujinx.git"
|
||||||
|
):
|
||||||
|
source["commit"] = os.environ['RYUJINX_GIT_HASH']
|
||||||
|
|
||||||
|
is_same_version = data["modules"][0]["build-options"]["env"]["RYUJINX_VERSION"] == os.environ['RYUJINX_VERSION']
|
||||||
|
|
||||||
|
with open(os.environ['GITHUB_OUTPUT'], "a") as gh_out:
|
||||||
|
if is_same_version:
|
||||||
|
gh_out.write(f"commit_message=Retry update to {os.environ['RYUJINX_VERSION']}")
|
||||||
|
else:
|
||||||
|
gh_out.write(f"commit_message=Update to {os.environ['RYUJINX_VERSION']}")
|
||||||
|
|
||||||
|
if not is_same_version:
|
||||||
|
data["modules"][0]["build-options"]["env"]["RYUJINX_VERSION"] = os.environ['RYUJINX_VERSION']
|
||||||
|
|
||||||
|
with open(yaml_file, "w") as f:
|
||||||
|
yaml.safe_dump(data, f, sort_keys=False)
|
||||||
|
|
||||||
|
parser = etree.XMLParser(remove_blank_text=True)
|
||||||
|
tree = etree.parse(xml_file, parser)
|
||||||
|
|
||||||
|
root = tree.getroot()
|
||||||
|
|
||||||
|
releases = root.find("releases")
|
||||||
|
|
||||||
|
element = etree.Element("release")
|
||||||
|
element.set("version", os.environ['RYUJINX_VERSION'])
|
||||||
|
element.set("date", datetime.now().date().isoformat())
|
||||||
|
releases.insert(0, element)
|
||||||
|
|
||||||
|
# Ensure 4 spaces
|
||||||
|
etree.indent(root, space=" ")
|
||||||
|
|
||||||
|
with open(xml_file, "wb") as f:
|
||||||
|
f.write(
|
||||||
|
etree.tostring(
|
||||||
|
tree,
|
||||||
|
pretty_print=True,
|
||||||
|
encoding="UTF-8",
|
||||||
|
doctype='<?xml version="1.0" encoding="UTF-8"?>',
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
- name: Push flatpak update
|
||||||
|
working-directory: flathub
|
||||||
|
env:
|
||||||
|
COMMIT_MESSAGE: ${{ steps.metadata.outputs.commit_message }}
|
||||||
|
run: |
|
||||||
|
git config user.name "${{ env.GIT_COMMITTER_NAME }}"
|
||||||
|
git config user.email "${{ env.GIT_COMMITTER_EMAIL }}"
|
||||||
|
git add .
|
||||||
|
git commit -m "$COMMIT_MESSAGE"
|
||||||
|
git push origin master
|
27
.github/workflows/nightly_pr_comment.yml
vendored
27
.github/workflows/nightly_pr_comment.yml
vendored
@ -7,8 +7,9 @@ jobs:
|
|||||||
pr_comment:
|
pr_comment:
|
||||||
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
|
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 35
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/github-script@v3
|
- uses: actions/github-script@v6
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const {owner, repo} = context.repo;
|
const {owner, repo} = context.repo;
|
||||||
@ -16,7 +17,7 @@ jobs:
|
|||||||
const pull_head_sha = '${{github.event.workflow_run.head_sha}}';
|
const pull_head_sha = '${{github.event.workflow_run.head_sha}}';
|
||||||
|
|
||||||
const issue_number = await (async () => {
|
const issue_number = await (async () => {
|
||||||
const pulls = await github.pulls.list({owner, repo});
|
const pulls = await github.rest.pulls.list({owner, repo});
|
||||||
for await (const {data} of github.paginate.iterator(pulls)) {
|
for await (const {data} of github.paginate.iterator(pulls)) {
|
||||||
for (const pull of data) {
|
for (const pull of data) {
|
||||||
if (pull.head.sha === pull_head_sha) {
|
if (pull.head.sha === pull_head_sha) {
|
||||||
@ -31,28 +32,38 @@ jobs:
|
|||||||
return core.error(`No matching pull request found`);
|
return core.error(`No matching pull request found`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const {data: {artifacts}} = await github.actions.listWorkflowRunArtifacts({owner, repo, run_id});
|
const {data: {artifacts}} = await github.rest.actions.listWorkflowRunArtifacts({owner, repo, run_id});
|
||||||
if (!artifacts.length) {
|
if (!artifacts.length) {
|
||||||
return core.error(`No artifacts found`);
|
return core.error(`No artifacts found`);
|
||||||
}
|
}
|
||||||
let body = `Download the artifacts for this pull request:\n`;
|
let body = `Download the artifacts for this pull request:\n`;
|
||||||
|
let hidden_avalonia_artifacts = `\n\n <details><summary>Experimental GUI (Avalonia)</summary>\n`;
|
||||||
|
let hidden_headless_artifacts = `\n\n <details><summary>GUI-less (SDL2)</summary>\n`;
|
||||||
let hidden_debug_artifacts = `\n\n <details><summary>Only for Developers</summary>\n`;
|
let hidden_debug_artifacts = `\n\n <details><summary>Only for Developers</summary>\n`;
|
||||||
for (const art of artifacts) {
|
for (const art of artifacts) {
|
||||||
if(art.name.includes('Debug')){
|
if(art.name.includes('Debug')) {
|
||||||
hidden_debug_artifacts += `\n* [${art.name}](https://nightly.link/${owner}/${repo}/actions/artifacts/${art.id}.zip)`;
|
hidden_debug_artifacts += `\n* [${art.name}](https://nightly.link/${owner}/${repo}/actions/artifacts/${art.id}.zip)`;
|
||||||
}else{
|
} else if(art.name.includes('ava-ryujinx')) {
|
||||||
|
hidden_avalonia_artifacts += `\n* [${art.name}](https://nightly.link/${owner}/${repo}/actions/artifacts/${art.id}.zip)`;
|
||||||
|
} else if(art.name.includes('sdl2-ryujinx-headless')) {
|
||||||
|
hidden_headless_artifacts += `\n* [${art.name}](https://nightly.link/${owner}/${repo}/actions/artifacts/${art.id}.zip)`;
|
||||||
|
} else {
|
||||||
body += `\n* [${art.name}](https://nightly.link/${owner}/${repo}/actions/artifacts/${art.id}.zip)`;
|
body += `\n* [${art.name}](https://nightly.link/${owner}/${repo}/actions/artifacts/${art.id}.zip)`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
hidden_avalonia_artifacts += `\n</details>`;
|
||||||
|
hidden_headless_artifacts += `\n</details>`;
|
||||||
hidden_debug_artifacts += `\n</details>`;
|
hidden_debug_artifacts += `\n</details>`;
|
||||||
|
body += hidden_avalonia_artifacts;
|
||||||
|
body += hidden_headless_artifacts;
|
||||||
body += hidden_debug_artifacts;
|
body += hidden_debug_artifacts;
|
||||||
|
|
||||||
const {data: comments} = await github.issues.listComments({repo, owner, issue_number});
|
const {data: comments} = await github.rest.issues.listComments({repo, owner, issue_number});
|
||||||
const existing_comment = comments.find((c) => c.user.login === 'github-actions[bot]');
|
const existing_comment = comments.find((c) => c.user.login === 'github-actions[bot]');
|
||||||
if (existing_comment) {
|
if (existing_comment) {
|
||||||
core.info(`Updating comment ${existing_comment.id}`);
|
core.info(`Updating comment ${existing_comment.id}`);
|
||||||
await github.issues.updateComment({repo, owner, comment_id: existing_comment.id, body});
|
await github.rest.issues.updateComment({repo, owner, comment_id: existing_comment.id, body});
|
||||||
} else {
|
} else {
|
||||||
core.info(`Creating a comment`);
|
core.info(`Creating a comment`);
|
||||||
await github.issues.createComment({repo, owner, issue_number, body});
|
await github.rest.issues.createComment({repo, owner, issue_number, body});
|
||||||
}
|
}
|
199
.github/workflows/release.yml
vendored
199
.github/workflows/release.yml
vendored
@ -11,72 +11,119 @@ on:
|
|||||||
- '*.yml'
|
- '*.yml'
|
||||||
- 'README.md'
|
- 'README.md'
|
||||||
|
|
||||||
|
concurrency: release
|
||||||
|
|
||||||
|
env:
|
||||||
|
POWERSHELL_TELEMETRY_OPTOUT: 1
|
||||||
|
DOTNET_CLI_TELEMETRY_OPTOUT: 1
|
||||||
|
RYUJINX_BASE_VERSION: "1.1"
|
||||||
|
RYUJINX_TARGET_RELEASE_CHANNEL_NAME: "master"
|
||||||
|
RYUJINX_TARGET_RELEASE_CHANNEL_OWNER: "Ryujinx"
|
||||||
|
RYUJINX_TARGET_RELEASE_CHANNEL_REPO: "release-channel-master"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
tag:
|
||||||
runs-on: windows-latest
|
name: Create tag
|
||||||
|
runs-on: ubuntu-latest
|
||||||
env:
|
|
||||||
POWERSHELL_TELEMETRY_OPTOUT: 1
|
|
||||||
DOTNET_CLI_TELEMETRY_OPTOUT: 1
|
|
||||||
RYUJINX_BASE_VERSION: "1.1"
|
|
||||||
RYUJINX_TARGET_RELEASE_CHANNEL_NAME: "master"
|
|
||||||
RYUJINX_TARGET_RELEASE_CHANNEL_OWNER: "Ryujinx"
|
|
||||||
RYUJINX_TARGET_RELEASE_CHANNEL_REPO: "release-channel-master"
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- uses: actions/setup-dotnet@v1
|
|
||||||
with:
|
|
||||||
dotnet-version: 6.0.x
|
|
||||||
- name: Ensure NuGet Source
|
|
||||||
uses: fabriciomurta/ensure-nuget-source@v1
|
|
||||||
- name: Clear
|
|
||||||
run: dotnet clean && dotnet nuget locals all --clear
|
|
||||||
- name: Get version info
|
- name: Get version info
|
||||||
id: version_info
|
id: version_info
|
||||||
run: |
|
run: |
|
||||||
echo "::set-output name=build_version::${{ env.RYUJINX_BASE_VERSION }}.${{ github.run_number }}"
|
echo "build_version=${{ env.RYUJINX_BASE_VERSION }}.${{ github.run_number }}" >> $GITHUB_OUTPUT
|
||||||
echo "::set-output name=git_short_hash::$(git rev-parse --short "${{ github.sha }}")"
|
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
|
- name: Create tag
|
||||||
|
uses: actions/github-script@v5
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
github.rest.git.createRef({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
ref: 'refs/tags/${{ steps.version_info.outputs.build_version }}',
|
||||||
|
sha: context.sha
|
||||||
|
})
|
||||||
|
|
||||||
|
release:
|
||||||
|
name: Release ${{ matrix.OS_NAME }}
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
timeout-minutes: 35
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ ubuntu-latest, windows-latest ]
|
||||||
|
include:
|
||||||
|
- os: ubuntu-latest
|
||||||
|
OS_NAME: Linux x64
|
||||||
|
DOTNET_RUNTIME_IDENTIFIER: linux-x64
|
||||||
|
RELEASE_ZIP_OS_NAME: linux_x64
|
||||||
|
|
||||||
|
- os: windows-latest
|
||||||
|
OS_NAME: Windows x64
|
||||||
|
DOTNET_RUNTIME_IDENTIFIER: win10-x64
|
||||||
|
RELEASE_ZIP_OS_NAME: win_x64
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- uses: actions/setup-dotnet@v3
|
||||||
|
with:
|
||||||
|
global-json-file: global.json
|
||||||
|
|
||||||
|
- name: Get version info
|
||||||
|
id: version_info
|
||||||
|
run: |
|
||||||
|
echo "build_version=${{ env.RYUJINX_BASE_VERSION }}.${{ github.run_number }}" >> $GITHUB_OUTPUT
|
||||||
|
echo "git_short_hash=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT
|
||||||
|
shell: bash
|
||||||
|
|
||||||
- name: Configure for release
|
- name: Configure for release
|
||||||
run: |
|
run: |
|
||||||
sed -r --in-place 's/\%\%RYUJINX_BUILD_VERSION\%\%/${{ steps.version_info.outputs.build_version }}/g;' Ryujinx.Common/ReleaseInformations.cs
|
sed -r --in-place 's/\%\%RYUJINX_BUILD_VERSION\%\%/${{ steps.version_info.outputs.build_version }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
|
||||||
sed -r --in-place 's/\%\%RYUJINX_BUILD_GIT_HASH\%\%/${{ steps.version_info.outputs.git_short_hash }}/g;' Ryujinx.Common/ReleaseInformations.cs
|
sed -r --in-place 's/\%\%RYUJINX_BUILD_GIT_HASH\%\%/${{ steps.version_info.outputs.git_short_hash }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
|
||||||
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_NAME\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }}/g;' Ryujinx.Common/ReleaseInformations.cs
|
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_NAME\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
|
||||||
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_OWNER\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/g;' Ryujinx.Common/ReleaseInformations.cs
|
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_OWNER\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
|
||||||
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/g;' Ryujinx.Common/ReleaseInformations.cs
|
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Create output dir
|
- name: Create output dir
|
||||||
run: "mkdir release_output"
|
run: "mkdir release_output"
|
||||||
- name: Publish Windows
|
|
||||||
|
- name: Publish
|
||||||
run: |
|
run: |
|
||||||
dotnet publish -c Release -r win-x64 -o ./publish_windows/publish /p:Version="${{ steps.version_info.outputs.build_version }}" /p:SourceRevisionId="${{ steps.version_info.outputs.git_short_hash }}" /p:DebugType=embedded Ryujinx --self-contained
|
dotnet publish -c Release -r "${{ matrix.DOTNET_RUNTIME_IDENTIFIER }}" -o ./publish_gtk/publish -p:Version="${{ steps.version_info.outputs.build_version }}" -p:SourceRevisionId="${{ steps.version_info.outputs.git_short_hash }}" -p:DebugType=embedded src/Ryujinx --self-contained true
|
||||||
dotnet publish -c Release -r win-x64 -o ./publish_windows_sdl2_headless/publish /p:Version="${{ steps.version_info.outputs.build_version }}" /p:SourceRevisionId="${{ steps.version_info.outputs.git_short_hash }}" /p:DebugType=embedded Ryujinx.Headless.SDL2 --self-contained
|
dotnet publish -c Release -r "${{ matrix.DOTNET_RUNTIME_IDENTIFIER }}" -o ./publish_sdl2_headless/publish -p:Version="${{ steps.version_info.outputs.build_version }}" -p:SourceRevisionId="${{ steps.version_info.outputs.git_short_hash }}" -p:DebugType=embedded src/Ryujinx.Headless.SDL2 --self-contained true
|
||||||
|
dotnet publish -c Release -r "${{ matrix.DOTNET_RUNTIME_IDENTIFIER }}" -o ./publish_ava/publish -p:Version="${{ steps.version_info.outputs.build_version }}" -p:SourceRevisionId="${{ steps.version_info.outputs.git_short_hash }}" -p:DebugType=embedded src/Ryujinx.Ava --self-contained true
|
||||||
|
|
||||||
- name: Packing Windows builds
|
- name: Packing Windows builds
|
||||||
|
if: matrix.os == 'windows-latest'
|
||||||
run: |
|
run: |
|
||||||
pushd publish_windows
|
pushd publish_gtk
|
||||||
7z a ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-win_x64.zip publish
|
7z a ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-win_x64.zip publish
|
||||||
popd
|
popd
|
||||||
|
|
||||||
pushd publish_windows_sdl2_headless
|
pushd publish_sdl2_headless
|
||||||
7z a ../release_output/ryujinx-headless-sdl2-${{ steps.version_info.outputs.build_version }}-win_x64.zip publish
|
7z a ../release_output/sdl2-ryujinx-headless-${{ steps.version_info.outputs.build_version }}-win_x64.zip publish
|
||||||
|
popd
|
||||||
|
|
||||||
|
pushd publish_ava
|
||||||
|
7z a ../release_output/test-ava-ryujinx-${{ steps.version_info.outputs.build_version }}-win_x64.zip publish
|
||||||
popd
|
popd
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Publish Linux
|
|
||||||
run: |
|
|
||||||
dotnet publish -c Release -r linux-x64 -o ./publish_linux/publish /p:Version="${{ steps.version_info.outputs.build_version }}" /p:SourceRevisionId="${{ steps.version_info.outputs.git_short_hash }}" /p:DebugType=embedded Ryujinx --self-contained
|
|
||||||
dotnet publish -c Release -r linux-x64 -o ./publish_linux_sdl2_headless/publish /p:Version="${{ steps.version_info.outputs.build_version }}" /p:SourceRevisionId="${{ steps.version_info.outputs.git_short_hash }}" /p:DebugType=embedded Ryujinx.Headless.SDL2 --self-contained
|
|
||||||
|
|
||||||
- name: Packing Linux builds
|
- name: Packing Linux builds
|
||||||
|
if: matrix.os == 'ubuntu-latest'
|
||||||
run: |
|
run: |
|
||||||
pushd publish_linux
|
pushd publish_gtk
|
||||||
|
chmod +x publish/Ryujinx.sh publish/Ryujinx
|
||||||
tar -czvf ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-linux_x64.tar.gz publish
|
tar -czvf ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-linux_x64.tar.gz publish
|
||||||
popd
|
popd
|
||||||
|
|
||||||
pushd publish_linux_sdl2_headless
|
pushd publish_sdl2_headless
|
||||||
tar -czvf ../release_output/ryujinx-headless-sdl2-${{ steps.version_info.outputs.build_version }}-linux_x64.tar.gz publish
|
chmod +x publish/Ryujinx.sh publish/Ryujinx.Headless.SDL2
|
||||||
|
tar -czvf ../release_output/sdl2-ryujinx-headless-${{ steps.version_info.outputs.build_version }}-linux_x64.tar.gz publish
|
||||||
|
popd
|
||||||
|
|
||||||
|
pushd publish_ava
|
||||||
|
chmod +x publish/Ryujinx.sh publish/Ryujinx.Ava
|
||||||
|
tar -czvf ../release_output/test-ava-ryujinx-${{ steps.version_info.outputs.build_version }}-linux_x64.tar.gz publish
|
||||||
popd
|
popd
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
@ -86,10 +133,78 @@ jobs:
|
|||||||
name: ${{ steps.version_info.outputs.build_version }}
|
name: ${{ steps.version_info.outputs.build_version }}
|
||||||
artifacts: "release_output/*.tar.gz,release_output/*.zip"
|
artifacts: "release_output/*.tar.gz,release_output/*.zip"
|
||||||
tag: ${{ steps.version_info.outputs.build_version }}
|
tag: ${{ steps.version_info.outputs.build_version }}
|
||||||
body: "For more informations about this release please check out the official [Changelog](https://github.com/Ryujinx/Ryujinx/wiki/Changelog)."
|
body: "For more information about this release please check out the official [Changelog](https://github.com/Ryujinx/Ryujinx/wiki/Changelog)."
|
||||||
|
omitBodyDuringUpdate: true
|
||||||
allowUpdates: true
|
allowUpdates: true
|
||||||
removeArtifacts: true
|
|
||||||
replacesArtifacts: true
|
replacesArtifacts: true
|
||||||
owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}
|
owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}
|
||||||
repo: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}
|
repo: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}
|
||||||
token: ${{ secrets.RELEASE_TOKEN }}
|
token: ${{ secrets.RELEASE_TOKEN }}
|
||||||
|
|
||||||
|
macos_release:
|
||||||
|
name: Release MacOS universal
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 35
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- uses: actions/setup-dotnet@v3
|
||||||
|
with:
|
||||||
|
global-json-file: global.json
|
||||||
|
|
||||||
|
- name: Setup LLVM 14
|
||||||
|
run: |
|
||||||
|
wget https://apt.llvm.org/llvm.sh
|
||||||
|
chmod +x llvm.sh
|
||||||
|
sudo ./llvm.sh 14
|
||||||
|
|
||||||
|
- name: Install rcodesign
|
||||||
|
run: |
|
||||||
|
mkdir -p $HOME/.bin
|
||||||
|
gh release download -R indygreg/apple-platform-rs -O apple-codesign.tar.gz -p 'apple-codesign-*-x86_64-unknown-linux-musl.tar.gz'
|
||||||
|
tar -xzvf apple-codesign.tar.gz --wildcards '*/rcodesign' --strip-components=1
|
||||||
|
rm apple-codesign.tar.gz
|
||||||
|
mv rcodesign $HOME/.bin/
|
||||||
|
echo "$HOME/.bin" >> $GITHUB_PATH
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Get version info
|
||||||
|
id: version_info
|
||||||
|
run: |
|
||||||
|
echo "build_version=${{ env.RYUJINX_BASE_VERSION }}.${{ github.run_number }}" >> $GITHUB_OUTPUT
|
||||||
|
echo "git_short_hash=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Configure for release
|
||||||
|
run: |
|
||||||
|
sed -r --in-place 's/\%\%RYUJINX_BUILD_VERSION\%\%/${{ steps.version_info.outputs.build_version }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
|
||||||
|
sed -r --in-place 's/\%\%RYUJINX_BUILD_GIT_HASH\%\%/${{ steps.version_info.outputs.git_short_hash }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
|
||||||
|
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_NAME\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
|
||||||
|
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_OWNER\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
|
||||||
|
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Publish macOS
|
||||||
|
run: |
|
||||||
|
./distribution/macos/create_macos_build.sh . publish_tmp publish_ava ./distribution/macos/entitlements.xml "${{ steps.version_info.outputs.build_version }}" "${{ steps.version_info.outputs.git_short_hash }}" Release
|
||||||
|
|
||||||
|
- name: Pushing new release
|
||||||
|
uses: ncipollo/release-action@v1
|
||||||
|
with:
|
||||||
|
name: ${{ steps.version_info.outputs.build_version }}
|
||||||
|
artifacts: "publish_ava/*.tar.gz"
|
||||||
|
tag: ${{ steps.version_info.outputs.build_version }}
|
||||||
|
body: "For more information about this release please check out the official [Changelog](https://github.com/Ryujinx/Ryujinx/wiki/Changelog)."
|
||||||
|
omitBodyDuringUpdate: true
|
||||||
|
allowUpdates: true
|
||||||
|
replacesArtifacts: true
|
||||||
|
owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}
|
||||||
|
repo: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}
|
||||||
|
token: ${{ secrets.RELEASE_TOKEN }}
|
||||||
|
|
||||||
|
flatpak_release:
|
||||||
|
uses: ./.github/workflows/flatpak.yml
|
||||||
|
needs: release
|
||||||
|
with:
|
||||||
|
ryujinx_version: "1.1.${{ github.run_number }}"
|
||||||
|
secrets: inherit
|
6
.gitignore
vendored
6
.gitignore
vendored
@ -125,6 +125,9 @@ ClientBin/
|
|||||||
packages/*
|
packages/*
|
||||||
*.config
|
*.config
|
||||||
|
|
||||||
|
# Include nuget.config
|
||||||
|
!nuget.config
|
||||||
|
|
||||||
# RIA/Silverlight projects
|
# RIA/Silverlight projects
|
||||||
Generated_Code/
|
Generated_Code/
|
||||||
|
|
||||||
@ -167,3 +170,6 @@ launchSettings.json
|
|||||||
|
|
||||||
# NetCore Publishing Profiles
|
# NetCore Publishing Profiles
|
||||||
PublishProfiles/
|
PublishProfiles/
|
||||||
|
|
||||||
|
# Glade backup files
|
||||||
|
*.glade~
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\Ryujinx.Common\Ryujinx.Common.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
@ -1,281 +0,0 @@
|
|||||||
using System;
|
|
||||||
|
|
||||||
namespace ARMeilleure.CodeGen.X86
|
|
||||||
{
|
|
||||||
partial class Assembler
|
|
||||||
{
|
|
||||||
private const int BadOp = 0;
|
|
||||||
|
|
||||||
[Flags]
|
|
||||||
private enum InstructionFlags
|
|
||||||
{
|
|
||||||
None = 0,
|
|
||||||
RegOnly = 1 << 0,
|
|
||||||
Reg8Src = 1 << 1,
|
|
||||||
Reg8Dest = 1 << 2,
|
|
||||||
RexW = 1 << 3,
|
|
||||||
Vex = 1 << 4,
|
|
||||||
|
|
||||||
PrefixBit = 16,
|
|
||||||
PrefixMask = 7 << PrefixBit,
|
|
||||||
Prefix66 = 1 << PrefixBit,
|
|
||||||
PrefixF3 = 2 << PrefixBit,
|
|
||||||
PrefixF2 = 4 << PrefixBit
|
|
||||||
}
|
|
||||||
|
|
||||||
private readonly struct InstructionInfo
|
|
||||||
{
|
|
||||||
public int OpRMR { get; }
|
|
||||||
public int OpRMImm8 { get; }
|
|
||||||
public int OpRMImm32 { get; }
|
|
||||||
public int OpRImm64 { get; }
|
|
||||||
public int OpRRM { get; }
|
|
||||||
|
|
||||||
public InstructionFlags Flags { get; }
|
|
||||||
|
|
||||||
public InstructionInfo(
|
|
||||||
int opRMR,
|
|
||||||
int opRMImm8,
|
|
||||||
int opRMImm32,
|
|
||||||
int opRImm64,
|
|
||||||
int opRRM,
|
|
||||||
InstructionFlags flags)
|
|
||||||
{
|
|
||||||
OpRMR = opRMR;
|
|
||||||
OpRMImm8 = opRMImm8;
|
|
||||||
OpRMImm32 = opRMImm32;
|
|
||||||
OpRImm64 = opRImm64;
|
|
||||||
OpRRM = opRRM;
|
|
||||||
Flags = flags;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private readonly static InstructionInfo[] _instTable;
|
|
||||||
|
|
||||||
static Assembler()
|
|
||||||
{
|
|
||||||
_instTable = new InstructionInfo[(int)X86Instruction.Count];
|
|
||||||
|
|
||||||
// Name RM/R RM/I8 RM/I32 R/I64 R/RM Flags
|
|
||||||
Add(X86Instruction.Add, new InstructionInfo(0x00000001, 0x00000083, 0x00000081, BadOp, 0x00000003, InstructionFlags.None));
|
|
||||||
Add(X86Instruction.Addpd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f58, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Addps, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f58, InstructionFlags.Vex));
|
|
||||||
Add(X86Instruction.Addsd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f58, InstructionFlags.Vex | InstructionFlags.PrefixF2));
|
|
||||||
Add(X86Instruction.Addss, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f58, InstructionFlags.Vex | InstructionFlags.PrefixF3));
|
|
||||||
Add(X86Instruction.Aesdec, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f38de, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Aesdeclast, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f38df, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Aesenc, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f38dc, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Aesenclast, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f38dd, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Aesimc, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f38db, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.And, new InstructionInfo(0x00000021, 0x04000083, 0x04000081, BadOp, 0x00000023, InstructionFlags.None));
|
|
||||||
Add(X86Instruction.Andnpd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f55, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Andnps, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f55, InstructionFlags.Vex));
|
|
||||||
Add(X86Instruction.Andpd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f54, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Andps, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f54, InstructionFlags.Vex));
|
|
||||||
Add(X86Instruction.Blendvpd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f3815, InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Blendvps, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f3814, InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Bsr, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000fbd, InstructionFlags.None));
|
|
||||||
Add(X86Instruction.Bswap, new InstructionInfo(0x00000fc8, BadOp, BadOp, BadOp, BadOp, InstructionFlags.RegOnly));
|
|
||||||
Add(X86Instruction.Call, new InstructionInfo(0x020000ff, BadOp, BadOp, BadOp, BadOp, InstructionFlags.None));
|
|
||||||
Add(X86Instruction.Cmovcc, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f40, InstructionFlags.None));
|
|
||||||
Add(X86Instruction.Cmp, new InstructionInfo(0x00000039, 0x07000083, 0x07000081, BadOp, 0x0000003b, InstructionFlags.None));
|
|
||||||
Add(X86Instruction.Cmppd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000fc2, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Cmpps, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000fc2, InstructionFlags.Vex));
|
|
||||||
Add(X86Instruction.Cmpsd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000fc2, InstructionFlags.Vex | InstructionFlags.PrefixF2));
|
|
||||||
Add(X86Instruction.Cmpss, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000fc2, InstructionFlags.Vex | InstructionFlags.PrefixF3));
|
|
||||||
Add(X86Instruction.Cmpxchg, new InstructionInfo(0x00000fb1, BadOp, BadOp, BadOp, BadOp, InstructionFlags.None));
|
|
||||||
Add(X86Instruction.Cmpxchg16b, new InstructionInfo(0x01000fc7, BadOp, BadOp, BadOp, BadOp, InstructionFlags.RexW));
|
|
||||||
Add(X86Instruction.Cmpxchg8, new InstructionInfo(0x00000fb0, BadOp, BadOp, BadOp, BadOp, InstructionFlags.Reg8Src));
|
|
||||||
Add(X86Instruction.Comisd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f2f, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Comiss, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f2f, InstructionFlags.Vex));
|
|
||||||
Add(X86Instruction.Crc32, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f38f1, InstructionFlags.PrefixF2));
|
|
||||||
Add(X86Instruction.Crc32_16, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f38f1, InstructionFlags.PrefixF2 | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Crc32_8, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f38f0, InstructionFlags.PrefixF2 | InstructionFlags.Reg8Src));
|
|
||||||
Add(X86Instruction.Cvtdq2pd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000fe6, InstructionFlags.Vex | InstructionFlags.PrefixF3));
|
|
||||||
Add(X86Instruction.Cvtdq2ps, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f5b, InstructionFlags.Vex));
|
|
||||||
Add(X86Instruction.Cvtpd2dq, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000fe6, InstructionFlags.Vex | InstructionFlags.PrefixF2));
|
|
||||||
Add(X86Instruction.Cvtpd2ps, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f5a, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Cvtps2dq, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f5b, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Cvtps2pd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f5a, InstructionFlags.Vex));
|
|
||||||
Add(X86Instruction.Cvtsd2si, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f2d, InstructionFlags.Vex | InstructionFlags.PrefixF2));
|
|
||||||
Add(X86Instruction.Cvtsd2ss, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f5a, InstructionFlags.Vex | InstructionFlags.PrefixF2));
|
|
||||||
Add(X86Instruction.Cvtsi2sd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f2a, InstructionFlags.Vex | InstructionFlags.PrefixF2));
|
|
||||||
Add(X86Instruction.Cvtsi2ss, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f2a, InstructionFlags.Vex | InstructionFlags.PrefixF3));
|
|
||||||
Add(X86Instruction.Cvtss2sd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f5a, InstructionFlags.Vex | InstructionFlags.PrefixF3));
|
|
||||||
Add(X86Instruction.Cvtss2si, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f2d, InstructionFlags.Vex | InstructionFlags.PrefixF3));
|
|
||||||
Add(X86Instruction.Div, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x060000f7, InstructionFlags.None));
|
|
||||||
Add(X86Instruction.Divpd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f5e, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Divps, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f5e, InstructionFlags.Vex));
|
|
||||||
Add(X86Instruction.Divsd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f5e, InstructionFlags.Vex | InstructionFlags.PrefixF2));
|
|
||||||
Add(X86Instruction.Divss, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f5e, InstructionFlags.Vex | InstructionFlags.PrefixF3));
|
|
||||||
Add(X86Instruction.Haddpd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f7c, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Haddps, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f7c, InstructionFlags.Vex | InstructionFlags.PrefixF2));
|
|
||||||
Add(X86Instruction.Idiv, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x070000f7, InstructionFlags.None));
|
|
||||||
Add(X86Instruction.Imul, new InstructionInfo(BadOp, 0x0000006b, 0x00000069, BadOp, 0x00000faf, InstructionFlags.None));
|
|
||||||
Add(X86Instruction.Imul128, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x050000f7, InstructionFlags.None));
|
|
||||||
Add(X86Instruction.Insertps, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f3a21, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Jmp, new InstructionInfo(0x040000ff, BadOp, BadOp, BadOp, BadOp, InstructionFlags.None));
|
|
||||||
Add(X86Instruction.Ldmxcsr, new InstructionInfo(0x02000fae, BadOp, BadOp, BadOp, BadOp, InstructionFlags.Vex));
|
|
||||||
Add(X86Instruction.Lea, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x0000008d, InstructionFlags.None));
|
|
||||||
Add(X86Instruction.Maxpd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f5f, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Maxps, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f5f, InstructionFlags.Vex));
|
|
||||||
Add(X86Instruction.Maxsd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f5f, InstructionFlags.Vex | InstructionFlags.PrefixF2));
|
|
||||||
Add(X86Instruction.Maxss, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f5f, InstructionFlags.Vex | InstructionFlags.PrefixF3));
|
|
||||||
Add(X86Instruction.Minpd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f5d, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Minps, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f5d, InstructionFlags.Vex));
|
|
||||||
Add(X86Instruction.Minsd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f5d, InstructionFlags.Vex | InstructionFlags.PrefixF2));
|
|
||||||
Add(X86Instruction.Minss, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f5d, InstructionFlags.Vex | InstructionFlags.PrefixF3));
|
|
||||||
Add(X86Instruction.Mov, new InstructionInfo(0x00000089, BadOp, 0x000000c7, 0x000000b8, 0x0000008b, InstructionFlags.None));
|
|
||||||
Add(X86Instruction.Mov16, new InstructionInfo(0x00000089, BadOp, 0x000000c7, BadOp, 0x0000008b, InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Mov8, new InstructionInfo(0x00000088, 0x000000c6, BadOp, BadOp, 0x0000008a, InstructionFlags.Reg8Src | InstructionFlags.Reg8Dest));
|
|
||||||
Add(X86Instruction.Movd, new InstructionInfo(0x00000f7e, BadOp, BadOp, BadOp, 0x00000f6e, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Movdqu, new InstructionInfo(0x00000f7f, BadOp, BadOp, BadOp, 0x00000f6f, InstructionFlags.Vex | InstructionFlags.PrefixF3));
|
|
||||||
Add(X86Instruction.Movhlps, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f12, InstructionFlags.Vex));
|
|
||||||
Add(X86Instruction.Movlhps, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f16, InstructionFlags.Vex));
|
|
||||||
Add(X86Instruction.Movq, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f7e, InstructionFlags.Vex | InstructionFlags.PrefixF3));
|
|
||||||
Add(X86Instruction.Movsd, new InstructionInfo(0x00000f11, BadOp, BadOp, BadOp, 0x00000f10, InstructionFlags.Vex | InstructionFlags.PrefixF2));
|
|
||||||
Add(X86Instruction.Movss, new InstructionInfo(0x00000f11, BadOp, BadOp, BadOp, 0x00000f10, InstructionFlags.Vex | InstructionFlags.PrefixF3));
|
|
||||||
Add(X86Instruction.Movsx16, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000fbf, InstructionFlags.None));
|
|
||||||
Add(X86Instruction.Movsx32, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000063, InstructionFlags.None));
|
|
||||||
Add(X86Instruction.Movsx8, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000fbe, InstructionFlags.Reg8Src));
|
|
||||||
Add(X86Instruction.Movzx16, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000fb7, InstructionFlags.None));
|
|
||||||
Add(X86Instruction.Movzx8, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000fb6, InstructionFlags.Reg8Src));
|
|
||||||
Add(X86Instruction.Mul128, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x040000f7, InstructionFlags.None));
|
|
||||||
Add(X86Instruction.Mulpd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f59, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Mulps, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f59, InstructionFlags.Vex));
|
|
||||||
Add(X86Instruction.Mulsd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f59, InstructionFlags.Vex | InstructionFlags.PrefixF2));
|
|
||||||
Add(X86Instruction.Mulss, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f59, InstructionFlags.Vex | InstructionFlags.PrefixF3));
|
|
||||||
Add(X86Instruction.Neg, new InstructionInfo(0x030000f7, BadOp, BadOp, BadOp, BadOp, InstructionFlags.None));
|
|
||||||
Add(X86Instruction.Not, new InstructionInfo(0x020000f7, BadOp, BadOp, BadOp, BadOp, InstructionFlags.None));
|
|
||||||
Add(X86Instruction.Or, new InstructionInfo(0x00000009, 0x01000083, 0x01000081, BadOp, 0x0000000b, InstructionFlags.None));
|
|
||||||
Add(X86Instruction.Paddb, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000ffc, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Paddd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000ffe, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Paddq, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000fd4, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Paddw, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000ffd, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pand, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000fdb, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pandn, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000fdf, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pavgb, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000fe0, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pavgw, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000fe3, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pblendvb, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f3810, InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pclmulqdq, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f3a44, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pcmpeqb, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f74, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pcmpeqd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f76, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pcmpeqq, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f3829, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pcmpeqw, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f75, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pcmpgtb, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f64, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pcmpgtd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f66, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pcmpgtq, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f3837, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pcmpgtw, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f65, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pextrb, new InstructionInfo(0x000f3a14, BadOp, BadOp, BadOp, BadOp, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pextrd, new InstructionInfo(0x000f3a16, BadOp, BadOp, BadOp, BadOp, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pextrq, new InstructionInfo(0x000f3a16, BadOp, BadOp, BadOp, BadOp, InstructionFlags.Vex | InstructionFlags.RexW | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pextrw, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000fc5, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pinsrb, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f3a20, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pinsrd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f3a22, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pinsrq, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f3a22, InstructionFlags.Vex | InstructionFlags.RexW | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pinsrw, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000fc4, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pmaxsb, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f383c, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pmaxsd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f383d, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pmaxsw, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000fee, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pmaxub, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000fde, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pmaxud, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f383f, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pmaxuw, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f383e, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pminsb, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f3838, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pminsd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f3839, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pminsw, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000fea, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pminub, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000fda, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pminud, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f383b, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pminuw, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f383a, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pmovsxbw, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f3820, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pmovsxdq, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f3825, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pmovsxwd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f3823, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pmovzxbw, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f3830, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pmovzxdq, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f3835, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pmovzxwd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f3833, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pmulld, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f3840, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pmullw, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000fd5, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pop, new InstructionInfo(0x0000008f, BadOp, BadOp, BadOp, BadOp, InstructionFlags.None));
|
|
||||||
Add(X86Instruction.Popcnt, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000fb8, InstructionFlags.PrefixF3));
|
|
||||||
Add(X86Instruction.Por, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000feb, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pshufb, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f3800, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pshufd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f70, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pslld, new InstructionInfo(BadOp, 0x06000f72, BadOp, BadOp, 0x00000ff2, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Pslldq, new InstructionInfo(BadOp, 0x07000f73, BadOp, BadOp, BadOp, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Psllq, new InstructionInfo(BadOp, 0x06000f73, BadOp, BadOp, 0x00000ff3, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Psllw, new InstructionInfo(BadOp, 0x06000f71, BadOp, BadOp, 0x00000ff1, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Psrad, new InstructionInfo(BadOp, 0x04000f72, BadOp, BadOp, 0x00000fe2, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Psraw, new InstructionInfo(BadOp, 0x04000f71, BadOp, BadOp, 0x00000fe1, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Psrld, new InstructionInfo(BadOp, 0x02000f72, BadOp, BadOp, 0x00000fd2, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Psrlq, new InstructionInfo(BadOp, 0x02000f73, BadOp, BadOp, 0x00000fd3, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Psrldq, new InstructionInfo(BadOp, 0x03000f73, BadOp, BadOp, BadOp, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Psrlw, new InstructionInfo(BadOp, 0x02000f71, BadOp, BadOp, 0x00000fd1, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Psubb, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000ff8, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Psubd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000ffa, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Psubq, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000ffb, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Psubw, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000ff9, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Punpckhbw, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f68, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Punpckhdq, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f6a, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Punpckhqdq, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f6d, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Punpckhwd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f69, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Punpcklbw, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f60, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Punpckldq, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f62, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Punpcklqdq, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f6c, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Punpcklwd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f61, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Push, new InstructionInfo(BadOp, 0x0000006a, 0x00000068, BadOp, 0x060000ff, InstructionFlags.None));
|
|
||||||
Add(X86Instruction.Pxor, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000fef, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Rcpps, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f53, InstructionFlags.Vex));
|
|
||||||
Add(X86Instruction.Rcpss, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f53, InstructionFlags.Vex | InstructionFlags.PrefixF3));
|
|
||||||
Add(X86Instruction.Ror, new InstructionInfo(0x010000d3, 0x010000c1, BadOp, BadOp, BadOp, InstructionFlags.None));
|
|
||||||
Add(X86Instruction.Roundpd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f3a09, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Roundps, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f3a08, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Roundsd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f3a0b, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Roundss, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f3a0a, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Rsqrtps, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f52, InstructionFlags.Vex));
|
|
||||||
Add(X86Instruction.Rsqrtss, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f52, InstructionFlags.Vex | InstructionFlags.PrefixF3));
|
|
||||||
Add(X86Instruction.Sar, new InstructionInfo(0x070000d3, 0x070000c1, BadOp, BadOp, BadOp, InstructionFlags.None));
|
|
||||||
Add(X86Instruction.Setcc, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f90, InstructionFlags.Reg8Dest));
|
|
||||||
Add(X86Instruction.Shl, new InstructionInfo(0x040000d3, 0x040000c1, BadOp, BadOp, BadOp, InstructionFlags.None));
|
|
||||||
Add(X86Instruction.Shr, new InstructionInfo(0x050000d3, 0x050000c1, BadOp, BadOp, BadOp, InstructionFlags.None));
|
|
||||||
Add(X86Instruction.Shufpd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000fc6, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Shufps, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000fc6, InstructionFlags.Vex));
|
|
||||||
Add(X86Instruction.Sqrtpd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f51, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Sqrtps, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f51, InstructionFlags.Vex));
|
|
||||||
Add(X86Instruction.Sqrtsd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f51, InstructionFlags.Vex | InstructionFlags.PrefixF2));
|
|
||||||
Add(X86Instruction.Sqrtss, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f51, InstructionFlags.Vex | InstructionFlags.PrefixF3));
|
|
||||||
Add(X86Instruction.Stmxcsr, new InstructionInfo(0x03000fae, BadOp, BadOp, BadOp, BadOp, InstructionFlags.Vex));
|
|
||||||
Add(X86Instruction.Sub, new InstructionInfo(0x00000029, 0x05000083, 0x05000081, BadOp, 0x0000002b, InstructionFlags.None));
|
|
||||||
Add(X86Instruction.Subpd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f5c, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Subps, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f5c, InstructionFlags.Vex));
|
|
||||||
Add(X86Instruction.Subsd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f5c, InstructionFlags.Vex | InstructionFlags.PrefixF2));
|
|
||||||
Add(X86Instruction.Subss, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f5c, InstructionFlags.Vex | InstructionFlags.PrefixF3));
|
|
||||||
Add(X86Instruction.Test, new InstructionInfo(0x00000085, BadOp, 0x000000f7, BadOp, BadOp, InstructionFlags.None));
|
|
||||||
Add(X86Instruction.Unpckhpd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f15, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Unpckhps, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f15, InstructionFlags.Vex));
|
|
||||||
Add(X86Instruction.Unpcklpd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f14, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Unpcklps, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f14, InstructionFlags.Vex));
|
|
||||||
Add(X86Instruction.Vblendvpd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f3a4b, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Vblendvps, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f3a4a, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Vcvtph2ps, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f3813, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Vcvtps2ph, new InstructionInfo(0x000f3a1d, BadOp, BadOp, BadOp, BadOp, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Vfmadd231ps, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f38b8, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Vfmadd231sd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f38b9, InstructionFlags.Vex | InstructionFlags.Prefix66 | InstructionFlags.RexW));
|
|
||||||
Add(X86Instruction.Vfmadd231ss, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f38b9, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Vfmsub231sd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f38bb, InstructionFlags.Vex | InstructionFlags.Prefix66 | InstructionFlags.RexW));
|
|
||||||
Add(X86Instruction.Vfmsub231ss, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f38bb, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Vfnmadd231ps, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f38bc, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Vfnmadd231sd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f38bd, InstructionFlags.Vex | InstructionFlags.Prefix66 | InstructionFlags.RexW));
|
|
||||||
Add(X86Instruction.Vfnmadd231ss, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f38bd, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Vfnmsub231sd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f38bf, InstructionFlags.Vex | InstructionFlags.Prefix66 | InstructionFlags.RexW));
|
|
||||||
Add(X86Instruction.Vfnmsub231ss, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f38bf, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Vpblendvb, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x000f3a4c, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Xor, new InstructionInfo(0x00000031, 0x06000083, 0x06000081, BadOp, 0x00000033, InstructionFlags.None));
|
|
||||||
Add(X86Instruction.Xorpd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f57, InstructionFlags.Vex | InstructionFlags.Prefix66));
|
|
||||||
Add(X86Instruction.Xorps, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f57, InstructionFlags.Vex));
|
|
||||||
|
|
||||||
static void Add(X86Instruction inst, in InstructionInfo info)
|
|
||||||
{
|
|
||||||
_instTable[(int)inst] = info;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,63 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Runtime.Intrinsics.X86;
|
|
||||||
|
|
||||||
namespace ARMeilleure.CodeGen.X86
|
|
||||||
{
|
|
||||||
static class HardwareCapabilities
|
|
||||||
{
|
|
||||||
static HardwareCapabilities()
|
|
||||||
{
|
|
||||||
if (!X86Base.IsSupported)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
(_, _, int ecx, int edx) = X86Base.CpuId(0x00000001, 0x00000000);
|
|
||||||
|
|
||||||
FeatureInfoEdx = (FeatureFlagsEdx)edx;
|
|
||||||
FeatureInfoEcx = (FeatureFlagsEcx)ecx;
|
|
||||||
}
|
|
||||||
|
|
||||||
[Flags]
|
|
||||||
public enum FeatureFlagsEdx
|
|
||||||
{
|
|
||||||
Sse = 1 << 25,
|
|
||||||
Sse2 = 1 << 26
|
|
||||||
}
|
|
||||||
|
|
||||||
[Flags]
|
|
||||||
public enum FeatureFlagsEcx
|
|
||||||
{
|
|
||||||
Sse3 = 1 << 0,
|
|
||||||
Pclmulqdq = 1 << 1,
|
|
||||||
Ssse3 = 1 << 9,
|
|
||||||
Fma = 1 << 12,
|
|
||||||
Sse41 = 1 << 19,
|
|
||||||
Sse42 = 1 << 20,
|
|
||||||
Popcnt = 1 << 23,
|
|
||||||
Aes = 1 << 25,
|
|
||||||
Avx = 1 << 28,
|
|
||||||
F16c = 1 << 29
|
|
||||||
}
|
|
||||||
|
|
||||||
public static FeatureFlagsEdx FeatureInfoEdx { get; }
|
|
||||||
public static FeatureFlagsEcx FeatureInfoEcx { get; }
|
|
||||||
|
|
||||||
public static bool SupportsSse => FeatureInfoEdx.HasFlag(FeatureFlagsEdx.Sse);
|
|
||||||
public static bool SupportsSse2 => FeatureInfoEdx.HasFlag(FeatureFlagsEdx.Sse2);
|
|
||||||
public static bool SupportsSse3 => FeatureInfoEcx.HasFlag(FeatureFlagsEcx.Sse3);
|
|
||||||
public static bool SupportsPclmulqdq => FeatureInfoEcx.HasFlag(FeatureFlagsEcx.Pclmulqdq);
|
|
||||||
public static bool SupportsSsse3 => FeatureInfoEcx.HasFlag(FeatureFlagsEcx.Ssse3);
|
|
||||||
public static bool SupportsFma => FeatureInfoEcx.HasFlag(FeatureFlagsEcx.Fma);
|
|
||||||
public static bool SupportsSse41 => FeatureInfoEcx.HasFlag(FeatureFlagsEcx.Sse41);
|
|
||||||
public static bool SupportsSse42 => FeatureInfoEcx.HasFlag(FeatureFlagsEcx.Sse42);
|
|
||||||
public static bool SupportsPopcnt => FeatureInfoEcx.HasFlag(FeatureFlagsEcx.Popcnt);
|
|
||||||
public static bool SupportsAesni => FeatureInfoEcx.HasFlag(FeatureFlagsEcx.Aes);
|
|
||||||
public static bool SupportsAvx => FeatureInfoEcx.HasFlag(FeatureFlagsEcx.Avx);
|
|
||||||
public static bool SupportsF16c => FeatureInfoEcx.HasFlag(FeatureFlagsEcx.F16c);
|
|
||||||
|
|
||||||
public static bool ForceLegacySse { get; set; }
|
|
||||||
|
|
||||||
public static bool SupportsVexEncoding => SupportsAvx && !ForceLegacySse;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,194 +0,0 @@
|
|||||||
using ARMeilleure.Common;
|
|
||||||
using ARMeilleure.IntermediateRepresentation;
|
|
||||||
|
|
||||||
namespace ARMeilleure.CodeGen.X86
|
|
||||||
{
|
|
||||||
static class IntrinsicTable
|
|
||||||
{
|
|
||||||
private const int BadOp = 0;
|
|
||||||
|
|
||||||
private static IntrinsicInfo[] _intrinTable;
|
|
||||||
|
|
||||||
static IntrinsicTable()
|
|
||||||
{
|
|
||||||
_intrinTable = new IntrinsicInfo[EnumUtils.GetCount(typeof(Intrinsic))];
|
|
||||||
|
|
||||||
Add(Intrinsic.X86Addpd, new IntrinsicInfo(X86Instruction.Addpd, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Addps, new IntrinsicInfo(X86Instruction.Addps, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Addsd, new IntrinsicInfo(X86Instruction.Addsd, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Addss, new IntrinsicInfo(X86Instruction.Addss, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Aesdec, new IntrinsicInfo(X86Instruction.Aesdec, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Aesdeclast, new IntrinsicInfo(X86Instruction.Aesdeclast, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Aesenc, new IntrinsicInfo(X86Instruction.Aesenc, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Aesenclast, new IntrinsicInfo(X86Instruction.Aesenclast, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Aesimc, new IntrinsicInfo(X86Instruction.Aesimc, IntrinsicType.Unary));
|
|
||||||
Add(Intrinsic.X86Andnpd, new IntrinsicInfo(X86Instruction.Andnpd, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Andnps, new IntrinsicInfo(X86Instruction.Andnps, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Andpd, new IntrinsicInfo(X86Instruction.Andpd, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Andps, new IntrinsicInfo(X86Instruction.Andps, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Blendvpd, new IntrinsicInfo(X86Instruction.Blendvpd, IntrinsicType.Ternary));
|
|
||||||
Add(Intrinsic.X86Blendvps, new IntrinsicInfo(X86Instruction.Blendvps, IntrinsicType.Ternary));
|
|
||||||
Add(Intrinsic.X86Cmppd, new IntrinsicInfo(X86Instruction.Cmppd, IntrinsicType.TernaryImm));
|
|
||||||
Add(Intrinsic.X86Cmpps, new IntrinsicInfo(X86Instruction.Cmpps, IntrinsicType.TernaryImm));
|
|
||||||
Add(Intrinsic.X86Cmpsd, new IntrinsicInfo(X86Instruction.Cmpsd, IntrinsicType.TernaryImm));
|
|
||||||
Add(Intrinsic.X86Cmpss, new IntrinsicInfo(X86Instruction.Cmpss, IntrinsicType.TernaryImm));
|
|
||||||
Add(Intrinsic.X86Comisdeq, new IntrinsicInfo(X86Instruction.Comisd, IntrinsicType.Comis_));
|
|
||||||
Add(Intrinsic.X86Comisdge, new IntrinsicInfo(X86Instruction.Comisd, IntrinsicType.Comis_));
|
|
||||||
Add(Intrinsic.X86Comisdlt, new IntrinsicInfo(X86Instruction.Comisd, IntrinsicType.Comis_));
|
|
||||||
Add(Intrinsic.X86Comisseq, new IntrinsicInfo(X86Instruction.Comiss, IntrinsicType.Comis_));
|
|
||||||
Add(Intrinsic.X86Comissge, new IntrinsicInfo(X86Instruction.Comiss, IntrinsicType.Comis_));
|
|
||||||
Add(Intrinsic.X86Comisslt, new IntrinsicInfo(X86Instruction.Comiss, IntrinsicType.Comis_));
|
|
||||||
Add(Intrinsic.X86Crc32, new IntrinsicInfo(X86Instruction.Crc32, IntrinsicType.Crc32));
|
|
||||||
Add(Intrinsic.X86Crc32_16, new IntrinsicInfo(X86Instruction.Crc32_16, IntrinsicType.Crc32));
|
|
||||||
Add(Intrinsic.X86Crc32_8, new IntrinsicInfo(X86Instruction.Crc32_8, IntrinsicType.Crc32));
|
|
||||||
Add(Intrinsic.X86Cvtdq2pd, new IntrinsicInfo(X86Instruction.Cvtdq2pd, IntrinsicType.Unary));
|
|
||||||
Add(Intrinsic.X86Cvtdq2ps, new IntrinsicInfo(X86Instruction.Cvtdq2ps, IntrinsicType.Unary));
|
|
||||||
Add(Intrinsic.X86Cvtpd2dq, new IntrinsicInfo(X86Instruction.Cvtpd2dq, IntrinsicType.Unary));
|
|
||||||
Add(Intrinsic.X86Cvtpd2ps, new IntrinsicInfo(X86Instruction.Cvtpd2ps, IntrinsicType.Unary));
|
|
||||||
Add(Intrinsic.X86Cvtps2dq, new IntrinsicInfo(X86Instruction.Cvtps2dq, IntrinsicType.Unary));
|
|
||||||
Add(Intrinsic.X86Cvtps2pd, new IntrinsicInfo(X86Instruction.Cvtps2pd, IntrinsicType.Unary));
|
|
||||||
Add(Intrinsic.X86Cvtsd2si, new IntrinsicInfo(X86Instruction.Cvtsd2si, IntrinsicType.UnaryToGpr));
|
|
||||||
Add(Intrinsic.X86Cvtsd2ss, new IntrinsicInfo(X86Instruction.Cvtsd2ss, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Cvtsi2sd, new IntrinsicInfo(X86Instruction.Cvtsi2sd, IntrinsicType.BinaryGpr));
|
|
||||||
Add(Intrinsic.X86Cvtsi2si, new IntrinsicInfo(X86Instruction.Movd, IntrinsicType.UnaryToGpr));
|
|
||||||
Add(Intrinsic.X86Cvtsi2ss, new IntrinsicInfo(X86Instruction.Cvtsi2ss, IntrinsicType.BinaryGpr));
|
|
||||||
Add(Intrinsic.X86Cvtss2sd, new IntrinsicInfo(X86Instruction.Cvtss2sd, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Cvtss2si, new IntrinsicInfo(X86Instruction.Cvtss2si, IntrinsicType.UnaryToGpr));
|
|
||||||
Add(Intrinsic.X86Divpd, new IntrinsicInfo(X86Instruction.Divpd, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Divps, new IntrinsicInfo(X86Instruction.Divps, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Divsd, new IntrinsicInfo(X86Instruction.Divsd, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Divss, new IntrinsicInfo(X86Instruction.Divss, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Haddpd, new IntrinsicInfo(X86Instruction.Haddpd, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Haddps, new IntrinsicInfo(X86Instruction.Haddps, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Insertps, new IntrinsicInfo(X86Instruction.Insertps, IntrinsicType.TernaryImm));
|
|
||||||
Add(Intrinsic.X86Maxpd, new IntrinsicInfo(X86Instruction.Maxpd, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Maxps, new IntrinsicInfo(X86Instruction.Maxps, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Maxsd, new IntrinsicInfo(X86Instruction.Maxsd, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Maxss, new IntrinsicInfo(X86Instruction.Maxss, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Minpd, new IntrinsicInfo(X86Instruction.Minpd, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Minps, new IntrinsicInfo(X86Instruction.Minps, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Minsd, new IntrinsicInfo(X86Instruction.Minsd, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Minss, new IntrinsicInfo(X86Instruction.Minss, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Movhlps, new IntrinsicInfo(X86Instruction.Movhlps, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Movlhps, new IntrinsicInfo(X86Instruction.Movlhps, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Movss, new IntrinsicInfo(X86Instruction.Movss, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Mulpd, new IntrinsicInfo(X86Instruction.Mulpd, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Mulps, new IntrinsicInfo(X86Instruction.Mulps, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Mulsd, new IntrinsicInfo(X86Instruction.Mulsd, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Mulss, new IntrinsicInfo(X86Instruction.Mulss, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Mxcsrmb, new IntrinsicInfo(X86Instruction.None, IntrinsicType.Mxcsr)); // Mask bits.
|
|
||||||
Add(Intrinsic.X86Mxcsrub, new IntrinsicInfo(X86Instruction.None, IntrinsicType.Mxcsr)); // Unmask bits.
|
|
||||||
Add(Intrinsic.X86Paddb, new IntrinsicInfo(X86Instruction.Paddb, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Paddd, new IntrinsicInfo(X86Instruction.Paddd, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Paddq, new IntrinsicInfo(X86Instruction.Paddq, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Paddw, new IntrinsicInfo(X86Instruction.Paddw, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Pand, new IntrinsicInfo(X86Instruction.Pand, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Pandn, new IntrinsicInfo(X86Instruction.Pandn, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Pavgb, new IntrinsicInfo(X86Instruction.Pavgb, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Pavgw, new IntrinsicInfo(X86Instruction.Pavgw, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Pblendvb, new IntrinsicInfo(X86Instruction.Pblendvb, IntrinsicType.Ternary));
|
|
||||||
Add(Intrinsic.X86Pclmulqdq, new IntrinsicInfo(X86Instruction.Pclmulqdq, IntrinsicType.TernaryImm));
|
|
||||||
Add(Intrinsic.X86Pcmpeqb, new IntrinsicInfo(X86Instruction.Pcmpeqb, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Pcmpeqd, new IntrinsicInfo(X86Instruction.Pcmpeqd, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Pcmpeqq, new IntrinsicInfo(X86Instruction.Pcmpeqq, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Pcmpeqw, new IntrinsicInfo(X86Instruction.Pcmpeqw, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Pcmpgtb, new IntrinsicInfo(X86Instruction.Pcmpgtb, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Pcmpgtd, new IntrinsicInfo(X86Instruction.Pcmpgtd, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Pcmpgtq, new IntrinsicInfo(X86Instruction.Pcmpgtq, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Pcmpgtw, new IntrinsicInfo(X86Instruction.Pcmpgtw, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Pmaxsb, new IntrinsicInfo(X86Instruction.Pmaxsb, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Pmaxsd, new IntrinsicInfo(X86Instruction.Pmaxsd, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Pmaxsw, new IntrinsicInfo(X86Instruction.Pmaxsw, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Pmaxub, new IntrinsicInfo(X86Instruction.Pmaxub, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Pmaxud, new IntrinsicInfo(X86Instruction.Pmaxud, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Pmaxuw, new IntrinsicInfo(X86Instruction.Pmaxuw, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Pminsb, new IntrinsicInfo(X86Instruction.Pminsb, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Pminsd, new IntrinsicInfo(X86Instruction.Pminsd, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Pminsw, new IntrinsicInfo(X86Instruction.Pminsw, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Pminub, new IntrinsicInfo(X86Instruction.Pminub, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Pminud, new IntrinsicInfo(X86Instruction.Pminud, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Pminuw, new IntrinsicInfo(X86Instruction.Pminuw, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Pmovsxbw, new IntrinsicInfo(X86Instruction.Pmovsxbw, IntrinsicType.Unary));
|
|
||||||
Add(Intrinsic.X86Pmovsxdq, new IntrinsicInfo(X86Instruction.Pmovsxdq, IntrinsicType.Unary));
|
|
||||||
Add(Intrinsic.X86Pmovsxwd, new IntrinsicInfo(X86Instruction.Pmovsxwd, IntrinsicType.Unary));
|
|
||||||
Add(Intrinsic.X86Pmovzxbw, new IntrinsicInfo(X86Instruction.Pmovzxbw, IntrinsicType.Unary));
|
|
||||||
Add(Intrinsic.X86Pmovzxdq, new IntrinsicInfo(X86Instruction.Pmovzxdq, IntrinsicType.Unary));
|
|
||||||
Add(Intrinsic.X86Pmovzxwd, new IntrinsicInfo(X86Instruction.Pmovzxwd, IntrinsicType.Unary));
|
|
||||||
Add(Intrinsic.X86Pmulld, new IntrinsicInfo(X86Instruction.Pmulld, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Pmullw, new IntrinsicInfo(X86Instruction.Pmullw, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Popcnt, new IntrinsicInfo(X86Instruction.Popcnt, IntrinsicType.PopCount));
|
|
||||||
Add(Intrinsic.X86Por, new IntrinsicInfo(X86Instruction.Por, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Pshufb, new IntrinsicInfo(X86Instruction.Pshufb, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Pshufd, new IntrinsicInfo(X86Instruction.Pshufd, IntrinsicType.BinaryImm));
|
|
||||||
Add(Intrinsic.X86Pslld, new IntrinsicInfo(X86Instruction.Pslld, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Pslldq, new IntrinsicInfo(X86Instruction.Pslldq, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Psllq, new IntrinsicInfo(X86Instruction.Psllq, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Psllw, new IntrinsicInfo(X86Instruction.Psllw, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Psrad, new IntrinsicInfo(X86Instruction.Psrad, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Psraw, new IntrinsicInfo(X86Instruction.Psraw, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Psrld, new IntrinsicInfo(X86Instruction.Psrld, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Psrlq, new IntrinsicInfo(X86Instruction.Psrlq, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Psrldq, new IntrinsicInfo(X86Instruction.Psrldq, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Psrlw, new IntrinsicInfo(X86Instruction.Psrlw, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Psubb, new IntrinsicInfo(X86Instruction.Psubb, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Psubd, new IntrinsicInfo(X86Instruction.Psubd, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Psubq, new IntrinsicInfo(X86Instruction.Psubq, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Psubw, new IntrinsicInfo(X86Instruction.Psubw, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Punpckhbw, new IntrinsicInfo(X86Instruction.Punpckhbw, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Punpckhdq, new IntrinsicInfo(X86Instruction.Punpckhdq, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Punpckhqdq, new IntrinsicInfo(X86Instruction.Punpckhqdq, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Punpckhwd, new IntrinsicInfo(X86Instruction.Punpckhwd, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Punpcklbw, new IntrinsicInfo(X86Instruction.Punpcklbw, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Punpckldq, new IntrinsicInfo(X86Instruction.Punpckldq, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Punpcklqdq, new IntrinsicInfo(X86Instruction.Punpcklqdq, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Punpcklwd, new IntrinsicInfo(X86Instruction.Punpcklwd, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Pxor, new IntrinsicInfo(X86Instruction.Pxor, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Rcpps, new IntrinsicInfo(X86Instruction.Rcpps, IntrinsicType.Unary));
|
|
||||||
Add(Intrinsic.X86Rcpss, new IntrinsicInfo(X86Instruction.Rcpss, IntrinsicType.Unary));
|
|
||||||
Add(Intrinsic.X86Roundpd, new IntrinsicInfo(X86Instruction.Roundpd, IntrinsicType.BinaryImm));
|
|
||||||
Add(Intrinsic.X86Roundps, new IntrinsicInfo(X86Instruction.Roundps, IntrinsicType.BinaryImm));
|
|
||||||
Add(Intrinsic.X86Roundsd, new IntrinsicInfo(X86Instruction.Roundsd, IntrinsicType.BinaryImm));
|
|
||||||
Add(Intrinsic.X86Roundss, new IntrinsicInfo(X86Instruction.Roundss, IntrinsicType.BinaryImm));
|
|
||||||
Add(Intrinsic.X86Rsqrtps, new IntrinsicInfo(X86Instruction.Rsqrtps, IntrinsicType.Unary));
|
|
||||||
Add(Intrinsic.X86Rsqrtss, new IntrinsicInfo(X86Instruction.Rsqrtss, IntrinsicType.Unary));
|
|
||||||
Add(Intrinsic.X86Shufpd, new IntrinsicInfo(X86Instruction.Shufpd, IntrinsicType.TernaryImm));
|
|
||||||
Add(Intrinsic.X86Shufps, new IntrinsicInfo(X86Instruction.Shufps, IntrinsicType.TernaryImm));
|
|
||||||
Add(Intrinsic.X86Sqrtpd, new IntrinsicInfo(X86Instruction.Sqrtpd, IntrinsicType.Unary));
|
|
||||||
Add(Intrinsic.X86Sqrtps, new IntrinsicInfo(X86Instruction.Sqrtps, IntrinsicType.Unary));
|
|
||||||
Add(Intrinsic.X86Sqrtsd, new IntrinsicInfo(X86Instruction.Sqrtsd, IntrinsicType.Unary));
|
|
||||||
Add(Intrinsic.X86Sqrtss, new IntrinsicInfo(X86Instruction.Sqrtss, IntrinsicType.Unary));
|
|
||||||
Add(Intrinsic.X86Subpd, new IntrinsicInfo(X86Instruction.Subpd, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Subps, new IntrinsicInfo(X86Instruction.Subps, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Subsd, new IntrinsicInfo(X86Instruction.Subsd, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Subss, new IntrinsicInfo(X86Instruction.Subss, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Unpckhpd, new IntrinsicInfo(X86Instruction.Unpckhpd, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Unpckhps, new IntrinsicInfo(X86Instruction.Unpckhps, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Unpcklpd, new IntrinsicInfo(X86Instruction.Unpcklpd, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Unpcklps, new IntrinsicInfo(X86Instruction.Unpcklps, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Vcvtph2ps, new IntrinsicInfo(X86Instruction.Vcvtph2ps, IntrinsicType.Unary));
|
|
||||||
Add(Intrinsic.X86Vcvtps2ph, new IntrinsicInfo(X86Instruction.Vcvtps2ph, IntrinsicType.BinaryImm));
|
|
||||||
Add(Intrinsic.X86Vfmadd231ps, new IntrinsicInfo(X86Instruction.Vfmadd231ps, IntrinsicType.Fma));
|
|
||||||
Add(Intrinsic.X86Vfmadd231sd, new IntrinsicInfo(X86Instruction.Vfmadd231sd, IntrinsicType.Fma));
|
|
||||||
Add(Intrinsic.X86Vfmadd231ss, new IntrinsicInfo(X86Instruction.Vfmadd231ss, IntrinsicType.Fma));
|
|
||||||
Add(Intrinsic.X86Vfmsub231sd, new IntrinsicInfo(X86Instruction.Vfmsub231sd, IntrinsicType.Fma));
|
|
||||||
Add(Intrinsic.X86Vfmsub231ss, new IntrinsicInfo(X86Instruction.Vfmsub231ss, IntrinsicType.Fma));
|
|
||||||
Add(Intrinsic.X86Vfnmadd231ps, new IntrinsicInfo(X86Instruction.Vfnmadd231ps, IntrinsicType.Fma));
|
|
||||||
Add(Intrinsic.X86Vfnmadd231sd, new IntrinsicInfo(X86Instruction.Vfnmadd231sd, IntrinsicType.Fma));
|
|
||||||
Add(Intrinsic.X86Vfnmadd231ss, new IntrinsicInfo(X86Instruction.Vfnmadd231ss, IntrinsicType.Fma));
|
|
||||||
Add(Intrinsic.X86Vfnmsub231sd, new IntrinsicInfo(X86Instruction.Vfnmsub231sd, IntrinsicType.Fma));
|
|
||||||
Add(Intrinsic.X86Vfnmsub231ss, new IntrinsicInfo(X86Instruction.Vfnmsub231ss, IntrinsicType.Fma));
|
|
||||||
Add(Intrinsic.X86Xorpd, new IntrinsicInfo(X86Instruction.Xorpd, IntrinsicType.Binary));
|
|
||||||
Add(Intrinsic.X86Xorps, new IntrinsicInfo(X86Instruction.Xorps, IntrinsicType.Binary));
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void Add(Intrinsic intrin, IntrinsicInfo info)
|
|
||||||
{
|
|
||||||
_intrinTable[(int)intrin] = info;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static IntrinsicInfo GetInfo(Intrinsic intrin)
|
|
||||||
{
|
|
||||||
return _intrinTable[(int)intrin];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
namespace ARMeilleure.Decoders;
|
|
||||||
|
|
||||||
interface IOpCode32Exception
|
|
||||||
{
|
|
||||||
int Id { get; }
|
|
||||||
}
|
|
@ -1,51 +0,0 @@
|
|||||||
using System.Diagnostics.Tracing;
|
|
||||||
|
|
||||||
namespace ARMeilleure.Diagnostics.EventSources
|
|
||||||
{
|
|
||||||
[EventSource(Name = "ARMeilleure")]
|
|
||||||
class AddressTableEventSource : EventSource
|
|
||||||
{
|
|
||||||
public static readonly AddressTableEventSource Log = new();
|
|
||||||
|
|
||||||
private ulong _size;
|
|
||||||
private ulong _leafSize;
|
|
||||||
private PollingCounter _sizeCounter;
|
|
||||||
private PollingCounter _leafSizeCounter;
|
|
||||||
|
|
||||||
public AddressTableEventSource()
|
|
||||||
{
|
|
||||||
_sizeCounter = new PollingCounter("addr-tab-alloc", this, () => _size / 1024d / 1024d)
|
|
||||||
{
|
|
||||||
DisplayName = "AddressTable Total Bytes Allocated",
|
|
||||||
DisplayUnits = "MB"
|
|
||||||
};
|
|
||||||
|
|
||||||
_leafSizeCounter = new PollingCounter("addr-tab-leaf-alloc", this, () => _leafSize / 1024d / 1024d)
|
|
||||||
{
|
|
||||||
DisplayName = "AddressTable Total Leaf Bytes Allocated",
|
|
||||||
DisplayUnits = "MB"
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Allocated(int bytes, bool leaf)
|
|
||||||
{
|
|
||||||
_size += (uint)bytes;
|
|
||||||
|
|
||||||
if (leaf)
|
|
||||||
{
|
|
||||||
_leafSize += (uint)bytes;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Dispose(bool disposing)
|
|
||||||
{
|
|
||||||
_leafSizeCounter.Dispose();
|
|
||||||
_leafSizeCounter = null;
|
|
||||||
|
|
||||||
_sizeCounter.Dispose();
|
|
||||||
_sizeCounter = null;
|
|
||||||
|
|
||||||
base.Dispose(disposing);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
File diff suppressed because it is too large
Load Diff
@ -1,164 +0,0 @@
|
|||||||
using ARMeilleure.Decoders;
|
|
||||||
using ARMeilleure.IntermediateRepresentation;
|
|
||||||
using ARMeilleure.State;
|
|
||||||
using ARMeilleure.Translation;
|
|
||||||
using System;
|
|
||||||
using System.Reflection;
|
|
||||||
|
|
||||||
using static ARMeilleure.Instructions.InstEmitHelper;
|
|
||||||
using static ARMeilleure.IntermediateRepresentation.Operand.Factory;
|
|
||||||
|
|
||||||
namespace ARMeilleure.Instructions
|
|
||||||
{
|
|
||||||
static partial class InstEmit
|
|
||||||
{
|
|
||||||
private const int DczSizeLog2 = 4; // Log2 size in words
|
|
||||||
public const int DczSizeInBytes = 4 << DczSizeLog2;
|
|
||||||
|
|
||||||
public static void Hint(ArmEmitterContext context)
|
|
||||||
{
|
|
||||||
// Execute as no-op.
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void Isb(ArmEmitterContext context)
|
|
||||||
{
|
|
||||||
// Execute as no-op.
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void Mrs(ArmEmitterContext context)
|
|
||||||
{
|
|
||||||
OpCodeSystem op = (OpCodeSystem)context.CurrOp;
|
|
||||||
|
|
||||||
MethodInfo info;
|
|
||||||
|
|
||||||
switch (GetPackedId(op))
|
|
||||||
{
|
|
||||||
case 0b11_011_0000_0000_001: info = typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetCtrEl0)); break;
|
|
||||||
case 0b11_011_0000_0000_111: info = typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetDczidEl0)); break;
|
|
||||||
case 0b11_011_0100_0010_000: EmitGetNzcv(context); return;
|
|
||||||
case 0b11_011_0100_0100_000: info = typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetFpcr)); break;
|
|
||||||
case 0b11_011_0100_0100_001: info = typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetFpsr)); break;
|
|
||||||
case 0b11_011_1101_0000_010: info = typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetTpidrEl0)); break;
|
|
||||||
case 0b11_011_1101_0000_011: info = typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetTpidr)); break;
|
|
||||||
case 0b11_011_1110_0000_000: info = typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetCntfrqEl0)); break;
|
|
||||||
case 0b11_011_1110_0000_001: info = typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetCntpctEl0)); break;
|
|
||||||
case 0b11_011_1110_0000_010: info = typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetCntvctEl0)); break;
|
|
||||||
|
|
||||||
default: throw new NotImplementedException($"Unknown MRS 0x{op.RawOpCode:X8} at 0x{op.Address:X16}.");
|
|
||||||
}
|
|
||||||
|
|
||||||
SetIntOrZR(context, op.Rt, context.Call(info));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void Msr(ArmEmitterContext context)
|
|
||||||
{
|
|
||||||
OpCodeSystem op = (OpCodeSystem)context.CurrOp;
|
|
||||||
|
|
||||||
MethodInfo info;
|
|
||||||
|
|
||||||
switch (GetPackedId(op))
|
|
||||||
{
|
|
||||||
case 0b11_011_0100_0010_000: EmitSetNzcv(context); return;
|
|
||||||
case 0b11_011_0100_0100_000: info = typeof(NativeInterface).GetMethod(nameof(NativeInterface.SetFpcr)); break;
|
|
||||||
case 0b11_011_0100_0100_001: info = typeof(NativeInterface).GetMethod(nameof(NativeInterface.SetFpsr)); break;
|
|
||||||
case 0b11_011_1101_0000_010: info = typeof(NativeInterface).GetMethod(nameof(NativeInterface.SetTpidrEl0)); break;
|
|
||||||
|
|
||||||
default: throw new NotImplementedException($"Unknown MSR 0x{op.RawOpCode:X8} at 0x{op.Address:X16}.");
|
|
||||||
}
|
|
||||||
|
|
||||||
context.Call(info, GetIntOrZR(context, op.Rt));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void Nop(ArmEmitterContext context)
|
|
||||||
{
|
|
||||||
// Do nothing.
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void Sys(ArmEmitterContext context)
|
|
||||||
{
|
|
||||||
// This instruction is used to do some operations on the CPU like cache invalidation,
|
|
||||||
// address translation and the like.
|
|
||||||
// We treat it as no-op here since we don't have any cache being emulated anyway.
|
|
||||||
OpCodeSystem op = (OpCodeSystem)context.CurrOp;
|
|
||||||
|
|
||||||
switch (GetPackedId(op))
|
|
||||||
{
|
|
||||||
case 0b11_011_0111_0100_001:
|
|
||||||
{
|
|
||||||
// DC ZVA
|
|
||||||
Operand t = GetIntOrZR(context, op.Rt);
|
|
||||||
|
|
||||||
for (long offset = 0; offset < DczSizeInBytes; offset += 8)
|
|
||||||
{
|
|
||||||
Operand address = context.Add(t, Const(offset));
|
|
||||||
|
|
||||||
InstEmitMemoryHelper.EmitStore(context, address, RegisterConsts.ZeroIndex, 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// No-op
|
|
||||||
case 0b11_011_0111_1110_001: // DC CIVAC
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 0b11_011_0111_0101_001: // IC IVAU
|
|
||||||
Operand target = Register(op.Rt, RegisterType.Integer, OperandType.I64);
|
|
||||||
context.Call(typeof(NativeInterface).GetMethod(nameof(NativeInterface.InvalidateCacheLine)), target);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static int GetPackedId(OpCodeSystem op)
|
|
||||||
{
|
|
||||||
int id;
|
|
||||||
|
|
||||||
id = op.Op2 << 0;
|
|
||||||
id |= op.CRm << 3;
|
|
||||||
id |= op.CRn << 7;
|
|
||||||
id |= op.Op1 << 11;
|
|
||||||
id |= op.Op0 << 14;
|
|
||||||
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void EmitGetNzcv(ArmEmitterContext context)
|
|
||||||
{
|
|
||||||
OpCodeSystem op = (OpCodeSystem)context.CurrOp;
|
|
||||||
|
|
||||||
Operand vSh = context.ShiftLeft(GetFlag(PState.VFlag), Const((int)PState.VFlag));
|
|
||||||
Operand cSh = context.ShiftLeft(GetFlag(PState.CFlag), Const((int)PState.CFlag));
|
|
||||||
Operand zSh = context.ShiftLeft(GetFlag(PState.ZFlag), Const((int)PState.ZFlag));
|
|
||||||
Operand nSh = context.ShiftLeft(GetFlag(PState.NFlag), Const((int)PState.NFlag));
|
|
||||||
|
|
||||||
Operand nzcvSh = context.BitwiseOr(context.BitwiseOr(nSh, zSh), context.BitwiseOr(cSh, vSh));
|
|
||||||
|
|
||||||
SetIntOrZR(context, op.Rt, nzcvSh);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void EmitSetNzcv(ArmEmitterContext context)
|
|
||||||
{
|
|
||||||
OpCodeSystem op = (OpCodeSystem)context.CurrOp;
|
|
||||||
|
|
||||||
Operand t = GetIntOrZR(context, op.Rt);
|
|
||||||
t = context.ConvertI64ToI32(t);
|
|
||||||
|
|
||||||
Operand v = context.ShiftRightUI(t, Const((int)PState.VFlag));
|
|
||||||
v = context.BitwiseAnd (v, Const(1));
|
|
||||||
|
|
||||||
Operand c = context.ShiftRightUI(t, Const((int)PState.CFlag));
|
|
||||||
c = context.BitwiseAnd (c, Const(1));
|
|
||||||
|
|
||||||
Operand z = context.ShiftRightUI(t, Const((int)PState.ZFlag));
|
|
||||||
z = context.BitwiseAnd (z, Const(1));
|
|
||||||
|
|
||||||
Operand n = context.ShiftRightUI(t, Const((int)PState.NFlag));
|
|
||||||
n = context.BitwiseAnd (n, Const(1));
|
|
||||||
|
|
||||||
SetFlag(context, PState.VFlag, v);
|
|
||||||
SetFlag(context, PState.CFlag, c);
|
|
||||||
SetFlag(context, PState.ZFlag, z);
|
|
||||||
SetFlag(context, PState.NFlag, n);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,172 +0,0 @@
|
|||||||
namespace ARMeilleure.IntermediateRepresentation
|
|
||||||
{
|
|
||||||
enum Intrinsic : ushort
|
|
||||||
{
|
|
||||||
X86Addpd,
|
|
||||||
X86Addps,
|
|
||||||
X86Addsd,
|
|
||||||
X86Addss,
|
|
||||||
X86Aesdec,
|
|
||||||
X86Aesdeclast,
|
|
||||||
X86Aesenc,
|
|
||||||
X86Aesenclast,
|
|
||||||
X86Aesimc,
|
|
||||||
X86Andnpd,
|
|
||||||
X86Andnps,
|
|
||||||
X86Andpd,
|
|
||||||
X86Andps,
|
|
||||||
X86Blendvpd,
|
|
||||||
X86Blendvps,
|
|
||||||
X86Cmppd,
|
|
||||||
X86Cmpps,
|
|
||||||
X86Cmpsd,
|
|
||||||
X86Cmpss,
|
|
||||||
X86Comisdeq,
|
|
||||||
X86Comisdge,
|
|
||||||
X86Comisdlt,
|
|
||||||
X86Comisseq,
|
|
||||||
X86Comissge,
|
|
||||||
X86Comisslt,
|
|
||||||
X86Crc32,
|
|
||||||
X86Crc32_16,
|
|
||||||
X86Crc32_8,
|
|
||||||
X86Cvtdq2pd,
|
|
||||||
X86Cvtdq2ps,
|
|
||||||
X86Cvtpd2dq,
|
|
||||||
X86Cvtpd2ps,
|
|
||||||
X86Cvtps2dq,
|
|
||||||
X86Cvtps2pd,
|
|
||||||
X86Cvtsd2si,
|
|
||||||
X86Cvtsd2ss,
|
|
||||||
X86Cvtsi2sd,
|
|
||||||
X86Cvtsi2si,
|
|
||||||
X86Cvtsi2ss,
|
|
||||||
X86Cvtss2sd,
|
|
||||||
X86Cvtss2si,
|
|
||||||
X86Divpd,
|
|
||||||
X86Divps,
|
|
||||||
X86Divsd,
|
|
||||||
X86Divss,
|
|
||||||
X86Haddpd,
|
|
||||||
X86Haddps,
|
|
||||||
X86Insertps,
|
|
||||||
X86Maxpd,
|
|
||||||
X86Maxps,
|
|
||||||
X86Maxsd,
|
|
||||||
X86Maxss,
|
|
||||||
X86Minpd,
|
|
||||||
X86Minps,
|
|
||||||
X86Minsd,
|
|
||||||
X86Minss,
|
|
||||||
X86Movhlps,
|
|
||||||
X86Movlhps,
|
|
||||||
X86Movss,
|
|
||||||
X86Mulpd,
|
|
||||||
X86Mulps,
|
|
||||||
X86Mulsd,
|
|
||||||
X86Mulss,
|
|
||||||
X86Mxcsrmb,
|
|
||||||
X86Mxcsrub,
|
|
||||||
X86Paddb,
|
|
||||||
X86Paddd,
|
|
||||||
X86Paddq,
|
|
||||||
X86Paddw,
|
|
||||||
X86Pand,
|
|
||||||
X86Pandn,
|
|
||||||
X86Pavgb,
|
|
||||||
X86Pavgw,
|
|
||||||
X86Pblendvb,
|
|
||||||
X86Pclmulqdq,
|
|
||||||
X86Pcmpeqb,
|
|
||||||
X86Pcmpeqd,
|
|
||||||
X86Pcmpeqq,
|
|
||||||
X86Pcmpeqw,
|
|
||||||
X86Pcmpgtb,
|
|
||||||
X86Pcmpgtd,
|
|
||||||
X86Pcmpgtq,
|
|
||||||
X86Pcmpgtw,
|
|
||||||
X86Pmaxsb,
|
|
||||||
X86Pmaxsd,
|
|
||||||
X86Pmaxsw,
|
|
||||||
X86Pmaxub,
|
|
||||||
X86Pmaxud,
|
|
||||||
X86Pmaxuw,
|
|
||||||
X86Pminsb,
|
|
||||||
X86Pminsd,
|
|
||||||
X86Pminsw,
|
|
||||||
X86Pminub,
|
|
||||||
X86Pminud,
|
|
||||||
X86Pminuw,
|
|
||||||
X86Pmovsxbw,
|
|
||||||
X86Pmovsxdq,
|
|
||||||
X86Pmovsxwd,
|
|
||||||
X86Pmovzxbw,
|
|
||||||
X86Pmovzxdq,
|
|
||||||
X86Pmovzxwd,
|
|
||||||
X86Pmulld,
|
|
||||||
X86Pmullw,
|
|
||||||
X86Popcnt,
|
|
||||||
X86Por,
|
|
||||||
X86Pshufb,
|
|
||||||
X86Pshufd,
|
|
||||||
X86Pslld,
|
|
||||||
X86Pslldq,
|
|
||||||
X86Psllq,
|
|
||||||
X86Psllw,
|
|
||||||
X86Psrad,
|
|
||||||
X86Psraw,
|
|
||||||
X86Psrld,
|
|
||||||
X86Psrlq,
|
|
||||||
X86Psrldq,
|
|
||||||
X86Psrlw,
|
|
||||||
X86Psubb,
|
|
||||||
X86Psubd,
|
|
||||||
X86Psubq,
|
|
||||||
X86Psubw,
|
|
||||||
X86Punpckhbw,
|
|
||||||
X86Punpckhdq,
|
|
||||||
X86Punpckhqdq,
|
|
||||||
X86Punpckhwd,
|
|
||||||
X86Punpcklbw,
|
|
||||||
X86Punpckldq,
|
|
||||||
X86Punpcklqdq,
|
|
||||||
X86Punpcklwd,
|
|
||||||
X86Pxor,
|
|
||||||
X86Rcpps,
|
|
||||||
X86Rcpss,
|
|
||||||
X86Roundpd,
|
|
||||||
X86Roundps,
|
|
||||||
X86Roundsd,
|
|
||||||
X86Roundss,
|
|
||||||
X86Rsqrtps,
|
|
||||||
X86Rsqrtss,
|
|
||||||
X86Shufpd,
|
|
||||||
X86Shufps,
|
|
||||||
X86Sqrtpd,
|
|
||||||
X86Sqrtps,
|
|
||||||
X86Sqrtsd,
|
|
||||||
X86Sqrtss,
|
|
||||||
X86Subpd,
|
|
||||||
X86Subps,
|
|
||||||
X86Subsd,
|
|
||||||
X86Subss,
|
|
||||||
X86Unpckhpd,
|
|
||||||
X86Unpckhps,
|
|
||||||
X86Unpcklpd,
|
|
||||||
X86Unpcklps,
|
|
||||||
X86Vcvtph2ps,
|
|
||||||
X86Vcvtps2ph,
|
|
||||||
X86Vfmadd231ps,
|
|
||||||
X86Vfmadd231sd,
|
|
||||||
X86Vfmadd231ss,
|
|
||||||
X86Vfmsub231sd,
|
|
||||||
X86Vfmsub231ss,
|
|
||||||
X86Vfnmadd231ps,
|
|
||||||
X86Vfnmadd231sd,
|
|
||||||
X86Vfnmadd231ss,
|
|
||||||
X86Vfnmsub231sd,
|
|
||||||
X86Vfnmsub231ss,
|
|
||||||
X86Xorpd,
|
|
||||||
X86Xorps
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,44 +0,0 @@
|
|||||||
using ARMeilleure.CodeGen.X86;
|
|
||||||
|
|
||||||
namespace ARMeilleure
|
|
||||||
{
|
|
||||||
public static class Optimizations
|
|
||||||
{
|
|
||||||
public static bool FastFP { get; set; } = true;
|
|
||||||
|
|
||||||
public static bool AllowLcqInFunctionTable { get; set; } = true;
|
|
||||||
public static bool UseUnmanagedDispatchLoop { get; set; } = true;
|
|
||||||
|
|
||||||
public static bool UseSseIfAvailable { get; set; } = true;
|
|
||||||
public static bool UseSse2IfAvailable { get; set; } = true;
|
|
||||||
public static bool UseSse3IfAvailable { get; set; } = true;
|
|
||||||
public static bool UseSsse3IfAvailable { get; set; } = true;
|
|
||||||
public static bool UseSse41IfAvailable { get; set; } = true;
|
|
||||||
public static bool UseSse42IfAvailable { get; set; } = true;
|
|
||||||
public static bool UsePopCntIfAvailable { get; set; } = true;
|
|
||||||
public static bool UseAvxIfAvailable { get; set; } = true;
|
|
||||||
public static bool UseF16cIfAvailable { get; set; } = true;
|
|
||||||
public static bool UseFmaIfAvailable { get; set; } = true;
|
|
||||||
public static bool UseAesniIfAvailable { get; set; } = true;
|
|
||||||
public static bool UsePclmulqdqIfAvailable { get; set; } = true;
|
|
||||||
|
|
||||||
public static bool ForceLegacySse
|
|
||||||
{
|
|
||||||
get => HardwareCapabilities.ForceLegacySse;
|
|
||||||
set => HardwareCapabilities.ForceLegacySse = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
internal static bool UseSse => UseSseIfAvailable && HardwareCapabilities.SupportsSse;
|
|
||||||
internal static bool UseSse2 => UseSse2IfAvailable && HardwareCapabilities.SupportsSse2;
|
|
||||||
internal static bool UseSse3 => UseSse3IfAvailable && HardwareCapabilities.SupportsSse3;
|
|
||||||
internal static bool UseSsse3 => UseSsse3IfAvailable && HardwareCapabilities.SupportsSsse3;
|
|
||||||
internal static bool UseSse41 => UseSse41IfAvailable && HardwareCapabilities.SupportsSse41;
|
|
||||||
internal static bool UseSse42 => UseSse42IfAvailable && HardwareCapabilities.SupportsSse42;
|
|
||||||
internal static bool UsePopCnt => UsePopCntIfAvailable && HardwareCapabilities.SupportsPopcnt;
|
|
||||||
internal static bool UseAvx => UseAvxIfAvailable && HardwareCapabilities.SupportsAvx && !ForceLegacySse;
|
|
||||||
internal static bool UseF16c => UseF16cIfAvailable && HardwareCapabilities.SupportsF16c;
|
|
||||||
internal static bool UseFma => UseFmaIfAvailable && HardwareCapabilities.SupportsFma;
|
|
||||||
internal static bool UseAesni => UseAesniIfAvailable && HardwareCapabilities.SupportsAesni;
|
|
||||||
internal static bool UsePclmulqdq => UsePclmulqdqIfAvailable && HardwareCapabilities.SupportsPclmulqdq;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,57 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace ARMeilleure.Signal
|
|
||||||
{
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
|
||||||
unsafe struct SigSet
|
|
||||||
{
|
|
||||||
fixed long sa_mask[16];
|
|
||||||
}
|
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
|
||||||
struct SigAction
|
|
||||||
{
|
|
||||||
public IntPtr sa_handler;
|
|
||||||
public SigSet sa_mask;
|
|
||||||
public int sa_flags;
|
|
||||||
public IntPtr sa_restorer;
|
|
||||||
}
|
|
||||||
|
|
||||||
static class UnixSignalHandlerRegistration
|
|
||||||
{
|
|
||||||
private const int SIGSEGV = 11;
|
|
||||||
private const int SA_SIGINFO = 0x00000004;
|
|
||||||
|
|
||||||
[DllImport("libc", SetLastError = true)]
|
|
||||||
private static extern int sigaction(int signum, ref SigAction sigAction, out SigAction oldAction);
|
|
||||||
|
|
||||||
[DllImport("libc", SetLastError = true)]
|
|
||||||
private static extern int sigemptyset(ref SigSet set);
|
|
||||||
|
|
||||||
public static SigAction RegisterExceptionHandler(IntPtr action)
|
|
||||||
{
|
|
||||||
SigAction sig = new SigAction
|
|
||||||
{
|
|
||||||
sa_handler = action,
|
|
||||||
sa_flags = SA_SIGINFO
|
|
||||||
};
|
|
||||||
|
|
||||||
sigemptyset(ref sig.sa_mask);
|
|
||||||
|
|
||||||
int result = sigaction(SIGSEGV, ref sig, out SigAction old);
|
|
||||||
|
|
||||||
if (result != 0)
|
|
||||||
{
|
|
||||||
throw new InvalidOperationException($"Could not register sigaction. Error: {result}");
|
|
||||||
}
|
|
||||||
|
|
||||||
return old;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool RestoreExceptionHandler(SigAction oldAction)
|
|
||||||
{
|
|
||||||
return sigaction(SIGSEGV, ref oldAction, out SigAction _) == 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,24 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace ARMeilleure.Signal
|
|
||||||
{
|
|
||||||
class WindowsSignalHandlerRegistration
|
|
||||||
{
|
|
||||||
[DllImport("kernel32.dll")]
|
|
||||||
private static extern IntPtr AddVectoredExceptionHandler(uint first, IntPtr handler);
|
|
||||||
|
|
||||||
[DllImport("kernel32.dll")]
|
|
||||||
private static extern ulong RemoveVectoredExceptionHandler(IntPtr handle);
|
|
||||||
|
|
||||||
public static IntPtr RegisterExceptionHandler(IntPtr action)
|
|
||||||
{
|
|
||||||
return AddVectoredExceptionHandler(1, action);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool RemoveExceptionHandler(IntPtr handle)
|
|
||||||
{
|
|
||||||
return RemoveVectoredExceptionHandler(handle) != 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,25 +0,0 @@
|
|||||||
using System;
|
|
||||||
|
|
||||||
namespace ARMeilleure.State
|
|
||||||
{
|
|
||||||
[Flags]
|
|
||||||
public enum FPCR : uint
|
|
||||||
{
|
|
||||||
Ufe = 1u << 11,
|
|
||||||
Fz = 1u << 24,
|
|
||||||
Dn = 1u << 25,
|
|
||||||
Ahp = 1u << 26,
|
|
||||||
|
|
||||||
A32Mask = 0x07FF9F00u
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class FPCRExtensions
|
|
||||||
{
|
|
||||||
private const int RModeShift = 22;
|
|
||||||
|
|
||||||
public static FPRoundingMode GetRoundingMode(this FPCR fpcr)
|
|
||||||
{
|
|
||||||
return (FPRoundingMode)(((int)fpcr >> RModeShift) & 3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
namespace ARMeilleure.State
|
|
||||||
{
|
|
||||||
public enum FPRoundingMode
|
|
||||||
{
|
|
||||||
ToNearest = 0,
|
|
||||||
TowardsPlusInfinity = 1,
|
|
||||||
TowardsMinusInfinity = 2,
|
|
||||||
TowardsZero = 3
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
using System;
|
|
||||||
|
|
||||||
namespace ARMeilleure.State
|
|
||||||
{
|
|
||||||
[Flags]
|
|
||||||
public enum FPSR : uint
|
|
||||||
{
|
|
||||||
Ufc = 1u << 3,
|
|
||||||
Qc = 1u << 27,
|
|
||||||
|
|
||||||
Nzcv = (1u << 31) | (1u << 30) | (1u << 29) | (1u << 28),
|
|
||||||
|
|
||||||
A32Mask = 0xF800009Fu
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
namespace ARMeilleure.State
|
|
||||||
{
|
|
||||||
public enum FPState
|
|
||||||
{
|
|
||||||
VFlag = 28,
|
|
||||||
CFlag = 29,
|
|
||||||
ZFlag = 30,
|
|
||||||
NFlag = 31
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
using System;
|
|
||||||
|
|
||||||
namespace ARMeilleure.State
|
|
||||||
{
|
|
||||||
public class InstExceptionEventArgs : EventArgs
|
|
||||||
{
|
|
||||||
public ulong Address { get; }
|
|
||||||
public int Id { get; }
|
|
||||||
|
|
||||||
public InstExceptionEventArgs(ulong address, int id)
|
|
||||||
{
|
|
||||||
Address = address;
|
|
||||||
Id = id;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
using System;
|
|
||||||
|
|
||||||
namespace ARMeilleure.State
|
|
||||||
{
|
|
||||||
public class InstUndefinedEventArgs : EventArgs
|
|
||||||
{
|
|
||||||
public ulong Address { get; }
|
|
||||||
public int OpCode { get; }
|
|
||||||
|
|
||||||
public InstUndefinedEventArgs(ulong address, int opCode)
|
|
||||||
{
|
|
||||||
Address = address;
|
|
||||||
OpCode = opCode;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,107 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Reflection;
|
|
||||||
using System.Reflection.Emit;
|
|
||||||
|
|
||||||
namespace ARMeilleure.Translation
|
|
||||||
{
|
|
||||||
static class DelegateHelper
|
|
||||||
{
|
|
||||||
private const string DelegateTypesAssemblyName = "JitDelegateTypes";
|
|
||||||
|
|
||||||
private static readonly ModuleBuilder _modBuilder;
|
|
||||||
|
|
||||||
private static readonly Dictionary<string, Type> _delegateTypesCache;
|
|
||||||
|
|
||||||
static DelegateHelper()
|
|
||||||
{
|
|
||||||
AssemblyBuilder asmBuilder = AssemblyBuilder.DefineDynamicAssembly(new AssemblyName(DelegateTypesAssemblyName), AssemblyBuilderAccess.Run);
|
|
||||||
|
|
||||||
_modBuilder = asmBuilder.DefineDynamicModule(DelegateTypesAssemblyName);
|
|
||||||
|
|
||||||
_delegateTypesCache = new Dictionary<string, Type>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Delegate GetDelegate(MethodInfo info)
|
|
||||||
{
|
|
||||||
if (info == null)
|
|
||||||
{
|
|
||||||
throw new ArgumentNullException(nameof(info));
|
|
||||||
}
|
|
||||||
|
|
||||||
Type[] parameters = info.GetParameters().Select(pI => pI.ParameterType).ToArray();
|
|
||||||
Type returnType = info.ReturnType;
|
|
||||||
|
|
||||||
Type delegateType = GetDelegateType(parameters, returnType);
|
|
||||||
|
|
||||||
return Delegate.CreateDelegate(delegateType, info);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static Type GetDelegateType(Type[] parameters, Type returnType)
|
|
||||||
{
|
|
||||||
string key = GetFunctionSignatureKey(parameters, returnType);
|
|
||||||
|
|
||||||
if (!_delegateTypesCache.TryGetValue(key, out Type delegateType))
|
|
||||||
{
|
|
||||||
delegateType = MakeDelegateType(parameters, returnType, key);
|
|
||||||
|
|
||||||
_delegateTypesCache.TryAdd(key, delegateType);
|
|
||||||
}
|
|
||||||
|
|
||||||
return delegateType;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string GetFunctionSignatureKey(Type[] parameters, Type returnType)
|
|
||||||
{
|
|
||||||
string sig = GetTypeName(returnType);
|
|
||||||
|
|
||||||
foreach (Type type in parameters)
|
|
||||||
{
|
|
||||||
sig += '_' + GetTypeName(type);
|
|
||||||
}
|
|
||||||
|
|
||||||
return sig;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string GetTypeName(Type type)
|
|
||||||
{
|
|
||||||
return type.FullName.Replace(".", string.Empty);
|
|
||||||
}
|
|
||||||
|
|
||||||
private const MethodAttributes CtorAttributes =
|
|
||||||
MethodAttributes.RTSpecialName |
|
|
||||||
MethodAttributes.HideBySig |
|
|
||||||
MethodAttributes.Public;
|
|
||||||
|
|
||||||
private const TypeAttributes DelegateTypeAttributes =
|
|
||||||
TypeAttributes.Class |
|
|
||||||
TypeAttributes.Public |
|
|
||||||
TypeAttributes.Sealed |
|
|
||||||
TypeAttributes.AnsiClass |
|
|
||||||
TypeAttributes.AutoClass;
|
|
||||||
|
|
||||||
private const MethodImplAttributes ImplAttributes =
|
|
||||||
MethodImplAttributes.Runtime |
|
|
||||||
MethodImplAttributes.Managed;
|
|
||||||
|
|
||||||
private const MethodAttributes InvokeAttributes =
|
|
||||||
MethodAttributes.Public |
|
|
||||||
MethodAttributes.HideBySig |
|
|
||||||
MethodAttributes.NewSlot |
|
|
||||||
MethodAttributes.Virtual;
|
|
||||||
|
|
||||||
private static readonly Type[] _delegateCtorSignature = { typeof(object), typeof(IntPtr) };
|
|
||||||
|
|
||||||
private static Type MakeDelegateType(Type[] parameters, Type returnType, string name)
|
|
||||||
{
|
|
||||||
TypeBuilder builder = _modBuilder.DefineType(name, DelegateTypeAttributes, typeof(MulticastDelegate));
|
|
||||||
|
|
||||||
builder.DefineConstructor(CtorAttributes, CallingConventions.Standard, _delegateCtorSignature).SetImplementationFlags(ImplAttributes);
|
|
||||||
|
|
||||||
builder.DefineMethod("Invoke", InvokeAttributes, returnType, parameters).SetImplementationFlags(ImplAttributes);
|
|
||||||
|
|
||||||
return builder.CreateTypeInfo();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,299 +0,0 @@
|
|||||||
using ARMeilleure.Instructions;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Reflection;
|
|
||||||
|
|
||||||
namespace ARMeilleure.Translation
|
|
||||||
{
|
|
||||||
static class Delegates
|
|
||||||
{
|
|
||||||
public static bool TryGetDelegateFuncPtrByIndex(int index, out IntPtr funcPtr)
|
|
||||||
{
|
|
||||||
if (index >= 0 && index < _delegates.Count)
|
|
||||||
{
|
|
||||||
funcPtr = _delegates.Values[index].FuncPtr; // O(1).
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
funcPtr = default;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static IntPtr GetDelegateFuncPtrByIndex(int index)
|
|
||||||
{
|
|
||||||
if (index < 0 || index >= _delegates.Count)
|
|
||||||
{
|
|
||||||
throw new ArgumentOutOfRangeException($"({nameof(index)} = {index})");
|
|
||||||
}
|
|
||||||
|
|
||||||
return _delegates.Values[index].FuncPtr; // O(1).
|
|
||||||
}
|
|
||||||
|
|
||||||
public static IntPtr GetDelegateFuncPtr(MethodInfo info)
|
|
||||||
{
|
|
||||||
if (info == null)
|
|
||||||
{
|
|
||||||
throw new ArgumentNullException(nameof(info));
|
|
||||||
}
|
|
||||||
|
|
||||||
string key = GetKey(info);
|
|
||||||
|
|
||||||
if (!_delegates.TryGetValue(key, out DelegateInfo dlgInfo)) // O(log(n)).
|
|
||||||
{
|
|
||||||
throw new KeyNotFoundException($"({nameof(key)} = {key})");
|
|
||||||
}
|
|
||||||
|
|
||||||
return dlgInfo.FuncPtr;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int GetDelegateIndex(MethodInfo info)
|
|
||||||
{
|
|
||||||
if (info == null)
|
|
||||||
{
|
|
||||||
throw new ArgumentNullException(nameof(info));
|
|
||||||
}
|
|
||||||
|
|
||||||
string key = GetKey(info);
|
|
||||||
|
|
||||||
int index = _delegates.IndexOfKey(key); // O(log(n)).
|
|
||||||
|
|
||||||
if (index == -1)
|
|
||||||
{
|
|
||||||
throw new KeyNotFoundException($"({nameof(key)} = {key})");
|
|
||||||
}
|
|
||||||
|
|
||||||
return index;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void SetDelegateInfo(MethodInfo info)
|
|
||||||
{
|
|
||||||
string key = GetKey(info);
|
|
||||||
|
|
||||||
Delegate dlg = DelegateHelper.GetDelegate(info);
|
|
||||||
|
|
||||||
_delegates.Add(key, new DelegateInfo(dlg)); // ArgumentException (key).
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string GetKey(MethodInfo info)
|
|
||||||
{
|
|
||||||
return $"{info.DeclaringType.Name}.{info.Name}";
|
|
||||||
}
|
|
||||||
|
|
||||||
private static readonly SortedList<string, DelegateInfo> _delegates;
|
|
||||||
|
|
||||||
static Delegates()
|
|
||||||
{
|
|
||||||
_delegates = new SortedList<string, DelegateInfo>();
|
|
||||||
|
|
||||||
SetDelegateInfo(typeof(Math).GetMethod(nameof(Math.Abs), new Type[] { typeof(double) }));
|
|
||||||
SetDelegateInfo(typeof(Math).GetMethod(nameof(Math.Ceiling), new Type[] { typeof(double) }));
|
|
||||||
SetDelegateInfo(typeof(Math).GetMethod(nameof(Math.Floor), new Type[] { typeof(double) }));
|
|
||||||
SetDelegateInfo(typeof(Math).GetMethod(nameof(Math.Round), new Type[] { typeof(double), typeof(MidpointRounding) }));
|
|
||||||
SetDelegateInfo(typeof(Math).GetMethod(nameof(Math.Truncate), new Type[] { typeof(double) }));
|
|
||||||
|
|
||||||
SetDelegateInfo(typeof(MathF).GetMethod(nameof(MathF.Abs), new Type[] { typeof(float) }));
|
|
||||||
SetDelegateInfo(typeof(MathF).GetMethod(nameof(MathF.Ceiling), new Type[] { typeof(float) }));
|
|
||||||
SetDelegateInfo(typeof(MathF).GetMethod(nameof(MathF.Floor), new Type[] { typeof(float) }));
|
|
||||||
SetDelegateInfo(typeof(MathF).GetMethod(nameof(MathF.Round), new Type[] { typeof(float), typeof(MidpointRounding) }));
|
|
||||||
SetDelegateInfo(typeof(MathF).GetMethod(nameof(MathF.Truncate), new Type[] { typeof(float) }));
|
|
||||||
|
|
||||||
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.Break)));
|
|
||||||
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.CheckSynchronization)));
|
|
||||||
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.EnqueueForRejit)));
|
|
||||||
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetCntfrqEl0)));
|
|
||||||
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetCntpctEl0)));
|
|
||||||
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetCntvctEl0)));
|
|
||||||
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetCtrEl0)));
|
|
||||||
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetDczidEl0)));
|
|
||||||
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetFpcr)));
|
|
||||||
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetFpcrFz)));
|
|
||||||
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetFpscr))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetFpsr)));
|
|
||||||
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetFunctionAddress)));
|
|
||||||
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.InvalidateCacheLine)));
|
|
||||||
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetTpidr)));
|
|
||||||
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetTpidr32))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetTpidrEl0)));
|
|
||||||
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetTpidrEl032))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.ReadByte)));
|
|
||||||
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.ReadUInt16)));
|
|
||||||
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.ReadUInt32)));
|
|
||||||
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.ReadUInt64)));
|
|
||||||
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.ReadVector128)));
|
|
||||||
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.SetFpcr)));
|
|
||||||
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.SetFpscr))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.SetFpsr)));
|
|
||||||
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.SetFpsrQc))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.SetTpidrEl0)));
|
|
||||||
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.SetTpidrEl032))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.SignalMemoryTracking)));
|
|
||||||
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.SupervisorCall)));
|
|
||||||
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.ThrowInvalidMemoryAccess)));
|
|
||||||
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.Undefined)));
|
|
||||||
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.WriteByte)));
|
|
||||||
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.WriteUInt16)));
|
|
||||||
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.WriteUInt32)));
|
|
||||||
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.WriteUInt64)));
|
|
||||||
SetDelegateInfo(typeof(NativeInterface).GetMethod(nameof(NativeInterface.WriteVector128)));
|
|
||||||
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.BinarySignedSatQAcc)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.BinarySignedSatQAdd)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.BinarySignedSatQSub)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.BinaryUnsignedSatQAcc)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.BinaryUnsignedSatQAdd)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.BinaryUnsignedSatQSub)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.CountLeadingSigns)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.CountLeadingZeros)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.Crc32b)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.Crc32cb)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.Crc32ch)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.Crc32cw)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.Crc32cx)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.Crc32h)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.Crc32w)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.Crc32x)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.Decrypt)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.DoubleToInt32))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.DoubleToUInt32))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.Encrypt)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.FixedRotate)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.FloatToInt32))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.FloatToUInt32))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.HashChoose)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.HashLower)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.HashMajority)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.HashParity)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.HashUpper)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.InverseMixColumns)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.MixColumns)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.PolynomialMult64_128)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.Round)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.RoundF)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.SatF32ToS32)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.SatF32ToS64)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.SatF32ToU32)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.SatF32ToU64)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.SatF64ToS32)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.SatF64ToS64)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.SatF64ToU32)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.SatF64ToU64)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.Sha1SchedulePart1)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.Sha1SchedulePart2)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.Sha256SchedulePart1)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.Sha256SchedulePart2)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.SignedShlReg)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.SignedShlRegSatQ)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.SignedShrImm64)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.SignedSrcSignedDstSatQ)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.SignedSrcUnsignedDstSatQ)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.Tbl1)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.Tbl2)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.Tbl3)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.Tbl4)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.Tbx1)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.Tbx2)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.Tbx3)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.Tbx4)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.UnarySignedSatQAbsOrNeg)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.UnsignedShlReg)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.UnsignedShlRegSatQ)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.UnsignedShrImm64)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.UnsignedSrcSignedDstSatQ)));
|
|
||||||
SetDelegateInfo(typeof(SoftFallback).GetMethod(nameof(SoftFallback.UnsignedSrcUnsignedDstSatQ)));
|
|
||||||
|
|
||||||
SetDelegateInfo(typeof(SoftFloat16_32).GetMethod(nameof(SoftFloat16_32.FPConvert)));
|
|
||||||
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPAdd)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPAddFpscr))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPCompare)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPCompareEQ)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPCompareEQFpscr))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPCompareGE)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPCompareGEFpscr))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPCompareGT)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPCompareGTFpscr))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPCompareLE)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPCompareLEFpscr))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPCompareLT)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPCompareLTFpscr))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPDiv)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPMax)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPMaxFpscr))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPMaxNum)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPMaxNumFpscr))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPMin)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPMinFpscr))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPMinNum)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPMinNumFpscr))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPMul)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPMulFpscr))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPMulAdd)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPMulAddFpscr))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPMulSub)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPMulSubFpscr))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPMulX)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPNegMulAdd)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPNegMulSub)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPRecipEstimate)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPRecipEstimateFpscr))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPRecipStep))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPRecipStepFused)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPRecpX)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPRSqrtEstimate)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPRSqrtEstimateFpscr))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPRSqrtStep))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPRSqrtStepFused)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPSqrt)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32).GetMethod(nameof(SoftFloat32.FPSub)));
|
|
||||||
|
|
||||||
SetDelegateInfo(typeof(SoftFloat32_16).GetMethod(nameof(SoftFloat32_16.FPConvert)));
|
|
||||||
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPAdd)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPAddFpscr))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPCompare)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPCompareEQ)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPCompareEQFpscr))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPCompareGE)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPCompareGEFpscr))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPCompareGT)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPCompareGTFpscr))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPCompareLE)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPCompareLEFpscr))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPCompareLT)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPCompareLTFpscr))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPDiv)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPMax)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPMaxFpscr))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPMaxNum)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPMaxNumFpscr))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPMin)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPMinFpscr))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPMinNum)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPMinNumFpscr))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPMul)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPMulFpscr))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPMulAdd)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPMulAddFpscr))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPMulSub)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPMulSubFpscr))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPMulX)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPNegMulAdd)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPNegMulSub)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPRecipEstimate)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPRecipEstimateFpscr))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPRecipStep))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPRecipStepFused)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPRecpX)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPRSqrtEstimate)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPRSqrtEstimateFpscr))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPRSqrtStep))); // A32 only.
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPRSqrtStepFused)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPSqrt)));
|
|
||||||
SetDelegateInfo(typeof(SoftFloat64).GetMethod(nameof(SoftFloat64.FPSub)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
53
Directory.Packages.props
Normal file
53
Directory.Packages.props
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
<Project>
|
||||||
|
<PropertyGroup>
|
||||||
|
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageVersion Include="Avalonia" Version="0.10.19" />
|
||||||
|
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="0.10.19" />
|
||||||
|
<PackageVersion Include="Avalonia.Desktop" Version="0.10.19" />
|
||||||
|
<PackageVersion Include="Avalonia.Diagnostics" Version="0.10.19" />
|
||||||
|
<PackageVersion Include="Avalonia.Markup.Xaml.Loader" Version="0.10.19" />
|
||||||
|
<PackageVersion Include="Avalonia.Svg" Version="0.10.18" />
|
||||||
|
<PackageVersion Include="Avalonia.Svg.Skia" Version="0.10.18" />
|
||||||
|
<PackageVersion Include="CommandLineParser" Version="2.9.1" />
|
||||||
|
<PackageVersion Include="Concentus" Version="1.1.7" />
|
||||||
|
<PackageVersion Include="DiscordRichPresence" Version="1.1.3.18" />
|
||||||
|
<PackageVersion Include="DynamicData" Version="7.13.8" />
|
||||||
|
<PackageVersion Include="FluentAvaloniaUI" Version="1.4.5" />
|
||||||
|
<PackageVersion Include="GtkSharp.Dependencies" Version="1.1.1" />
|
||||||
|
<PackageVersion Include="GtkSharp.Dependencies.osx" Version="0.0.5" />
|
||||||
|
<PackageVersion Include="jp2masa.Avalonia.Flexbox" Version="0.2.0" />
|
||||||
|
<PackageVersion Include="LibHac" Version="0.18.0" />
|
||||||
|
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" />
|
||||||
|
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.5.0" />
|
||||||
|
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
|
||||||
|
<PackageVersion Include="Microsoft.IO.RecyclableMemoryStream" Version="2.3.2" />
|
||||||
|
<PackageVersion Include="MsgPack.Cli" Version="1.0.1" />
|
||||||
|
<PackageVersion Include="NUnit" Version="3.13.3" />
|
||||||
|
<PackageVersion Include="NUnit3TestAdapter" Version="4.1.0" />
|
||||||
|
<PackageVersion Include="OpenTK.Core" Version="4.7.7" />
|
||||||
|
<PackageVersion Include="OpenTK.Graphics" Version="4.7.7" />
|
||||||
|
<PackageVersion Include="OpenTK.OpenAL" Version="4.7.7" />
|
||||||
|
<PackageVersion Include="OpenTK.Windowing.GraphicsLibraryFramework" Version="4.7.7" />
|
||||||
|
<PackageVersion Include="Ryujinx.Audio.OpenAL.Dependencies" Version="1.21.0.1" />
|
||||||
|
<PackageVersion Include="Ryujinx.Graphics.Nvdec.Dependencies" Version="5.0.1-build13" />
|
||||||
|
<PackageVersion Include="Ryujinx.Graphics.Vulkan.Dependencies.MoltenVK" Version="1.2.0" />
|
||||||
|
<PackageVersion Include="Ryujinx.GtkSharp" Version="3.24.24.59-ryujinx" />
|
||||||
|
<PackageVersion Include="Ryujinx.SDL2-CS" Version="2.26.3-build25" />
|
||||||
|
<PackageVersion Include="shaderc.net" Version="0.1.0" />
|
||||||
|
<PackageVersion Include="SharpZipLib" Version="1.4.2" />
|
||||||
|
<PackageVersion Include="Silk.NET.Vulkan" Version="2.16.0" />
|
||||||
|
<PackageVersion Include="Silk.NET.Vulkan.Extensions.EXT" Version="2.16.0" />
|
||||||
|
<PackageVersion Include="Silk.NET.Vulkan.Extensions.KHR" Version="2.16.0" />
|
||||||
|
<PackageVersion Include="SixLabors.ImageSharp" Version="1.0.4" />
|
||||||
|
<PackageVersion Include="SixLabors.ImageSharp.Drawing" Version="1.0.0-beta11" />
|
||||||
|
<PackageVersion Include="SPB" Version="0.0.4-build28" />
|
||||||
|
<PackageVersion Include="System.Drawing.Common" Version="7.0.0" />
|
||||||
|
<PackageVersion Include="System.IdentityModel.Tokens.Jwt" Version="6.30.1" />
|
||||||
|
<PackageVersion Include="System.IO.Hashing" Version="7.0.0" />
|
||||||
|
<PackageVersion Include="System.Management" Version="7.0.1" />
|
||||||
|
<PackageVersion Include="UnicornEngine.Unicorn" Version="2.0.2-rc1-fb78016" />
|
||||||
|
<PackageVersion Include="XamlNameReferenceGenerator" Version="1.6.1" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
28
README.md
28
README.md
@ -21,13 +21,17 @@
|
|||||||
<img src="https://github.com/Ryujinx/Ryujinx/actions/workflows/release.yml/badge.svg"
|
<img src="https://github.com/Ryujinx/Ryujinx/actions/workflows/release.yml/badge.svg"
|
||||||
alt="">
|
alt="">
|
||||||
</a>
|
</a>
|
||||||
|
<a href="https://crwd.in/ryujinx">
|
||||||
|
<img src="https://badges.crowdin.net/ryujinx/localized.svg"
|
||||||
|
alt="">
|
||||||
|
</a>
|
||||||
<a href="https://discord.com/invite/VkQYXAZ">
|
<a href="https://discord.com/invite/VkQYXAZ">
|
||||||
<img src="https://img.shields.io/discord/410208534861447168?color=5865F2&label=Ryujinx&logo=discord&logoColor=white"
|
<img src="https://img.shields.io/discord/410208534861447168?color=5865F2&label=Ryujinx&logo=discord&logoColor=white"
|
||||||
alt="Discord">
|
alt="Discord">
|
||||||
</a>
|
</a>
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
<img src="https://raw.githubusercontent.com/Ryujinx/Ryujinx-Website/master/static/public/shell_fullsize.png">
|
<img src="https://raw.githubusercontent.com/Ryujinx/Ryujinx-Website/master/public/assets/images/shell.png">
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h5 align="center">
|
<h5 align="center">
|
||||||
@ -36,18 +40,20 @@
|
|||||||
|
|
||||||
## Compatibility
|
## Compatibility
|
||||||
|
|
||||||
As of January 2022, Ryujinx has been tested on approximately 3,500 titles; over 3,200 boot past menus and into gameplay, with roughly 2,500 of those being considered playable.
|
As of April 2023, Ryujinx has been tested on approximately 4,050 titles; over 4,000 boot past menus and into gameplay, with roughly 3,400 of those being considered playable.
|
||||||
You can check out the compatibility list [here](https://github.com/Ryujinx/Ryujinx-Games-List/issues). Anyone is free to submit an updated test on an existing game entry; simply follow the new issue template and testing guidelines, or post as a reply to the applicable game issue. Use the search function to see if a game has been tested already!
|
You can check out the compatibility list [here](https://github.com/Ryujinx/Ryujinx-Games-List/issues). Anyone is free to submit a new game test or update an existing game test entry; simply follow the new issue template and testing guidelines, or post as a reply to the applicable game issue. Use the search function to see if a game has been tested already!
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
To run this emulator, your PC must be equipped with at least 8GB of RAM; failing to meet this requirement may result in a poor gameplay experience or unexpected crashes.
|
To run this emulator, your PC must be equipped with at least 8GiB of RAM; failing to meet this requirement may result in a poor gameplay experience or unexpected crashes.
|
||||||
|
|
||||||
See our [Setup & Configuration Guide](https://github.com/Ryujinx/Ryujinx/wiki/Ryujinx-Setup-&-Configuration-Guide) on how to set up the emulator.
|
See our [Setup & Configuration Guide](https://github.com/Ryujinx/Ryujinx/wiki/Ryujinx-Setup-&-Configuration-Guide) on how to set up the emulator.
|
||||||
|
|
||||||
For our Local Wireless and LAN builds, see our [Multiplayer: Local Play/Local Wireless Guide
|
For our Local Wireless and LAN builds, see our [Multiplayer: Local Play/Local Wireless Guide
|
||||||
](https://github.com/Ryujinx/Ryujinx/wiki/Multiplayer-(LDN-Local-Wireless)-Guide).
|
](https://github.com/Ryujinx/Ryujinx/wiki/Multiplayer-(LDN-Local-Wireless)-Guide).
|
||||||
|
|
||||||
|
Avalonia UI comes with translations for various languages. See [Crowdin](https://crwd.in/ryujinx) for more information.
|
||||||
|
|
||||||
## Latest build
|
## Latest build
|
||||||
|
|
||||||
These builds are compiled automatically for each commit on the master branch. While we strive to ensure optimal stability and performance prior to pushing an update, our automated builds **may be unstable or completely broken.**
|
These builds are compiled automatically for each commit on the master branch. While we strive to ensure optimal stability and performance prior to pushing an update, our automated builds **may be unstable or completely broken.**
|
||||||
@ -62,7 +68,7 @@ The latest automatic build for Windows, macOS, and Linux can be found on the [Of
|
|||||||
If you wish to build the emulator yourself, follow these steps:
|
If you wish to build the emulator yourself, follow these steps:
|
||||||
|
|
||||||
### Step 1
|
### Step 1
|
||||||
Install the X64 version of [.NET 6.0 (or higher) SDK](https://dotnet.microsoft.com/download/dotnet/6.0).
|
Install the X64 version of [.NET 7.0 (or higher) SDK](https://dotnet.microsoft.com/download/dotnet/7.0).
|
||||||
|
|
||||||
### Step 2
|
### Step 2
|
||||||
Either use `git clone https://github.com/Ryujinx/Ryujinx` on the command line to clone the repository or use Code --> Download zip button to get the files.
|
Either use `git clone https://github.com/Ryujinx/Ryujinx` on the command line to clone the repository or use Code --> Download zip button to get the files.
|
||||||
@ -90,7 +96,7 @@ Ryujinx system files are stored in the `Ryujinx` folder. This folder is located
|
|||||||
|
|
||||||
- **GPU**
|
- **GPU**
|
||||||
|
|
||||||
The GPU emulator emulates the Switch's Maxwell GPU using the OpenGL API (version 4.5 minimum) through a custom build of OpenTK. There are currently four graphics enhancements available to the end user in Ryujinx: disk shader caching, resolution scaling, aspect ratio adjustment and anisotropic filtering. These enhancements can be adjusted or toggled as desired in the GUI.
|
The GPU emulator emulates the Switch's Maxwell GPU using either the OpenGL (version 4.5 minimum), Vulkan, or Metal (via MoltenVK) APIs through a custom build of OpenTK or Silk.NET respectively. There are currently six graphics enhancements available to the end user in Ryujinx: Disk Shader Caching, Resolution Scaling, Anti-Aliasing, Scaling Filters (including FSR), Anisotropic Filtering and Aspect Ratio Adjustment. These enhancements can be adjusted or toggled as desired in the GUI.
|
||||||
|
|
||||||
- **Input**
|
- **Input**
|
||||||
|
|
||||||
@ -118,21 +124,19 @@ If you'd like to support the project financially, Ryujinx has an active Patreon
|
|||||||
<img src="https://images.squarespace-cdn.com/content/v1/560c1d39e4b0b4fae0c9cf2a/1567548955044-WVD994WZP76EWF15T0L3/Patreon+Button.png?format=500w" width="150">
|
<img src="https://images.squarespace-cdn.com/content/v1/560c1d39e4b0b4fae0c9cf2a/1567548955044-WVD994WZP76EWF15T0L3/Patreon+Button.png?format=500w" width="150">
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
All the developers working on the project do so on their free time, but the project has several expenses:
|
All developers working on the project do so in their free time, but the project has several expenses:
|
||||||
* Hackable Nintendo Switch consoles to reverse-engineer the hardware
|
* Hackable Nintendo Switch consoles to reverse-engineer the hardware
|
||||||
* Additional computer hardware for testing purposes (e.g. GPUs to diagnose graphical bugs, etc.)
|
* Additional computer hardware for testing purposes (e.g. GPUs to diagnose graphical bugs, etc.)
|
||||||
* Licenses for various software development tools (e.g. Jetbrains, LDN servers, IDA)
|
* Licenses for various software development tools (e.g. Jetbrains, IDA)
|
||||||
* Web hosting and infrastructure maintenance
|
* Web hosting and infrastructure maintenance (e.g. LDN servers)
|
||||||
|
|
||||||
All funds received through Patreon are considered a donation to support the project. Patrons receive early access to progress reports and exclusive access to developer interviews.
|
All funds received through Patreon are considered a donation to support the project. Patrons receive early access to progress reports and exclusive access to developer interviews.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
This software is licensed under the terms of the <a href="https://github.com/Ryujinx/Ryujinx/blob/master/LICENSE.txt" target="_blank">MIT license.</a></i><br />
|
This software is licensed under the terms of the <a href="https://github.com/Ryujinx/Ryujinx/blob/master/LICENSE.txt" target="_blank">MIT license.</a></i><br />
|
||||||
The Ryujinx.Audio project is licensed under the terms of the <a href="https://github.com/Ryujinx/Ryujinx/blob/master/Ryujinx.Audio/LICENSE.txt
|
|
||||||
" target="_blank">LGPLv3 license.</a></i><br />
|
|
||||||
This project makes use of code authored by the libvpx project, licensed under BSD and the ffmpeg project, licensed under LGPLv3.
|
This project makes use of code authored by the libvpx project, licensed under BSD and the ffmpeg project, licensed under LGPLv3.
|
||||||
See [LICENSE.txt](LICENSE.txt) and [THIRDPARTY.md](Ryujinx/THIRDPARTY.md) for more details.
|
See [LICENSE.txt](LICENSE.txt) and [THIRDPARTY.md](distribution/legal/THIRDPARTY.md) for more details.
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
- [LibHac](https://github.com/Thealexbarney/LibHac) is used for our file-system.
|
- [LibHac](https://github.com/Thealexbarney/LibHac) is used for our file-system.
|
||||||
|
@ -1,38 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace SoundIOSharp
|
|
||||||
{
|
|
||||||
public static class MarshalEx
|
|
||||||
{
|
|
||||||
public static double ReadDouble(IntPtr handle, int offset = 0)
|
|
||||||
{
|
|
||||||
return BitConverter.Int64BitsToDouble(Marshal.ReadInt64(handle, offset));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void WriteDouble(IntPtr handle, double value)
|
|
||||||
{
|
|
||||||
WriteDouble(handle, 0, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void WriteDouble(IntPtr handle, int offset, double value)
|
|
||||||
{
|
|
||||||
Marshal.WriteInt64(handle, offset, BitConverter.DoubleToInt64Bits(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static float ReadFloat(IntPtr handle, int offset = 0)
|
|
||||||
{
|
|
||||||
return BitConverter.Int32BitsToSingle(Marshal.ReadInt32(handle, offset));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void WriteFloat(IntPtr handle, float value)
|
|
||||||
{
|
|
||||||
WriteFloat(handle, 0, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void WriteFloat(IntPtr handle, int offset, float value)
|
|
||||||
{
|
|
||||||
Marshal.WriteInt32(handle, offset, BitConverter.SingleToInt32Bits(value));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,386 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace SoundIOSharp
|
|
||||||
{
|
|
||||||
public class SoundIO : IDisposable
|
|
||||||
{
|
|
||||||
Pointer<SoundIo> handle;
|
|
||||||
|
|
||||||
public SoundIO()
|
|
||||||
{
|
|
||||||
handle = Natives.soundio_create();
|
|
||||||
}
|
|
||||||
|
|
||||||
internal SoundIO(Pointer<SoundIo> handle)
|
|
||||||
{
|
|
||||||
this.handle = handle;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Dispose ()
|
|
||||||
{
|
|
||||||
foreach (var h in allocated_hglobals)
|
|
||||||
{
|
|
||||||
Marshal.FreeHGlobal(h);
|
|
||||||
}
|
|
||||||
|
|
||||||
Natives.soundio_destroy(handle);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Equality (based on handle)
|
|
||||||
|
|
||||||
public override bool Equals(object other)
|
|
||||||
{
|
|
||||||
var d = other as SoundIO;
|
|
||||||
|
|
||||||
return d != null && this.handle == d.handle;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int GetHashCode()
|
|
||||||
{
|
|
||||||
return (int)(IntPtr)handle;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool operator == (SoundIO obj1, SoundIO obj2)
|
|
||||||
{
|
|
||||||
return obj1 is null ? obj2 is null : obj1.Equals(obj2);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool operator != (SoundIO obj1, SoundIO obj2)
|
|
||||||
{
|
|
||||||
return obj1 is null ? obj2 is object : !obj1.Equals(obj2);
|
|
||||||
}
|
|
||||||
|
|
||||||
// fields
|
|
||||||
|
|
||||||
// FIXME: this should be taken care in more centralized/decent manner... we don't want to write
|
|
||||||
// this kind of code anywhere we need string marshaling.
|
|
||||||
List<IntPtr> allocated_hglobals = new List<IntPtr>();
|
|
||||||
|
|
||||||
public string ApplicationName {
|
|
||||||
get { return Marshal.PtrToStringAnsi(Marshal.ReadIntPtr(handle, app_name_offset)); }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
unsafe
|
|
||||||
{
|
|
||||||
var existing = Marshal.ReadIntPtr(handle, app_name_offset);
|
|
||||||
if (allocated_hglobals.Contains (existing))
|
|
||||||
{
|
|
||||||
allocated_hglobals.Remove(existing);
|
|
||||||
Marshal.FreeHGlobal(existing);
|
|
||||||
}
|
|
||||||
|
|
||||||
var ptr = Marshal.StringToHGlobalAnsi(value);
|
|
||||||
Marshal.WriteIntPtr(handle, app_name_offset, ptr);
|
|
||||||
allocated_hglobals.Add(ptr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int app_name_offset = (int)Marshal.OffsetOf<SoundIo>("app_name");
|
|
||||||
|
|
||||||
public SoundIOBackend CurrentBackend
|
|
||||||
{
|
|
||||||
get { return (SoundIOBackend)Marshal.ReadInt32(handle, current_backend_offset); }
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int current_backend_offset = (int)Marshal.OffsetOf<SoundIo>("current_backend");
|
|
||||||
|
|
||||||
// emit_rtprio_warning
|
|
||||||
public Action EmitRealtimePriorityWarning
|
|
||||||
{
|
|
||||||
get { return emit_rtprio_warning; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
emit_rtprio_warning = value;
|
|
||||||
|
|
||||||
var ptr = Marshal.GetFunctionPointerForDelegate(on_devices_change);
|
|
||||||
|
|
||||||
Marshal.WriteIntPtr(handle, emit_rtprio_warning_offset, ptr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int emit_rtprio_warning_offset = (int)Marshal.OffsetOf<SoundIo>("emit_rtprio_warning");
|
|
||||||
|
|
||||||
Action emit_rtprio_warning;
|
|
||||||
|
|
||||||
// jack_error_callback
|
|
||||||
public Action<string> JackErrorCallback
|
|
||||||
{
|
|
||||||
get { return jack_error_callback; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
jack_error_callback = value;
|
|
||||||
if (value == null)
|
|
||||||
{
|
|
||||||
jack_error_callback = null;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
jack_error_callback_native = msg => jack_error_callback(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
var ptr = Marshal.GetFunctionPointerForDelegate(jack_error_callback_native);
|
|
||||||
Marshal.WriteIntPtr(handle, jack_error_callback_offset, ptr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int jack_error_callback_offset = (int)Marshal.OffsetOf<SoundIo>("jack_error_callback");
|
|
||||||
|
|
||||||
Action<string> jack_error_callback;
|
|
||||||
delegate void jack_error_delegate(string message);
|
|
||||||
jack_error_delegate jack_error_callback_native;
|
|
||||||
|
|
||||||
// jack_info_callback
|
|
||||||
public Action<string> JackInfoCallback
|
|
||||||
{
|
|
||||||
get { return jack_info_callback; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
jack_info_callback = value;
|
|
||||||
if (value == null)
|
|
||||||
{
|
|
||||||
jack_info_callback = null;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
jack_info_callback_native = msg => jack_info_callback(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
var ptr = Marshal.GetFunctionPointerForDelegate(jack_info_callback_native);
|
|
||||||
Marshal.WriteIntPtr(handle, jack_info_callback_offset, ptr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int jack_info_callback_offset = (int)Marshal.OffsetOf<SoundIo>("jack_info_callback");
|
|
||||||
|
|
||||||
Action<string> jack_info_callback;
|
|
||||||
delegate void jack_info_delegate(string message);
|
|
||||||
jack_info_delegate jack_info_callback_native;
|
|
||||||
|
|
||||||
// on_backend_disconnect
|
|
||||||
public Action<int> OnBackendDisconnect
|
|
||||||
{
|
|
||||||
get { return on_backend_disconnect; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
on_backend_disconnect = value;
|
|
||||||
if (value == null)
|
|
||||||
{
|
|
||||||
on_backend_disconnect_native = null;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
on_backend_disconnect_native = (sio, err) => on_backend_disconnect(err);
|
|
||||||
}
|
|
||||||
|
|
||||||
var ptr = Marshal.GetFunctionPointerForDelegate(on_backend_disconnect_native);
|
|
||||||
Marshal.WriteIntPtr(handle, on_backend_disconnect_offset, ptr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int on_backend_disconnect_offset = (int)Marshal.OffsetOf<SoundIo>("on_backend_disconnect");
|
|
||||||
|
|
||||||
Action<int> on_backend_disconnect;
|
|
||||||
delegate void on_backend_disconnect_delegate(IntPtr handle, int errorCode);
|
|
||||||
on_backend_disconnect_delegate on_backend_disconnect_native;
|
|
||||||
|
|
||||||
// on_devices_change
|
|
||||||
public Action OnDevicesChange
|
|
||||||
{
|
|
||||||
get { return on_devices_change; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
on_devices_change = value;
|
|
||||||
if (value == null)
|
|
||||||
{
|
|
||||||
on_devices_change_native = null;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
on_devices_change_native = sio => on_devices_change();
|
|
||||||
}
|
|
||||||
|
|
||||||
var ptr = Marshal.GetFunctionPointerForDelegate(on_devices_change_native);
|
|
||||||
Marshal.WriteIntPtr(handle, on_devices_change_offset, ptr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int on_devices_change_offset = (int)Marshal.OffsetOf<SoundIo>("on_devices_change");
|
|
||||||
|
|
||||||
Action on_devices_change;
|
|
||||||
delegate void on_devices_change_delegate(IntPtr handle);
|
|
||||||
on_devices_change_delegate on_devices_change_native;
|
|
||||||
|
|
||||||
// on_events_signal
|
|
||||||
public Action OnEventsSignal
|
|
||||||
{
|
|
||||||
get { return on_events_signal; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
on_events_signal = value;
|
|
||||||
if (value == null)
|
|
||||||
{
|
|
||||||
on_events_signal_native = null;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
on_events_signal_native = sio => on_events_signal();
|
|
||||||
}
|
|
||||||
|
|
||||||
var ptr = Marshal.GetFunctionPointerForDelegate(on_events_signal_native);
|
|
||||||
Marshal.WriteIntPtr(handle, on_events_signal_offset, ptr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int on_events_signal_offset = (int)Marshal.OffsetOf<SoundIo>("on_events_signal");
|
|
||||||
|
|
||||||
Action on_events_signal;
|
|
||||||
delegate void on_events_signal_delegate(IntPtr handle);
|
|
||||||
on_events_signal_delegate on_events_signal_native;
|
|
||||||
|
|
||||||
|
|
||||||
// functions
|
|
||||||
|
|
||||||
public int BackendCount
|
|
||||||
{
|
|
||||||
get { return Natives.soundio_backend_count(handle); }
|
|
||||||
}
|
|
||||||
|
|
||||||
public int InputDeviceCount
|
|
||||||
{
|
|
||||||
get { return Natives.soundio_input_device_count(handle); }
|
|
||||||
}
|
|
||||||
|
|
||||||
public int OutputDeviceCount
|
|
||||||
{
|
|
||||||
get { return Natives.soundio_output_device_count(handle); }
|
|
||||||
}
|
|
||||||
|
|
||||||
public int DefaultInputDeviceIndex
|
|
||||||
{
|
|
||||||
get { return Natives.soundio_default_input_device_index(handle); }
|
|
||||||
}
|
|
||||||
|
|
||||||
public int DefaultOutputDeviceIndex
|
|
||||||
{
|
|
||||||
get { return Natives.soundio_default_output_device_index(handle); }
|
|
||||||
}
|
|
||||||
|
|
||||||
public SoundIOBackend GetBackend(int index)
|
|
||||||
{
|
|
||||||
return (SoundIOBackend)Natives.soundio_get_backend(handle, index);
|
|
||||||
}
|
|
||||||
|
|
||||||
public SoundIODevice GetInputDevice(int index)
|
|
||||||
{
|
|
||||||
return new SoundIODevice(Natives.soundio_get_input_device(handle, index));
|
|
||||||
}
|
|
||||||
|
|
||||||
public SoundIODevice GetOutputDevice(int index)
|
|
||||||
{
|
|
||||||
return new SoundIODevice(Natives.soundio_get_output_device(handle, index));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Connect()
|
|
||||||
{
|
|
||||||
var ret = (SoundIoError)Natives.soundio_connect(handle);
|
|
||||||
if (ret != SoundIoError.SoundIoErrorNone)
|
|
||||||
{
|
|
||||||
throw new SoundIOException(ret);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ConnectBackend(SoundIOBackend backend)
|
|
||||||
{
|
|
||||||
var ret = (SoundIoError)Natives.soundio_connect_backend(handle, (SoundIoBackend)backend);
|
|
||||||
if (ret != SoundIoError.SoundIoErrorNone)
|
|
||||||
{
|
|
||||||
throw new SoundIOException(ret);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Disconnect()
|
|
||||||
{
|
|
||||||
Natives.soundio_disconnect(handle);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void FlushEvents()
|
|
||||||
{
|
|
||||||
Natives.soundio_flush_events(handle);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void WaitEvents()
|
|
||||||
{
|
|
||||||
Natives.soundio_wait_events(handle);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Wakeup()
|
|
||||||
{
|
|
||||||
Natives.soundio_wakeup(handle);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ForceDeviceScan()
|
|
||||||
{
|
|
||||||
Natives.soundio_force_device_scan(handle);
|
|
||||||
}
|
|
||||||
|
|
||||||
public SoundIORingBuffer CreateRingBuffer(int capacity)
|
|
||||||
{
|
|
||||||
return new SoundIORingBuffer(Natives.soundio_ring_buffer_create(handle, capacity));
|
|
||||||
}
|
|
||||||
|
|
||||||
// static methods
|
|
||||||
|
|
||||||
public static string VersionString
|
|
||||||
{
|
|
||||||
get { return Marshal.PtrToStringAnsi(Natives.soundio_version_string()); }
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int VersionMajor
|
|
||||||
{
|
|
||||||
get { return Natives.soundio_version_major(); }
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int VersionMinor
|
|
||||||
{
|
|
||||||
get { return Natives.soundio_version_minor(); }
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int VersionPatch
|
|
||||||
{
|
|
||||||
get { return Natives.soundio_version_patch(); }
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string GetBackendName(SoundIOBackend backend)
|
|
||||||
{
|
|
||||||
return Marshal.PtrToStringAnsi(Natives.soundio_backend_name((SoundIoBackend)backend));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool HaveBackend(SoundIOBackend backend)
|
|
||||||
{
|
|
||||||
return Natives.soundio_have_backend((SoundIoBackend)backend);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int GetBytesPerSample(SoundIOFormat format)
|
|
||||||
{
|
|
||||||
return Natives.soundio_get_bytes_per_sample((SoundIoFormat)format);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int GetBytesPerFrame(SoundIOFormat format, int channelCount)
|
|
||||||
{
|
|
||||||
return Natives.soundio_get_bytes_per_frame((SoundIoFormat)format, channelCount);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int GetBytesPerSecond(SoundIOFormat format, int channelCount, int sampleRate)
|
|
||||||
{
|
|
||||||
return Natives.soundio_get_bytes_per_second((SoundIoFormat)format, channelCount, sampleRate);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string GetSoundFormatName(SoundIOFormat format)
|
|
||||||
{
|
|
||||||
return Marshal.PtrToStringAnsi(Natives.soundio_format_string((SoundIoFormat)format));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,13 +0,0 @@
|
|||||||
namespace SoundIOSharp
|
|
||||||
{
|
|
||||||
public enum SoundIOBackend
|
|
||||||
{
|
|
||||||
None,
|
|
||||||
Jack,
|
|
||||||
PulseAudio,
|
|
||||||
Alsa,
|
|
||||||
CoreAudio,
|
|
||||||
Wasapi,
|
|
||||||
Dummy
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,30 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace SoundIOSharp
|
|
||||||
{
|
|
||||||
public struct SoundIOChannelArea
|
|
||||||
{
|
|
||||||
internal SoundIOChannelArea(Pointer<SoundIoChannelArea> handle)
|
|
||||||
{
|
|
||||||
this.handle = handle;
|
|
||||||
}
|
|
||||||
|
|
||||||
Pointer<SoundIoChannelArea> handle;
|
|
||||||
|
|
||||||
public IntPtr Pointer
|
|
||||||
{
|
|
||||||
get { return Marshal.ReadIntPtr(handle, ptr_offset); }
|
|
||||||
set { Marshal.WriteIntPtr(handle, ptr_offset, value); }
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int ptr_offset = (int)Marshal.OffsetOf<SoundIoChannelArea>("ptr");
|
|
||||||
|
|
||||||
public int Step
|
|
||||||
{
|
|
||||||
get { return Marshal.ReadInt32(handle, step_offset); }
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int step_offset = (int)Marshal.OffsetOf<SoundIoChannelArea>("step");
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,34 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace SoundIOSharp
|
|
||||||
{
|
|
||||||
public struct SoundIOChannelAreas
|
|
||||||
{
|
|
||||||
static readonly int native_size = Marshal.SizeOf<SoundIoChannelArea>();
|
|
||||||
|
|
||||||
internal SoundIOChannelAreas(IntPtr head, int channelCount, int frameCount)
|
|
||||||
{
|
|
||||||
this.head = head;
|
|
||||||
this.channel_count = channelCount;
|
|
||||||
this.frame_count = frameCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
IntPtr head;
|
|
||||||
int channel_count;
|
|
||||||
int frame_count;
|
|
||||||
|
|
||||||
public bool IsEmpty
|
|
||||||
{
|
|
||||||
get { return head == IntPtr.Zero; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public SoundIOChannelArea GetArea(int channel)
|
|
||||||
{
|
|
||||||
return new SoundIOChannelArea(head + native_size * channel);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int ChannelCount => channel_count;
|
|
||||||
public int FrameCount => frame_count;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,75 +0,0 @@
|
|||||||
namespace SoundIOSharp
|
|
||||||
{
|
|
||||||
public enum SoundIOChannelId
|
|
||||||
{
|
|
||||||
Invalid,
|
|
||||||
FrontLeft,
|
|
||||||
FrontRight,
|
|
||||||
FrontCenter,
|
|
||||||
Lfe,
|
|
||||||
BackLeft,
|
|
||||||
BackRight,
|
|
||||||
FrontLeftCenter,
|
|
||||||
FrontRightCenter,
|
|
||||||
BackCenter,
|
|
||||||
SideLeft,
|
|
||||||
SideRight,
|
|
||||||
TopCenter,
|
|
||||||
TopFrontLeft,
|
|
||||||
TopFrontCenter,
|
|
||||||
TopFrontRight,
|
|
||||||
TopBackLeft,
|
|
||||||
TopBackCenter,
|
|
||||||
TopBackRight,
|
|
||||||
BackLeftCenter,
|
|
||||||
BackRightCenter,
|
|
||||||
FrontLeftWide,
|
|
||||||
FrontRightWide,
|
|
||||||
FrontLeftHigh,
|
|
||||||
FrontCenterHigh,
|
|
||||||
FrontRightHigh,
|
|
||||||
TopFrontLeftCenter,
|
|
||||||
TopFrontRightCenter,
|
|
||||||
TopSideLeft,
|
|
||||||
TopSideRight,
|
|
||||||
LeftLfe,
|
|
||||||
RightLfe,
|
|
||||||
Lfe2,
|
|
||||||
BottomCenter,
|
|
||||||
BottomLeftCenter,
|
|
||||||
BottomRightCenter,
|
|
||||||
MsMid,
|
|
||||||
MsSide,
|
|
||||||
AmbisonicW,
|
|
||||||
AmbisonicX,
|
|
||||||
AmbisonicY,
|
|
||||||
AmbisonicZ,
|
|
||||||
XyX,
|
|
||||||
XyY,
|
|
||||||
HeadphonesLeft,
|
|
||||||
HeadphonesRight,
|
|
||||||
ClickTrack,
|
|
||||||
ForeignLanguage,
|
|
||||||
HearingImpaired,
|
|
||||||
Narration,
|
|
||||||
Haptic,
|
|
||||||
DialogCentricMix,
|
|
||||||
Aux,
|
|
||||||
Aux0,
|
|
||||||
Aux1,
|
|
||||||
Aux2,
|
|
||||||
Aux3,
|
|
||||||
Aux4,
|
|
||||||
Aux5,
|
|
||||||
Aux6,
|
|
||||||
Aux7,
|
|
||||||
Aux8,
|
|
||||||
Aux9,
|
|
||||||
Aux10,
|
|
||||||
Aux11,
|
|
||||||
Aux12,
|
|
||||||
Aux13,
|
|
||||||
Aux14,
|
|
||||||
Aux15
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,116 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace SoundIOSharp
|
|
||||||
{
|
|
||||||
public struct SoundIOChannelLayout
|
|
||||||
{
|
|
||||||
public static int BuiltInCount
|
|
||||||
{
|
|
||||||
get { return Natives.soundio_channel_layout_builtin_count(); }
|
|
||||||
}
|
|
||||||
|
|
||||||
public static SoundIOChannelLayout GetBuiltIn(int index)
|
|
||||||
{
|
|
||||||
return new SoundIOChannelLayout(Natives.soundio_channel_layout_get_builtin(index));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static SoundIOChannelLayout GetDefault(int channelCount)
|
|
||||||
{
|
|
||||||
var handle = Natives.soundio_channel_layout_get_default(channelCount);
|
|
||||||
|
|
||||||
return new SoundIOChannelLayout (handle);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static SoundIOChannelId ParseChannelId(string name)
|
|
||||||
{
|
|
||||||
var ptr = Marshal.StringToHGlobalAnsi(name);
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
return (SoundIOChannelId)Natives.soundio_parse_channel_id(ptr, name.Length);
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
Marshal.FreeHGlobal(ptr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// instance members
|
|
||||||
|
|
||||||
internal SoundIOChannelLayout(Pointer<SoundIoChannelLayout> handle)
|
|
||||||
{
|
|
||||||
this.handle = handle;
|
|
||||||
}
|
|
||||||
|
|
||||||
readonly Pointer<SoundIoChannelLayout> handle;
|
|
||||||
|
|
||||||
public bool IsNull
|
|
||||||
{
|
|
||||||
get { return handle.Handle == IntPtr.Zero; }
|
|
||||||
}
|
|
||||||
|
|
||||||
internal IntPtr Handle
|
|
||||||
{
|
|
||||||
get { return handle; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public int ChannelCount
|
|
||||||
{
|
|
||||||
get { return IsNull ? 0 : Marshal.ReadInt32((IntPtr)handle + channel_count_offset); }
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int channel_count_offset = (int)Marshal.OffsetOf<SoundIoChannelLayout>("channel_count");
|
|
||||||
|
|
||||||
public string Name
|
|
||||||
{
|
|
||||||
get { return IsNull ? null : Marshal.PtrToStringAnsi(Marshal.ReadIntPtr((IntPtr)handle + name_offset)); }
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int name_offset = (int)Marshal.OffsetOf<SoundIoChannelLayout>("name");
|
|
||||||
|
|
||||||
public IEnumerable<SoundIOChannelId> Channels
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (IsNull) yield break;
|
|
||||||
|
|
||||||
for (int i = 0; i < 24; i++)
|
|
||||||
{
|
|
||||||
yield return (SoundIOChannelId)Marshal.ReadInt32((IntPtr)handle + channels_offset + sizeof(SoundIoChannelId) * i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int channels_offset = (int)Marshal.OffsetOf<SoundIoChannelLayout>("channels");
|
|
||||||
|
|
||||||
public override bool Equals(object other)
|
|
||||||
{
|
|
||||||
if (!(other is SoundIOChannelLayout)) return false;
|
|
||||||
|
|
||||||
var s = (SoundIOChannelLayout) other;
|
|
||||||
|
|
||||||
return handle == s.handle || Natives.soundio_channel_layout_equal(handle, s.handle);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int GetHashCode()
|
|
||||||
{
|
|
||||||
return handle.GetHashCode();
|
|
||||||
}
|
|
||||||
|
|
||||||
public string DetectBuiltInName()
|
|
||||||
{
|
|
||||||
if (IsNull) throw new InvalidOperationException();
|
|
||||||
|
|
||||||
return Natives.soundio_channel_layout_detect_builtin(handle) ? Name : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int FindChannel(SoundIOChannelId channel)
|
|
||||||
{
|
|
||||||
if (IsNull) throw new InvalidOperationException();
|
|
||||||
|
|
||||||
return Natives.soundio_channel_layout_find_channel(handle, (SoundIoChannelId)channel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,267 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace SoundIOSharp
|
|
||||||
{
|
|
||||||
public class SoundIODevice
|
|
||||||
{
|
|
||||||
public static SoundIOChannelLayout BestMatchingChannelLayout(SoundIODevice device1, SoundIODevice device2)
|
|
||||||
{
|
|
||||||
var ptr1 = Marshal.ReadIntPtr(device1.handle, layouts_offset);
|
|
||||||
var ptr2 = Marshal.ReadIntPtr(device2.handle, layouts_offset);
|
|
||||||
|
|
||||||
return new SoundIOChannelLayout(Natives.soundio_best_matching_channel_layout(ptr1, device1.LayoutCount, ptr2, device2.LayoutCount));
|
|
||||||
}
|
|
||||||
|
|
||||||
internal SoundIODevice(Pointer<SoundIoDevice> handle)
|
|
||||||
{
|
|
||||||
this.handle = handle;
|
|
||||||
}
|
|
||||||
|
|
||||||
readonly Pointer<SoundIoDevice> handle;
|
|
||||||
|
|
||||||
// Equality (based on handle and native func)
|
|
||||||
|
|
||||||
public override bool Equals(object other)
|
|
||||||
{
|
|
||||||
var d = other as SoundIODevice;
|
|
||||||
|
|
||||||
return d != null && (this.handle == d.handle || Natives.soundio_device_equal (this.handle, d.handle));
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int GetHashCode()
|
|
||||||
{
|
|
||||||
return (int)(IntPtr)handle;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool operator == (SoundIODevice obj1, SoundIODevice obj2)
|
|
||||||
{
|
|
||||||
return obj1 is null ? obj2 is null : obj1.Equals(obj2);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool operator != (SoundIODevice obj1, SoundIODevice obj2)
|
|
||||||
{
|
|
||||||
return obj1 is null ? obj2 is object : !obj1.Equals(obj2);
|
|
||||||
}
|
|
||||||
|
|
||||||
// fields
|
|
||||||
|
|
||||||
public SoundIODeviceAim Aim
|
|
||||||
{
|
|
||||||
get { return (SoundIODeviceAim)Marshal.ReadInt32(handle, aim_offset); }
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int aim_offset = (int)Marshal.OffsetOf<SoundIoDevice>("aim");
|
|
||||||
|
|
||||||
public SoundIOFormat CurrentFormat
|
|
||||||
{
|
|
||||||
get { return (SoundIOFormat)Marshal.ReadInt32(handle, current_format_offset); }
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int current_format_offset = (int)Marshal.OffsetOf<SoundIoDevice>("current_format");
|
|
||||||
|
|
||||||
public SoundIOChannelLayout CurrentLayout
|
|
||||||
{
|
|
||||||
get { return new SoundIOChannelLayout((IntPtr)handle + current_layout_offset); }
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int current_layout_offset = (int)Marshal.OffsetOf<SoundIoDevice>("current_layout");
|
|
||||||
|
|
||||||
public int FormatCount
|
|
||||||
{
|
|
||||||
get { return Marshal.ReadInt32(handle, format_count_offset); }
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int format_count_offset = (int)Marshal.OffsetOf<SoundIoDevice>("format_count");
|
|
||||||
|
|
||||||
public IEnumerable<SoundIOFormat> Formats
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
var ptr = Marshal.ReadIntPtr(handle, formats_offset);
|
|
||||||
|
|
||||||
for (int i = 0; i < FormatCount; i++)
|
|
||||||
{
|
|
||||||
yield return (SoundIOFormat)Marshal.ReadInt32(ptr, i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int formats_offset = (int)Marshal.OffsetOf<SoundIoDevice>("formats");
|
|
||||||
|
|
||||||
public string Id
|
|
||||||
{
|
|
||||||
get { return Marshal.PtrToStringAnsi(Marshal.ReadIntPtr(handle, id_offset)); }
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int id_offset = (int)Marshal.OffsetOf<SoundIoDevice>("id");
|
|
||||||
|
|
||||||
public bool IsRaw
|
|
||||||
{
|
|
||||||
get { return Marshal.ReadInt32(handle, is_raw_offset) != 0; }
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int is_raw_offset = (int)Marshal.OffsetOf<SoundIoDevice>("is_raw");
|
|
||||||
|
|
||||||
public int LayoutCount
|
|
||||||
{
|
|
||||||
get { return Marshal.ReadInt32(handle, layout_count_offset); }
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int layout_count_offset = (int)Marshal.OffsetOf<SoundIoDevice>("layout_count");
|
|
||||||
|
|
||||||
public IEnumerable<SoundIOChannelLayout> Layouts
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
var ptr = Marshal.ReadIntPtr (handle, layouts_offset);
|
|
||||||
|
|
||||||
for (int i = 0; i < LayoutCount; i++)
|
|
||||||
{
|
|
||||||
yield return new SoundIOChannelLayout(ptr + i * Marshal.SizeOf<SoundIoChannelLayout>());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int layouts_offset = (int)Marshal.OffsetOf<SoundIoDevice>("layouts");
|
|
||||||
|
|
||||||
public string Name
|
|
||||||
{
|
|
||||||
get { return Marshal.PtrToStringAnsi(Marshal.ReadIntPtr(handle, name_offset)); }
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int name_offset = (int)Marshal.OffsetOf<SoundIoDevice>("name");
|
|
||||||
|
|
||||||
public int ProbeError
|
|
||||||
{
|
|
||||||
get { return Marshal.ReadInt32(handle, probe_error_offset); }
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int probe_error_offset = (int)Marshal.OffsetOf<SoundIoDevice>("probe_error");
|
|
||||||
|
|
||||||
public int ReferenceCount
|
|
||||||
{
|
|
||||||
get { return Marshal.ReadInt32(handle, ref_count_offset); }
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int ref_count_offset = (int)Marshal.OffsetOf<SoundIoDevice>("ref_count");
|
|
||||||
|
|
||||||
public int SampleRateCount
|
|
||||||
{
|
|
||||||
get { return Marshal.ReadInt32(handle, sample_rate_count_offset); }
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int sample_rate_count_offset = (int)Marshal.OffsetOf<SoundIoDevice>("sample_rate_count");
|
|
||||||
|
|
||||||
public IEnumerable<SoundIOSampleRateRange> SampleRates
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
var ptr = Marshal.ReadIntPtr(handle, sample_rates_offset);
|
|
||||||
|
|
||||||
for (int i = 0; i < SampleRateCount; i++)
|
|
||||||
{
|
|
||||||
yield return new SoundIOSampleRateRange(Marshal.ReadInt32(ptr, i * 2), Marshal.ReadInt32(ptr, i * 2 + 1));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int sample_rates_offset = (int)Marshal.OffsetOf<SoundIoDevice>("sample_rates");
|
|
||||||
|
|
||||||
public double SoftwareLatencyCurrent
|
|
||||||
{
|
|
||||||
get { return MarshalEx.ReadDouble(handle, software_latency_current_offset); }
|
|
||||||
set { MarshalEx.WriteDouble(handle, software_latency_current_offset, value); }
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int software_latency_current_offset = (int)Marshal.OffsetOf<SoundIoDevice>("software_latency_current");
|
|
||||||
|
|
||||||
public double SoftwareLatencyMin
|
|
||||||
{
|
|
||||||
get { return MarshalEx.ReadDouble(handle, software_latency_min_offset); }
|
|
||||||
set { MarshalEx.WriteDouble(handle, software_latency_min_offset, value); }
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int software_latency_min_offset = (int)Marshal.OffsetOf<SoundIoDevice>("software_latency_min");
|
|
||||||
|
|
||||||
public double SoftwareLatencyMax
|
|
||||||
{
|
|
||||||
get { return MarshalEx.ReadDouble(handle, software_latency_max_offset); }
|
|
||||||
set { MarshalEx.WriteDouble(handle, software_latency_max_offset, value); }
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int software_latency_max_offset = (int)Marshal.OffsetOf<SoundIoDevice>("software_latency_max");
|
|
||||||
|
|
||||||
public SoundIO SoundIO
|
|
||||||
{
|
|
||||||
get { return new SoundIO(Marshal.ReadIntPtr(handle, soundio_offset)); }
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int soundio_offset = (int)Marshal.OffsetOf<SoundIoDevice>("soundio");
|
|
||||||
|
|
||||||
// functions
|
|
||||||
|
|
||||||
public void AddReference()
|
|
||||||
{
|
|
||||||
Natives.soundio_device_ref(handle);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void RemoveReference()
|
|
||||||
{
|
|
||||||
Natives.soundio_device_unref(handle);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SortDeviceChannelLayouts()
|
|
||||||
{
|
|
||||||
Natives.soundio_device_sort_channel_layouts(handle);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static readonly SoundIOFormat S16NE = BitConverter.IsLittleEndian ? SoundIOFormat.S16LE : SoundIOFormat.S16BE;
|
|
||||||
public static readonly SoundIOFormat U16NE = BitConverter.IsLittleEndian ? SoundIOFormat.U16LE : SoundIOFormat.U16BE;
|
|
||||||
public static readonly SoundIOFormat S24NE = BitConverter.IsLittleEndian ? SoundIOFormat.S24LE : SoundIOFormat.S24BE;
|
|
||||||
public static readonly SoundIOFormat U24NE = BitConverter.IsLittleEndian ? SoundIOFormat.U24LE : SoundIOFormat.U24BE;
|
|
||||||
public static readonly SoundIOFormat S32NE = BitConverter.IsLittleEndian ? SoundIOFormat.S32LE : SoundIOFormat.S32BE;
|
|
||||||
public static readonly SoundIOFormat U32NE = BitConverter.IsLittleEndian ? SoundIOFormat.U32LE : SoundIOFormat.U32BE;
|
|
||||||
public static readonly SoundIOFormat Float32NE = BitConverter.IsLittleEndian ? SoundIOFormat.Float32LE : SoundIOFormat.Float32BE;
|
|
||||||
public static readonly SoundIOFormat Float64NE = BitConverter.IsLittleEndian ? SoundIOFormat.Float64LE : SoundIOFormat.Float64BE;
|
|
||||||
public static readonly SoundIOFormat S16FE = !BitConverter.IsLittleEndian ? SoundIOFormat.S16LE : SoundIOFormat.S16BE;
|
|
||||||
public static readonly SoundIOFormat U16FE = !BitConverter.IsLittleEndian ? SoundIOFormat.U16LE : SoundIOFormat.U16BE;
|
|
||||||
public static readonly SoundIOFormat S24FE = !BitConverter.IsLittleEndian ? SoundIOFormat.S24LE : SoundIOFormat.S24BE;
|
|
||||||
public static readonly SoundIOFormat U24FE = !BitConverter.IsLittleEndian ? SoundIOFormat.U24LE : SoundIOFormat.U24BE;
|
|
||||||
public static readonly SoundIOFormat S32FE = !BitConverter.IsLittleEndian ? SoundIOFormat.S32LE : SoundIOFormat.S32BE;
|
|
||||||
public static readonly SoundIOFormat U32FE = !BitConverter.IsLittleEndian ? SoundIOFormat.U32LE : SoundIOFormat.U32BE;
|
|
||||||
public static readonly SoundIOFormat Float32FE = !BitConverter.IsLittleEndian ? SoundIOFormat.Float32LE : SoundIOFormat.Float32BE;
|
|
||||||
public static readonly SoundIOFormat Float64FE = !BitConverter.IsLittleEndian ? SoundIOFormat.Float64LE : SoundIOFormat.Float64BE;
|
|
||||||
|
|
||||||
public bool SupportsFormat(SoundIOFormat format)
|
|
||||||
{
|
|
||||||
return Natives.soundio_device_supports_format(handle, (SoundIoFormat)format);
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool SupportsSampleRate(int sampleRate)
|
|
||||||
{
|
|
||||||
return Natives.soundio_device_supports_sample_rate(handle, sampleRate);
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool SupportsChannelCount(int channelCount)
|
|
||||||
{
|
|
||||||
return Natives.soundio_device_supports_layout(handle, SoundIOChannelLayout.GetDefault(channelCount).Handle);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int GetNearestSampleRate(int sampleRate)
|
|
||||||
{
|
|
||||||
return Natives.soundio_device_nearest_sample_rate(handle, sampleRate);
|
|
||||||
}
|
|
||||||
|
|
||||||
public SoundIOInStream CreateInStream()
|
|
||||||
{
|
|
||||||
return new SoundIOInStream(Natives.soundio_instream_create(handle));
|
|
||||||
}
|
|
||||||
|
|
||||||
public SoundIOOutStream CreateOutStream()
|
|
||||||
{
|
|
||||||
return new SoundIOOutStream(Natives.soundio_outstream_create(handle));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,8 +0,0 @@
|
|||||||
namespace SoundIOSharp
|
|
||||||
{
|
|
||||||
public enum SoundIODeviceAim // soundio.h (228, 6)
|
|
||||||
{
|
|
||||||
Input,
|
|
||||||
Output
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace SoundIOSharp
|
|
||||||
{
|
|
||||||
public class SoundIOException : Exception
|
|
||||||
{
|
|
||||||
internal SoundIOException(SoundIoError errorCode) : base (Marshal.PtrToStringAnsi(Natives.soundio_strerror((int) errorCode))) { }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,25 +0,0 @@
|
|||||||
namespace SoundIOSharp
|
|
||||||
{
|
|
||||||
public enum SoundIOFormat
|
|
||||||
{
|
|
||||||
Invalid,
|
|
||||||
S8,
|
|
||||||
U8,
|
|
||||||
S16LE,
|
|
||||||
S16BE,
|
|
||||||
U16LE,
|
|
||||||
U16BE,
|
|
||||||
S24LE,
|
|
||||||
S24BE,
|
|
||||||
U24LE,
|
|
||||||
U24BE,
|
|
||||||
S32LE,
|
|
||||||
S32BE,
|
|
||||||
U32LE,
|
|
||||||
U32BE,
|
|
||||||
Float32LE,
|
|
||||||
Float32BE,
|
|
||||||
Float64LE,
|
|
||||||
Float64BE
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,293 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace SoundIOSharp
|
|
||||||
{
|
|
||||||
public class SoundIOInStream : IDisposable
|
|
||||||
{
|
|
||||||
internal SoundIOInStream(Pointer<SoundIoInStream> handle)
|
|
||||||
{
|
|
||||||
this.handle = handle;
|
|
||||||
}
|
|
||||||
|
|
||||||
Pointer<SoundIoInStream> handle;
|
|
||||||
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
Natives.soundio_instream_destroy(handle);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Equality (based on handle)
|
|
||||||
|
|
||||||
public override bool Equals(object other)
|
|
||||||
{
|
|
||||||
var d = other as SoundIOInStream;
|
|
||||||
|
|
||||||
return d != null && (this.handle == d.handle);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int GetHashCode()
|
|
||||||
{
|
|
||||||
return (int)(IntPtr)handle;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool operator == (SoundIOInStream obj1, SoundIOInStream obj2)
|
|
||||||
{
|
|
||||||
return obj1 is null ? obj2 is null : obj1.Equals(obj2);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool operator != (SoundIOInStream obj1, SoundIOInStream obj2)
|
|
||||||
{
|
|
||||||
return obj1 is null ? obj2 is object : !obj1.Equals(obj2);
|
|
||||||
}
|
|
||||||
|
|
||||||
// fields
|
|
||||||
|
|
||||||
public SoundIODevice Device
|
|
||||||
{
|
|
||||||
get { return new SoundIODevice(Marshal.ReadIntPtr(handle, device_offset)); }
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int device_offset = (int)Marshal.OffsetOf<SoundIoInStream>("device");
|
|
||||||
|
|
||||||
public SoundIOFormat Format
|
|
||||||
{
|
|
||||||
get { return (SoundIOFormat)Marshal.ReadInt32(handle, format_offset); }
|
|
||||||
set { Marshal.WriteInt32(handle, format_offset, (int) value); }
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int format_offset = (int)Marshal.OffsetOf<SoundIoInStream>("format");
|
|
||||||
|
|
||||||
public int SampleRate
|
|
||||||
{
|
|
||||||
get { return Marshal.ReadInt32(handle, sample_rate_offset); }
|
|
||||||
set { Marshal.WriteInt32(handle, sample_rate_offset, value); }
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int sample_rate_offset = (int)Marshal.OffsetOf<SoundIoInStream>("sample_rate");
|
|
||||||
|
|
||||||
public SoundIOChannelLayout Layout
|
|
||||||
{
|
|
||||||
get { return new SoundIOChannelLayout ((IntPtr) handle + layout_offset); }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
unsafe
|
|
||||||
{
|
|
||||||
Buffer.MemoryCopy((void*)((IntPtr)handle + layout_offset), (void*)value.Handle, Marshal.SizeOf<SoundIoChannelLayout>(), Marshal.SizeOf<SoundIoChannelLayout>());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int layout_offset = (int)Marshal.OffsetOf<SoundIoInStream>("layout");
|
|
||||||
|
|
||||||
public double SoftwareLatency
|
|
||||||
{
|
|
||||||
get { return MarshalEx.ReadDouble(handle, software_latency_offset); }
|
|
||||||
set { MarshalEx.WriteDouble(handle, software_latency_offset, value); }
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int software_latency_offset = (int)Marshal.OffsetOf<SoundIoInStream>("software_latency");
|
|
||||||
|
|
||||||
// error_callback
|
|
||||||
public Action ErrorCallback
|
|
||||||
{
|
|
||||||
get { return error_callback; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
error_callback = value;
|
|
||||||
error_callback_native = _ => error_callback();
|
|
||||||
|
|
||||||
var ptr = Marshal.GetFunctionPointerForDelegate(error_callback_native);
|
|
||||||
|
|
||||||
Marshal.WriteIntPtr(handle, error_callback_offset, ptr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int error_callback_offset = (int)Marshal.OffsetOf<SoundIoInStream>("error_callback");
|
|
||||||
|
|
||||||
Action error_callback;
|
|
||||||
delegate void error_callback_delegate(IntPtr handle);
|
|
||||||
error_callback_delegate error_callback_native;
|
|
||||||
|
|
||||||
// read_callback
|
|
||||||
public Action<int,int> ReadCallback
|
|
||||||
{
|
|
||||||
get { return read_callback; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
read_callback = value;
|
|
||||||
read_callback_native = (_, minFrameCount, maxFrameCount) => read_callback(minFrameCount, maxFrameCount);
|
|
||||||
|
|
||||||
var ptr = Marshal.GetFunctionPointerForDelegate(read_callback_native);
|
|
||||||
|
|
||||||
Marshal.WriteIntPtr(handle, read_callback_offset, ptr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int read_callback_offset = (int)Marshal.OffsetOf<SoundIoInStream>("read_callback");
|
|
||||||
|
|
||||||
Action<int, int> read_callback;
|
|
||||||
delegate void read_callback_delegate(IntPtr handle, int min, int max);
|
|
||||||
read_callback_delegate read_callback_native;
|
|
||||||
|
|
||||||
// overflow_callback
|
|
||||||
public Action OverflowCallback
|
|
||||||
{
|
|
||||||
get { return overflow_callback; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
overflow_callback = value;
|
|
||||||
overflow_callback_native = _ => overflow_callback();
|
|
||||||
|
|
||||||
var ptr = Marshal.GetFunctionPointerForDelegate(overflow_callback_native);
|
|
||||||
|
|
||||||
Marshal.WriteIntPtr(handle, overflow_callback_offset, ptr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
static readonly int overflow_callback_offset = (int)Marshal.OffsetOf<SoundIoInStream>("overflow_callback");
|
|
||||||
|
|
||||||
Action overflow_callback;
|
|
||||||
delegate void overflow_callback_delegate(IntPtr handle);
|
|
||||||
overflow_callback_delegate overflow_callback_native;
|
|
||||||
|
|
||||||
// FIXME: this should be taken care in more centralized/decent manner... we don't want to write
|
|
||||||
// this kind of code anywhere we need string marshaling.
|
|
||||||
List<IntPtr> allocated_hglobals = new List<IntPtr>();
|
|
||||||
|
|
||||||
public string Name
|
|
||||||
{
|
|
||||||
get { return Marshal.PtrToStringAnsi(Marshal.ReadIntPtr(handle, name_offset)); }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
unsafe
|
|
||||||
{
|
|
||||||
var existing = Marshal.ReadIntPtr(handle, name_offset);
|
|
||||||
if (allocated_hglobals.Contains(existing))
|
|
||||||
{
|
|
||||||
allocated_hglobals.Remove(existing);
|
|
||||||
Marshal.FreeHGlobal(existing);
|
|
||||||
}
|
|
||||||
|
|
||||||
var ptr = Marshal.StringToHGlobalAnsi(value);
|
|
||||||
Marshal.WriteIntPtr(handle, name_offset, ptr);
|
|
||||||
allocated_hglobals.Add(ptr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int name_offset = (int)Marshal.OffsetOf<SoundIoInStream>("name");
|
|
||||||
|
|
||||||
public bool NonTerminalHint
|
|
||||||
{
|
|
||||||
get { return Marshal.ReadInt32(handle, non_terminal_hint_offset) != 0; }
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int non_terminal_hint_offset = (int)Marshal.OffsetOf<SoundIoInStream>("non_terminal_hint");
|
|
||||||
|
|
||||||
public int BytesPerFrame
|
|
||||||
{
|
|
||||||
get { return Marshal.ReadInt32(handle, bytes_per_frame_offset); }
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int bytes_per_frame_offset = (int)Marshal.OffsetOf<SoundIoInStream>("bytes_per_frame");
|
|
||||||
|
|
||||||
public int BytesPerSample
|
|
||||||
{
|
|
||||||
get { return Marshal.ReadInt32(handle, bytes_per_sample_offset); }
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int bytes_per_sample_offset = (int)Marshal.OffsetOf<SoundIoInStream>("bytes_per_sample");
|
|
||||||
|
|
||||||
public string LayoutErrorMessage
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
var code = (SoundIoError)Marshal.ReadInt32(handle, layout_error_offset);
|
|
||||||
|
|
||||||
return code == SoundIoError.SoundIoErrorNone ? null : Marshal.PtrToStringAnsi(Natives.soundio_strerror((int)code));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int layout_error_offset = (int)Marshal.OffsetOf<SoundIoInStream>("layout_error");
|
|
||||||
|
|
||||||
// functions
|
|
||||||
|
|
||||||
public void Open()
|
|
||||||
{
|
|
||||||
var ret = (SoundIoError)Natives.soundio_instream_open(handle);
|
|
||||||
if (ret != SoundIoError.SoundIoErrorNone)
|
|
||||||
{
|
|
||||||
throw new SoundIOException(ret);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Start()
|
|
||||||
{
|
|
||||||
var ret = (SoundIoError)Natives.soundio_instream_start(handle);
|
|
||||||
if (ret != SoundIoError.SoundIoErrorNone)
|
|
||||||
{
|
|
||||||
throw new SoundIOException(ret);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public SoundIOChannelAreas BeginRead(ref int frameCount)
|
|
||||||
{
|
|
||||||
IntPtr ptrs = default;
|
|
||||||
int nativeFrameCount = frameCount;
|
|
||||||
|
|
||||||
unsafe
|
|
||||||
{
|
|
||||||
var frameCountPtr = &nativeFrameCount;
|
|
||||||
var ptrptr = &ptrs;
|
|
||||||
var ret = (SoundIoError)Natives.soundio_instream_begin_read(handle, (IntPtr)ptrptr, (IntPtr)frameCountPtr);
|
|
||||||
|
|
||||||
frameCount = *frameCountPtr;
|
|
||||||
|
|
||||||
if (ret != SoundIoError.SoundIoErrorNone)
|
|
||||||
{
|
|
||||||
throw new SoundIOException(ret);
|
|
||||||
}
|
|
||||||
|
|
||||||
return new SoundIOChannelAreas(ptrs, Layout.ChannelCount, frameCount);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void EndRead()
|
|
||||||
{
|
|
||||||
var ret = (SoundIoError)Natives.soundio_instream_end_read(handle);
|
|
||||||
if (ret != SoundIoError.SoundIoErrorNone)
|
|
||||||
{
|
|
||||||
throw new SoundIOException(ret);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Pause(bool pause)
|
|
||||||
{
|
|
||||||
var ret = (SoundIoError)Natives.soundio_instream_pause(handle, pause);
|
|
||||||
if (ret != SoundIoError.SoundIoErrorNone)
|
|
||||||
{
|
|
||||||
throw new SoundIOException(ret);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public double GetLatency()
|
|
||||||
{
|
|
||||||
unsafe
|
|
||||||
{
|
|
||||||
double* dptr = null;
|
|
||||||
IntPtr p = new IntPtr(dptr);
|
|
||||||
|
|
||||||
var ret = (SoundIoError)Natives.soundio_instream_get_latency(handle, p);
|
|
||||||
if (ret != SoundIoError.SoundIoErrorNone)
|
|
||||||
{
|
|
||||||
throw new SoundIOException(ret);
|
|
||||||
}
|
|
||||||
|
|
||||||
dptr = (double*)p;
|
|
||||||
|
|
||||||
return *dptr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,331 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace SoundIOSharp
|
|
||||||
{
|
|
||||||
public class SoundIOOutStream : IDisposable
|
|
||||||
{
|
|
||||||
internal SoundIOOutStream (Pointer<SoundIoOutStream> handle)
|
|
||||||
{
|
|
||||||
this.handle = handle;
|
|
||||||
}
|
|
||||||
|
|
||||||
Pointer<SoundIoOutStream> handle;
|
|
||||||
|
|
||||||
public void Dispose ()
|
|
||||||
{
|
|
||||||
Natives.soundio_outstream_destroy (handle);
|
|
||||||
}
|
|
||||||
// Equality (based on handle)
|
|
||||||
|
|
||||||
public override bool Equals (object other)
|
|
||||||
{
|
|
||||||
var d = other as SoundIOOutStream;
|
|
||||||
|
|
||||||
return d != null && (this.handle == d.handle);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int GetHashCode ()
|
|
||||||
{
|
|
||||||
return (int)(IntPtr)handle;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool operator == (SoundIOOutStream obj1, SoundIOOutStream obj2)
|
|
||||||
{
|
|
||||||
return obj1 is null ? obj2 is null : obj1.Equals(obj2);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool operator != (SoundIOOutStream obj1, SoundIOOutStream obj2)
|
|
||||||
{
|
|
||||||
return obj1 is null ? obj2 is object : !obj1.Equals(obj2);
|
|
||||||
}
|
|
||||||
|
|
||||||
// fields
|
|
||||||
|
|
||||||
public SoundIODevice Device
|
|
||||||
{
|
|
||||||
get { return new SoundIODevice(Marshal.ReadIntPtr(handle, device_offset)); }
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int device_offset = (int)Marshal.OffsetOf<SoundIoOutStream>("device");
|
|
||||||
|
|
||||||
public SoundIOFormat Format
|
|
||||||
{
|
|
||||||
get { return (SoundIOFormat) Marshal.ReadInt32(handle, format_offset); }
|
|
||||||
set { Marshal.WriteInt32(handle, format_offset, (int) value); }
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int format_offset = (int)Marshal.OffsetOf<SoundIoOutStream>("format");
|
|
||||||
|
|
||||||
public int SampleRate
|
|
||||||
{
|
|
||||||
get { return Marshal.ReadInt32(handle, sample_rate_offset); }
|
|
||||||
set { Marshal.WriteInt32(handle, sample_rate_offset, value); }
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int sample_rate_offset = (int)Marshal.OffsetOf<SoundIoOutStream>("sample_rate");
|
|
||||||
|
|
||||||
public SoundIOChannelLayout Layout
|
|
||||||
{
|
|
||||||
get { unsafe { return new SoundIOChannelLayout((IntPtr) (void*)((IntPtr)handle + layout_offset)); } }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
unsafe
|
|
||||||
{
|
|
||||||
Buffer.MemoryCopy((void*)value.Handle, (void*)((IntPtr)handle + layout_offset), Marshal.SizeOf<SoundIoChannelLayout>(), Marshal.SizeOf<SoundIoChannelLayout>());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
static readonly int layout_offset = (int)Marshal.OffsetOf<SoundIoOutStream>("layout");
|
|
||||||
|
|
||||||
public double SoftwareLatency
|
|
||||||
{
|
|
||||||
get { return MarshalEx.ReadDouble (handle, software_latency_offset); }
|
|
||||||
set { MarshalEx.WriteDouble (handle, software_latency_offset, value); }
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int software_latency_offset = (int)Marshal.OffsetOf<SoundIoOutStream>("software_latency");
|
|
||||||
|
|
||||||
public float Volume
|
|
||||||
{
|
|
||||||
get { return MarshalEx.ReadFloat(handle, volume_offset); }
|
|
||||||
set { MarshalEx.WriteFloat(handle, volume_offset, value); }
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int volume_offset = (int)Marshal.OffsetOf<SoundIoOutStream>("volume");
|
|
||||||
|
|
||||||
// error_callback
|
|
||||||
public Action ErrorCallback
|
|
||||||
{
|
|
||||||
get { return error_callback; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
error_callback = value;
|
|
||||||
if (value == null)
|
|
||||||
{
|
|
||||||
error_callback_native = null;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
error_callback_native = stream => error_callback();
|
|
||||||
}
|
|
||||||
|
|
||||||
var ptr = Marshal.GetFunctionPointerForDelegate(error_callback_native);
|
|
||||||
Marshal.WriteIntPtr(handle, error_callback_offset, ptr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int error_callback_offset = (int)Marshal.OffsetOf<SoundIoOutStream>("error_callback");
|
|
||||||
|
|
||||||
Action error_callback;
|
|
||||||
delegate void error_callback_delegate (IntPtr handle);
|
|
||||||
error_callback_delegate error_callback_native;
|
|
||||||
|
|
||||||
// write_callback
|
|
||||||
public Action<int, int> WriteCallback
|
|
||||||
{
|
|
||||||
get { return write_callback; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
write_callback = value;
|
|
||||||
if (value == null)
|
|
||||||
{
|
|
||||||
write_callback_native = null;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
write_callback_native = (h, frame_count_min, frame_count_max) => write_callback(frame_count_min, frame_count_max);
|
|
||||||
}
|
|
||||||
|
|
||||||
var ptr = Marshal.GetFunctionPointerForDelegate (write_callback_native);
|
|
||||||
Marshal.WriteIntPtr (handle, write_callback_offset, ptr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int write_callback_offset = (int)Marshal.OffsetOf<SoundIoOutStream>("write_callback");
|
|
||||||
|
|
||||||
Action<int, int> write_callback;
|
|
||||||
delegate void write_callback_delegate(IntPtr handle, int min, int max);
|
|
||||||
write_callback_delegate write_callback_native;
|
|
||||||
|
|
||||||
// underflow_callback
|
|
||||||
public Action UnderflowCallback
|
|
||||||
{
|
|
||||||
get { return underflow_callback; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
underflow_callback = value;
|
|
||||||
if (value == null)
|
|
||||||
{
|
|
||||||
underflow_callback_native = null;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
underflow_callback_native = h => underflow_callback();
|
|
||||||
}
|
|
||||||
|
|
||||||
var ptr = Marshal.GetFunctionPointerForDelegate (underflow_callback_native);
|
|
||||||
Marshal.WriteIntPtr (handle, underflow_callback_offset, ptr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int underflow_callback_offset = (int)Marshal.OffsetOf<SoundIoOutStream>("underflow_callback");
|
|
||||||
|
|
||||||
Action underflow_callback;
|
|
||||||
delegate void underflow_callback_delegate(IntPtr handle);
|
|
||||||
underflow_callback_delegate underflow_callback_native;
|
|
||||||
|
|
||||||
// FIXME: this should be taken care in more centralized/decent manner... we don't want to write
|
|
||||||
// this kind of code anywhere we need string marshaling.
|
|
||||||
List<IntPtr> allocated_hglobals = new List<IntPtr>();
|
|
||||||
|
|
||||||
public string Name {
|
|
||||||
get { return Marshal.PtrToStringAnsi(Marshal.ReadIntPtr(handle, name_offset)); }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
unsafe
|
|
||||||
{
|
|
||||||
var existing = Marshal.ReadIntPtr(handle, name_offset);
|
|
||||||
if (allocated_hglobals.Contains(existing))
|
|
||||||
{
|
|
||||||
allocated_hglobals.Remove(existing);
|
|
||||||
Marshal.FreeHGlobal(existing);
|
|
||||||
}
|
|
||||||
|
|
||||||
var ptr = Marshal.StringToHGlobalAnsi(value);
|
|
||||||
Marshal.WriteIntPtr(handle, name_offset, ptr);
|
|
||||||
allocated_hglobals.Add(ptr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int name_offset = (int)Marshal.OffsetOf<SoundIoOutStream>("name");
|
|
||||||
|
|
||||||
public bool NonTerminalHint
|
|
||||||
{
|
|
||||||
get { return Marshal.ReadInt32(handle, non_terminal_hint_offset) != 0; }
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int non_terminal_hint_offset = (int)Marshal.OffsetOf<SoundIoOutStream>("non_terminal_hint");
|
|
||||||
|
|
||||||
public int BytesPerFrame
|
|
||||||
{
|
|
||||||
get { return Marshal.ReadInt32(handle, bytes_per_frame_offset); }
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int bytes_per_frame_offset = (int)Marshal.OffsetOf<SoundIoOutStream>("bytes_per_frame");
|
|
||||||
|
|
||||||
public int BytesPerSample
|
|
||||||
{
|
|
||||||
get { return Marshal.ReadInt32(handle, bytes_per_sample_offset); }
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int bytes_per_sample_offset = (int)Marshal.OffsetOf<SoundIoOutStream>("bytes_per_sample");
|
|
||||||
|
|
||||||
public string LayoutErrorMessage
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
var code = (SoundIoError)Marshal.ReadInt32(handle, layout_error_offset);
|
|
||||||
|
|
||||||
return code == SoundIoError.SoundIoErrorNone ? null : Marshal.PtrToStringAnsi(Natives.soundio_strerror((int)code));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly int layout_error_offset = (int)Marshal.OffsetOf<SoundIoOutStream> ("layout_error");
|
|
||||||
|
|
||||||
// functions
|
|
||||||
|
|
||||||
public void Open ()
|
|
||||||
{
|
|
||||||
var ret = (SoundIoError)Natives.soundio_outstream_open(handle);
|
|
||||||
if (ret != SoundIoError.SoundIoErrorNone)
|
|
||||||
{
|
|
||||||
throw new SoundIOException(ret);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Start ()
|
|
||||||
{
|
|
||||||
var ret = (SoundIoError)Natives.soundio_outstream_start(handle);
|
|
||||||
if (ret != SoundIoError.SoundIoErrorNone)
|
|
||||||
{
|
|
||||||
throw new SoundIOException(ret);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public SoundIOChannelAreas BeginWrite(ref int frameCount)
|
|
||||||
{
|
|
||||||
IntPtr ptrs = default;
|
|
||||||
int nativeFrameCount = frameCount;
|
|
||||||
|
|
||||||
unsafe
|
|
||||||
{
|
|
||||||
var frameCountPtr = &nativeFrameCount;
|
|
||||||
var ptrptr = &ptrs;
|
|
||||||
var ret = (SoundIoError)Natives.soundio_outstream_begin_write(handle, (IntPtr)ptrptr, (IntPtr)frameCountPtr);
|
|
||||||
|
|
||||||
frameCount = *frameCountPtr;
|
|
||||||
|
|
||||||
if (ret != SoundIoError.SoundIoErrorNone)
|
|
||||||
{
|
|
||||||
throw new SoundIOException(ret);
|
|
||||||
}
|
|
||||||
|
|
||||||
return new SoundIOChannelAreas(ptrs, Layout.ChannelCount, frameCount);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void EndWrite ()
|
|
||||||
{
|
|
||||||
var ret = (SoundIoError)Natives.soundio_outstream_end_write(handle);
|
|
||||||
if (ret != SoundIoError.SoundIoErrorNone)
|
|
||||||
{
|
|
||||||
throw new SoundIOException(ret);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ClearBuffer ()
|
|
||||||
{
|
|
||||||
_ = Natives.soundio_outstream_clear_buffer(handle);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Pause (bool pause)
|
|
||||||
{
|
|
||||||
var ret = (SoundIoError)Natives.soundio_outstream_pause(handle, pause);
|
|
||||||
if (ret != SoundIoError.SoundIoErrorNone)
|
|
||||||
{
|
|
||||||
throw new SoundIOException(ret);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public double GetLatency ()
|
|
||||||
{
|
|
||||||
unsafe
|
|
||||||
{
|
|
||||||
double* dptr = null;
|
|
||||||
IntPtr p = new IntPtr(dptr);
|
|
||||||
|
|
||||||
var ret = (SoundIoError)Natives.soundio_outstream_get_latency(handle, p);
|
|
||||||
if (ret != SoundIoError.SoundIoErrorNone)
|
|
||||||
{
|
|
||||||
throw new SoundIOException(ret);
|
|
||||||
}
|
|
||||||
|
|
||||||
dptr = (double*)p;
|
|
||||||
|
|
||||||
return *dptr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SetVolume (double volume)
|
|
||||||
{
|
|
||||||
var ret = (SoundIoError)Natives.soundio_outstream_set_volume(handle, volume);
|
|
||||||
if (ret != SoundIoError.SoundIoErrorNone)
|
|
||||||
{
|
|
||||||
throw new SoundIOException(ret);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,58 +0,0 @@
|
|||||||
using System;
|
|
||||||
namespace SoundIOSharp
|
|
||||||
{
|
|
||||||
public class SoundIORingBuffer : IDisposable
|
|
||||||
{
|
|
||||||
internal SoundIORingBuffer(IntPtr handle)
|
|
||||||
{
|
|
||||||
this.handle = handle;
|
|
||||||
}
|
|
||||||
|
|
||||||
IntPtr handle;
|
|
||||||
|
|
||||||
public int Capacity
|
|
||||||
{
|
|
||||||
get { return Natives.soundio_ring_buffer_capacity(handle); }
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Clear()
|
|
||||||
{
|
|
||||||
Natives.soundio_ring_buffer_clear(handle);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
Natives.soundio_ring_buffer_destroy(handle);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int FillCount
|
|
||||||
{
|
|
||||||
get { return Natives.soundio_ring_buffer_fill_count(handle); }
|
|
||||||
}
|
|
||||||
|
|
||||||
public int FreeCount
|
|
||||||
{
|
|
||||||
get { return Natives.soundio_ring_buffer_free_count(handle); }
|
|
||||||
}
|
|
||||||
|
|
||||||
public IntPtr ReadPointer
|
|
||||||
{
|
|
||||||
get { return Natives.soundio_ring_buffer_read_ptr(handle); }
|
|
||||||
}
|
|
||||||
|
|
||||||
public IntPtr WritePointer
|
|
||||||
{
|
|
||||||
get { return Natives.soundio_ring_buffer_write_ptr(handle); }
|
|
||||||
}
|
|
||||||
|
|
||||||
public void AdvanceReadPointer(int count)
|
|
||||||
{
|
|
||||||
Natives.soundio_ring_buffer_advance_read_ptr(handle, count);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void AdvanceWritePointer(int count)
|
|
||||||
{
|
|
||||||
Natives.soundio_ring_buffer_advance_write_ptr(handle, count);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
using System;
|
|
||||||
namespace SoundIOSharp
|
|
||||||
{
|
|
||||||
public struct SoundIOSampleRateRange
|
|
||||||
{
|
|
||||||
internal SoundIOSampleRateRange(int min, int max)
|
|
||||||
{
|
|
||||||
Min = min;
|
|
||||||
Max = max;
|
|
||||||
}
|
|
||||||
|
|
||||||
public readonly int Min;
|
|
||||||
public readonly int Max;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,643 +0,0 @@
|
|||||||
// This source file is generated by nclang PInvokeGenerator.
|
|
||||||
using System;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using delegate0 = SoundIOSharp.Delegates.delegate0;
|
|
||||||
using delegate1 = SoundIOSharp.Delegates.delegate1;
|
|
||||||
using delegate2 = SoundIOSharp.Delegates.delegate2;
|
|
||||||
using delegate3 = SoundIOSharp.Delegates.delegate3;
|
|
||||||
using delegate4 = SoundIOSharp.Delegates.delegate4;
|
|
||||||
using delegate5 = SoundIOSharp.Delegates.delegate5;
|
|
||||||
using delegate6 = SoundIOSharp.Delegates.delegate6;
|
|
||||||
using delegate7 = SoundIOSharp.Delegates.delegate7;
|
|
||||||
using delegate8 = SoundIOSharp.Delegates.delegate8;
|
|
||||||
using delegate9 = SoundIOSharp.Delegates.delegate9;
|
|
||||||
|
|
||||||
namespace SoundIOSharp
|
|
||||||
{
|
|
||||||
enum SoundIoError // soundio.h (72, 6)
|
|
||||||
{
|
|
||||||
SoundIoErrorNone = 0,
|
|
||||||
SoundIoErrorNoMem = 1,
|
|
||||||
SoundIoErrorInitAudioBackend = 2,
|
|
||||||
SoundIoErrorSystemResources = 3,
|
|
||||||
SoundIoErrorOpeningDevice = 4,
|
|
||||||
SoundIoErrorNoSuchDevice = 5,
|
|
||||||
SoundIoErrorInvalid = 6,
|
|
||||||
SoundIoErrorBackendUnavailable = 7,
|
|
||||||
SoundIoErrorStreaming = 8,
|
|
||||||
SoundIoErrorIncompatibleDevice = 9,
|
|
||||||
SoundIoErrorNoSuchClient = 10,
|
|
||||||
SoundIoErrorIncompatibleBackend = 11,
|
|
||||||
SoundIoErrorBackendDisconnected = 12,
|
|
||||||
SoundIoErrorInterrupted = 13,
|
|
||||||
SoundIoErrorUnderflow = 14,
|
|
||||||
SoundIoErrorEncodingString = 15,
|
|
||||||
}
|
|
||||||
|
|
||||||
enum SoundIoChannelId // soundio.h (106, 6)
|
|
||||||
{
|
|
||||||
SoundIoChannelIdInvalid = 0,
|
|
||||||
SoundIoChannelIdFrontLeft = 1,
|
|
||||||
SoundIoChannelIdFrontRight = 2,
|
|
||||||
SoundIoChannelIdFrontCenter = 3,
|
|
||||||
SoundIoChannelIdLfe = 4,
|
|
||||||
SoundIoChannelIdBackLeft = 5,
|
|
||||||
SoundIoChannelIdBackRight = 6,
|
|
||||||
SoundIoChannelIdFrontLeftCenter = 7,
|
|
||||||
SoundIoChannelIdFrontRightCenter = 8,
|
|
||||||
SoundIoChannelIdBackCenter = 9,
|
|
||||||
SoundIoChannelIdSideLeft = 10,
|
|
||||||
SoundIoChannelIdSideRight = 11,
|
|
||||||
SoundIoChannelIdTopCenter = 12,
|
|
||||||
SoundIoChannelIdTopFrontLeft = 13,
|
|
||||||
SoundIoChannelIdTopFrontCenter = 14,
|
|
||||||
SoundIoChannelIdTopFrontRight = 15,
|
|
||||||
SoundIoChannelIdTopBackLeft = 16,
|
|
||||||
SoundIoChannelIdTopBackCenter = 17,
|
|
||||||
SoundIoChannelIdTopBackRight = 18,
|
|
||||||
SoundIoChannelIdBackLeftCenter = 19,
|
|
||||||
SoundIoChannelIdBackRightCenter = 20,
|
|
||||||
SoundIoChannelIdFrontLeftWide = 21,
|
|
||||||
SoundIoChannelIdFrontRightWide = 22,
|
|
||||||
SoundIoChannelIdFrontLeftHigh = 23,
|
|
||||||
SoundIoChannelIdFrontCenterHigh = 24,
|
|
||||||
SoundIoChannelIdFrontRightHigh = 25,
|
|
||||||
SoundIoChannelIdTopFrontLeftCenter = 26,
|
|
||||||
SoundIoChannelIdTopFrontRightCenter = 27,
|
|
||||||
SoundIoChannelIdTopSideLeft = 28,
|
|
||||||
SoundIoChannelIdTopSideRight = 29,
|
|
||||||
SoundIoChannelIdLeftLfe = 30,
|
|
||||||
SoundIoChannelIdRightLfe = 31,
|
|
||||||
SoundIoChannelIdLfe2 = 32,
|
|
||||||
SoundIoChannelIdBottomCenter = 33,
|
|
||||||
SoundIoChannelIdBottomLeftCenter = 34,
|
|
||||||
SoundIoChannelIdBottomRightCenter = 35,
|
|
||||||
SoundIoChannelIdMsMid = 36,
|
|
||||||
SoundIoChannelIdMsSide = 37,
|
|
||||||
SoundIoChannelIdAmbisonicW = 38,
|
|
||||||
SoundIoChannelIdAmbisonicX = 39,
|
|
||||||
SoundIoChannelIdAmbisonicY = 40,
|
|
||||||
SoundIoChannelIdAmbisonicZ = 41,
|
|
||||||
SoundIoChannelIdXyX = 42,
|
|
||||||
SoundIoChannelIdXyY = 43,
|
|
||||||
SoundIoChannelIdHeadphonesLeft = 44,
|
|
||||||
SoundIoChannelIdHeadphonesRight = 45,
|
|
||||||
SoundIoChannelIdClickTrack = 46,
|
|
||||||
SoundIoChannelIdForeignLanguage = 47,
|
|
||||||
SoundIoChannelIdHearingImpaired = 48,
|
|
||||||
SoundIoChannelIdNarration = 49,
|
|
||||||
SoundIoChannelIdHaptic = 50,
|
|
||||||
SoundIoChannelIdDialogCentricMix = 51,
|
|
||||||
SoundIoChannelIdAux = 52,
|
|
||||||
SoundIoChannelIdAux0 = 53,
|
|
||||||
SoundIoChannelIdAux1 = 54,
|
|
||||||
SoundIoChannelIdAux2 = 55,
|
|
||||||
SoundIoChannelIdAux3 = 56,
|
|
||||||
SoundIoChannelIdAux4 = 57,
|
|
||||||
SoundIoChannelIdAux5 = 58,
|
|
||||||
SoundIoChannelIdAux6 = 59,
|
|
||||||
SoundIoChannelIdAux7 = 60,
|
|
||||||
SoundIoChannelIdAux8 = 61,
|
|
||||||
SoundIoChannelIdAux9 = 62,
|
|
||||||
SoundIoChannelIdAux10 = 63,
|
|
||||||
SoundIoChannelIdAux11 = 64,
|
|
||||||
SoundIoChannelIdAux12 = 65,
|
|
||||||
SoundIoChannelIdAux13 = 66,
|
|
||||||
SoundIoChannelIdAux14 = 67,
|
|
||||||
SoundIoChannelIdAux15 = 68,
|
|
||||||
}
|
|
||||||
|
|
||||||
enum SoundIoChannelLayoutId // soundio.h (189, 6)
|
|
||||||
{
|
|
||||||
SoundIoChannelLayoutIdMono = 0,
|
|
||||||
SoundIoChannelLayoutIdStereo = 1,
|
|
||||||
SoundIoChannelLayoutId2Point1 = 2,
|
|
||||||
SoundIoChannelLayoutId3Point0 = 3,
|
|
||||||
SoundIoChannelLayoutId3Point0Back = 4,
|
|
||||||
SoundIoChannelLayoutId3Point1 = 5,
|
|
||||||
SoundIoChannelLayoutId4Point0 = 6,
|
|
||||||
SoundIoChannelLayoutIdQuad = 7,
|
|
||||||
SoundIoChannelLayoutIdQuadSide = 8,
|
|
||||||
SoundIoChannelLayoutId4Point1 = 9,
|
|
||||||
SoundIoChannelLayoutId5Point0Back = 10,
|
|
||||||
SoundIoChannelLayoutId5Point0Side = 11,
|
|
||||||
SoundIoChannelLayoutId5Point1 = 12,
|
|
||||||
SoundIoChannelLayoutId5Point1Back = 13,
|
|
||||||
SoundIoChannelLayoutId6Point0Side = 14,
|
|
||||||
SoundIoChannelLayoutId6Point0Front = 15,
|
|
||||||
SoundIoChannelLayoutIdHexagonal = 16,
|
|
||||||
SoundIoChannelLayoutId6Point1 = 17,
|
|
||||||
SoundIoChannelLayoutId6Point1Back = 18,
|
|
||||||
SoundIoChannelLayoutId6Point1Front = 19,
|
|
||||||
SoundIoChannelLayoutId7Point0 = 20,
|
|
||||||
SoundIoChannelLayoutId7Point0Front = 21,
|
|
||||||
SoundIoChannelLayoutId7Point1 = 22,
|
|
||||||
SoundIoChannelLayoutId7Point1Wide = 23,
|
|
||||||
SoundIoChannelLayoutId7Point1WideBack = 24,
|
|
||||||
SoundIoChannelLayoutIdOctagonal = 25,
|
|
||||||
}
|
|
||||||
|
|
||||||
enum SoundIoBackend // soundio.h (218, 6)
|
|
||||||
{
|
|
||||||
SoundIoBackendNone = 0,
|
|
||||||
SoundIoBackendJack = 1,
|
|
||||||
SoundIoBackendPulseAudio = 2,
|
|
||||||
SoundIoBackendAlsa = 3,
|
|
||||||
SoundIoBackendCoreAudio = 4,
|
|
||||||
SoundIoBackendWasapi = 5,
|
|
||||||
SoundIoBackendDummy = 6,
|
|
||||||
}
|
|
||||||
|
|
||||||
enum SoundIoDeviceAim // soundio.h (228, 6)
|
|
||||||
{
|
|
||||||
SoundIoDeviceAimInput = 0,
|
|
||||||
SoundIoDeviceAimOutput = 1,
|
|
||||||
}
|
|
||||||
|
|
||||||
enum SoundIoFormat // soundio.h (235, 6)
|
|
||||||
{
|
|
||||||
SoundIoFormatInvalid = 0,
|
|
||||||
SoundIoFormatS8 = 1,
|
|
||||||
SoundIoFormatU8 = 2,
|
|
||||||
SoundIoFormatS16LE = 3,
|
|
||||||
SoundIoFormatS16BE = 4,
|
|
||||||
SoundIoFormatU16LE = 5,
|
|
||||||
SoundIoFormatU16BE = 6,
|
|
||||||
SoundIoFormatS24LE = 7,
|
|
||||||
SoundIoFormatS24BE = 8,
|
|
||||||
SoundIoFormatU24LE = 9,
|
|
||||||
SoundIoFormatU24BE = 10,
|
|
||||||
SoundIoFormatS32LE = 11,
|
|
||||||
SoundIoFormatS32BE = 12,
|
|
||||||
SoundIoFormatU32LE = 13,
|
|
||||||
SoundIoFormatU32BE = 14,
|
|
||||||
SoundIoFormatFloat32LE = 15,
|
|
||||||
SoundIoFormatFloat32BE = 16,
|
|
||||||
SoundIoFormatFloat64LE = 17,
|
|
||||||
SoundIoFormatFloat64BE = 18,
|
|
||||||
}
|
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
|
||||||
struct SoundIoChannelLayout // soundio.h (306, 8)
|
|
||||||
{
|
|
||||||
[CTypeDetails("Pointer<byte>")] public System.IntPtr @name;
|
|
||||||
public int @channel_count;
|
|
||||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 24)]
|
|
||||||
[CTypeDetails("ConstArrayOf<SoundIoChannelId>")] public SoundIoChannelId[] @channels;
|
|
||||||
}
|
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
|
||||||
struct SoundIoSampleRateRange // soundio.h (313, 8)
|
|
||||||
{
|
|
||||||
public int @min;
|
|
||||||
public int @max;
|
|
||||||
}
|
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
|
||||||
struct SoundIoChannelArea // soundio.h (319, 8)
|
|
||||||
{
|
|
||||||
[CTypeDetails("Pointer<byte>")] public System.IntPtr @ptr;
|
|
||||||
public int @step;
|
|
||||||
}
|
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
|
||||||
struct SoundIo // soundio.h (328, 8)
|
|
||||||
{
|
|
||||||
[CTypeDetails("Pointer<void>")] public System.IntPtr @userdata;
|
|
||||||
[CTypeDetails("Pointer<void (SoundIo *)>")] public delegate0 @on_devices_change;
|
|
||||||
[CTypeDetails("Pointer<void (SoundIo *, int)>")] public delegate1 @on_backend_disconnect;
|
|
||||||
[CTypeDetails("Pointer<void (SoundIo *)>")] public Delegates.delegate0 @on_events_signal;
|
|
||||||
public SoundIoBackend @current_backend;
|
|
||||||
[CTypeDetails("Pointer<byte>")] public System.IntPtr @app_name;
|
|
||||||
[CTypeDetails("Pointer<void ()>")] public delegate2 @emit_rtprio_warning;
|
|
||||||
[CTypeDetails("Pointer<void (const char *)>")] public delegate3 @jack_info_callback;
|
|
||||||
[CTypeDetails("Pointer<void (const char *)>")] public Delegates.delegate3 @jack_error_callback;
|
|
||||||
}
|
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
|
||||||
struct SoundIoDevice // soundio.h (387, 8)
|
|
||||||
{
|
|
||||||
[CTypeDetails("Pointer<SoundIo>")] public System.IntPtr @soundio;
|
|
||||||
[CTypeDetails("Pointer<byte>")] public System.IntPtr @id;
|
|
||||||
[CTypeDetails("Pointer<byte>")] public System.IntPtr @name;
|
|
||||||
public SoundIoDeviceAim @aim;
|
|
||||||
[CTypeDetails("Pointer<SoundIoChannelLayout>")] public System.IntPtr @layouts;
|
|
||||||
public int @layout_count;
|
|
||||||
public SoundIoChannelLayout @current_layout;
|
|
||||||
[CTypeDetails("Pointer<SoundIoFormat>")] public System.IntPtr @formats;
|
|
||||||
public int @format_count;
|
|
||||||
public SoundIoFormat @current_format;
|
|
||||||
[CTypeDetails("Pointer<SoundIoSampleRateRange>")] public System.IntPtr @sample_rates;
|
|
||||||
public int @sample_rate_count;
|
|
||||||
public int @sample_rate_current;
|
|
||||||
public double @software_latency_min;
|
|
||||||
public double @software_latency_max;
|
|
||||||
public double @software_latency_current;
|
|
||||||
public bool @is_raw;
|
|
||||||
public int @ref_count;
|
|
||||||
public int @probe_error;
|
|
||||||
}
|
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
|
||||||
struct SoundIoOutStream // soundio.h (497, 8)
|
|
||||||
{
|
|
||||||
[CTypeDetails("Pointer<SoundIoDevice>")] public System.IntPtr @device;
|
|
||||||
public SoundIoFormat @format;
|
|
||||||
public int @sample_rate;
|
|
||||||
public SoundIoChannelLayout @layout;
|
|
||||||
public double @software_latency;
|
|
||||||
public float @volume;
|
|
||||||
[CTypeDetails("Pointer<void>")] public System.IntPtr @userdata;
|
|
||||||
[CTypeDetails("Pointer<void (SoundIoOutStream *, int, int)>")] public delegate4 @write_callback;
|
|
||||||
[CTypeDetails("Pointer<void (SoundIoOutStream *)>")] public delegate5 @underflow_callback;
|
|
||||||
[CTypeDetails("Pointer<void (SoundIoOutStream *, int)>")] public delegate6 @error_callback;
|
|
||||||
[CTypeDetails("Pointer<byte>")] public System.IntPtr @name;
|
|
||||||
public bool @non_terminal_hint;
|
|
||||||
public int @bytes_per_frame;
|
|
||||||
public int @bytes_per_sample;
|
|
||||||
public int @layout_error;
|
|
||||||
}
|
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
|
||||||
struct SoundIoInStream // soundio.h (600, 8)
|
|
||||||
{
|
|
||||||
[CTypeDetails("Pointer<SoundIoDevice>")] public System.IntPtr @device;
|
|
||||||
public SoundIoFormat @format;
|
|
||||||
public int @sample_rate;
|
|
||||||
public SoundIoChannelLayout @layout;
|
|
||||||
public double @software_latency;
|
|
||||||
[CTypeDetails("Pointer<void>")] public System.IntPtr @userdata;
|
|
||||||
[CTypeDetails("Pointer<void (SoundIoInStream *, int, int)>")] public delegate7 @read_callback;
|
|
||||||
[CTypeDetails("Pointer<void (SoundIoInStream *)>")] public delegate8 @overflow_callback;
|
|
||||||
[CTypeDetails("Pointer<void (SoundIoInStream *, int)>")] public delegate9 @error_callback;
|
|
||||||
[CTypeDetails("Pointer<byte>")] public System.IntPtr @name;
|
|
||||||
public bool @non_terminal_hint;
|
|
||||||
public int @bytes_per_frame;
|
|
||||||
public int @bytes_per_sample;
|
|
||||||
public int @layout_error;
|
|
||||||
}
|
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
|
||||||
struct SoundIoRingBuffer // soundio.h (1170, 8)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
partial class Natives
|
|
||||||
{
|
|
||||||
const string LibraryName = "libsoundio";
|
|
||||||
// function soundio_version_string - soundio.h (682, 28)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern System.IntPtr soundio_version_string();
|
|
||||||
|
|
||||||
// function soundio_version_major - soundio.h (684, 20)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern int soundio_version_major();
|
|
||||||
|
|
||||||
// function soundio_version_minor - soundio.h (686, 20)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern int soundio_version_minor();
|
|
||||||
|
|
||||||
// function soundio_version_patch - soundio.h (688, 20)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern int soundio_version_patch();
|
|
||||||
|
|
||||||
// function soundio_create - soundio.h (694, 32)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern System.IntPtr soundio_create();
|
|
||||||
|
|
||||||
// function soundio_destroy - soundio.h (695, 21)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern void soundio_destroy([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio);
|
|
||||||
|
|
||||||
// function soundio_connect - soundio.h (705, 20)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern int soundio_connect([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio);
|
|
||||||
|
|
||||||
// function soundio_connect_backend - soundio.h (717, 20)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern int soundio_connect_backend([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio, SoundIoBackend @backend);
|
|
||||||
|
|
||||||
// function soundio_disconnect - soundio.h (718, 21)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern void soundio_disconnect([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio);
|
|
||||||
|
|
||||||
// function soundio_strerror - soundio.h (721, 28)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern System.IntPtr soundio_strerror(int @error);
|
|
||||||
|
|
||||||
// function soundio_backend_name - soundio.h (723, 28)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern System.IntPtr soundio_backend_name(SoundIoBackend @backend);
|
|
||||||
|
|
||||||
// function soundio_backend_count - soundio.h (726, 20)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern int soundio_backend_count([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio);
|
|
||||||
|
|
||||||
// function soundio_get_backend - soundio.h (729, 36)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern SoundIoBackend soundio_get_backend([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio, int @index);
|
|
||||||
|
|
||||||
// function soundio_have_backend - soundio.h (732, 21)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern bool soundio_have_backend(SoundIoBackend @backend);
|
|
||||||
|
|
||||||
// function soundio_flush_events - soundio.h (756, 21)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern void soundio_flush_events([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio);
|
|
||||||
|
|
||||||
// function soundio_wait_events - soundio.h (760, 21)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern void soundio_wait_events([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio);
|
|
||||||
|
|
||||||
// function soundio_wakeup - soundio.h (763, 21)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern void soundio_wakeup([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio);
|
|
||||||
|
|
||||||
// function soundio_force_device_scan - soundio.h (780, 21)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern void soundio_force_device_scan([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio);
|
|
||||||
|
|
||||||
// function soundio_channel_layout_equal - soundio.h (787, 21)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern bool soundio_channel_layout_equal([CTypeDetails("Pointer<SoundIoChannelLayout>")]System.IntPtr @a, [CTypeDetails("Pointer<SoundIoChannelLayout>")]System.IntPtr @b);
|
|
||||||
|
|
||||||
// function soundio_get_channel_name - soundio.h (791, 28)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern System.IntPtr soundio_get_channel_name(SoundIoChannelId @id);
|
|
||||||
|
|
||||||
// function soundio_parse_channel_id - soundio.h (795, 38)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern SoundIoChannelId soundio_parse_channel_id([CTypeDetails("Pointer<byte>")]System.IntPtr @str, int @str_len);
|
|
||||||
|
|
||||||
// function soundio_channel_layout_builtin_count - soundio.h (798, 20)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern int soundio_channel_layout_builtin_count();
|
|
||||||
|
|
||||||
// function soundio_channel_layout_get_builtin - soundio.h (803, 51)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern System.IntPtr soundio_channel_layout_get_builtin(int @index);
|
|
||||||
|
|
||||||
// function soundio_channel_layout_get_default - soundio.h (806, 51)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern System.IntPtr soundio_channel_layout_get_default(int @channel_count);
|
|
||||||
|
|
||||||
// function soundio_channel_layout_find_channel - soundio.h (809, 20)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern int soundio_channel_layout_find_channel([CTypeDetails("Pointer<SoundIoChannelLayout>")]System.IntPtr @layout, SoundIoChannelId @channel);
|
|
||||||
|
|
||||||
// function soundio_channel_layout_detect_builtin - soundio.h (814, 21)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern bool soundio_channel_layout_detect_builtin([CTypeDetails("Pointer<SoundIoChannelLayout>")]System.IntPtr @layout);
|
|
||||||
|
|
||||||
// function soundio_best_matching_channel_layout - soundio.h (819, 51)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern System.IntPtr soundio_best_matching_channel_layout([CTypeDetails("Pointer<SoundIoChannelLayout>")]System.IntPtr @preferred_layouts, int @preferred_layout_count, [CTypeDetails("Pointer<SoundIoChannelLayout>")]System.IntPtr @available_layouts, int @available_layout_count);
|
|
||||||
|
|
||||||
// function soundio_sort_channel_layouts - soundio.h (824, 21)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern void soundio_sort_channel_layouts([CTypeDetails("Pointer<SoundIoChannelLayout>")]System.IntPtr @layouts, int @layout_count);
|
|
||||||
|
|
||||||
// function soundio_get_bytes_per_sample - soundio.h (830, 20)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern int soundio_get_bytes_per_sample(SoundIoFormat @format);
|
|
||||||
|
|
||||||
// function soundio_get_bytes_per_frame - soundio.h (833, 19)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern int soundio_get_bytes_per_frame(SoundIoFormat @format, int @channel_count);
|
|
||||||
|
|
||||||
// function soundio_get_bytes_per_second - soundio.h (838, 19)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern int soundio_get_bytes_per_second(SoundIoFormat @format, int @channel_count, int @sample_rate);
|
|
||||||
|
|
||||||
// function soundio_format_string - soundio.h (845, 29)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern System.IntPtr soundio_format_string(SoundIoFormat @format);
|
|
||||||
|
|
||||||
// function soundio_input_device_count - soundio.h (861, 20)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern int soundio_input_device_count([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio);
|
|
||||||
|
|
||||||
// function soundio_output_device_count - soundio.h (864, 20)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern int soundio_output_device_count([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio);
|
|
||||||
|
|
||||||
// function soundio_get_input_device - soundio.h (870, 38)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern System.IntPtr soundio_get_input_device([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio, int @index);
|
|
||||||
|
|
||||||
// function soundio_get_output_device - soundio.h (875, 38)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern System.IntPtr soundio_get_output_device([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio, int @index);
|
|
||||||
|
|
||||||
// function soundio_default_input_device_index - soundio.h (880, 20)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern int soundio_default_input_device_index([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio);
|
|
||||||
|
|
||||||
// function soundio_default_output_device_index - soundio.h (885, 20)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern int soundio_default_output_device_index([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio);
|
|
||||||
|
|
||||||
// function soundio_device_ref - soundio.h (888, 21)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern void soundio_device_ref([CTypeDetails("Pointer<SoundIoDevice>")]System.IntPtr @device);
|
|
||||||
|
|
||||||
// function soundio_device_unref - soundio.h (891, 21)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern void soundio_device_unref([CTypeDetails("Pointer<SoundIoDevice>")]System.IntPtr @device);
|
|
||||||
|
|
||||||
// function soundio_device_equal - soundio.h (895, 21)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern bool soundio_device_equal([CTypeDetails("Pointer<SoundIoDevice>")]System.IntPtr @a, [CTypeDetails("Pointer<SoundIoDevice>")]System.IntPtr @b);
|
|
||||||
|
|
||||||
// function soundio_device_sort_channel_layouts - soundio.h (900, 21)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern void soundio_device_sort_channel_layouts([CTypeDetails("Pointer<SoundIoDevice>")]System.IntPtr @device);
|
|
||||||
|
|
||||||
// function soundio_device_supports_format - soundio.h (904, 21)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern bool soundio_device_supports_format([CTypeDetails("Pointer<SoundIoDevice>")]System.IntPtr @device, SoundIoFormat @format);
|
|
||||||
|
|
||||||
// function soundio_device_supports_layout - soundio.h (909, 21)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern bool soundio_device_supports_layout([CTypeDetails("Pointer<SoundIoDevice>")]System.IntPtr @device, [CTypeDetails("Pointer<SoundIoChannelLayout>")]System.IntPtr @layout);
|
|
||||||
|
|
||||||
// function soundio_device_supports_sample_rate - soundio.h (914, 21)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern bool soundio_device_supports_sample_rate([CTypeDetails("Pointer<SoundIoDevice>")]System.IntPtr @device, int @sample_rate);
|
|
||||||
|
|
||||||
// function soundio_device_nearest_sample_rate - soundio.h (919, 20)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern int soundio_device_nearest_sample_rate([CTypeDetails("Pointer<SoundIoDevice>")]System.IntPtr @device, int @sample_rate);
|
|
||||||
|
|
||||||
// function soundio_outstream_create - soundio.h (929, 41)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern System.IntPtr soundio_outstream_create([CTypeDetails("Pointer<SoundIoDevice>")]System.IntPtr @device);
|
|
||||||
|
|
||||||
// function soundio_outstream_destroy - soundio.h (931, 21)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern void soundio_outstream_destroy([CTypeDetails("Pointer<SoundIoOutStream>")]System.IntPtr @outstream);
|
|
||||||
|
|
||||||
// function soundio_outstream_open - soundio.h (954, 20)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern int soundio_outstream_open([CTypeDetails("Pointer<SoundIoOutStream>")]System.IntPtr @outstream);
|
|
||||||
|
|
||||||
// function soundio_outstream_start - soundio.h (965, 20)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern int soundio_outstream_start([CTypeDetails("Pointer<SoundIoOutStream>")]System.IntPtr @outstream);
|
|
||||||
|
|
||||||
// function soundio_outstream_begin_write - soundio.h (997, 20)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern int soundio_outstream_begin_write([CTypeDetails("Pointer<SoundIoOutStream>")]System.IntPtr @outstream, [CTypeDetails("Pointer<System.IntPtr>")]System.IntPtr @areas, [CTypeDetails("Pointer<int>")]System.IntPtr @frame_count);
|
|
||||||
|
|
||||||
// function soundio_outstream_end_write - soundio.h (1009, 20)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern int soundio_outstream_end_write([CTypeDetails("Pointer<SoundIoOutStream>")]System.IntPtr @outstream);
|
|
||||||
|
|
||||||
// function soundio_outstream_clear_buffer - soundio.h (1024, 20)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern int soundio_outstream_clear_buffer([CTypeDetails("Pointer<SoundIoOutStream>")]System.IntPtr @outstream);
|
|
||||||
|
|
||||||
// function soundio_outstream_pause - soundio.h (1045, 20)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern int soundio_outstream_pause([CTypeDetails("Pointer<SoundIoOutStream>")]System.IntPtr @outstream, bool @pause);
|
|
||||||
|
|
||||||
// function soundio_outstream_get_latency - soundio.h (1058, 20)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern int soundio_outstream_get_latency([CTypeDetails("Pointer<SoundIoOutStream>")]System.IntPtr @outstream, [CTypeDetails("Pointer<double>")]System.IntPtr @out_latency);
|
|
||||||
|
|
||||||
// function soundio_outstream_set_volume - soundio.h (1061, 20)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern int soundio_outstream_set_volume([CTypeDetails("Pointer<SoundIoOutStream>")]System.IntPtr @outstream, double @volume);
|
|
||||||
|
|
||||||
// function soundio_instream_create - soundio.h (1071, 40)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern System.IntPtr soundio_instream_create([CTypeDetails("Pointer<SoundIoDevice>")]System.IntPtr @device);
|
|
||||||
|
|
||||||
// function soundio_instream_destroy - soundio.h (1073, 21)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern void soundio_instream_destroy([CTypeDetails("Pointer<SoundIoInStream>")]System.IntPtr @instream);
|
|
||||||
|
|
||||||
// function soundio_instream_open - soundio.h (1093, 20)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern int soundio_instream_open([CTypeDetails("Pointer<SoundIoInStream>")]System.IntPtr @instream);
|
|
||||||
|
|
||||||
// function soundio_instream_start - soundio.h (1102, 20)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern int soundio_instream_start([CTypeDetails("Pointer<SoundIoInStream>")]System.IntPtr @instream);
|
|
||||||
|
|
||||||
// function soundio_instream_begin_read - soundio.h (1133, 20)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern int soundio_instream_begin_read([CTypeDetails("Pointer<SoundIoInStream>")]System.IntPtr @instream, [CTypeDetails("Pointer<System.IntPtr>")]System.IntPtr @areas, [CTypeDetails("Pointer<int>")]System.IntPtr @frame_count);
|
|
||||||
|
|
||||||
// function soundio_instream_end_read - soundio.h (1143, 20)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern int soundio_instream_end_read([CTypeDetails("Pointer<SoundIoInStream>")]System.IntPtr @instream);
|
|
||||||
|
|
||||||
// function soundio_instream_pause - soundio.h (1156, 20)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern int soundio_instream_pause([CTypeDetails("Pointer<SoundIoInStream>")]System.IntPtr @instream, bool @pause);
|
|
||||||
|
|
||||||
// function soundio_instream_get_latency - soundio.h (1166, 20)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern int soundio_instream_get_latency([CTypeDetails("Pointer<SoundIoInStream>")]System.IntPtr @instream, [CTypeDetails("Pointer<double>")]System.IntPtr @out_latency);
|
|
||||||
|
|
||||||
// function soundio_ring_buffer_create - soundio.h (1181, 42)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern System.IntPtr soundio_ring_buffer_create([CTypeDetails("Pointer<SoundIo>")]System.IntPtr @soundio, int @requested_capacity);
|
|
||||||
|
|
||||||
// function soundio_ring_buffer_destroy - soundio.h (1182, 21)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern void soundio_ring_buffer_destroy([CTypeDetails("Pointer<SoundIoRingBuffer>")]System.IntPtr @ring_buffer);
|
|
||||||
|
|
||||||
// function soundio_ring_buffer_capacity - soundio.h (1186, 20)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern int soundio_ring_buffer_capacity([CTypeDetails("Pointer<SoundIoRingBuffer>")]System.IntPtr @ring_buffer);
|
|
||||||
|
|
||||||
// function soundio_ring_buffer_write_ptr - soundio.h (1189, 22)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern System.IntPtr soundio_ring_buffer_write_ptr([CTypeDetails("Pointer<SoundIoRingBuffer>")]System.IntPtr @ring_buffer);
|
|
||||||
|
|
||||||
// function soundio_ring_buffer_advance_write_ptr - soundio.h (1191, 21)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern void soundio_ring_buffer_advance_write_ptr([CTypeDetails("Pointer<SoundIoRingBuffer>")]System.IntPtr @ring_buffer, int @count);
|
|
||||||
|
|
||||||
// function soundio_ring_buffer_read_ptr - soundio.h (1194, 22)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern System.IntPtr soundio_ring_buffer_read_ptr([CTypeDetails("Pointer<SoundIoRingBuffer>")]System.IntPtr @ring_buffer);
|
|
||||||
|
|
||||||
// function soundio_ring_buffer_advance_read_ptr - soundio.h (1196, 21)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern void soundio_ring_buffer_advance_read_ptr([CTypeDetails("Pointer<SoundIoRingBuffer>")]System.IntPtr @ring_buffer, int @count);
|
|
||||||
|
|
||||||
// function soundio_ring_buffer_fill_count - soundio.h (1199, 20)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern int soundio_ring_buffer_fill_count([CTypeDetails("Pointer<SoundIoRingBuffer>")]System.IntPtr @ring_buffer);
|
|
||||||
|
|
||||||
// function soundio_ring_buffer_free_count - soundio.h (1202, 20)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern int soundio_ring_buffer_free_count([CTypeDetails("Pointer<SoundIoRingBuffer>")]System.IntPtr @ring_buffer);
|
|
||||||
|
|
||||||
// function soundio_ring_buffer_clear - soundio.h (1205, 21)
|
|
||||||
[DllImport(LibraryName)]
|
|
||||||
internal static extern void soundio_ring_buffer_clear([CTypeDetails("Pointer<SoundIoRingBuffer>")]System.IntPtr @ring_buffer);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
class Delegates
|
|
||||||
{
|
|
||||||
public delegate void delegate0(System.IntPtr p0);
|
|
||||||
public delegate void delegate1(System.IntPtr p0, int p1);
|
|
||||||
public delegate void delegate2();
|
|
||||||
public delegate void delegate3(System.IntPtr p0);
|
|
||||||
public delegate void delegate4(System.IntPtr p0, int p1, int p2);
|
|
||||||
public delegate void delegate5(System.IntPtr p0);
|
|
||||||
public delegate void delegate6(System.IntPtr p0, int p1);
|
|
||||||
public delegate void delegate7(System.IntPtr p0, int p1, int p2);
|
|
||||||
public delegate void delegate8(System.IntPtr p0);
|
|
||||||
public delegate void delegate9(System.IntPtr p0, int p1);
|
|
||||||
}
|
|
||||||
|
|
||||||
public struct Pointer<T>
|
|
||||||
{
|
|
||||||
public IntPtr Handle;
|
|
||||||
public static implicit operator IntPtr(Pointer<T> value) { return value.Handle; }
|
|
||||||
public static implicit operator Pointer<T>(IntPtr value) { return new Pointer<T>(value); }
|
|
||||||
|
|
||||||
public Pointer(IntPtr handle)
|
|
||||||
{
|
|
||||||
Handle = handle;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool Equals(object obj)
|
|
||||||
{
|
|
||||||
return obj is Pointer<T> && this == (Pointer<T>)obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int GetHashCode()
|
|
||||||
{
|
|
||||||
return (int)Handle;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool operator ==(Pointer<T> p1, Pointer<T> p2)
|
|
||||||
{
|
|
||||||
return p1.Handle == p2.Handle;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool operator !=(Pointer<T> p1, Pointer<T> p2)
|
|
||||||
{
|
|
||||||
return p1.Handle != p2.Handle;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public struct ArrayOf<T> { }
|
|
||||||
public struct ConstArrayOf<T> { }
|
|
||||||
public class CTypeDetailsAttribute : Attribute
|
|
||||||
{
|
|
||||||
public CTypeDetailsAttribute(string value)
|
|
||||||
{
|
|
||||||
Value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string Value { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,140 +0,0 @@
|
|||||||
//
|
|
||||||
// Copyright (c) 2019-2021 Ryujinx
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
//
|
|
||||||
|
|
||||||
using Ryujinx.Audio.Backends.Common;
|
|
||||||
using Ryujinx.Audio.Common;
|
|
||||||
using System;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace Ryujinx.Audio.Backends.CompatLayer
|
|
||||||
{
|
|
||||||
class CompatLayerHardwareDeviceSession : HardwareDeviceSessionOutputBase
|
|
||||||
{
|
|
||||||
private HardwareDeviceSessionOutputBase _realSession;
|
|
||||||
private uint _userChannelCount;
|
|
||||||
|
|
||||||
public CompatLayerHardwareDeviceSession(HardwareDeviceSessionOutputBase realSession, uint userChannelCount) : base(realSession.MemoryManager, realSession.RequestedSampleFormat, realSession.RequestedSampleRate, userChannelCount)
|
|
||||||
{
|
|
||||||
_realSession = realSession;
|
|
||||||
_userChannelCount = userChannelCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Dispose()
|
|
||||||
{
|
|
||||||
_realSession.Dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override ulong GetPlayedSampleCount()
|
|
||||||
{
|
|
||||||
return _realSession.GetPlayedSampleCount();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override float GetVolume()
|
|
||||||
{
|
|
||||||
return _realSession.GetVolume();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void PrepareToClose()
|
|
||||||
{
|
|
||||||
_realSession.PrepareToClose();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void QueueBuffer(AudioBuffer buffer)
|
|
||||||
{
|
|
||||||
_realSession.QueueBuffer(buffer);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool RegisterBuffer(AudioBuffer buffer, byte[] samples)
|
|
||||||
{
|
|
||||||
if (RequestedSampleFormat != SampleFormat.PcmInt16)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException("Downmixing formats other than PCM16 is not supported.");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (samples == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
short[] downmixedBufferPCM16;
|
|
||||||
|
|
||||||
ReadOnlySpan<short> samplesPCM16 = MemoryMarshal.Cast<byte, short>(samples);
|
|
||||||
|
|
||||||
if (_userChannelCount == 6)
|
|
||||||
{
|
|
||||||
downmixedBufferPCM16 = Downmixing.DownMixSurroundToStereo(samplesPCM16);
|
|
||||||
|
|
||||||
if (_realSession.RequestedChannelCount == 1)
|
|
||||||
{
|
|
||||||
downmixedBufferPCM16 = Downmixing.DownMixStereoToMono(downmixedBufferPCM16);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (_userChannelCount == 2 && _realSession.RequestedChannelCount == 1)
|
|
||||||
{
|
|
||||||
downmixedBufferPCM16 = Downmixing.DownMixStereoToMono(samplesPCM16);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
throw new NotImplementedException($"Downmixing from {_userChannelCount} to {_realSession.RequestedChannelCount} not implemented.");
|
|
||||||
}
|
|
||||||
|
|
||||||
byte[] downmixedBuffer = MemoryMarshal.Cast<short, byte>(downmixedBufferPCM16).ToArray();
|
|
||||||
|
|
||||||
AudioBuffer fakeBuffer = new AudioBuffer
|
|
||||||
{
|
|
||||||
BufferTag = buffer.BufferTag,
|
|
||||||
DataPointer = buffer.DataPointer,
|
|
||||||
DataSize = (ulong)downmixedBuffer.Length
|
|
||||||
};
|
|
||||||
|
|
||||||
bool result = _realSession.RegisterBuffer(fakeBuffer, downmixedBuffer);
|
|
||||||
|
|
||||||
if (result)
|
|
||||||
{
|
|
||||||
buffer.Data = fakeBuffer.Data;
|
|
||||||
buffer.DataSize = fakeBuffer.DataSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void SetVolume(float volume)
|
|
||||||
{
|
|
||||||
_realSession.SetVolume(volume);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Start()
|
|
||||||
{
|
|
||||||
_realSession.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Stop()
|
|
||||||
{
|
|
||||||
_realSession.Stop();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void UnregisterBuffer(AudioBuffer buffer)
|
|
||||||
{
|
|
||||||
_realSession.UnregisterBuffer(buffer);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool WasBufferFullyConsumed(AudioBuffer buffer)
|
|
||||||
{
|
|
||||||
return _realSession.WasBufferFullyConsumed(buffer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,35 +0,0 @@
|
|||||||
//
|
|
||||||
// Copyright (c) 2019-2021 Ryujinx
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
//
|
|
||||||
|
|
||||||
namespace Ryujinx.Audio.Common
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Audio device state.
|
|
||||||
/// </summary>
|
|
||||||
public enum AudioDeviceState : uint
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The audio device is started.
|
|
||||||
/// </summary>
|
|
||||||
Started,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The audio device is stopped.
|
|
||||||
/// </summary>
|
|
||||||
Stopped
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,45 +0,0 @@
|
|||||||
//
|
|
||||||
// Copyright (c) 2019-2021 Ryujinx
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
//
|
|
||||||
|
|
||||||
using Ryujinx.Audio.Common;
|
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace Ryujinx.Audio.Integration
|
|
||||||
{
|
|
||||||
public interface IHardwareDeviceSession : IDisposable
|
|
||||||
{
|
|
||||||
bool RegisterBuffer(AudioBuffer buffer);
|
|
||||||
|
|
||||||
void UnregisterBuffer(AudioBuffer buffer);
|
|
||||||
|
|
||||||
void QueueBuffer(AudioBuffer buffer);
|
|
||||||
|
|
||||||
bool WasBufferFullyConsumed(AudioBuffer buffer);
|
|
||||||
|
|
||||||
void SetVolume(float volume);
|
|
||||||
|
|
||||||
float GetVolume();
|
|
||||||
|
|
||||||
ulong GetPlayedSampleCount();
|
|
||||||
|
|
||||||
void Start();
|
|
||||||
|
|
||||||
void Stop();
|
|
||||||
|
|
||||||
void PrepareToClose();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,35 +0,0 @@
|
|||||||
//
|
|
||||||
// Copyright (c) 2019-2021 Ryujinx
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
//
|
|
||||||
|
|
||||||
namespace Ryujinx.Audio.Integration
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Represent a writable event with manual clear.
|
|
||||||
/// </summary>
|
|
||||||
public interface IWritableEvent
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Signal the event.
|
|
||||||
/// </summary>
|
|
||||||
void Signal();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Clear the signaled state of the event.
|
|
||||||
/// </summary>
|
|
||||||
void Clear();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,165 +0,0 @@
|
|||||||
GNU LESSER GENERAL PUBLIC LICENSE
|
|
||||||
Version 3, 29 June 2007
|
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
|
|
||||||
This version of the GNU Lesser General Public License incorporates
|
|
||||||
the terms and conditions of version 3 of the GNU General Public
|
|
||||||
License, supplemented by the additional permissions listed below.
|
|
||||||
|
|
||||||
0. Additional Definitions.
|
|
||||||
|
|
||||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
|
||||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
|
||||||
General Public License.
|
|
||||||
|
|
||||||
"The Library" refers to a covered work governed by this License,
|
|
||||||
other than an Application or a Combined Work as defined below.
|
|
||||||
|
|
||||||
An "Application" is any work that makes use of an interface provided
|
|
||||||
by the Library, but which is not otherwise based on the Library.
|
|
||||||
Defining a subclass of a class defined by the Library is deemed a mode
|
|
||||||
of using an interface provided by the Library.
|
|
||||||
|
|
||||||
A "Combined Work" is a work produced by combining or linking an
|
|
||||||
Application with the Library. The particular version of the Library
|
|
||||||
with which the Combined Work was made is also called the "Linked
|
|
||||||
Version".
|
|
||||||
|
|
||||||
The "Minimal Corresponding Source" for a Combined Work means the
|
|
||||||
Corresponding Source for the Combined Work, excluding any source code
|
|
||||||
for portions of the Combined Work that, considered in isolation, are
|
|
||||||
based on the Application, and not on the Linked Version.
|
|
||||||
|
|
||||||
The "Corresponding Application Code" for a Combined Work means the
|
|
||||||
object code and/or source code for the Application, including any data
|
|
||||||
and utility programs needed for reproducing the Combined Work from the
|
|
||||||
Application, but excluding the System Libraries of the Combined Work.
|
|
||||||
|
|
||||||
1. Exception to Section 3 of the GNU GPL.
|
|
||||||
|
|
||||||
You may convey a covered work under sections 3 and 4 of this License
|
|
||||||
without being bound by section 3 of the GNU GPL.
|
|
||||||
|
|
||||||
2. Conveying Modified Versions.
|
|
||||||
|
|
||||||
If you modify a copy of the Library, and, in your modifications, a
|
|
||||||
facility refers to a function or data to be supplied by an Application
|
|
||||||
that uses the facility (other than as an argument passed when the
|
|
||||||
facility is invoked), then you may convey a copy of the modified
|
|
||||||
version:
|
|
||||||
|
|
||||||
a) under this License, provided that you make a good faith effort to
|
|
||||||
ensure that, in the event an Application does not supply the
|
|
||||||
function or data, the facility still operates, and performs
|
|
||||||
whatever part of its purpose remains meaningful, or
|
|
||||||
|
|
||||||
b) under the GNU GPL, with none of the additional permissions of
|
|
||||||
this License applicable to that copy.
|
|
||||||
|
|
||||||
3. Object Code Incorporating Material from Library Header Files.
|
|
||||||
|
|
||||||
The object code form of an Application may incorporate material from
|
|
||||||
a header file that is part of the Library. You may convey such object
|
|
||||||
code under terms of your choice, provided that, if the incorporated
|
|
||||||
material is not limited to numerical parameters, data structure
|
|
||||||
layouts and accessors, or small macros, inline functions and templates
|
|
||||||
(ten or fewer lines in length), you do both of the following:
|
|
||||||
|
|
||||||
a) Give prominent notice with each copy of the object code that the
|
|
||||||
Library is used in it and that the Library and its use are
|
|
||||||
covered by this License.
|
|
||||||
|
|
||||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
|
||||||
document.
|
|
||||||
|
|
||||||
4. Combined Works.
|
|
||||||
|
|
||||||
You may convey a Combined Work under terms of your choice that,
|
|
||||||
taken together, effectively do not restrict modification of the
|
|
||||||
portions of the Library contained in the Combined Work and reverse
|
|
||||||
engineering for debugging such modifications, if you also do each of
|
|
||||||
the following:
|
|
||||||
|
|
||||||
a) Give prominent notice with each copy of the Combined Work that
|
|
||||||
the Library is used in it and that the Library and its use are
|
|
||||||
covered by this License.
|
|
||||||
|
|
||||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
|
||||||
document.
|
|
||||||
|
|
||||||
c) For a Combined Work that displays copyright notices during
|
|
||||||
execution, include the copyright notice for the Library among
|
|
||||||
these notices, as well as a reference directing the user to the
|
|
||||||
copies of the GNU GPL and this license document.
|
|
||||||
|
|
||||||
d) Do one of the following:
|
|
||||||
|
|
||||||
0) Convey the Minimal Corresponding Source under the terms of this
|
|
||||||
License, and the Corresponding Application Code in a form
|
|
||||||
suitable for, and under terms that permit, the user to
|
|
||||||
recombine or relink the Application with a modified version of
|
|
||||||
the Linked Version to produce a modified Combined Work, in the
|
|
||||||
manner specified by section 6 of the GNU GPL for conveying
|
|
||||||
Corresponding Source.
|
|
||||||
|
|
||||||
1) Use a suitable shared library mechanism for linking with the
|
|
||||||
Library. A suitable mechanism is one that (a) uses at run time
|
|
||||||
a copy of the Library already present on the user's computer
|
|
||||||
system, and (b) will operate properly with a modified version
|
|
||||||
of the Library that is interface-compatible with the Linked
|
|
||||||
Version.
|
|
||||||
|
|
||||||
e) Provide Installation Information, but only if you would otherwise
|
|
||||||
be required to provide such information under section 6 of the
|
|
||||||
GNU GPL, and only to the extent that such information is
|
|
||||||
necessary to install and execute a modified version of the
|
|
||||||
Combined Work produced by recombining or relinking the
|
|
||||||
Application with a modified version of the Linked Version. (If
|
|
||||||
you use option 4d0, the Installation Information must accompany
|
|
||||||
the Minimal Corresponding Source and Corresponding Application
|
|
||||||
Code. If you use option 4d1, you must provide the Installation
|
|
||||||
Information in the manner specified by section 6 of the GNU GPL
|
|
||||||
for conveying Corresponding Source.)
|
|
||||||
|
|
||||||
5. Combined Libraries.
|
|
||||||
|
|
||||||
You may place library facilities that are a work based on the
|
|
||||||
Library side by side in a single library together with other library
|
|
||||||
facilities that are not Applications and are not covered by this
|
|
||||||
License, and convey such a combined library under terms of your
|
|
||||||
choice, if you do both of the following:
|
|
||||||
|
|
||||||
a) Accompany the combined library with a copy of the same work based
|
|
||||||
on the Library, uncombined with any other library facilities,
|
|
||||||
conveyed under the terms of this License.
|
|
||||||
|
|
||||||
b) Give prominent notice with the combined library that part of it
|
|
||||||
is a work based on the Library, and explaining where to find the
|
|
||||||
accompanying uncombined form of the same work.
|
|
||||||
|
|
||||||
6. Revised Versions of the GNU Lesser General Public License.
|
|
||||||
|
|
||||||
The Free Software Foundation may publish revised and/or new versions
|
|
||||||
of the GNU Lesser General Public License from time to time. Such new
|
|
||||||
versions will be similar in spirit to the present version, but may
|
|
||||||
differ in detail to address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the
|
|
||||||
Library as you received it specifies that a certain numbered version
|
|
||||||
of the GNU Lesser General Public License "or any later version"
|
|
||||||
applies to it, you have the option of following the terms and
|
|
||||||
conditions either of that published version or of any later version
|
|
||||||
published by the Free Software Foundation. If the Library as you
|
|
||||||
received it does not specify a version number of the GNU Lesser
|
|
||||||
General Public License, you may choose any version of the GNU Lesser
|
|
||||||
General Public License ever published by the Free Software Foundation.
|
|
||||||
|
|
||||||
If the Library as you received it specifies that a proxy can decide
|
|
||||||
whether future versions of the GNU Lesser General Public License shall
|
|
||||||
apply, that proxy's public statement of acceptance of any version is
|
|
||||||
permanent authorization for you to choose that version for the
|
|
||||||
Library.
|
|
@ -1,30 +0,0 @@
|
|||||||
//
|
|
||||||
// Copyright (c) 2019-2021 Ryujinx
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
//
|
|
||||||
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace Ryujinx.Audio.Renderer.Common
|
|
||||||
{
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
|
||||||
public struct AuxiliaryBufferAddresses
|
|
||||||
{
|
|
||||||
public ulong SendBufferInfo;
|
|
||||||
public ulong SendBufferInfoBase;
|
|
||||||
public ulong ReturnBufferInfo;
|
|
||||||
public ulong ReturnBufferInfoBase;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,36 +0,0 @@
|
|||||||
//
|
|
||||||
// Copyright (c) 2019-2021 Ryujinx
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
//
|
|
||||||
|
|
||||||
namespace Ryujinx.Audio.Renderer.Common
|
|
||||||
{
|
|
||||||
public enum PerformanceDetailType : byte
|
|
||||||
{
|
|
||||||
Unknown,
|
|
||||||
PcmInt16,
|
|
||||||
Adpcm,
|
|
||||||
VolumeRamp,
|
|
||||||
BiquadFilter,
|
|
||||||
Mix,
|
|
||||||
Delay,
|
|
||||||
Aux,
|
|
||||||
Reverb,
|
|
||||||
Reverb3d,
|
|
||||||
PcmFloat,
|
|
||||||
Limiter,
|
|
||||||
CaptureBuffer
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,28 +0,0 @@
|
|||||||
//
|
|
||||||
// Copyright (c) 2019-2021 Ryujinx
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
//
|
|
||||||
|
|
||||||
namespace Ryujinx.Audio.Renderer.Common
|
|
||||||
{
|
|
||||||
public enum PerformanceEntryType : byte
|
|
||||||
{
|
|
||||||
Invalid,
|
|
||||||
Voice,
|
|
||||||
SubMix,
|
|
||||||
FinalMix,
|
|
||||||
Sink
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,40 +0,0 @@
|
|||||||
//
|
|
||||||
// Copyright (c) 2019-2021 Ryujinx
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
//
|
|
||||||
|
|
||||||
namespace Ryujinx.Audio.Renderer.Common
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Common play state.
|
|
||||||
/// </summary>
|
|
||||||
public enum PlayState : byte
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The user request the voice to be started.
|
|
||||||
/// </summary>
|
|
||||||
Start,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The user request the voice to be stopped.
|
|
||||||
/// </summary>
|
|
||||||
Stop,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The user request the voice to be paused.
|
|
||||||
/// </summary>
|
|
||||||
Pause
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,40 +0,0 @@
|
|||||||
//
|
|
||||||
// Copyright (c) 2019-2021 Ryujinx
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
//
|
|
||||||
|
|
||||||
namespace Ryujinx.Audio.Renderer.Common
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The type of a sink.
|
|
||||||
/// </summary>
|
|
||||||
public enum SinkType : byte
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The sink is in an invalid state.
|
|
||||||
/// </summary>
|
|
||||||
Invalid,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The sink is a device.
|
|
||||||
/// </summary>
|
|
||||||
Device,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The sink is a circular buffer.
|
|
||||||
/// </summary>
|
|
||||||
CircularBuffer
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,41 +0,0 @@
|
|||||||
//
|
|
||||||
// Copyright (c) 2019-2021 Ryujinx
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
//
|
|
||||||
|
|
||||||
namespace Ryujinx.Audio.Renderer.Dsp.Command
|
|
||||||
{
|
|
||||||
public class ClearMixBufferCommand : ICommand
|
|
||||||
{
|
|
||||||
public bool Enabled { get; set; }
|
|
||||||
|
|
||||||
public int NodeId { get; }
|
|
||||||
|
|
||||||
public CommandType CommandType => CommandType.ClearMixBuffer;
|
|
||||||
|
|
||||||
public ulong EstimatedProcessingTime { get; set; }
|
|
||||||
|
|
||||||
public ClearMixBufferCommand(int nodeId)
|
|
||||||
{
|
|
||||||
Enabled = true;
|
|
||||||
NodeId = nodeId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Process(CommandList context)
|
|
||||||
{
|
|
||||||
context.ClearBuffers();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,49 +0,0 @@
|
|||||||
//
|
|
||||||
// Copyright (c) 2019-2021 Ryujinx
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
//
|
|
||||||
|
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace Ryujinx.Audio.Renderer.Dsp.Command
|
|
||||||
{
|
|
||||||
public class CopyMixBufferCommand : ICommand
|
|
||||||
{
|
|
||||||
public bool Enabled { get; set; }
|
|
||||||
|
|
||||||
public int NodeId { get; }
|
|
||||||
|
|
||||||
public CommandType CommandType => CommandType.CopyMixBuffer;
|
|
||||||
|
|
||||||
public ulong EstimatedProcessingTime { get; set; }
|
|
||||||
|
|
||||||
public ushort InputBufferIndex { get; }
|
|
||||||
public ushort OutputBufferIndex { get; }
|
|
||||||
|
|
||||||
public CopyMixBufferCommand(uint inputBufferIndex, uint outputBufferIndex, int nodeId)
|
|
||||||
{
|
|
||||||
Enabled = true;
|
|
||||||
NodeId = nodeId;
|
|
||||||
|
|
||||||
InputBufferIndex = (ushort)inputBufferIndex;
|
|
||||||
OutputBufferIndex = (ushort)outputBufferIndex;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Process(CommandList context)
|
|
||||||
{
|
|
||||||
context.CopyBuffer(OutputBufferIndex, InputBufferIndex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,37 +0,0 @@
|
|||||||
//
|
|
||||||
// Copyright (c) 2019-2021 Ryujinx
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
//
|
|
||||||
|
|
||||||
namespace Ryujinx.Audio.Renderer.Dsp.Command
|
|
||||||
{
|
|
||||||
public interface ICommand
|
|
||||||
{
|
|
||||||
public bool Enabled { get; set; }
|
|
||||||
|
|
||||||
public int NodeId { get; }
|
|
||||||
|
|
||||||
public CommandType CommandType { get; }
|
|
||||||
|
|
||||||
public ulong EstimatedProcessingTime { get; }
|
|
||||||
|
|
||||||
public void Process(CommandList context);
|
|
||||||
|
|
||||||
public bool ShouldMeter()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,29 +0,0 @@
|
|||||||
//
|
|
||||||
// Copyright (c) 2019-2021 Ryujinx
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
//
|
|
||||||
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace Ryujinx.Audio.Renderer.Dsp.State
|
|
||||||
{
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 1, Size = 6)]
|
|
||||||
public struct AdpcmLoopContext
|
|
||||||
{
|
|
||||||
public short PredScale;
|
|
||||||
public short History0;
|
|
||||||
public short History1;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,30 +0,0 @@
|
|||||||
//
|
|
||||||
// Copyright (c) 2019-2021 Ryujinx
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
//
|
|
||||||
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace Ryujinx.Audio.Renderer.Dsp.State
|
|
||||||
{
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 1, Size = 0x10)]
|
|
||||||
public struct BiquadFilterState
|
|
||||||
{
|
|
||||||
public float State0;
|
|
||||||
public float State1;
|
|
||||||
public float State2;
|
|
||||||
public float State3;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,47 +0,0 @@
|
|||||||
//
|
|
||||||
// Copyright (c) 2019-2021 Ryujinx
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
//
|
|
||||||
|
|
||||||
using Ryujinx.Audio.Renderer.Parameter.Effect;
|
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace Ryujinx.Audio.Renderer.Dsp.State
|
|
||||||
{
|
|
||||||
public class LimiterState
|
|
||||||
{
|
|
||||||
public float[] DectectorAverage;
|
|
||||||
public float[] CompressionGain;
|
|
||||||
public float[] DelayedSampleBuffer;
|
|
||||||
public int[] DelayedSampleBufferPosition;
|
|
||||||
|
|
||||||
public LimiterState(ref LimiterParameter parameter, ulong workBuffer)
|
|
||||||
{
|
|
||||||
DectectorAverage = new float[parameter.ChannelCount];
|
|
||||||
CompressionGain = new float[parameter.ChannelCount];
|
|
||||||
DelayedSampleBuffer = new float[parameter.ChannelCount * parameter.DelayBufferSampleCountMax];
|
|
||||||
DelayedSampleBufferPosition = new int[parameter.ChannelCount];
|
|
||||||
|
|
||||||
DectectorAverage.AsSpan().Fill(0.0f);
|
|
||||||
CompressionGain.AsSpan().Fill(1.0f);
|
|
||||||
DelayedSampleBufferPosition.AsSpan().Fill(0);
|
|
||||||
DelayedSampleBuffer.AsSpan().Fill(0.0f);
|
|
||||||
|
|
||||||
UpdateParameter(ref parameter);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void UpdateParameter(ref LimiterParameter parameter) {}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,48 +0,0 @@
|
|||||||
//
|
|
||||||
// Copyright (c) 2019-2021 Ryujinx
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
//
|
|
||||||
|
|
||||||
using Ryujinx.Common.Memory;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace Ryujinx.Audio.Renderer.Parameter.Effect
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Effect result state for <seealso cref="Common.EffectType.Limiter"/>.
|
|
||||||
/// </summary>
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
|
||||||
public struct LimiterStatistics
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The max input sample value recorded by the limiter.
|
|
||||||
/// </summary>
|
|
||||||
public Array6<float> InputMax;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Compression gain min value.
|
|
||||||
/// </summary>
|
|
||||||
public Array6<float> CompressionGainMin;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Reset the statistics.
|
|
||||||
/// </summary>
|
|
||||||
public void Reset()
|
|
||||||
{
|
|
||||||
InputMax.ToSpan().Fill(0.0f);
|
|
||||||
CompressionGainMin.ToSpan().Fill(1.0f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,40 +0,0 @@
|
|||||||
//
|
|
||||||
// Copyright (c) 2019-2021 Ryujinx
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
//
|
|
||||||
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace Ryujinx.Audio.Renderer.Parameter
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Output information for an effect version 1.
|
|
||||||
/// </summary>
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
|
||||||
public struct EffectOutStatusVersion1 : IEffectOutStatus
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Current effect state.
|
|
||||||
/// </summary>
|
|
||||||
public EffectState State;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unused/Reserved.
|
|
||||||
/// </summary>
|
|
||||||
private unsafe fixed byte _reserved[15];
|
|
||||||
|
|
||||||
EffectState IEffectOutStatus.State { get => State; set => State = value; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,35 +0,0 @@
|
|||||||
//
|
|
||||||
// Copyright (c) 2019-2021 Ryujinx
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
//
|
|
||||||
|
|
||||||
namespace Ryujinx.Audio.Renderer.Parameter
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The state of an effect.
|
|
||||||
/// </summary>
|
|
||||||
public enum EffectState : byte
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The effect is enabled.
|
|
||||||
/// </summary>
|
|
||||||
Enabled = 3,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The effect is disabled.
|
|
||||||
/// </summary>
|
|
||||||
Disabled = 4
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,30 +0,0 @@
|
|||||||
//
|
|
||||||
// Copyright (c) 2019-2021 Ryujinx
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
//
|
|
||||||
|
|
||||||
namespace Ryujinx.Audio.Renderer.Parameter
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Generic interface to represent output information for an effect.
|
|
||||||
/// </summary>
|
|
||||||
public interface IEffectOutStatus
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Current effect state.
|
|
||||||
/// </summary>
|
|
||||||
EffectState State { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,39 +0,0 @@
|
|||||||
//
|
|
||||||
// Copyright (c) 2019-2021 Ryujinx
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
//
|
|
||||||
|
|
||||||
using Ryujinx.Audio.Renderer.Common;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace Ryujinx.Audio.Renderer.Parameter
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Output information for a memory pool.
|
|
||||||
/// </summary>
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
|
||||||
public struct MemoryPoolOutStatus
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The current server memory pool state.
|
|
||||||
/// </summary>
|
|
||||||
public MemoryPoolUserState State;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Reserved/unused.
|
|
||||||
/// </summary>
|
|
||||||
private unsafe fixed uint _reserved[3];
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,38 +0,0 @@
|
|||||||
//
|
|
||||||
// Copyright (c) 2019-2021 Ryujinx
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
//
|
|
||||||
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace Ryujinx.Audio.Renderer.Parameter.Performance
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Input information for performance monitoring.
|
|
||||||
/// </summary>
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
|
||||||
public struct PerformanceInParameter
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The target node id to monitor performance on.
|
|
||||||
/// </summary>
|
|
||||||
public int TargetNodeId;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Reserved/unused.
|
|
||||||
/// </summary>
|
|
||||||
private unsafe fixed uint _reserved[3];
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,38 +0,0 @@
|
|||||||
//
|
|
||||||
// Copyright (c) 2019-2021 Ryujinx
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
//
|
|
||||||
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace Ryujinx.Audio.Renderer.Parameter.Performance
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Output information for performance monitoring.
|
|
||||||
/// </summary>
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
|
||||||
public struct PerformanceOutStatus
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Indicates the total size output to the performance buffer.
|
|
||||||
/// </summary>
|
|
||||||
public uint HistorySize;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Reserved/unused.
|
|
||||||
/// </summary>
|
|
||||||
private unsafe fixed uint _reserved[3];
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,38 +0,0 @@
|
|||||||
//
|
|
||||||
// Copyright (c) 2019-2021 Ryujinx
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
//
|
|
||||||
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace Ryujinx.Audio.Renderer.Parameter
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Renderer output information on REV5 and later.
|
|
||||||
/// </summary>
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
|
||||||
public struct RendererInfoOutStatus
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The count of updates sent to the <see cref="Dsp.AudioProcessor"/>.
|
|
||||||
/// </summary>
|
|
||||||
public ulong ElapsedFrameCount;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Reserved/Unused.
|
|
||||||
/// </summary>
|
|
||||||
private ulong _reserved;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,43 +0,0 @@
|
|||||||
//
|
|
||||||
// Copyright (c) 2019-2021 Ryujinx
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
//
|
|
||||||
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace Ryujinx.Audio.Renderer.Parameter
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Output information for a sink.
|
|
||||||
/// </summary>
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
|
||||||
public struct SinkOutStatus
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Last written offset if the sink type is <see cref="Common.SinkType.CircularBuffer"/>.
|
|
||||||
/// </summary>
|
|
||||||
public uint LastWrittenOffset;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Reserved/padding.
|
|
||||||
/// </summary>
|
|
||||||
private uint _padding;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Reserved/padding.
|
|
||||||
/// </summary>
|
|
||||||
private unsafe fixed ulong _reserved[3];
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,45 +0,0 @@
|
|||||||
//
|
|
||||||
// Copyright (c) 2019-2021 Ryujinx
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
//
|
|
||||||
|
|
||||||
namespace Ryujinx.Audio.Renderer.Server.Effect
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The usage state of an effect.
|
|
||||||
/// </summary>
|
|
||||||
public enum UsageState : byte
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The effect is in an invalid state.
|
|
||||||
/// </summary>
|
|
||||||
Invalid,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The effect is new.
|
|
||||||
/// </summary>
|
|
||||||
New,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The effect is enabled.
|
|
||||||
/// </summary>
|
|
||||||
Enabled,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The effect is disabled.
|
|
||||||
/// </summary>
|
|
||||||
Disabled
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,36 +0,0 @@
|
|||||||
//
|
|
||||||
// Copyright (c) 2019-2021 Ryujinx
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
//
|
|
||||||
|
|
||||||
namespace Ryujinx.Audio.Renderer.Server.Types
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The execution mode of an <see cref="AudioRenderSystem"/>.
|
|
||||||
/// </summary>
|
|
||||||
public enum AudioRendererExecutionMode : byte
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Automatically send commands to the DSP at a fixed rate (see <see cref="AudioRenderSystem.SendCommands"/>
|
|
||||||
/// </summary>
|
|
||||||
Auto,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Audio renderer operation needs to be done manually via ExecuteAudioRenderer.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>This is not supported on the DSP and is as such stubbed.</remarks>
|
|
||||||
Manual
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,41 +0,0 @@
|
|||||||
//
|
|
||||||
// Copyright (c) 2019-2021 Ryujinx
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
//
|
|
||||||
|
|
||||||
namespace Ryujinx.Audio.Renderer.Server.Types
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The rendering device of an <see cref="AudioRenderSystem"/>.
|
|
||||||
/// </summary>
|
|
||||||
public enum AudioRendererRenderingDevice : byte
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Rendering is performed on the DSP.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// Only supports <see cref="AudioRendererExecutionMode.Auto"/>.
|
|
||||||
/// </remarks>
|
|
||||||
Dsp,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Rendering is performed on the CPU.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// Only supports <see cref="AudioRendererExecutionMode.Manual"/>.
|
|
||||||
/// </remarks>
|
|
||||||
Cpu
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,38 +0,0 @@
|
|||||||
//
|
|
||||||
// Copyright (c) 2019-2021 Ryujinx
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
//
|
|
||||||
|
|
||||||
namespace Ryujinx.Audio
|
|
||||||
{
|
|
||||||
public enum ResultCode
|
|
||||||
{
|
|
||||||
ModuleId = 153,
|
|
||||||
ErrorCodeShift = 9,
|
|
||||||
|
|
||||||
Success = 0,
|
|
||||||
|
|
||||||
DeviceNotFound = (1 << ErrorCodeShift) | ModuleId,
|
|
||||||
OperationFailed = (2 << ErrorCodeShift) | ModuleId,
|
|
||||||
UnsupportedSampleRate = (3 << ErrorCodeShift) | ModuleId,
|
|
||||||
WorkBufferTooSmall = (4 << ErrorCodeShift) | ModuleId,
|
|
||||||
BufferRingFull = (8 << ErrorCodeShift) | ModuleId,
|
|
||||||
UnsupportedChannelConfiguration = (10 << ErrorCodeShift) | ModuleId,
|
|
||||||
InvalidUpdateInfo = (41 << ErrorCodeShift) | ModuleId,
|
|
||||||
InvalidAddressInfo = (42 << ErrorCodeShift) | ModuleId,
|
|
||||||
InvalidMixSorting = (43 << ErrorCodeShift) | ModuleId,
|
|
||||||
UnsupportedOperation = (513 << ErrorCodeShift) | ModuleId,
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,9 +0,0 @@
|
|||||||
namespace Ryujinx.Common.Configuration
|
|
||||||
{
|
|
||||||
public enum BackendThreading
|
|
||||||
{
|
|
||||||
Auto,
|
|
||||||
Off,
|
|
||||||
On
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace Ryujinx.Common.Configuration
|
|
||||||
{
|
|
||||||
public struct DlcContainer
|
|
||||||
{
|
|
||||||
public string Path { get; set; }
|
|
||||||
public List<DlcNca> DlcNcaList { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,9 +0,0 @@
|
|||||||
namespace Ryujinx.Common.Configuration
|
|
||||||
{
|
|
||||||
public struct DlcNca
|
|
||||||
{
|
|
||||||
public string Path { get; set; }
|
|
||||||
public ulong TitleId { get; set; }
|
|
||||||
public bool Enabled { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,9 +0,0 @@
|
|||||||
namespace Ryujinx.Common.Configuration.Hid.Controller.Motion
|
|
||||||
{
|
|
||||||
public enum MotionInputBackendType : byte
|
|
||||||
{
|
|
||||||
Invalid,
|
|
||||||
GamepadDriver,
|
|
||||||
CemuHook
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,11 +0,0 @@
|
|||||||
namespace Ryujinx.Common.Configuration.Hid.Controller
|
|
||||||
{
|
|
||||||
public enum StickInputId : byte
|
|
||||||
{
|
|
||||||
Unbound,
|
|
||||||
Left,
|
|
||||||
Right,
|
|
||||||
|
|
||||||
Count
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,9 +0,0 @@
|
|||||||
namespace Ryujinx.Common.Configuration.Hid
|
|
||||||
{
|
|
||||||
public enum InputBackendType
|
|
||||||
{
|
|
||||||
Invalid,
|
|
||||||
WindowKeyboard,
|
|
||||||
GamepadSDL2,
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,11 +0,0 @@
|
|||||||
namespace Ryujinx.Common.Configuration.Hid
|
|
||||||
{
|
|
||||||
public struct KeyboardHotkeys
|
|
||||||
{
|
|
||||||
public Key ToggleVsync { get; set; }
|
|
||||||
public Key Screenshot { get; set; }
|
|
||||||
public Key ShowUi { get; set; }
|
|
||||||
public Key Pause { get; set; }
|
|
||||||
public Key ToggleMute { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,9 +0,0 @@
|
|||||||
namespace Ryujinx.Common.Configuration
|
|
||||||
{
|
|
||||||
public enum MemoryManagerMode : byte
|
|
||||||
{
|
|
||||||
SoftwarePageTable,
|
|
||||||
HostMapped,
|
|
||||||
HostMappedUnsafe
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,57 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.IO;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace Ryujinx.Common
|
|
||||||
{
|
|
||||||
public static class BinaryReaderExtensions
|
|
||||||
{
|
|
||||||
public unsafe static T ReadStruct<T>(this BinaryReader reader)
|
|
||||||
where T : struct
|
|
||||||
{
|
|
||||||
int size = Marshal.SizeOf<T>();
|
|
||||||
|
|
||||||
byte[] data = reader.ReadBytes(size);
|
|
||||||
|
|
||||||
fixed (byte* ptr = data)
|
|
||||||
{
|
|
||||||
return Marshal.PtrToStructure<T>((IntPtr)ptr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public unsafe static T[] ReadStructArray<T>(this BinaryReader reader, int count)
|
|
||||||
where T : struct
|
|
||||||
{
|
|
||||||
int size = Marshal.SizeOf<T>();
|
|
||||||
|
|
||||||
T[] result = new T[count];
|
|
||||||
|
|
||||||
for (int i = 0; i < count; i++)
|
|
||||||
{
|
|
||||||
byte[] data = reader.ReadBytes(size);
|
|
||||||
|
|
||||||
fixed (byte* ptr = data)
|
|
||||||
{
|
|
||||||
result[i] = Marshal.PtrToStructure<T>((IntPtr)ptr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public unsafe static void WriteStruct<T>(this BinaryWriter writer, T value)
|
|
||||||
where T : struct
|
|
||||||
{
|
|
||||||
long size = Marshal.SizeOf<T>();
|
|
||||||
|
|
||||||
byte[] data = new byte[size];
|
|
||||||
|
|
||||||
fixed (byte* ptr = data)
|
|
||||||
{
|
|
||||||
Marshal.StructureToPtr<T>(value, (IntPtr)ptr, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
writer.Write(data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,80 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Reflection;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace Ryujinx.Common.Logging
|
|
||||||
{
|
|
||||||
internal class DefaultLogFormatter : ILogFormatter
|
|
||||||
{
|
|
||||||
private static readonly ObjectPool<StringBuilder> _stringBuilderPool = SharedPools.Default<StringBuilder>();
|
|
||||||
|
|
||||||
public string Format(LogEventArgs args)
|
|
||||||
{
|
|
||||||
StringBuilder sb = _stringBuilderPool.Allocate();
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
sb.Clear();
|
|
||||||
|
|
||||||
sb.AppendFormat(@"{0:hh\:mm\:ss\.fff}", args.Time);
|
|
||||||
sb.Append($" |{args.Level.ToString()[0]}| ");
|
|
||||||
|
|
||||||
if (args.ThreadName != null)
|
|
||||||
{
|
|
||||||
sb.Append(args.ThreadName);
|
|
||||||
sb.Append(' ');
|
|
||||||
}
|
|
||||||
|
|
||||||
sb.Append(args.Message);
|
|
||||||
|
|
||||||
if (args.Data != null)
|
|
||||||
{
|
|
||||||
PropertyInfo[] props = args.Data.GetType().GetProperties();
|
|
||||||
|
|
||||||
sb.Append(" {");
|
|
||||||
|
|
||||||
foreach (var prop in props)
|
|
||||||
{
|
|
||||||
sb.Append(prop.Name);
|
|
||||||
sb.Append(": ");
|
|
||||||
|
|
||||||
if (typeof(Array).IsAssignableFrom(prop.PropertyType))
|
|
||||||
{
|
|
||||||
Array array = (Array)prop.GetValue(args.Data);
|
|
||||||
foreach (var item in array)
|
|
||||||
{
|
|
||||||
sb.Append(item.ToString());
|
|
||||||
sb.Append(", ");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (array.Length > 0)
|
|
||||||
{
|
|
||||||
sb.Remove(sb.Length - 2, 2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sb.Append(prop.GetValue(args.Data));
|
|
||||||
}
|
|
||||||
|
|
||||||
sb.Append(" ; ");
|
|
||||||
}
|
|
||||||
|
|
||||||
// We remove the final ';' from the string
|
|
||||||
if (props.Length > 0)
|
|
||||||
{
|
|
||||||
sb.Remove(sb.Length - 3, 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
sb.Append('}');
|
|
||||||
}
|
|
||||||
|
|
||||||
return sb.ToString();
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
_stringBuilderPool.Release(sb);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="MsgPack.Cli" Version="1.0.1" />
|
|
||||||
<PackageReference Include="System.Drawing.Common" Version="6.0.0" />
|
|
||||||
<PackageReference Include="System.Management" Version="6.0.0" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
@ -1,52 +0,0 @@
|
|||||||
using Ryujinx.Common.Logging;
|
|
||||||
using System;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Runtime.Versioning;
|
|
||||||
|
|
||||||
namespace Ryujinx.Common.System
|
|
||||||
{
|
|
||||||
public static class ForceDpiAware
|
|
||||||
{
|
|
||||||
[DllImport("user32.dll")]
|
|
||||||
private static extern bool SetProcessDPIAware();
|
|
||||||
|
|
||||||
private static readonly double _standardDpiScale = 96.0;
|
|
||||||
private static readonly double _maxScaleFactor = 1.25;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Marks the application as DPI-Aware when running on the Windows operating system.
|
|
||||||
/// </summary>
|
|
||||||
public static void Windows()
|
|
||||||
{
|
|
||||||
// Make process DPI aware for proper window sizing on high-res screens.
|
|
||||||
if (OperatingSystem.IsWindowsVersionAtLeast(6))
|
|
||||||
{
|
|
||||||
SetProcessDPIAware();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static double GetWindowScaleFactor()
|
|
||||||
{
|
|
||||||
double userDpiScale = 96.0;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (OperatingSystem.IsWindows())
|
|
||||||
{
|
|
||||||
userDpiScale = Graphics.FromHwnd(IntPtr.Zero).DpiX;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// TODO: Linux support
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Logger.Warning?.Print(LogClass.Application, $"Couldn't determine monitor DPI: {e.Message}");
|
|
||||||
}
|
|
||||||
|
|
||||||
return Math.Min(userDpiScale / _standardDpiScale, _maxScaleFactor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,89 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Runtime.Versioning;
|
|
||||||
using System.Text;
|
|
||||||
using Ryujinx.Common.Logging;
|
|
||||||
|
|
||||||
namespace Ryujinx.Common.SystemInfo
|
|
||||||
{
|
|
||||||
[SupportedOSPlatform("macos")]
|
|
||||||
class MacOSSystemInfo : SystemInfo
|
|
||||||
{
|
|
||||||
internal MacOSSystemInfo()
|
|
||||||
{
|
|
||||||
string cpuName = GetCpuidCpuName();
|
|
||||||
|
|
||||||
if (cpuName == null && sysctlbyname("machdep.cpu.brand_string", out cpuName) != 0)
|
|
||||||
{
|
|
||||||
cpuName = "Unknown";
|
|
||||||
}
|
|
||||||
|
|
||||||
ulong totalRAM = 0;
|
|
||||||
|
|
||||||
if (sysctlbyname("hw.memsize", ref totalRAM) != 0) // Bytes
|
|
||||||
{
|
|
||||||
totalRAM = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
CpuName = $"{cpuName} ; {LogicalCoreCount} logical";
|
|
||||||
RamTotal = totalRAM;
|
|
||||||
}
|
|
||||||
|
|
||||||
[DllImport("libSystem.dylib", CharSet = CharSet.Ansi, SetLastError = true)]
|
|
||||||
private static extern int sysctlbyname(string name, IntPtr oldValue, ref ulong oldSize, IntPtr newValue, ulong newValueSize);
|
|
||||||
|
|
||||||
private static int sysctlbyname(string name, IntPtr oldValue, ref ulong oldSize)
|
|
||||||
{
|
|
||||||
if (sysctlbyname(name, oldValue, ref oldSize, IntPtr.Zero, 0) == -1)
|
|
||||||
{
|
|
||||||
int err = Marshal.GetLastWin32Error();
|
|
||||||
|
|
||||||
Logger.Error?.Print(LogClass.Application, $"Cannot retrieve '{name}'. Error Code {err}");
|
|
||||||
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static int sysctlbyname<T>(string name, ref T oldValue)
|
|
||||||
{
|
|
||||||
unsafe
|
|
||||||
{
|
|
||||||
ulong oldValueSize = (ulong)Unsafe.SizeOf<T>();
|
|
||||||
|
|
||||||
return sysctlbyname(name, (IntPtr)Unsafe.AsPointer(ref oldValue), ref oldValueSize);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static int sysctlbyname(string name, out string oldValue)
|
|
||||||
{
|
|
||||||
oldValue = default;
|
|
||||||
|
|
||||||
ulong strSize = 0;
|
|
||||||
|
|
||||||
int res = sysctlbyname(name, IntPtr.Zero, ref strSize);
|
|
||||||
|
|
||||||
if (res == 0)
|
|
||||||
{
|
|
||||||
byte[] rawData = new byte[strSize];
|
|
||||||
|
|
||||||
unsafe
|
|
||||||
{
|
|
||||||
fixed (byte* rawDataPtr = rawData)
|
|
||||||
{
|
|
||||||
res = sysctlbyname(name, (IntPtr)rawDataPtr, ref strSize);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (res == 0)
|
|
||||||
{
|
|
||||||
oldValue = Encoding.ASCII.GetString(rawData);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,110 +0,0 @@
|
|||||||
using Ryujinx.Common.Configuration.Hid;
|
|
||||||
using Ryujinx.Common.Configuration.Hid.Controller.Motion;
|
|
||||||
using System.IO;
|
|
||||||
using System.Text;
|
|
||||||
using System.Text.Json;
|
|
||||||
using System.Text.Json.Serialization;
|
|
||||||
|
|
||||||
namespace Ryujinx.Common.Utilities
|
|
||||||
{
|
|
||||||
public class JsonHelper
|
|
||||||
{
|
|
||||||
public static JsonNamingPolicy SnakeCase { get; }
|
|
||||||
|
|
||||||
private class SnakeCaseNamingPolicy : JsonNamingPolicy
|
|
||||||
{
|
|
||||||
public override string ConvertName(string name)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(name))
|
|
||||||
{
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
StringBuilder builder = new StringBuilder();
|
|
||||||
|
|
||||||
for (int i = 0; i < name.Length; i++)
|
|
||||||
{
|
|
||||||
char c = name[i];
|
|
||||||
|
|
||||||
if (char.IsUpper(c))
|
|
||||||
{
|
|
||||||
if (i == 0 || char.IsUpper(name[i - 1]))
|
|
||||||
{
|
|
||||||
builder.Append(char.ToLowerInvariant(c));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
builder.Append("_");
|
|
||||||
builder.Append(char.ToLowerInvariant(c));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
builder.Append(c);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return builder.ToString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static JsonHelper()
|
|
||||||
{
|
|
||||||
SnakeCase = new SnakeCaseNamingPolicy();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static JsonSerializerOptions GetDefaultSerializerOptions(bool prettyPrint = false)
|
|
||||||
{
|
|
||||||
JsonSerializerOptions options = new JsonSerializerOptions
|
|
||||||
{
|
|
||||||
DictionaryKeyPolicy = SnakeCase,
|
|
||||||
PropertyNamingPolicy = SnakeCase,
|
|
||||||
WriteIndented = prettyPrint,
|
|
||||||
AllowTrailingCommas = true,
|
|
||||||
ReadCommentHandling = JsonCommentHandling.Skip
|
|
||||||
};
|
|
||||||
|
|
||||||
options.Converters.Add(new JsonStringEnumConverter());
|
|
||||||
options.Converters.Add(new JsonInputConfigConverter());
|
|
||||||
options.Converters.Add(new JsonMotionConfigControllerConverter());
|
|
||||||
|
|
||||||
return options;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static T Deserialize<T>(Stream stream)
|
|
||||||
{
|
|
||||||
using (BinaryReader reader = new BinaryReader(stream))
|
|
||||||
{
|
|
||||||
return JsonSerializer.Deserialize<T>(reader.ReadBytes((int)(stream.Length - stream.Position)), GetDefaultSerializerOptions());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static T DeserializeFromFile<T>(string path)
|
|
||||||
{
|
|
||||||
return Deserialize<T>(File.ReadAllText(path));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static T Deserialize<T>(string json)
|
|
||||||
{
|
|
||||||
return JsonSerializer.Deserialize<T>(json, GetDefaultSerializerOptions());
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void Serialize<TValue>(Stream stream, TValue obj, bool prettyPrint = false)
|
|
||||||
{
|
|
||||||
using (BinaryWriter writer = new BinaryWriter(stream))
|
|
||||||
{
|
|
||||||
writer.Write(SerializeToUtf8Bytes(obj, prettyPrint));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string Serialize<TValue>(TValue obj, bool prettyPrint = false)
|
|
||||||
{
|
|
||||||
return JsonSerializer.Serialize(obj, GetDefaultSerializerOptions(prettyPrint));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static byte[] SerializeToUtf8Bytes<T>(T obj, bool prettyPrint = false)
|
|
||||||
{
|
|
||||||
return JsonSerializer.SerializeToUtf8Bytes(obj, GetDefaultSerializerOptions(prettyPrint));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
using System.IO;
|
|
||||||
|
|
||||||
namespace Ryujinx.Common.Utilities
|
|
||||||
{
|
|
||||||
public static class StreamUtils
|
|
||||||
{
|
|
||||||
public static byte[] StreamToBytes(Stream input)
|
|
||||||
{
|
|
||||||
using (MemoryStream stream = new MemoryStream())
|
|
||||||
{
|
|
||||||
input.CopyTo(stream);
|
|
||||||
|
|
||||||
return stream.ToArray();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,41 +0,0 @@
|
|||||||
using ARMeilleure.Signal;
|
|
||||||
using Ryujinx.Memory;
|
|
||||||
using Ryujinx.Memory.Tracking;
|
|
||||||
using System;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace Ryujinx.Cpu
|
|
||||||
{
|
|
||||||
class MemoryEhMeilleure : IDisposable
|
|
||||||
{
|
|
||||||
private delegate bool TrackingEventDelegate(ulong address, ulong size, bool write, bool precise = false);
|
|
||||||
|
|
||||||
private readonly MemoryBlock _addressSpace;
|
|
||||||
private readonly MemoryTracking _tracking;
|
|
||||||
private readonly TrackingEventDelegate _trackingEvent;
|
|
||||||
|
|
||||||
private readonly ulong _baseAddress;
|
|
||||||
|
|
||||||
public MemoryEhMeilleure(MemoryBlock addressSpace, MemoryTracking tracking)
|
|
||||||
{
|
|
||||||
_addressSpace = addressSpace;
|
|
||||||
_tracking = tracking;
|
|
||||||
|
|
||||||
_baseAddress = (ulong)_addressSpace.Pointer;
|
|
||||||
ulong endAddress = _baseAddress + addressSpace.Size;
|
|
||||||
|
|
||||||
_trackingEvent = new TrackingEventDelegate(tracking.VirtualMemoryEvent);
|
|
||||||
bool added = NativeSignalHandler.AddTrackedRegion((nuint)_baseAddress, (nuint)endAddress, Marshal.GetFunctionPointerForDelegate(_trackingEvent));
|
|
||||||
|
|
||||||
if (!added)
|
|
||||||
{
|
|
||||||
throw new InvalidOperationException("Number of allowed tracked regions exceeded.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
NativeSignalHandler.RemoveTrackedRegion((nuint)_baseAddress);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,28 +0,0 @@
|
|||||||
using Ryujinx.Memory.Tracking;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace Ryujinx.Cpu.Tracking
|
|
||||||
{
|
|
||||||
public class CpuMultiRegionHandle : IMultiRegionHandle
|
|
||||||
{
|
|
||||||
private readonly MultiRegionHandle _impl;
|
|
||||||
|
|
||||||
public bool Dirty => _impl.Dirty;
|
|
||||||
|
|
||||||
internal CpuMultiRegionHandle(MultiRegionHandle impl)
|
|
||||||
{
|
|
||||||
_impl = impl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Dispose() => _impl.Dispose();
|
|
||||||
public void ForceDirty(ulong address, ulong size) => _impl.ForceDirty(address, size);
|
|
||||||
public IEnumerable<IRegionHandle> GetHandles() => _impl.GetHandles();
|
|
||||||
public void QueryModified(Action<ulong, ulong> modifiedAction) => _impl.QueryModified(modifiedAction);
|
|
||||||
public void QueryModified(ulong address, ulong size, Action<ulong, ulong> modifiedAction) => _impl.QueryModified(address, size, modifiedAction);
|
|
||||||
public void QueryModified(ulong address, ulong size, Action<ulong, ulong> modifiedAction, int sequenceNumber) => _impl.QueryModified(address, size, modifiedAction, sequenceNumber);
|
|
||||||
public void RegisterAction(ulong address, ulong size, RegionSignal action) => _impl.RegisterAction(address, size, action);
|
|
||||||
public void RegisterPreciseAction(ulong address, ulong size, PreciseRegionSignal action) => _impl.RegisterPreciseAction(address, size, action);
|
|
||||||
public void SignalWrite() => _impl.SignalWrite();
|
|
||||||
}
|
|
||||||
}
|
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user