Compare commits
922 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c7fb3f7203 | ||
|
|
04beea44b0 | ||
|
|
d3bafc5b3b | ||
|
|
2c9e1a814c | ||
|
|
df012e6e21 | ||
|
|
2420b26981 | ||
|
|
c1d68d7f0d | ||
|
|
7cead4b620 | ||
|
|
27202b2fab | ||
|
|
1556a92a38 | ||
|
|
206b1a1b57 | ||
|
|
a26e157579 | ||
|
|
9578622abf | ||
|
|
d4f99ddb4d | ||
|
|
0105455086 | ||
|
|
28717bfd27 | ||
|
|
71fd69eb5a | ||
|
|
9d7b52e2d4 | ||
|
|
255e46e6d2 | ||
|
|
7472bc1c7f | ||
|
|
3c7ece2f8b | ||
|
|
a7e89c6dbb | ||
|
|
b0cae74bb9 | ||
|
|
889ea5e5aa | ||
|
|
7e6ff1f327 | ||
|
|
ea49c2ccd1 | ||
|
|
d484872a73 | ||
|
|
6ee525201c | ||
|
|
5ac7ae7edb | ||
|
|
0c590eb768 | ||
|
|
bd40d4f237 | ||
|
|
788436b4a3 | ||
|
|
2bb77237bc | ||
|
|
33827fe3a3 | ||
|
|
48b0b2fc46 | ||
|
|
4f29eedfe9 | ||
|
|
66372e2b2e | ||
|
|
2bae1ad116 | ||
|
|
bbdc643b6d | ||
|
|
a66fcde0ee | ||
|
|
7835486a4d | ||
|
|
90367aea0d | ||
|
|
16c638756c | ||
|
|
b08a97d883 | ||
|
|
746dbfe018 | ||
|
|
733f2b3cdd | ||
|
|
ad64cb5212 | ||
|
|
b1a9e8d0df | ||
|
|
4f9838df3c | ||
|
|
f4ca2c02a7 | ||
|
|
e1391d4162 | ||
|
|
8d9c51f204 | ||
|
|
c10ba67973 | ||
|
|
55610694c8 | ||
|
|
8764d94fd9 | ||
|
|
5228768841 | ||
|
|
9c68bea16c | ||
|
|
5484740cab | ||
|
|
421324b498 | ||
|
|
37e065fa2d | ||
|
|
b758e3fc55 | ||
|
|
393596ef9a | ||
|
|
02d4c97c6d | ||
|
|
2c5ef434f0 | ||
|
|
122f3e4403 | ||
|
|
ea3ebbaa7d | ||
|
|
1636668762 | ||
|
|
c6b9a0c4bf | ||
|
|
93a218abeb | ||
|
|
d7a06057eb | ||
|
|
8cb77ac136 | ||
|
|
4059dc6187 | ||
|
|
15773e4755 | ||
|
|
4f455dacf4 | ||
|
|
0b22af1206 | ||
|
|
ae2fa2fa60 | ||
|
|
6abd756e0c | ||
|
|
535e49a38d | ||
|
|
fbb5730369 | ||
|
|
e5d62025d3 | ||
|
|
89c6fc6437 | ||
|
|
799c158b86 | ||
|
|
8d16d2152b | ||
|
|
635ae4e3da | ||
|
|
59140d8dfa | ||
|
|
2cb8aadafc | ||
|
|
aa0826bb70 | ||
|
|
8bd2a9a23b | ||
|
|
2f959785e1 | ||
|
|
88a86a3363 | ||
|
|
0c7827104f | ||
|
|
c8ed190e5c | ||
|
|
f4dcd1db9b | ||
|
|
bd341d5c00 | ||
|
|
add18d868f | ||
|
|
609a302e16 | ||
|
|
e07011be32 | ||
|
|
bb223eb5ae | ||
|
|
73d904036d | ||
|
|
542833866e | ||
|
|
89c484414b | ||
|
|
fe2dd671fb | ||
|
|
8abee1bdaa | ||
|
|
78a730ddf6 | ||
|
|
a750e55f75 | ||
|
|
c62c4846fc | ||
|
|
8db5b01507 | ||
|
|
a6e405c988 | ||
|
|
6613fda4b1 | ||
|
|
a18a6e87df | ||
|
|
93d83c5bb9 | ||
|
|
6ee8720028 | ||
|
|
600d68bd1a | ||
|
|
0c3a294cbe | ||
|
|
25218795b4 | ||
|
|
a65ec67128 | ||
|
|
5d753f2384 | ||
|
|
1f2de35f94 | ||
|
|
5c140b4f35 | ||
|
|
362ee3cdb0 | ||
|
|
215f1bc8ee | ||
|
|
4d72c2b37a | ||
|
|
dc4dbe29ae | ||
|
|
72dd25a99e | ||
|
|
39d041466d | ||
|
|
442ebff829 | ||
|
|
7e169bc7df | ||
|
|
00f4e5158f | ||
|
|
0c688189f6 | ||
|
|
7cee36544c | ||
|
|
f9c1d5fc1b | ||
|
|
d95e20952c | ||
|
|
32a90334bb | ||
|
|
f534d3498e | ||
|
|
3ea9f444db | ||
|
|
5672c935ed | ||
|
|
4cc2b5c38a | ||
|
|
00e3d874e3 | ||
|
|
803e91a8c4 | ||
|
|
227a1d938d | ||
|
|
fc7f06dc78 | ||
|
|
6777dd9b38 | ||
|
|
4db212ea7b | ||
|
|
8177a27db9 | ||
|
|
27ff119ba6 | ||
|
|
c20774ff5d | ||
|
|
a9f5b7728b | ||
|
|
08ad48fbf3 | ||
|
|
2d0c881ffe | ||
|
|
c916a7db88 | ||
|
|
a5da286351 | ||
|
|
20a48c3a26 | ||
|
|
5bba0f47ff | ||
|
|
bfc987abcd | ||
|
|
85bf7c86e0 | ||
|
|
2225b86eea | ||
|
|
d09be18359 | ||
|
|
09ab3efddd | ||
|
|
382a0192f9 | ||
|
|
e3b968fa80 | ||
|
|
6f85b11fcc | ||
|
|
e561919a52 | ||
|
|
b0a66a63ba | ||
|
|
0d840e199d | ||
|
|
3a2bceef8d | ||
|
|
e871a754a8 | ||
|
|
6333327b81 | ||
|
|
18ca8aaf5b | ||
|
|
67c0f4527e | ||
|
|
e5c5101e8a | ||
|
|
934ff7bbde | ||
|
|
014f08f6b4 | ||
|
|
6ba2090c01 | ||
|
|
61fcf5e0f4 | ||
|
|
9217e4c5f9 | ||
|
|
3ccbb34c62 | ||
|
|
9baa4a17ed | ||
|
|
6bbece39bc | ||
|
|
729447eab0 | ||
|
|
1e7f41ea9f | ||
|
|
d0d4888184 | ||
|
|
804e5d49bb | ||
|
|
6d1d226842 | ||
|
|
06416aeded | ||
|
|
4fbae9e5a4 | ||
|
|
c87be7cd69 | ||
|
|
e62754ed56 | ||
|
|
53d7281e66 | ||
|
|
731a2c11a4 | ||
|
|
ec4d078d6d | ||
|
|
f9b48f06a3 | ||
|
|
d986ffa153 | ||
|
|
2357bc70a7 | ||
|
|
e86e1588e3 | ||
|
|
4be88c7180 | ||
|
|
8e8daa64ba | ||
|
|
1671c04e24 | ||
|
|
d3d6c552b7 | ||
|
|
8d9336f561 | ||
|
|
169ec9c12e | ||
|
|
60b831f369 | ||
|
|
4191dcee75 | ||
|
|
44725c8910 | ||
|
|
cead8a36ea | ||
|
|
7b6050a0cb | ||
|
|
491383c637 | ||
|
|
d7a3645f7f | ||
|
|
241b8f4627 | ||
|
|
3f7238cb10 | ||
|
|
1e8a6358ad | ||
|
|
c412d996fd | ||
|
|
f2086fe054 | ||
|
|
3f9d6574fb | ||
|
|
e996acff66 | ||
|
|
e274d3ef37 | ||
|
|
8663eb1a6e | ||
|
|
938da08e14 | ||
|
|
0468bd9483 | ||
|
|
c077c75b8d | ||
|
|
24f7977fa6 | ||
|
|
6699fda8c9 | ||
|
|
06e4158b93 | ||
|
|
b82d8aaba9 | ||
|
|
6829572556 | ||
|
|
11d8021435 | ||
|
|
493b074a9e | ||
|
|
befd912a88 | ||
|
|
c96ae0148e | ||
|
|
63a9c856fc | ||
|
|
31fde233e1 | ||
|
|
f9bf8923b1 | ||
|
|
ee40dcd76f | ||
|
|
c60ee15449 | ||
|
|
876d94c338 | ||
|
|
7c37b7497b | ||
|
|
dfcba5e6d4 | ||
|
|
a0cf3bbed8 | ||
|
|
1c503d59b5 | ||
|
|
0bf7df0426 | ||
|
|
2c46ec9638 | ||
|
|
ef0c8e0aac | ||
|
|
1a5801ee0f | ||
|
|
aa289410bb | ||
|
|
b7a370b156 | ||
|
|
87a1aa17a7 | ||
|
|
2fde907c5e | ||
|
|
3caa7166f2 | ||
|
|
af5d88d4e4 | ||
|
|
cd080e2552 | ||
|
|
68c530c4a4 | ||
|
|
aad02cd751 | ||
|
|
9de7b01ee6 | ||
|
|
65d499adb3 | ||
|
|
e5402bd8b8 | ||
|
|
5ae9bd5fe5 | ||
|
|
0dcb496522 | ||
|
|
c8f2d17d02 | ||
|
|
a4daa0761a | ||
|
|
8bd79e8299 | ||
|
|
4f8ab5c599 | ||
|
|
8cf30176cb | ||
|
|
e5e605a362 | ||
|
|
1021b4a455 | ||
|
|
919c3b2a65 | ||
|
|
0986b48a55 | ||
|
|
4c4f037361 | ||
|
|
e7e5ef4e5d | ||
|
|
df3c8f4c94 | ||
|
|
89a83b0e5a | ||
|
|
7bdd4bb2d1 | ||
|
|
f29ab6d0f3 | ||
|
|
dd10547ac2 | ||
|
|
452c61db7a | ||
|
|
00e22c7fd0 | ||
|
|
837b30d075 | ||
|
|
50e307b4b7 | ||
|
|
4c328b6c50 | ||
|
|
4387da1ecc | ||
|
|
6dd366cb22 | ||
|
|
40b838c896 | ||
|
|
d6502c174a | ||
|
|
f38965d0bd | ||
|
|
c2cb94062a | ||
|
|
cfa050cc8f | ||
|
|
bbcb3757bd | ||
|
|
a33ace8996 | ||
|
|
79d96bbdfd | ||
|
|
4dac80df75 | ||
|
|
cb532e3fb3 | ||
|
|
766097d0b7 | ||
|
|
5f5a8567ce | ||
|
|
7dbe61c94c | ||
|
|
422dce6974 | ||
|
|
1d429261e9 | ||
|
|
6f25e92892 | ||
|
|
6cc29185d2 | ||
|
|
13a1566b4e | ||
|
|
bbb658a7e5 | ||
|
|
ad812c8125 | ||
|
|
a64fdce505 | ||
|
|
7e950c3bcc | ||
|
|
d0d7772f98 | ||
|
|
674175e1c6 | ||
|
|
eab2d05680 | ||
|
|
56d7473451 | ||
|
|
bfd4d41834 | ||
|
|
defee07625 | ||
|
|
2c3111f9c9 | ||
|
|
ca2c171482 | ||
|
|
cfcb1cd3a1 | ||
|
|
bb6cc6532b | ||
|
|
03a425a579 | ||
|
|
41f5b39f6b | ||
|
|
b5dd621250 | ||
|
|
27cde7da7a | ||
|
|
377b8dae9f | ||
|
|
78828427a4 | ||
|
|
fe28dac9d3 | ||
|
|
a85102c97c | ||
|
|
9b11f1cb19 | ||
|
|
cf6b9de370 | ||
|
|
80c380e61e | ||
|
|
967fa456ba | ||
|
|
6ae6c80c25 | ||
|
|
142df74694 | ||
|
|
00db1dc286 | ||
|
|
1456246f60 | ||
|
|
7581306109 | ||
|
|
a4ee4d20ad | ||
|
|
625ac5b357 | ||
|
|
3f75a92fd2 | ||
|
|
b5e91ff9a4 | ||
|
|
db47a0c041 | ||
|
|
5e7b33cabd | ||
|
|
3cc79f4e11 | ||
|
|
7c36a827da | ||
|
|
ea90325535 | ||
|
|
72377c2345 | ||
|
|
cccef3b85c | ||
|
|
e10c6a3217 | ||
|
|
4ef7b83e34 | ||
|
|
4ca53e2ef1 | ||
|
|
d9da531b41 | ||
|
|
93fb060fac | ||
|
|
fe0d41623c | ||
|
|
4ea6ce3156 | ||
|
|
520b5f6c59 | ||
|
|
505324f625 | ||
|
|
9319463a6e | ||
|
|
31c4c33042 | ||
|
|
55a8154691 | ||
|
|
453c05cf7c | ||
|
|
4c5c78858c | ||
|
|
967613a261 | ||
|
|
348345340d | ||
|
|
38159bdf9a | ||
|
|
e58948a42b | ||
|
|
9c53c0c0cc | ||
|
|
7c5dc61795 | ||
|
|
6034beb084 | ||
|
|
0177b612f4 | ||
|
|
a9afbd2458 | ||
|
|
8c3dae846e | ||
|
|
dcc93ce60e | ||
|
|
7fef83885f | ||
|
|
3207c38a44 | ||
|
|
5952ebab54 | ||
|
|
ad41d010d3 | ||
|
|
21db90bae9 | ||
|
|
cf4f74c8f9 | ||
|
|
bf5a649928 | ||
|
|
c5fa4660c8 | ||
|
|
0d4a0348b5 | ||
|
|
51858e732a | ||
|
|
edcfbf4254 | ||
|
|
d984621150 | ||
|
|
4b8ebfa7c3 | ||
|
|
bc44e02aed | ||
|
|
85e8506fa8 | ||
|
|
5633444d5e | ||
|
|
99106076e6 | ||
|
|
0a194cb6a6 | ||
|
|
f4a8124dc3 | ||
|
|
9ea1a2a941 | ||
|
|
bfa84e27c1 | ||
|
|
14683405be | ||
|
|
ccbab35deb | ||
|
|
2dfa1c96d1 | ||
|
|
d44b91826d | ||
|
|
3a8f9114fc | ||
|
|
9858d6fc95 | ||
|
|
f6645387b0 | ||
|
|
df963967f5 | ||
|
|
8313669716 | ||
|
|
13c825a8bb | ||
|
|
30485f1df9 | ||
|
|
7945a921ca | ||
|
|
b09adb6a34 | ||
|
|
c3875796df | ||
|
|
a1d4caa7b4 | ||
|
|
9f972831cc | ||
|
|
f50bfaf7d7 | ||
|
|
bfd04cfe92 | ||
|
|
cb74bc6bb8 | ||
|
|
be4ca7eee5 | ||
|
|
7b24b43477 | ||
|
|
253afc90a4 | ||
|
|
a09c08994f | ||
|
|
13ded6bd1c | ||
|
|
4ba6d8b24c | ||
|
|
cb88fdfd62 | ||
|
|
d69fc060f4 | ||
|
|
e04fcfff6b | ||
|
|
79c52e2b91 | ||
|
|
4ac8f2745b | ||
|
|
6004b7479e | ||
|
|
ed86c44a49 | ||
|
|
5c9d0f05b1 | ||
|
|
87f7a6ebdc | ||
|
|
664e5e6b52 | ||
|
|
9691286d73 | ||
|
|
81895c8019 | ||
|
|
1a396235cd | ||
|
|
732a6159f7 | ||
|
|
a3389e25c9 | ||
|
|
908de31a0e | ||
|
|
4e5f033e41 | ||
|
|
ae90a9d7a6 | ||
|
|
a67d4064f0 | ||
|
|
017d473b99 | ||
|
|
a1512cf30f | ||
|
|
d0659377e8 | ||
|
|
ac07971211 | ||
|
|
b03a778611 | ||
|
|
67891954ec | ||
|
|
1e5fcff242 | ||
|
|
88294116b8 | ||
|
|
fe62ab9aed | ||
|
|
5868e0769a | ||
|
|
3cb60b324b | ||
|
|
03e176d7f1 | ||
|
|
92816be055 | ||
|
|
9eb0b84ed1 | ||
|
|
6b41a7e2e1 | ||
|
|
aed472775c | ||
|
|
a8ca92bc1e | ||
|
|
c878e96398 | ||
|
|
e5045556bf | ||
|
|
5bedcd305d | ||
|
|
c7ffcad74e | ||
|
|
2f1f56307d | ||
|
|
9113b04b48 | ||
|
|
05c4dfd8f8 | ||
|
|
938169cd3c | ||
|
|
7a4d1e786c | ||
|
|
b237168ec7 | ||
|
|
753958de28 | ||
|
|
fb5e02050b | ||
|
|
08a2f02a7c | ||
|
|
477bee2e4c | ||
|
|
a0f3183c79 | ||
|
|
f44a730a90 | ||
|
|
3459968ac3 | ||
|
|
428e176d9c | ||
|
|
16430217ff | ||
|
|
262d6af519 | ||
|
|
350dccff3d | ||
|
|
4d76f4d79c | ||
|
|
fd4d6a4e55 | ||
|
|
81aa5c7ec7 | ||
|
|
c6d67eab6a | ||
|
|
9427a5cf46 | ||
|
|
4167dfea14 | ||
|
|
c50cb83ec1 | ||
|
|
0001e93810 | ||
|
|
84c4cd7c53 | ||
|
|
29be429d2f | ||
|
|
acffae6643 | ||
|
|
285feba42b | ||
|
|
b940f61d42 | ||
|
|
696f66f620 | ||
|
|
db19fa0f7f | ||
|
|
2678735f73 | ||
|
|
23424629c9 | ||
|
|
f2433824ba | ||
|
|
d00b183f92 | ||
|
|
994d7d5429 | ||
|
|
eb90603f18 | ||
|
|
2d27dab6ab | ||
|
|
325c71b1b4 | ||
|
|
f9c9c1048e | ||
|
|
4ccb39a228 | ||
|
|
ad8acaefec | ||
|
|
106ae81614 | ||
|
|
93745dc40c | ||
|
|
3316820f86 | ||
|
|
f4950ff26e | ||
|
|
20ba6432b9 | ||
|
|
a611027eeb | ||
|
|
1a82b407a4 | ||
|
|
dc1db0dc72 | ||
|
|
047f3b653e | ||
|
|
79244078a6 | ||
|
|
fce2099d7d | ||
|
|
22d4de27f1 | ||
|
|
9d5ca47ac8 | ||
|
|
c1588d0300 | ||
|
|
b62014554c | ||
|
|
afcaf20020 | ||
|
|
bcf20b4441 | ||
|
|
c8a4a6dc58 | ||
|
|
634ce933be | ||
|
|
ca42a9daec | ||
|
|
9e1e9ff8c0 | ||
|
|
761c383958 | ||
|
|
48e4688c13 | ||
|
|
7ddaad615b | ||
|
|
a5854afd2f | ||
|
|
db3c5cf20f | ||
|
|
e7f941fa3d | ||
|
|
51fa778fb2 | ||
|
|
35167da6dd | ||
|
|
2a973b9e16 | ||
|
|
83626923cf | ||
|
|
7551bebb88 | ||
|
|
433b01aaf8 | ||
|
|
da664b49ad | ||
|
|
5d79952bdd | ||
|
|
e5ecd243f2 | ||
|
|
274035edd6 | ||
|
|
60776e8111 | ||
|
|
3fcad4bc65 | ||
|
|
991fe78740 | ||
|
|
aac64b1ded | ||
|
|
b6d3df3335 | ||
|
|
66560d0a7b | ||
|
|
b42d16cf1c | ||
|
|
bcdf32b214 | ||
|
|
9c3728c8f2 | ||
|
|
23fff1e8fd | ||
|
|
a553fbcdd1 | ||
|
|
e62606d276 | ||
|
|
e25d83f701 | ||
|
|
ed37c149d1 | ||
|
|
7c8d126f23 | ||
|
|
c9b88f0404 | ||
|
|
e24d7a1fd2 | ||
|
|
d756f2fc0d | ||
|
|
4d0ab41e6e | ||
|
|
512dbc3a24 | ||
|
|
a3d44e37b5 | ||
|
|
18e4d80073 | ||
|
|
e5bedd52ac | ||
|
|
a38927ec04 | ||
|
|
fbddf090a4 | ||
|
|
b4b1208222 | ||
|
|
4e95397ed5 | ||
|
|
853a57e4d4 | ||
|
|
8c86074da2 | ||
|
|
88a6ef4cd7 | ||
|
|
7d2dd628ba | ||
|
|
7e93ca0977 | ||
|
|
eddbd7c072 | ||
|
|
e734a5412a | ||
|
|
7ddb0da5f6 | ||
|
|
862aa73783 | ||
|
|
34af93b72f | ||
|
|
5ef3ca9364 | ||
|
|
37d3577028 | ||
|
|
ef68881e5c | ||
|
|
e8a5aa81f4 | ||
|
|
f2f25dd5ed | ||
|
|
8d140d835a | ||
|
|
afae7eaa11 | ||
|
|
af70a4a3a3 | ||
|
|
bc6ad53018 | ||
|
|
a3fc2c95b8 | ||
|
|
68af2c1c2a | ||
|
|
2552c0327c | ||
|
|
f5ac895062 | ||
|
|
e4cc39c29b | ||
|
|
c80eb26135 | ||
|
|
964a698875 | ||
|
|
b57ec74ca3 | ||
|
|
66d5c9fe26 | ||
|
|
434f600f95 | ||
|
|
89503049b3 | ||
|
|
aaabb4bfc4 | ||
|
|
be772b40e1 | ||
|
|
3149b8a6fe | ||
|
|
c8e0028874 | ||
|
|
a8d929a343 | ||
|
|
618de9546a | ||
|
|
2673118478 | ||
|
|
6cc69fb3fc | ||
|
|
eefee8c7a8 | ||
|
|
dcf44e406e | ||
|
|
1970a52fc9 | ||
|
|
37161c5d11 | ||
|
|
d646023bbd | ||
|
|
b63061a505 | ||
|
|
61b057c37d | ||
|
|
2388a3f4fd | ||
|
|
cfc9576eaf | ||
|
|
e9e3f29d74 | ||
|
|
83f21d7d2a | ||
|
|
4adf297c80 | ||
|
|
f5695145ef | ||
|
|
a0e06cf7b2 | ||
|
|
0288986e14 | ||
|
|
fa6cf1ffb8 | ||
|
|
5b235a4b03 | ||
|
|
771039e6a7 | ||
|
|
1a63078c32 | ||
|
|
4a60cee5ff | ||
|
|
0df92148a4 | ||
|
|
f1ea368585 | ||
|
|
656053582a | ||
|
|
37eb3315b6 | ||
|
|
d20cd73523 | ||
|
|
a0acbda9ce | ||
|
|
f00dd05f82 | ||
|
|
92d8829ee1 | ||
|
|
9979cec045 | ||
|
|
8cff208d36 | ||
|
|
7d170259d3 | ||
|
|
d0ff791260 | ||
|
|
ddc5222208 | ||
|
|
f1068d6c3f | ||
|
|
fb2baa8c8d | ||
|
|
c56561b234 | ||
|
|
f58f7c8a16 | ||
|
|
5fe24b620d | ||
|
|
26f45fab19 | ||
|
|
85669ef491 | ||
|
|
56246551e6 | ||
|
|
6027ff243d | ||
|
|
1d0efbf456 | ||
|
|
67c7ef69f4 | ||
|
|
e2a7f23214 | ||
|
|
784964d49d | ||
|
|
e715197290 | ||
|
|
5f836aca6d | ||
|
|
4e99eaa590 | ||
|
|
a3adb70a04 | ||
|
|
de07ed42bb | ||
|
|
53488eb8e5 | ||
|
|
752e0757d9 | ||
|
|
a71b2d9329 | ||
|
|
506ac3f167 | ||
|
|
46f4896992 | ||
|
|
6c41e105c4 | ||
|
|
bdfd7946e3 | ||
|
|
f78fd29e38 | ||
|
|
3d6405be85 | ||
|
|
7bdb2ae897 | ||
|
|
891b865da8 | ||
|
|
dc2b8ebab9 | ||
|
|
901723621c | ||
|
|
3f6325c358 | ||
|
|
ea02f389ac | ||
|
|
cd8621c632 | ||
|
|
e55a7bef26 | ||
|
|
da68d02c77 | ||
|
|
2677cf68d4 | ||
|
|
cedbcba3e3 | ||
|
|
5b1bb71787 | ||
|
|
7d4a257d57 | ||
|
|
051789c430 | ||
|
|
0e4c300745 | ||
|
|
f99dea798a | ||
|
|
f15fc6645e | ||
|
|
c56db864eb | ||
|
|
5b4e81aa8b | ||
|
|
e75f4e9f5a | ||
|
|
08d1e9b880 | ||
|
|
b2fb42e39d | ||
|
|
776ab21641 | ||
|
|
031c9e545b | ||
|
|
c6f06e2c40 | ||
|
|
c9c8f64f09 | ||
|
|
9bc45475f4 | ||
|
|
8bf8503fcd | ||
|
|
8a73ad996a | ||
|
|
24f74312f2 | ||
|
|
5f179cf19f | ||
|
|
254ac59016 | ||
|
|
2711702e29 | ||
|
|
18ee6eb2e6 | ||
|
|
4711d0565d | ||
|
|
f61f5feaf4 | ||
|
|
2165555170 | ||
|
|
260a819fd2 | ||
|
|
83025080c8 | ||
|
|
b6684ff845 | ||
|
|
deb124138b | ||
|
|
eeef08e58e | ||
|
|
295574740d | ||
|
|
a52e601f2e | ||
|
|
d349bdb1f8 | ||
|
|
caba025e97 | ||
|
|
add52b90c9 | ||
|
|
c42fc16d8e | ||
|
|
a09137c008 | ||
|
|
2a2d1bc78b | ||
|
|
50db685274 | ||
|
|
d0285fb57c | ||
|
|
a899a61f80 | ||
|
|
da0d22f05a | ||
|
|
35cf3b65a3 | ||
|
|
d0505d3c11 | ||
|
|
d1abc53d33 | ||
|
|
36a727ef81 | ||
|
|
3ce32d2014 | ||
|
|
a01d0e94f8 | ||
|
|
34c16e211f | ||
|
|
95a9e1e215 | ||
|
|
3924a2ef76 | ||
|
|
4f9ecc9d50 | ||
|
|
f6bc4abfd0 | ||
|
|
7a704827f1 | ||
|
|
72594c6783 | ||
|
|
754aaecc18 | ||
|
|
b419c0df29 | ||
|
|
a4ce50ffd5 | ||
|
|
802830d8d4 | ||
|
|
83941f8647 | ||
|
|
8d08e60916 | ||
|
|
0b15539479 | ||
|
|
a94bee71d2 | ||
|
|
5f905c6b42 | ||
|
|
e0f1e637f7 | ||
|
|
fc4912ef54 | ||
|
|
dca51291aa | ||
|
|
b72a68f622 | ||
|
|
a9a71fbeed | ||
|
|
84c776fa6b | ||
|
|
a21b5d453a | ||
|
|
aca8f53050 | ||
|
|
0ef3368893 | ||
|
|
4827fd71b4 | ||
|
|
00aa283a54 | ||
|
|
ef373d954f | ||
|
|
cdb7ce3dec | ||
|
|
49d1e65496 | ||
|
|
29153af2bc | ||
|
|
f79f4d175b | ||
|
|
600ad660a6 | ||
|
|
efcce68a56 | ||
|
|
6b04c937e6 | ||
|
|
46c50f2cbe | ||
|
|
d452d6f89d | ||
|
|
eb6ab2ba62 | ||
|
|
8a92a63a64 | ||
|
|
907f6fa72d | ||
|
|
94e527e763 | ||
|
|
588315f877 | ||
|
|
d1985fe77e | ||
|
|
61ad4e0991 | ||
|
|
24be9ffc57 | ||
|
|
d875d84d2d | ||
|
|
9fe8b22269 | ||
|
|
37e5a8544b | ||
|
|
bf7dc84893 | ||
|
|
bb48e33074 | ||
|
|
a51d355707 | ||
|
|
a79f4cf6f6 | ||
|
|
903789cf6e | ||
|
|
49ba3a86e2 | ||
|
|
021d84ff04 | ||
|
|
8ecf68cb65 | ||
|
|
bbed78149c | ||
|
|
3fa973f430 | ||
|
|
bd76e73b25 | ||
|
|
fc426a06b2 | ||
|
|
2572ae8378 | ||
|
|
46001263f8 | ||
|
|
ec8523af7c | ||
|
|
2708de3876 | ||
|
|
ef17dc16fa | ||
|
|
ed4a999caa | ||
|
|
6b3662d047 | ||
|
|
33b7e227d4 | ||
|
|
be5b58d033 | ||
|
|
8d3b8354c3 | ||
|
|
25956c4fa1 | ||
|
|
5201803685 | ||
|
|
c6003ff530 | ||
|
|
72f028efae | ||
|
|
72a2c10896 | ||
|
|
49ad66e478 | ||
|
|
bcdfc53d7d | ||
|
|
ed37706915 | ||
|
|
e321f0ac04 | ||
|
|
87c0c8b83e | ||
|
|
7bc95f35d7 | ||
|
|
ae4d29a49f | ||
|
|
67ff4fe913 | ||
|
|
dd255df90d | ||
|
|
ab33329129 | ||
|
|
767a4b3606 | ||
|
|
a71d98d78b | ||
|
|
c3569ec5e2 | ||
|
|
eab5e0df9b | ||
|
|
e214f4d325 | ||
|
|
982797df31 | ||
|
|
77bbb0ef78 | ||
|
|
13aa774d7a | ||
|
|
6e7eb47d33 | ||
|
|
a07e37121d | ||
|
|
d88fd04c73 | ||
|
|
abde50f162 | ||
|
|
2b4e6bf25d | ||
|
|
ff09efb1bf | ||
|
|
cff283f77d | ||
|
|
e0c7bfc93d | ||
|
|
ac391d9c5e | ||
|
|
46cc08160d | ||
|
|
7e3b5c37d0 | ||
|
|
a00e120bf7 | ||
|
|
1932662b4c | ||
|
|
b4781b8a4f | ||
|
|
83644692fe | ||
|
|
420361597e | ||
|
|
05187502b3 | ||
|
|
878ac59aae | ||
|
|
e1cc1b8d29 | ||
|
|
d95fc102db | ||
|
|
66da896347 | ||
|
|
c530bb8910 | ||
|
|
8054b2d219 | ||
|
|
7c61e935ee | ||
|
|
e5e9968d22 | ||
|
|
962fa0a690 | ||
|
|
9714db14d2 | ||
|
|
50c65ea7e1 | ||
|
|
98bdb2a7a3 | ||
|
|
d4ee772714 | ||
|
|
fa9d7f40fc | ||
|
|
20026587fd | ||
|
|
f16423c413 | ||
|
|
1bface09d5 | ||
|
|
560d899a9b | ||
|
|
2838e41819 | ||
|
|
8550f722ca | ||
|
|
9f6ff2ed6e | ||
|
|
164fb96da0 | ||
|
|
31c1338dba | ||
|
|
7d729e1836 | ||
|
|
36530a5501 | ||
|
|
1aba87ef76 | ||
|
|
b19e50e720 | ||
|
|
caf9d11c8c | ||
|
|
f7a7ce1847 | ||
|
|
893bad0db2 | ||
|
|
29833539bb | ||
|
|
f914edeebd | ||
|
|
5f3187300d | ||
|
|
5d5f8ad3d5 | ||
|
|
f8abd2b402 | ||
|
|
6335d21901 | ||
|
|
5649b6d63f | ||
|
|
e96eaa3d7c | ||
|
|
aa86d1abfa | ||
|
|
1228cd6903 | ||
|
|
6f240b1665 | ||
|
|
13e5043d64 | ||
|
|
b771c42f7f | ||
|
|
4d1481e2eb | ||
|
|
21b0f228b6 | ||
|
|
b9091e9466 | ||
|
|
a520481168 | ||
|
|
8daa2da97c | ||
|
|
bb29a2458f | ||
|
|
ce1a6a68bf | ||
|
|
cf510ad9bf | ||
|
|
9898a01d3b | ||
|
|
54a22797a7 | ||
|
|
5ef01edab5 | ||
|
|
3b8bb325e8 | ||
|
|
6538554485 | ||
|
|
9b1a2451b0 | ||
|
|
e65bee0d6a | ||
|
|
8426a4dc77 | ||
|
|
147f3c690a | ||
|
|
bac81f4ccc | ||
|
|
2894989eb7 | ||
|
|
952ee4227d | ||
|
|
9142e90a04 | ||
|
|
3ed239296a | ||
|
|
78a47dba6d | ||
|
|
5d0aabaa44 | ||
|
|
e786bc7e9a | ||
|
|
158f7224a7 | ||
|
|
865ca76772 | ||
|
|
b8f93562c0 | ||
|
|
ef5c7d6bab | ||
|
|
be044e691c | ||
|
|
536b89efae | ||
|
|
44175058f6 | ||
|
|
7309c7f358 | ||
|
|
6336089b63 | ||
|
|
6ef34d80a0 | ||
|
|
2f7224edce | ||
|
|
c49cfbd6af | ||
|
|
8b71378920 | ||
|
|
bbffbd654f | ||
|
|
4cdd9aa8f1 | ||
|
|
23a85a7c24 | ||
|
|
3dc679215b | ||
|
|
aef7d36300 | ||
|
|
887b4e0275 | ||
|
|
9a8c70ed68 | ||
|
|
058f735031 | ||
|
|
5c147e5188 | ||
|
|
18f51e9b2e | ||
|
|
376feb63bd | ||
|
|
a502d31cd1 | ||
|
|
afbf57c222 | ||
|
|
b62329bd5b | ||
|
|
de688ee17a | ||
|
|
0938057d67 |
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@@ -0,0 +1 @@
|
||||
config_templates/hbl_html/accessible-urls/accessible-urls.txt text eol=lf
|
||||
56
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
56
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
---
|
||||
name: Bug Report
|
||||
about: Something doesn't work correctly in Atmosphère.
|
||||
#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. ]</br>
|
||||
|
||||
[ * ]</br>
|
||||
[ Note: If the bug or crash you encountered is related to; ]</br>
|
||||
[ - software used to make "backups", ]</br>
|
||||
[ - software explicitly distributed for piracy, etc ]</br>
|
||||
[ then contributors will not provide support for your issue and your issue will be closed. ]</br>
|
||||
|
||||
### 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 Atmosphère itself? ]</br>
|
||||
[ If so, make sure to include details relating to what exactly you changed. ]</br>
|
||||
|
||||
### How can the issue be reproduced?
|
||||
|
||||
[ * ]</br>
|
||||
[ Include a detailed step by step process for recreating your issue. ]</br>
|
||||
|
||||
### Crash Report
|
||||
|
||||
[ Crash reports can be found under ``/atmosphere/crash_reports``. ]</br>
|
||||
[ If your issue caused Atmosphère to crash, include the crash report(s) by creating a [gist](https://gist.github.com/) and pasting the link here. ]</br>
|
||||
[ If you don't include a crash report in instances of crash related issues, we will ask you one to provide one. ]</br>
|
||||
|
||||
### System Firmware Version
|
||||
|
||||
X.X.X</br>
|
||||
[ Replace X's with system firmware version at time of crash. ]</br>
|
||||
[ You can find your firmware version in the Settings -> System, under "System Update". ]</br>
|
||||
[ If it says "Update Pending", you can clear the pending update by rebooting to Maintenance Mode. ]</br>
|
||||
|
||||
### Environment?
|
||||
|
||||
- What bootloader (fusèe, hekate, etc) was Atmosphère launched by:
|
||||
- Official release or unofficial build:
|
||||
- [ Official release version x.x.x (or) unofficial build ]
|
||||
- [ If using an unofficial build, include details on where/how you acquired the build. ]
|
||||
- [ Ex: Self-compilation ]
|
||||
- [ Ex: Kosmos' distribution of Atmosphère ]
|
||||
- Do you have additional kips or sysmodules you're loading:
|
||||
- Homebrew software installed: [ * ]
|
||||
|
||||
### Additional context?
|
||||
|
||||
- Additional info about your environment:
|
||||
- [ Any other information relevant to your issue. ]
|
||||
48
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
48
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
---
|
||||
name: Feature Request
|
||||
about: Suggest a new feature for Atmosphère.
|
||||
#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. ]
|
||||
|
||||
[ Please search for existing [feature requests](https://github.com/Atmosphere-NX/Atmosphere/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22features%2Ffeature-request%22) 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. ]</br>
|
||||
|
||||
#### Smaller Details:
|
||||
- [ These may include specific methods of implementation etc. ]</br>
|
||||
|
||||
#### 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.]
|
||||
|
||||
### What component do you feel this would best fit within?
|
||||
- [Fusée](https://github.com/Atmosphere-NX/Atmosphere#components)</br>
|
||||
- Atmosphère's custom bootloader.</br>
|
||||
- [Exosphère](https://github.com/Atmosphere-NX/Atmosphere#components)</br>
|
||||
- Fully-featured custom secure monitor.</br>
|
||||
- [Stratosphère](https://github.com/Atmosphere-NX/Atmosphere#components)</br>
|
||||
- Custom system modules.</br>
|
||||
- [**Thermosphère**](https://github.com/Atmosphere-NX/Atmosphere#components)</br>
|
||||
- Atmosphère's emuNAND implementation.</br>
|
||||
- [**Troposphère**](https://github.com/Atmosphere-NX/Atmosphere#components)</br>
|
||||
- Application-level patches to the Horizon OS.</br>
|
||||
|
||||
[ Note: **Bolded components are not implemented** or are still at the prototyping phase. ]
|
||||
|
||||
### 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 Atmosphère that did not already exist? ]</br>
|
||||
7
.github/ISSUE_TEMPLATE/question.md
vendored
Normal file
7
.github/ISSUE_TEMPLATE/question.md
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
name: Question
|
||||
about: Please ask questions in the ReSwitched discord, instead of making issues.
|
||||
---
|
||||
We would like to use GitHub to keep track of problems/feature requests.
|
||||
If you have a question, please join the ReSwitched discord for help.
|
||||
- Discord link: https://discordapp.com/invite/DThbZ7z
|
||||
14
.gitignore
vendored
14
.gitignore
vendored
@@ -65,10 +65,24 @@ dkms.conf
|
||||
*.tgz
|
||||
*.zip
|
||||
|
||||
# IDA binaries
|
||||
*.id0
|
||||
*.id1
|
||||
*.id2
|
||||
*.idb
|
||||
*.i64
|
||||
*.nam
|
||||
*.til
|
||||
|
||||
# KEYS file for sept-secondary.
|
||||
*.pyc
|
||||
sept/sept-secondary/KEYS.py
|
||||
|
||||
.**/
|
||||
|
||||
# NOTE: make sure to make exceptions to this pattern when needed!
|
||||
*.bin
|
||||
*.enc
|
||||
|
||||
**/out
|
||||
**/build
|
||||
|
||||
0
.gitmodules
vendored
Normal file
0
.gitmodules
vendored
Normal file
85
Makefile
85
Makefile
@@ -1,28 +1,49 @@
|
||||
TOPTARGETS := all clean dist
|
||||
AMSREV := $(shell git rev-parse --short HEAD)
|
||||
AMSBRANCH := $(shell git symbolic-ref --short HEAD)
|
||||
AMSHASH := $(shell git rev-parse --short HEAD)
|
||||
AMSREV := $(AMSBRANCH)-$(AMSHASH)
|
||||
|
||||
ifneq (, $(strip $(shell git status --porcelain 2>/dev/null)))
|
||||
AMSREV := $(AMSREV)-dirty
|
||||
endif
|
||||
|
||||
all: fusee creport
|
||||
fusee:
|
||||
COMPONENTS := fusee stratosphere exosphere thermosphere troposphere libraries
|
||||
|
||||
all: $(COMPONENTS)
|
||||
|
||||
thermosphere:
|
||||
$(MAKE) -C thermosphere all
|
||||
|
||||
exosphere: thermosphere
|
||||
$(MAKE) -C exosphere all
|
||||
|
||||
stratosphere: exosphere libraries
|
||||
$(MAKE) -C stratosphere all
|
||||
|
||||
troposphere: stratosphere
|
||||
$(MAKE) -C troposphere all
|
||||
|
||||
sept: exosphere
|
||||
$(MAKE) -C sept all
|
||||
|
||||
fusee: exosphere stratosphere sept
|
||||
$(MAKE) -C $@ all
|
||||
|
||||
creport:
|
||||
$(MAKE) -C stratosphere/creport all
|
||||
libraries:
|
||||
$(MAKE) -C libraries all
|
||||
|
||||
clean:
|
||||
$(MAKE) -C fusee clean
|
||||
rm -rf out
|
||||
|
||||
dist: fusee creport
|
||||
$(eval MAJORVER = $(shell grep '\ATMOSPHERE_RELEASE_VERSION_MAJOR\b' common/include/atmosphere/version.h \
|
||||
|
||||
dist: all
|
||||
$(eval MAJORVER = $(shell grep 'define ATMOSPHERE_RELEASE_VERSION_MAJOR\b' libraries/libvapours/include/vapours/ams/ams_api_version.h \
|
||||
| tr -s [:blank:] \
|
||||
| cut -d' ' -f3))
|
||||
$(eval MINORVER = $(shell grep '\ATMOSPHERE_RELEASE_VERSION_MINOR\b' common/include/atmosphere/version.h \
|
||||
$(eval MINORVER = $(shell grep 'define ATMOSPHERE_RELEASE_VERSION_MINOR\b' libraries/libvapours/include/vapours/ams/ams_api_version.h \
|
||||
| tr -s [:blank:] \
|
||||
| cut -d' ' -f3))
|
||||
$(eval MICROVER = $(shell grep '\ATMOSPHERE_RELEASE_VERSION_MICRO\b' common/include/atmosphere/version.h \
|
||||
$(eval MICROVER = $(shell grep 'define ATMOSPHERE_RELEASE_VERSION_MICRO\b' libraries/libvapours/include/vapours/ams/ams_api_version.h \
|
||||
| tr -s [:blank:] \
|
||||
| cut -d' ' -f3))
|
||||
$(eval AMSVER = $(MAJORVER).$(MINORVER).$(MICROVER)-$(AMSREV))
|
||||
@@ -30,16 +51,46 @@ dist: fusee creport
|
||||
rm -rf out
|
||||
mkdir atmosphere-$(AMSVER)
|
||||
mkdir atmosphere-$(AMSVER)/atmosphere
|
||||
mkdir -p atmosphere-$(AMSVER)/atmosphere/titles/0100000000000036
|
||||
cp fusee/fusee-secondary/fusee-secondary.bin atmosphere-$(AMSVER)/fusee-secondary.bin
|
||||
cp common/defaults/BCT.ini atmosphere-$(AMSVER)/BCT.ini
|
||||
cp common/defaults/loader.ini atmosphere-$(AMSVER)/atmosphere/loader.ini
|
||||
cp stratosphere/creport/creport.nsp atmosphere-$(AMSVER)/atmosphere/titles/0100000000000036/exefs.nsp
|
||||
mkdir atmosphere-$(AMSVER)/sept
|
||||
mkdir atmosphere-$(AMSVER)/switch
|
||||
mkdir -p atmosphere-$(AMSVER)/atmosphere/contents/0100000000000008
|
||||
mkdir -p atmosphere-$(AMSVER)/atmosphere/contents/010000000000000D
|
||||
mkdir -p atmosphere-$(AMSVER)/atmosphere/contents/0100000000000032
|
||||
mkdir -p atmosphere-$(AMSVER)/atmosphere/contents/0100000000000034
|
||||
mkdir -p atmosphere-$(AMSVER)/atmosphere/contents/0100000000000036
|
||||
mkdir -p atmosphere-$(AMSVER)/atmosphere/contents/0100000000000037
|
||||
mkdir -p atmosphere-$(AMSVER)/atmosphere/fatal_errors
|
||||
mkdir -p atmosphere-$(AMSVER)/atmosphere/config_templates
|
||||
mkdir -p atmosphere-$(AMSVER)/atmosphere/config
|
||||
cp fusee/fusee-primary/fusee-primary.bin atmosphere-$(AMSVER)/atmosphere/reboot_payload.bin
|
||||
cp fusee/fusee-mtc/fusee-mtc.bin atmosphere-$(AMSVER)/atmosphere/fusee-mtc.bin
|
||||
cp fusee/fusee-secondary/fusee-secondary.bin atmosphere-$(AMSVER)/atmosphere/fusee-secondary.bin
|
||||
cp fusee/fusee-secondary/fusee-secondary.bin atmosphere-$(AMSVER)/sept/payload.bin
|
||||
cp sept/sept-primary/sept-primary.bin atmosphere-$(AMSVER)/sept/sept-primary.bin
|
||||
cp sept/sept-secondary/sept-secondary.bin atmosphere-$(AMSVER)/sept/sept-secondary.bin
|
||||
cp sept/sept-secondary/sept-secondary_00.enc atmosphere-$(AMSVER)/sept/sept-secondary_00.enc
|
||||
cp sept/sept-secondary/sept-secondary_01.enc atmosphere-$(AMSVER)/sept/sept-secondary_01.enc
|
||||
cp config_templates/BCT.ini atmosphere-$(AMSVER)/atmosphere/config/BCT.ini
|
||||
cp config_templates/override_config.ini atmosphere-$(AMSVER)/atmosphere/config_templates/override_config.ini
|
||||
cp config_templates/system_settings.ini atmosphere-$(AMSVER)/atmosphere/config_templates/system_settings.ini
|
||||
cp -r config_templates/kip_patches atmosphere-$(AMSVER)/atmosphere/kip_patches
|
||||
cp -r config_templates/hbl_html atmosphere-$(AMSVER)/atmosphere/hbl_html
|
||||
cp stratosphere/boot2/boot2.nsp atmosphere-$(AMSVER)/atmosphere/contents/0100000000000008/exefs.nsp
|
||||
cp stratosphere/dmnt/dmnt.nsp atmosphere-$(AMSVER)/atmosphere/contents/010000000000000D/exefs.nsp
|
||||
cp stratosphere/eclct.stub/eclct.stub.nsp atmosphere-$(AMSVER)/atmosphere/contents/0100000000000032/exefs.nsp
|
||||
cp stratosphere/fatal/fatal.nsp atmosphere-$(AMSVER)/atmosphere/contents/0100000000000034/exefs.nsp
|
||||
cp stratosphere/creport/creport.nsp atmosphere-$(AMSVER)/atmosphere/contents/0100000000000036/exefs.nsp
|
||||
cp stratosphere/ro/ro.nsp atmosphere-$(AMSVER)/atmosphere/contents/0100000000000037/exefs.nsp
|
||||
mkdir -p atmosphere-$(AMSVER)/atmosphere/contents/0100000000000032/flags
|
||||
touch atmosphere-$(AMSVER)/atmosphere/contents/0100000000000032/flags/boot2.flag
|
||||
mkdir -p atmosphere-$(AMSVER)/atmosphere/contents/0100000000000037/flags
|
||||
touch atmosphere-$(AMSVER)/atmosphere/contents/0100000000000037/flags/boot2.flag
|
||||
cp troposphere/reboot_to_payload/reboot_to_payload.nro atmosphere-$(AMSVER)/switch/reboot_to_payload.nro
|
||||
cd atmosphere-$(AMSVER); zip -r ../atmosphere-$(AMSVER).zip ./*; cd ../;
|
||||
rm -r atmosphere-$(AMSVER)
|
||||
mkdir out
|
||||
mv atmosphere-$(AMSVER).zip out/atmosphere-$(AMSVER).zip
|
||||
cp fusee/fusee-primary/fusee-primary.bin out/fusee-primary.bin
|
||||
|
||||
|
||||
.PHONY: $(TOPTARGETS) fusee
|
||||
|
||||
.PHONY: $(TOPTARGETS) $(COMPONENTS)
|
||||
|
||||
19
README.md
19
README.md
@@ -3,6 +3,7 @@
|
||||
=====
|
||||
|
||||

|
||||
[](https://discordapp.com/invite/ZdqEhed)
|
||||
|
||||
Atmosphère is a work-in-progress customized firmware for the Nintendo Switch.
|
||||
|
||||
@@ -12,24 +13,36 @@ Components
|
||||
Atmosphère consists of multiple components, each of which replaces/modifies a different component of the system:
|
||||
|
||||
* Fusée: First-stage Loader, responsible for loading and validating stage 2 (custom TrustZone) plus package2 (Kernel/FIRM sysmodules), and patching them as needed. This replaces all functionality normally in Package1loader/NX Bootloader.
|
||||
* Sept: Payload used to enable support for runtime key derivation on 7.0.0.
|
||||
* Exosphère: Customized TrustZone, to run a customized Secure Monitor
|
||||
* Thermosphère: EL2 EmuNAND support, i.e. backing up and using virtualized/redirected NAND images
|
||||
* Stratosphère: Custom Sysmodule(s), both Rosalina style to extend the kernel/provide new features, and of the loader reimplementation style to hook important system actions
|
||||
* Troposphère: Application-level Horizon OS patches, used to implement desirable CFW features
|
||||
|
||||
Licensing
|
||||
=====
|
||||
|
||||
This software is licensed under the terms of the GPLv2, with exemptions for specific projects noted below.
|
||||
|
||||
You can find a copy of the license in the [LICENSE file](LICENSE).
|
||||
|
||||
Exemptions:
|
||||
* The [yuzu emulator project](https://github.com/yuzu-emu/yuzu) is exempt from GPLv2 licensing and may (at its option) instead license any source code authored for the Atmosphère project as GPLv2 or later.
|
||||
|
||||
Credits
|
||||
=====
|
||||
|
||||
Atmosphère is currently being developed and maintained by __SciresM__, __TuxSH__ and __hexkyz__.<br>
|
||||
Atmosphère is currently being developed and maintained by __SciresM__, __TuxSH__, __hexkyz__, and __fincs__.<br>
|
||||
In no particular order, we credit the following for their invaluable contributions:
|
||||
|
||||
* __switchbrew__ for the [libnx](https://github.com/switchbrew/libnx) project and the extensive [documentation, research and tool development](http://switchbrew.org) pertaining to the Nintendo Switch.
|
||||
* __devkitPro__ for the [devkitA64](https://devkitpro.org/) toolchain and libnx support.
|
||||
* __ReSwitched Team__ for additional [documentation, research and tool development](https://reswitched.tech/) pertaining to the Nintendo Switch.
|
||||
* __ReSwitched Team__ for additional [documentation, research and tool development](https://reswitched.team/) pertaining to the Nintendo Switch.
|
||||
* __ChaN__ for the [FatFs](http://elm-chan.org/fsw/ff/00index_e.html) module.
|
||||
* __Marcus Geelnard__ for the [bcl-1.2.0](https://sourceforge.net/projects/bcl/files/bcl/bcl-1.2.0) library.
|
||||
* __naehrwert__ and __st4rk__ for the original [hekate](https://github.com/nwert/hekate) project and its hwinit code base.
|
||||
* __CTCaer__ for the continued [hekate](https://github.com/CTCaer/hekate) project's fork.
|
||||
* __CTCaer__ for the continued [hekate](https://github.com/CTCaer/hekate) project's fork and the [minerva_tc](https://github.com/CTCaer/minerva_tc) project.
|
||||
* __m4xw__ for development of the [emuMMC](https://github.com/m4xw/emummc) project.
|
||||
* __Riley__ for suggesting "Atmosphere" as a Horizon OS reimplementation+customization project name.
|
||||
* __hedgeberg__ for research and hardware testing.
|
||||
* __lioncash__ for code cleanup and general improvements.
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
BCT0
|
||||
[stage1]
|
||||
stage2_path = fusee-secondary.bin
|
||||
stage2_addr = 0xF0000000
|
||||
stage2_entrypoint = 0xF0000000
|
||||
@@ -1,4 +0,0 @@
|
||||
[config]
|
||||
hbl_tid=010000000000100D
|
||||
hbl_path=atmosphere/hbl.nsp
|
||||
override_key=!R
|
||||
20
config_templates/BCT.ini
Normal file
20
config_templates/BCT.ini
Normal file
@@ -0,0 +1,20 @@
|
||||
BCT0
|
||||
[stage1]
|
||||
stage2_path = atmosphere/fusee-secondary.bin
|
||||
stage2_mtc_path = atmosphere/fusee-mtc.bin
|
||||
stage2_addr = 0xF0000000
|
||||
stage2_entrypoint = 0xF0000000
|
||||
|
||||
[exosphere]
|
||||
; Note: Disabling debugmode will cause parts of ams.tma to not work, in the future.
|
||||
debugmode = 1
|
||||
debugmode_user = 0
|
||||
; Note: Disabling usermode exception handlers will cause atmosphere to not fail gracefully under error conditions.
|
||||
; Support will not be provided to users who disable these. If you do not know what you are doing, leave them on.
|
||||
disable_user_exception_handlers = 0
|
||||
; Note: It's currently unknown what effects enabling the usermode PMU register access may have on official code.
|
||||
enable_user_pmu_access = 0
|
||||
|
||||
[stratosphere]
|
||||
; To force-enable nogc, add nogc = 1
|
||||
; To force-disable nogc, add nogc = 0
|
||||
@@ -0,0 +1 @@
|
||||
^http*
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
10
config_templates/override_config.ini
Normal file
10
config_templates/override_config.ini
Normal file
@@ -0,0 +1,10 @@
|
||||
[hbl_config]
|
||||
; program_id=010000000000100D
|
||||
; override_any_app=true
|
||||
; path=atmosphere/hbl.nsp
|
||||
; override_key=!R
|
||||
; override_any_app_key=R
|
||||
|
||||
[default_config]
|
||||
; override_key=!L
|
||||
; cheat_enable_key=!L
|
||||
43
config_templates/system_settings.ini
Normal file
43
config_templates/system_settings.ini
Normal file
@@ -0,0 +1,43 @@
|
||||
; Disable uploading error reports to Nintendo
|
||||
[eupld]
|
||||
; upload_enabled = u8!0x0
|
||||
; Control whether RO should ease its validation of NROs.
|
||||
; (note: this is normally not necessary, and ips patches can be used.)
|
||||
[ro]
|
||||
; ease_nro_restriction = u8!0x0
|
||||
; Atmosphere custom settings
|
||||
[atmosphere]
|
||||
; Reboot from fatal automatically after some number of milliseconds.
|
||||
; If field is not present or 0, fatal will wait indefinitely for user input.
|
||||
; fatal_auto_reboot_interval = u64!0x0
|
||||
; Make the power menu's "reboot" button reboot to payload.
|
||||
; Set to "normal" for normal reboot, "rcm" for rcm reboot.
|
||||
; power_menu_reboot_function = str!payload
|
||||
; Controls whether dmnt cheats should be toggled on or off by
|
||||
; default. 1 = toggled on by default, 0 = toggled off by default.
|
||||
; dmnt_cheats_enabled_by_default = u8!0x1
|
||||
; Controls whether dmnt should always save cheat toggle state
|
||||
; for restoration on new game launch. 1 = always save toggles,
|
||||
; 0 = only save toggles if toggle file exists.
|
||||
; dmnt_always_save_cheat_toggles = u8!0x0
|
||||
; Enable writing to BIS partitions for HBL.
|
||||
; This is probably undesirable for normal usage.
|
||||
; enable_hbl_bis_write = u8!0x0
|
||||
; Enable reading the CAL0 partition for HBL.
|
||||
; This is probably undesirable for normal usage.
|
||||
; enable_hbl_cal_read = u8!0x0
|
||||
; Controls whether fs.mitm should redirect save files
|
||||
; to directories on the sd card.
|
||||
; 0 = Do not redirect, 1 = Redirect.
|
||||
; NOTE: EXPERIMENTAL
|
||||
; If you do not know what you are doing, do not touch this yet.
|
||||
; fsmitm_redirect_saves_to_sd = u8!0x0
|
||||
[hbloader]
|
||||
; Controls the size of the homebrew heap when running as applet.
|
||||
; If set to zero, all available applet memory is used as heap.
|
||||
; The default is zero.
|
||||
; applet_heap_size = u64!0x0
|
||||
; Controls the amount of memory to reserve when running as applet
|
||||
; for usage by other applets. This setting has no effect if
|
||||
; applet_heap_size is non-zero. The default is 0x8600000.
|
||||
; applet_heap_reservation_size = u64!0x8600000
|
||||
@@ -1,6 +1,8 @@
|
||||
# Building Atmosphère
|
||||
The process for building Atmosphère is similar to building Fusée Gelée payloads and other Switch apps.
|
||||
|
||||
In order to build Atmosphère you must have devkitARM and devkitA64 installed on your computer. You can find instructions on how to install and setup devkitARM and devkitA64 on various OSes [here](https://devkitpro.org/wiki/Getting_Started).
|
||||
In order to build Atmosphère you must have devkitARM and devkitA64 installed on your computer. You can find instructions on how to install and setup devkitARM and devkitA64 on various OSes [here](https://devkitpro.org/wiki/Getting_Started). You'll need to install the following packages via (dkp-)pacman: switch-dev switch-freetype devkitARM devkitarm-rules
|
||||
|
||||
Once you have finished installing devkitARM and devkitA64, simply clone the Atmosphère repo, change to it and run `make`.
|
||||
sept requires you have python installed with the pycryptodome PyPi packages (`pip install pycryptodome`). You may also want to install the zip package from your package manager of choice to support the `make dist` recipe.
|
||||
|
||||
Once you have finished installing the devkitPro-provided toolchain/libraries, python, and the dependencies, simply clone the Atmosphère repo (clone with the -r flag), change your directory to it and run `make`.
|
||||
|
||||
@@ -1,14 +1,453 @@
|
||||
# Changelog
|
||||
## 0.10.1
|
||||
+ A bug was fixed that caused memory reallocation to the system pool to work improperly on firmware 5.0.0 and above.
|
||||
+ Atmosphere was always trying to deallocate memory away from the applet pool and towards the system pool.
|
||||
+ The intent of this is to facilitate running more custom sysmodules/atmosphere binaries.
|
||||
+ However, while memory was always successfully taken away from the applet pool, on 5.0.0+ granting it to the system pool did not work for technical reasons.
|
||||
+ If you are interested in the technical details, talk to SciresM.
|
||||
+ This has now been fixed by adding new kernel patches, and memory is correctly granted to the system pool as intended.
|
||||
+ Atmosphere's library system has been overhauled:
|
||||
+ libstratosphere's repository has been rebranded, more generally, to "Atmosphere-libs".
|
||||
+ In addition to libstratosphere, a new general library for not-stratosphere-specific code has been added.
|
||||
+ This is currently named `libvapours`.
|
||||
+ In the future, kernel functionality will be available as `libmesosphere`.
|
||||
+ The build system for stratosphere system modules has been similarly overhauled.
|
||||
+ A number of other bugs were fixed, including:
|
||||
+ A bug was fixed that could cause memory corruption when redirecting certain Romfs content.
|
||||
+ A bug was fixed that could cause an infinite loop when redirecting certain Romfs content.
|
||||
+ A bug was fixed that could cause certain NROs to fail to load.
|
||||
+ This caused the latest version of Super Smash Bros to display "An error has occurred" on launch.
|
||||
+ A bug was fixed that caused input/output array sizes for certain circumstances to be calculated incorrectly.
|
||||
+ This caused cheats to fail to function properly.
|
||||
+ C++ exception code is now more thoroughly removed from stratosphere executables.
|
||||
+ This saves a minor amount of memory.
|
||||
+ A number of minor logic inversions were fixed in libstratosphere.
|
||||
+ These did not affect any code currently used by released Atmosphere binaries.
|
||||
+ *Please note**: Because this update is releasing so soon after 0.10.0, the removal of the temporary hid-mitm has been postponed to 0.10.2.
|
||||
+ Please ensure your homebrew is updated.
|
||||
+ Random number generation now uses TinyMT instead of XorShift.
|
||||
+ General system stability improvements to enhance the user's experience.
|
||||
## 0.10.0
|
||||
+ Support was added for 9.1.0
|
||||
+ **Please note**: The temporary hid-mitm added in Atmosphere 0.9.0 will be removed in Atmosphere 0.10.1.
|
||||
+ Please ensure your homebrew is updated.
|
||||
+ The Stratosphere rewrite was completed.
|
||||
+ libstratosphere was rewritten as part of Stratosphere's refactor.
|
||||
+ Code responsible for providing and managing IPC services was greatly improved.
|
||||
+ The new code is significantly more accurate (it is bug-for-bug compatible with Nintendo's code), and significantly faster.
|
||||
+ ams.mitm was rewritten as part of Stratosphere's refactor.
|
||||
+ Saves redirected to the SD card are now separated for sysmmc vs emummc.
|
||||
+ **Please note**: If you find any bugs, please report them so they can be fixed.
|
||||
+ Thanks to the rewrite, Atmosphere now uses significantly less memory.
|
||||
+ Roughly 10 additional megabytes are now available for custom system modules to use.
|
||||
+ This means you can potentially run more custom system modules simultaneously.
|
||||
+ If system modules are incompatible, please ask their authors to reduce their memory footprints.
|
||||
+ Atmosphere's configuration layout has had major changes.
|
||||
+ Configuration now lives inside /atmosphere/config/.
|
||||
+ Atmosphere code now knows what default values should be, and includes them in code.
|
||||
+ It is no longer an error if configuration inis are not present.
|
||||
+ Correspondingly, Atmosphere no longer distributes default configuration inis.
|
||||
+ Templates are provided in /atmosphere/config_templates.
|
||||
+ loader.ini was renamed to override_config.ini.
|
||||
+ This fixes the longstanding problem that atmosphere updates overwrote user configuration when extracted.
|
||||
+ Atmosphere's process override layout was changed.
|
||||
+ Atmosphere now uses the /atmosphere/contents directory, instead of /atmosphere/titles.
|
||||
+ This goes along with a refactoring to remove all reference to "title id" from code, as Nintendo does not use the term.
|
||||
+ To make this transition easier, a temporary functionality has been added that migrates folders to the new directory.
|
||||
+ When booting into 0.10.0, Atmosphere will rename /atmosphere/titles/`<program id>` to /atmosphere/contents/`<program id>`.
|
||||
+ This functionality may or may not be removed in some future update.
|
||||
+ This should solve any transition difficulties for the typical user.
|
||||
+ Please make sure that any future mods you install extract to the correct directory.
|
||||
+ Support for configuring override keys for hbl was improved.
|
||||
+ The key used to override applications versus a specific program can now be different.
|
||||
+ The key to override a specific program can be managed via override_key.
|
||||
+ The key to override any app can be managed via override_any_app_key.
|
||||
+ Default override behavior was changed.
|
||||
+ By default, atmosphere will now override the album applet with hbl unless R is held.
|
||||
+ By default, atmosphere will now override any application with hbl only if R is held.
|
||||
+ The default amount of applet memory reserved has been slightly increased.
|
||||
+ This allows the profile selector applet to work by default in applet mode.
|
||||
+ The way process override status is captured was changed.
|
||||
+ Process override keys are now captured exactly once, when the process is created.
|
||||
+ This fixes the longstanding issue where letting go of the override button partway into the process launch could cause problems.
|
||||
+ The Mitm API was changed to pass around override status.
|
||||
+ Mitm services now know what keys were held when the client was created, as well as whether the client is HBL/should override contents.
|
||||
+ An extension was added to pm:info to allow querying a process's override status.
|
||||
+ Thanks to process override capture improvements, hbl html behavior has been greatly improved.
|
||||
+ Web applets launched by hbl will now always see the /atmosphere/hbl_html filesystem
|
||||
+ Support was added to exosphere for enabling usermode access to the PMU registers.
|
||||
+ This can be controlled via exosphere!enable_user_pmu_access in BCT.ini.
|
||||
+ An enormous number of minor bugs were fixed.
|
||||
+ dmnt's cheat VM had a fix for an inversion in opcode behavior.
|
||||
+ An issue was fixed in fs.mitm's management of domain object IDs that could lead to system corruption in rare cases.
|
||||
+ The Mitm API no longer silently fails when attempting to handle commands passing C descriptors.
|
||||
+ On previous atmosphere versions, certain commands to FS would silently fail due to this...
|
||||
+ No users reported any visible errors, but it was definitely a problem behind the scenes.
|
||||
+ These commands are now handled correctly.
|
||||
+ Atmosphere can now display a fatal error screen significantly earlier in the boot process, if things go wrong early on.
|
||||
+ The temporary hid mitm will no longer sometimes cause games to fail to detect input.
|
||||
+ Mitm Domain object ID management no longer desynchronizes from the host process.
|
||||
+ An issue was fixed that could cause service acquisition to hang forever if certain sm commands were called in a precise order.
|
||||
+ An off-by-one was fixed that could cause memory corruption in server memory management.
|
||||
+ ... and too many more bugs fixed to reasonably list them all :)
|
||||
+ General system stability improvements to enhance the user's experience.
|
||||
## 0.9.4
|
||||
+ Support was added for 9.0.0.
|
||||
+ **Please note**: 9.0.0 made a number of changes that may cause some issues with homebrew. Details:
|
||||
+ 9.0.0 changed HID in a way that causes libnx to be unable to detect button input.
|
||||
+ Homebrew should be recompiled with newest libnx to fix this.
|
||||
+ Atmosphere now provides a temporary hid-mitm that will cause homebrew to continue to work as expected.
|
||||
+ This mitm will be removed in a future Atmosphere revision once homebrew has been updated, to allow users to use a custom hid mitm again if they desire.
|
||||
+ 9.0.0 introduced an dependency in FS on the USB system module in order to launch the SD card.
|
||||
+ This means the USB system module must now be launched before the SD card is initialized.
|
||||
+ Correspondingly, the USB system module can no longer be IPS patched, and its settings cannot be reliably mitm'd.
|
||||
+ We know this is frustrating, so we'll be looking into whether there is some way of addressing this in the future.
|
||||
+ An off-by-one error was fixed in `boot` system module's pinmux initialization.
|
||||
+ This could theoretically have caused issues with HdmiCec communication.
|
||||
+ No users reported issues, so it's unclear if this was a problem in practice.
|
||||
+ A bug was fixed that could cause webapplet launching homebrew to improperly set the accessible url whitelist.
|
||||
+ BIS key generation has been fixed for newer hardware.
|
||||
+ Newer hardware uses new, per-firmware device key to generate BIS keys instead of the first device key, so previously the wrong keys were generated as backup.
|
||||
+ This only affects units manufactured after ~5.0.0.
|
||||
+ General system stability improvements to enhance the user's experience.
|
||||
## 0.9.3
|
||||
+ Thanks to hexkyz, fusee's boot sequence has been greatly optimized.
|
||||
+ Memory training is now managed by a separate binary (`fusee-mtc`, loaded by fusee-primary before fusee-secondary).
|
||||
+ Unnecessarily long splash screen display times were reduced.
|
||||
+ The end result is that Atmosphere now boots *significantly* faster. :)
|
||||
+ **Note:** This means fusee-primary must be updated for Atmosphere to boot successfully.
|
||||
+ The version string was adjusted, and now informs users whether or not they are using emummc.
|
||||
+ Atmosphere now automatically backs up the user's BIS keys on boot.
|
||||
+ This should prevent a user from corrupting nand without access to a copy of the keys needed to fix it.
|
||||
+ This is especially relevant on ipatched units, where the RCM vulnerability is not an option for addressing bricks.
|
||||
+ The `pm` system module was rewritten as part of Stratosphere's ongoing refactor.
|
||||
+ Support was added for forward-declaring a mitm'd service before a custom user sysmodule is launched.
|
||||
+ This should help resolve dependency issues with service registration times.
|
||||
+ SM is now informed of every process's title id, including built-in system modules.
|
||||
+ The `creport` system module was rewritten as part of Stratosphere's ongoing refactor.
|
||||
+ creport now dumps up to 0x100 of stack from each thread in the target process.
|
||||
+ A few bugs were fixed, including one that caused creport to incorrectly dump process dying messages.
|
||||
+ Defaults were added to `system_settings.ini` for controlling hbloader's memory usage in applet mode.
|
||||
+ These defaults reserve enough memory so that homebrew can launch swkbd while in applet mode.
|
||||
+ The `fatal` system module was rewritten as part of Stratosphere's ongoing refactor.
|
||||
+ Incorrect display output ("2000-0000") has been fixed. Fatal will now correctly show 2162-0002 when this occurs.
|
||||
+ A longstanding bug in how fatal manages the displays has been fixed, and official display init behavior is now matched precisely.
|
||||
+ General system stability improvements to enhance the user's experience.
|
||||
## 0.9.2
|
||||
+ A number of emummc bugfixes were added (all thanks to @m4xw's hard work). The following is a summary of emummc changes:
|
||||
+ Support for file-based emummc instances was fixed.
|
||||
+ Please note: file-based emummc is still unoptimized, and so may be much slower than partition-based.
|
||||
+ This speed differential should hopefully be made better in a future emummc update.
|
||||
+ The way emummc handles power management was completely overhauled.
|
||||
+ Emummc now properly handles init/de-init, and now supports low voltage mode.
|
||||
+ Much better support for shutdown was added, which should assuage corruption/synchronization problems.
|
||||
+ This should also improve support for more types of SD cards.
|
||||
+ A bug was fixed that caused emummc to not work on lower system versions due to missing SVC access.
|
||||
+ **Please note**: The configuration entries used for emummc have been changed.
|
||||
+ `emummc_` prefixes have been removed, since they are superfluous given the `emummc` category they are under.
|
||||
+ As an example, `emummc!emummc_enabled` is now `emummc!enabled`.
|
||||
+ INI configurations made by @CTCaer's [tool](https://github.com/ctcaer/hekate/releases/latest) (which is the recommended way to manage emummc) should automatically work as expected/be corrected.
|
||||
+ **If you do not wish to use the above, you will need to manually correct your configuration file**.
|
||||
+ General system stability improvements to enhance the user's experience.
|
||||
+ Stratosphere is currently in the process of being re-written/refactored.
|
||||
+ Stratosphere was my (SciresM's) first C++ project, ever -- the code written for it a year ago when I was learning C++ is/was of much lower quality than code written more recently.
|
||||
+ Code is thus being re-rwitten for clarity/stlye/to de-duplicate functionality, with much being moved into libstratosphere.
|
||||
+ Stratosphere will, after the rewrite, globally use the `sts::` namespace -- this should greatly enhancing libstratosphere's ability to provide functionality for system modules.
|
||||
+ The rewritten modules consistently have lower memory footprints, and should be easier to maintain going forwards.
|
||||
+ The `sm`, `boot`, `spl`, `ro`, and `loader` modules have been tackled so far.
|
||||
+ General system stability improvements to enhance the user's experience.
|
||||
## 0.9.1
|
||||
+ Support was added for 8.1.0.
|
||||
+ Please note, emummc is still considered **beta/experimental** -- this is not the inevitable bugfix update for it, although some number of bugs have been fixed. :)
|
||||
+ General system stability improvements to enhance the user's experience.
|
||||
## 0.9.0
|
||||
+ Creport output was improved significantly.
|
||||
+ Thread names are now dumped on crash in addition to 0x100 of TLS from each thread.
|
||||
+ This significantly aids debugging efforts for crashes.
|
||||
+ Support was added for 32-bit stackframes, so reports can now be generated for 32-bit games.
|
||||
+ `dmnt`'s Cheat VM was extended to add a new debug opcode.
|
||||
+ With thanks to/collaboration with @m4xw and @CTCaer, support was added for redirecting NAND to the SD card (emummc).
|
||||
+ Please note, this support is very much **beta/experimental**.
|
||||
+ It is quite likely we have not identified all bugs -- those will be fixed as they are reported over the next few days/weeks.
|
||||
+ In addition, some niceties (e.g. having a separate Atmosphere folder per emummc instance) still need some thought put in before they can be implemented in a way that makes everyone happy.
|
||||
+ If you are not an advanced user, you may wish to think about waiting for the inevitable 0.9.1 bugfix update before using emummc as your default boot option.
|
||||
+ You may especially wish to consider waiting if you are using Atmosphere on a unit with the RCM bug patched.
|
||||
+ Emummc is managed by editing the emummc section of "emummc/emummc.ini".
|
||||
+ To enable emummc, set `emummc!emummc_enabled` = 1.
|
||||
+ Support is included for redirecting NAND to a partition on the SD card.
|
||||
+ This can be done by setting `emummc!emummc_sector` to the start sector of your partition (e.g., `emummc_sector = 0x1A010000`).
|
||||
+ Support is also included for redirecting NAND to a collection of loose files on the SD card.
|
||||
+ This can be done by setting `emummc!emummc_path` to the folder (with archive bit set) containing the NAND boot partitions' files "boot0" and "boot1", and the raw NAND image files "00", "01", "02", etc. (single "00" file with the whole NAND image requires exFAT mode while multipart NAND can be used in both exFAT and FAT32 modes).
|
||||
+ The `Nintendo` contents directory can be redirected arbitrarily.
|
||||
+ By default, it will be redirected to `emummc/Nintendo_XXXX`, where `XXXX` is the hexadecimal representation of the emummc's ID.
|
||||
+ The current emummc ID may be selected by changing `emummc!emummc_id` in emummc.ini.
|
||||
+ This can be set to any arbitrary directory by setting `emummc!emummc_nintendo_path`.
|
||||
+ To create a backup usable for emummc, users may use tools provided by the [hekate](https://github.com/CTCaer/hekate) project.
|
||||
+ If, when using emummc, you encounter a bug, *please be sure to report it* -- that's the only way we can fix it. :)
|
||||
## 0.8.10
|
||||
+ A bug was fixed that could cause incorrect system memory allocation on 5.0.0.
|
||||
+ 5.0.0 should now correctly have an additional 12 MiB allocated for sysmodules.
|
||||
+ Atmosphère features which check button presses now consider all controllers, isntead of just P1.
|
||||
+ Support was added for configuring language/region on a per-game basis.
|
||||
+ This is managed by editing `atmosphere/titles/<title id>/config.ini` for the game.
|
||||
+ To edit title language, edit `override_config!override_language`.
|
||||
+ The languages supported are `ja`, `en-US`, `fr`, `de`, `it`, `es`, `zh-CN`, `ko`, `nl`, `pt`, `ru`, `zh-TW`, `en-GB`, `fr-CA`, `es-419`, `zh-Hans`, `zh-Hant`.
|
||||
+ To edit title region, edit `override_config!override_region`.
|
||||
+ The regions supported are `jpn`, `usa`, `eur`, `aus`, `chn`, `kor`, `twn`.
|
||||
+ Atmosphère now provides a reimplementation of the `boot` system module.
|
||||
+ `boot` is responsible for performing hardware initialization, showing the Nintendo logo, and repairing NAND on system update failure.
|
||||
+ Atmosphère's `boot` implementation preserves AutoRCM during NAND repair.
|
||||
+ NAND repair occurs when an unexpected shutdown or error happens during a system update.
|
||||
+ This fixes a final edge case where AutoRCM might be removed by HOS, which could cause a user to burn fuses.
|
||||
+ General system stability improvements to enhance the user's experience.
|
||||
## 0.8.9
|
||||
+ A number of bugs were fixed, including:
|
||||
+ A data abort was fixed when mounting certain partitions on NAND.
|
||||
+ All Stratosphère system modules now only maintain a connection to `sm` when actively using it.
|
||||
+ This helps mitigate the scenario where sm hits the limit of 64 active connections and crashes.
|
||||
+ This sometimes caused crashes when custom non-Atmosphère sysmodules were active and the user played certain games (ex: Smash's Stage Builder).
|
||||
+ fatal now uses the 8.0.0 clkrst API, instead of silently failing to adjust clock rates on that firmware version.
|
||||
+ A wait loop is now performed when trying to get a session to `sm`, in the case where `sm:` is not yet registered.
|
||||
+ This fixes a race condition that could cause a failure to boot under certain circumstances.
|
||||
+ libstratosphere's handling of domain object closing has been improved.
|
||||
+ Previously, this code could cause crashes/extremely odd behavior (misinterpreting what object a service is) under certain circumstances.
|
||||
+ An optional automatic reboot timer was added to fatal.
|
||||
+ By setting the system setting `atmosphere!fatal_auto_reboot_interval` to a non-zero u64 value, fatal can be made to automatically reboot after a certain number of milliseconds.
|
||||
+ If the setting is zero or not present, fatal will wait for user input as usual.
|
||||
+ Atmosphère now provides a reimplementation of the `ro` system module.
|
||||
+ `ro` is responsible for loading dynamic libraries (NROs) on 3.0.0+.
|
||||
+ On 1.0.0-2.3.0, this is handled by `loader`.
|
||||
+ Atmosphere's `ro` provides this functionality (`ldr:ro`, `ro:dmnt`) on all firmware versions.
|
||||
+ An extension was implemented to provide support for applying IPS patches to NROs.
|
||||
+ All patches at paths like /atmosphere/nro_patches/<user-defined patch name>/<Hex Build-ID for NRO to patch>.ips will be applied, allowing for easy distribution of patches.
|
||||
+ Both the IPS and IPS32 formats are supported.
|
||||
+ Atmosphère now provides a reimplementation of the `spl` system module.
|
||||
+ `spl` (Secure Platform Services) is responsible for cryptographic operations, including all communications with the secure monitor (exosphère).
|
||||
+ In the future, this may be used to provide extensions to the API for interacting with exosphère from userland.
|
||||
+ General system stability improvements to enhance the user's experience.
|
||||
## 0.8.8
|
||||
+ Support was added for firmware version 8.0.0.
|
||||
+ Custom exception handlers were added to stratosphere modules.
|
||||
+ If a crash happens in a core atmosphere module now, instead of silently failing a reboot will occur to log the information to the SD card.
|
||||
+ A bug was fixed in creport that caused games to hang when crashing under certain circumstances.
|
||||
+ A bug was fixed that prevented maintenance mode from booting on 7.0.0+.
|
||||
+ General system stability improvements to enhance the user's experience.
|
||||
## 0.8.7
|
||||
+ A few bugs were fixed that could cause fatal to fail to show an error under certain circumstances.
|
||||
+ A bug was fixed that caused an error when launching certain games (e.g. Hellblade: Senua's Sacrifice).
|
||||
+ Loader had support added in ams-0.8.4 for a new (7.0.0+) flag bit in NPDMs during process creation, but forgot to allow this bit to be set when validating the NPDM.
|
||||
+ dmnt's cheat virtual machine received new instructions.
|
||||
+ These allow for saving, restoring, or clearing registers to a secondary bank, effectively doubling the number of values that can be stored.
|
||||
+ SHA256 code has been swapped from linux code to libnx's new hw-accelerated cryptography API.
|
||||
+ Extensions were added to smcGetInfo:
|
||||
+ A ConfigItem was added to detect whether the current unit has the RCM bug patched.
|
||||
+ A ConfigItem was added to retrieve the current Atmosphère build hash.
|
||||
+ Exosphère now tells the kernel to enable user-mode exception handlers, which should allow for better crash reporting/detection from Atmosphère's modules in the future..
|
||||
+ Opt-in support was added for redirecting game save files to directories on the SD card.
|
||||
+ Please note, this feature is **experimental**, and may cause problems. Please use at your own risk (and back up your saves before enabling it), as it still needs testing.
|
||||
+ This can be enabled by setting `atmosphere!fsmitm_redirect_saves_to_sd` to 1 in `system_settings.ini`.
|
||||
+ General system stability improvements to enhance the user's experience.
|
||||
## 0.8.6
|
||||
+ A number of bugs were fixed, including:
|
||||
+ A case of inverted logic was fixed in fs.mitm which prevented the flags system from working correctly.
|
||||
+ Time service access was corrected in both creport/fatal.
|
||||
+ This fixes the timestamps used in fatal/crash report filenames.
|
||||
+ A coherency issue was fixed in exosphère's Security Engine driver.
|
||||
+ This fixes some instability issues encountered when overclocking the CPU.
|
||||
+ Loader now unmaps NROs correctly, when ldr:ro is used.
|
||||
+ This fixes a crash when repeatedly launching the web applet on < 3.0.0.
|
||||
+ Usage of hidKeysDown was corrected to hidKeysHeld in several modules.
|
||||
+ This fixes a rare issue where keypresses may have been incorrectly detected.
|
||||
+ An issue with code filesystem unmounting was fixed in loader.
|
||||
+ This issue could occasionally cause a fatal error 0x1015 to be thrown on boot.
|
||||
+ Two bugs were fixed in the implementations of dmnt's cheat virtual machine.
|
||||
+ These could cause cheats to work incorrectly under certain circumstances.
|
||||
+ PM now uses a static buffer instead of a dynamically allocated one during process launch.
|
||||
+ This fixes a memory exhaustion problem when building with gcc 8.3.0.
|
||||
+ A workaround for a deadlock bug in Horizon's kernel on >= 6.0.0 was added in dmnt.
|
||||
+ This prevents a system hang when booting certain titles with cheats enabled (ex: Mario Kart 8 Deluxe).
|
||||
+ set.mitm now reads the system firmware version directly from the system version archive, instead of calling into set:sys.
|
||||
+ This fixes compatibility with 1.0.0, which now successfully boots again.
|
||||
+ dmnt's cheat virtual machine had some instruction set changes.
|
||||
+ A new opcode was added for beginning conditional blocks based on register contents.
|
||||
+ More addressing modes were added to the StoreRegisterToAddress opcode.
|
||||
+ These should allow for more complex cheats to be implemented.
|
||||
+ A new system for saving the state of cheat toggles between game boots was added.
|
||||
+ Toggles are now saved to `atmosphere/titles/<title id>/cheats/toggles.txt` when either toggles were successfully loaded from that file or the system setting `atmosphere!dmnt_always_save_cheat_toggles` is non-zero.
|
||||
+ This removes the need for manually setting cheats from all-on or all-off to the desired state on each game boot.
|
||||
+ The default behavior for loader's HBL support was changed.
|
||||
+ Instead of launching HBL when album is launched without R held, loader now launches HBL when album or any game is launched with R held.
|
||||
+ Loader will now override any app in addition to a specific title id when `hbl_config!override_any_app` is true in `loader.ini`.
|
||||
+ Accordingly, the `hbl_config!title_id=app` setting was deprecated. Support will be removed in Atmosphère 0.9.0.
|
||||
+ First-class support was added to loader and fs.mitm for enabling homebrew to launch web applets.
|
||||
+ Loader will now cause the "HtmlDocument" NCA path to resolve for whatever title HBL is taking over, even if it would not normally do so.
|
||||
+ fs.mitm will also now cause requests to mount the HtmlDocument content for HBL's title to open the `sdmc:/atmosphere/hbl_html` folder.
|
||||
+ By default, this just contains a URL whitelist.
|
||||
+ General system stability improvements to enhance the user's experience.
|
||||
## 0.8.5
|
||||
+ Support was added for overriding content on a per-title basis, separate from HBL override.
|
||||
+ This allows for using mods on the same title that one uses to launch HBL.
|
||||
+ By default, `!L` is used for title content override (this is configurable by editing `default_config!override_key` in `loader.ini`)
|
||||
+ This key combination can be set on a per-title basis by creating a `atmosphere/titles/<title id>/config.ini`, and editing `override_config!override_key`.
|
||||
+ Content headers were added for the embedded files inside of fusee-secondary.
|
||||
+ This will allow non-fusee bootloaders (like `hekate`) to extract the components bundled inside release binaries.
|
||||
+ This should greatly simplify the update process in the future, for users who do not launch Atmosphère using fusee.
|
||||
+ Support for cheat codes was added.
|
||||
+ These are handled by a new `dmnt` sysmodule, which will also reimplement Nintendo's Debug Monitor in the future.
|
||||
+ Cheat codes can be enabled/disabled at application launch via a per-title key combination.
|
||||
+ For details, please see the [cheat loading documentation](https://github.com/Atmosphere-NX/Atmosphere/blob/master/docs/cheats.md#cheat-loating-process).
|
||||
+ Cheat codes are fully backwards compatible with the pre-existing format, although a number of bugs have been fixed and some new features have been added.
|
||||
+ For details, please see [the compatibility documentation](https://github.com/Atmosphere-NX/Atmosphere/blob/master/docs/cheats.md#cheat-code-compatibility).
|
||||
+ An HIPC service API was added (`dmnt:cht`), that will allow user homebrew to interface with and control Atmosphère's cheat manager.
|
||||
+ Please see [the relevant documentation](https://github.com/Atmosphere-NX/Atmosphere/blob/master/docs/modules/dmnt.md).
|
||||
+ Full client code can be found in [libstratosphere](https://github.com/Atmosphere-NX/libstratosphere/blob/master/include/stratosphere/services/dmntcht.h).
|
||||
+ Users interested in interfacing should see [EdiZon](https://github.com/WerWolv/EdiZon), which should have support for interfacing with Atmosphère's API shortly after 0.8.5 releases.
|
||||
+ A bug was fixed that would cause Atmosphère's fatal screen to not show on 1.0.0-2.3.0.
|
||||
+ A bug was fixed that caused Atmosphère's automatic ProdInfo backups to be corrupt.
|
||||
+ General system stability improvements to enhance the user's experience.
|
||||
## 0.8.4
|
||||
+ Support for 7.0.0/7.0.1 was added.
|
||||
+ This is facilitated through a new payload, `sept`, which can be signed, encrypted, and then loaded by Nintendo's TSEC firmware.
|
||||
+ `sept` will derive the keys needed to boot new firmware, and then load `sept/payload.bin` off the SD card and jump to it.
|
||||
+ Recognition of applications for override/mitm has been improved.
|
||||
+ Nintendo's official Title ID range (`0x0100000000000000`-`0x01FFFFFFFFFFFFFF`) is now enforced.
|
||||
+ A deadlock condition was fixed involving libstratosphere mitm sysmodules.
|
||||
+ Kernel patches for JIT support were added (Thanks, @m4xw!).
|
||||
+ These loosen restrictions on caller process in svcControlCodeMemory.
|
||||
+ `set.mitm` and `fs.mitm` were merged into a single `ams_mitm` sysmodule.
|
||||
+ This saves a process ID, allowing users to run one additional process up to the 0x40 process limit.
|
||||
+ A `bpc.mitm` component was added, performing custom behavior on shutdown/reboot requests from `am` or applications.
|
||||
+ Performing a reboot from the reboot menu now reboots to atmosphere. This can be configured via `system_settings.ini`.
|
||||
+ Performing a shutdown from the reboot menu now works properly with AutoRCM, and does a real shutdown.
|
||||
+ General system stability improvements to enhance the user's experience.
|
||||
## 0.8.3
|
||||
+ A custom warmboot firmware was implemented, which does not perform anti-downgrade fuse checks.
|
||||
+ This fixes sleep mode when using a downgraded NAND.
|
||||
+ This also removes Atmosphère's final dependency on Nintendo's encrypted PK11 binary; all components are now re-implemented.
|
||||
+ The ExternalContentSource API was changed to not clear on failure.
|
||||
+ Content override now supports an "app" setting, that causes all applications to be overridden with HBL instead of a specific title.
|
||||
+ Note: because override keys are system-wide, using this setting will prevent using mods in games (as every game will be HBL).
|
||||
+ A bug was fixed causing incorrect fatal-error output when svcBreak was called on 5.0.0+.
|
||||
+ An extension was added to set.mitm to support customization of system settings.
|
||||
+ These are controlled by `atmosphere/system_settings.ini`, see [here](https://github.com/Atmosphere-NX/Atmosphere/blob/master/docs/modules/set_mitm.md) for documentation.
|
||||
+ An extension was added to sm, adding a new `sm:dmnt` service.
|
||||
+ This can be used by a debug monitor in order to debug the registration state of various other services.
|
||||
+ A bug was fixed in the MitM API that could sometimes cause a system hang during boot.
|
||||
+ A change was made to the MitM API: in cases where sm would have returned 0xE15 when installing a mitm service, it now defers the result (following GetService semantics).
|
||||
+ Support for booting into maintenance mode by holding +/- was added to PM.
|
||||
+ An extension was added to exosphere, adding a custom SMC that allows for DMA to IRAM.
|
||||
+ In addition, smcGetConfig was extended to reboot to a payload in IRAM at 0x40010000 when ConfigItem 65001 is set to 2.
|
||||
+ Fatal will now use this to reboot to sdmc:/atmosphere/reboot_payload.bin if present, when a vol button is pressed.
|
||||
+ An example homebrew ("reboot_to_payload") was also written and is now included with Atmosphère.
|
||||
+ General system stability improvements to enhance the user's experience.
|
||||
## 0.8.2
|
||||
+ A number of bugs were fixed causing users to sometimes see `Key Derivation Failed!`.
|
||||
+ KFUSE clock enable timings have been adjusted to allow time to stabilize before TSEC is granted access.
|
||||
+ A race condition was fixed that could cause wrong key data to be used on 6.2.0
|
||||
+ The TSEC firmware is now retried on failure, fixing a failure affecting ~1/50 boots on 6.2.0.
|
||||
+ A bug was fixed causing some modules to not work on firmware 1.0.0.
|
||||
+ A bug was fixed causing sleep mode to not work with debugmode enabled.
|
||||
+ As a result, debugmode is now enabled in the default BCT.ini.
|
||||
+ General system stability improvements to enhance the user's experience.
|
||||
## 0.8.1
|
||||
+ A bug was fixed causing users to see `Failed to enable SMMU!` if fusee had previously rebooted.
|
||||
+ This message will still occur sporadically if fusee is not launched from coldboot, but it can never happen twice in a row.
|
||||
+ A race condition was fixed in Atmosphere `bis_protect` functionality that could cause NS to be able to overwrite BCT public keys.
|
||||
+ This sometimes broke AutoRCM protection, the current fix has been tested on hardware and verified to work.
|
||||
+ Support was added for enabling `debugmode` based on the `exosphere` section of `BCT.ini`:
|
||||
+ Setting `debugmode = 1` will cause exosphere to tell the kernel that debugmode is active.
|
||||
+ Setting `debugmode_user = 1` will cause exosphere to tell userland that debugmode is active.
|
||||
+ These are completely independent of one another, allowing fine control of system behavior.
|
||||
+ Support was added for `nogc` functionality; thanks to @rajkosto for the patches.
|
||||
+ By default, `nogc` patches will automatically apply if the user is booting into 4.0.0+ with fuses from <= 3.0.2.
|
||||
+ Users can override this functionality via the `nogc` entry in the `stratosphere` section of `BCT.ini`:
|
||||
+ Setting `nogc = 1` will force enable `nogc` patches.
|
||||
+ Setting `nogc = 0` will force disable `nogc` patches.
|
||||
+ If patches are enabled but not found for the booting system, a fatal error will be thrown.
|
||||
+ This should prevent running FS without `nogc` patches after updating to an unsupported system version.
|
||||
+ An extension was added to `exosphere` allowing userland applications to cause the system to reboot into RCM:
|
||||
+ This is done by calling smcSetConfig(id=65001, value=<nonzero>); user homebrew can use splSetConfig for this.
|
||||
+ On fatal error, the user can now choose to perform a standard reboot via the power button, or a reboot into RCM via either volume button.
|
||||
+ A custom message was added to `fatal` for when an Atmosphère API version mismatch is detected (2495-1623).
|
||||
+ General system stability improvements to enhance the user's experience.
|
||||
## 0.8.0
|
||||
+ A custom `fatal` system module was added.
|
||||
+ This re-implements and extends Nintendo's fatal module, with the following features:
|
||||
+ Atmosphère's `fatal` does not create error reports.
|
||||
+ Atmosphère's `fatal` draws a custom error screen, showing registers and a backtrace.
|
||||
+ Atmosphère's `fatal` attempts to gather debugging info for all crashes, and not just ones that include info.
|
||||
+ Atmosphère's `fatal` will attempt saving reports to the SD, if a crash report was not generated by `creport`.
|
||||
+ Title flag handling was changed to prevent folder clutter.
|
||||
+ Instead of living in `atmosphere/titles/<tid>/%s.flag`, flags are now located in `atmosphere/titles/<tid>/flags/%s.flag`
|
||||
+ The old format will continue to be supported for some time, but is deprecated.
|
||||
+ Flags can now be applied to HBL by placing them at `atmosphere/flags/hbl_%s.flag`.
|
||||
+ Changes were made to the mitm API, greatly improving caller semantics.
|
||||
+ `sm` now informs mitm services of a new session's process id, enabling custom handling based on title id/process id.
|
||||
+ smhax is no longer enabled, because it is no longer needed and breaks significant functionality.
|
||||
+ Users with updated HBL/homebrew should see no observable differences due to this change.
|
||||
+ Functionality was added implementing basic protections for NAND from userland homebrew:
|
||||
+ BOOT0 now has write protection for the BCT public key and keyblob regions.
|
||||
+ The `ns` sysmodule is no longer allowed to write the BCT public keys; all other processes can.
|
||||
+ This should prevent system updates from removing AutoRCM.
|
||||
+ No processes should be allowed to write to the keyblob region.
|
||||
+ By default, BIS partitions other than BOOT0 are now read-only, and CAL0 is neither readable nor writable.
|
||||
+ Adding a `bis_write` flag for a title will allow it to write to BIS.
|
||||
+ Adding a `cal_read` flag for a title will allow it to read CAL0.
|
||||
+ An automatic backup is now made of CAL0 on boot.
|
||||
+ `fs.mitm` maintains a file handle to this backup, so userland software cannot read it.
|
||||
+ To facilitate this, `fs.mitm` now mitms all sessions for non-system modules; content overriding has been made separate from service interception.
|
||||
+ Please note: these protections are basic, and sufficiently malicious homebrew ++can defeat them++.
|
||||
+ Please be careful to only run homebrew software from sources that you trust.
|
||||
+ A bug involving HDCP titles crashing on newer firmwares was fixed.
|
||||
+ Support was added for system version 6.2.0; our thanks to @motezazer for his invaluable help.
|
||||
+ By default, new keys will automatically be derived without user input.
|
||||
+ Support is also present for loading new keys from `atmosphere/prod.keys` or `atmosphere/dev.keys`
|
||||
+ General system stability improvements to enhance the user's experience.
|
||||
## 0.7.5
|
||||
+ DRAM training was added to fusee-secondary, courtesy @hexkyz.
|
||||
+ This greatly improves the speed of memory accesses during boot, resulting in a boot time that is ~200-400% faster.
|
||||
+ creport has had its code region detection improved.
|
||||
+ Instead of only checking one of the crashing thread's PC/LR for code region presence, creport now checks both + every address in the stacktrace. This is also now done for every thread.
|
||||
+ This matches the improvement Nintendo added to official creport in 6.1.0.
|
||||
+ The code region detection heuristic was further improved by checking whether an address points to .rodata or .rwdata, instead of just .text.
|
||||
+ This means that a crash appears in a loaded NRO (or otherwise discontiguous) code region, creport will be able to detect all active code regions, and not just that one.
|
||||
## 0.7.4
|
||||
+ [libstratosphere](https://github.com/Atmosphere-NX/libstratosphere) has been completely refactored/rewritten, and split into its own, separate submodule.
|
||||
+ While this is mostly "under the hood" for end-users, the refactor is faster (improving both boot-time and runtime performance), more accurate (many of the internal IPC structures are now bug-for-bug compatible with Nintendo's implementations), and significantly more stable (it fixes a large number of bugs present in the old library).
|
||||
+ The refactored API is significantly cleaner and easier to write system module code for, which should improve/speed up development of stratosphere.
|
||||
+ Developers looking to write their own custom system modules for the Switch can now easily include libstratosphere as a submodule in their projects.
|
||||
+ Loader was extended to add a new generic way to redirect content (ExternalContentSources), courtesy @misson20000:
|
||||
+ A new command was added to ldr:shel, taking in a tid to redirect and returning a session handle.
|
||||
+ When the requested TID is loading, Loader will query the handle as though it were an IFileSystem.
|
||||
+ This allows clients to generically define their own filesystems, and override content with them in loader.
|
||||
+ fs.mitm has gotten several optimizations that should improve its performance and stability:
|
||||
+ RomFS redirection now only occurs when there is content to redirect, even if the title is being mitm'd elsewhere.
|
||||
+ A cache is now maintained of the active data storage, if any, for all opened title IDs. This means if two processes both try to open the same archive, fs.mitm won't duplicate any of its work.
|
||||
+ RomFS metadata is now cached to the SD card on build instead of being persisted in memory -- this greatly reduces memory footprint and allows fs.mitm to redirect more titles simultaneously than before.
|
||||
+ A number of bugs were fixed, including:
|
||||
+ A resource leak was fixed in process creation. This fixes crashes that occur when a large number (>32) games have been launched since the last reboot.
|
||||
+ fs.mitm no longer errors when receiving a zero-sized buffer. This fixes crashes in some games, including The Messenger.
|
||||
+ Multi-threaded server semantics should no longer cause deadlocks in certain circumstances. This fixes crashes in some games, including NES Classics.
|
||||
+ PM now only gives full FS permissions to the active KIPs. This fixes a potential crash where new processes might be unable to be registered with FS.
|
||||
+ The `make dist` target now includes the branch in the generated zip name.
|
||||
+ General system stability improvements to enhance the user's experience.
|
||||
## 0.7.3
|
||||
+ Loader and fs.mitm now try to reload loader.ini before reading it. This allows for changing the override button combination/HBL title id at runtime.
|
||||
+ Added a MitM between set:sys and qlaunch, used to override the system version string displayed in system settings.
|
||||
+ The displayed system version will now display `<Actual version> (AMS <x>.<y>.<z>)`.
|
||||
+ General system stability improvements to enhance the user's experience.
|
||||
## 0.7.2
|
||||
+ Fixed a bug in fs.mitm's LayeredFS read implementation that caused some games to crash when trying to read files.
|
||||
+ Fixed a bug affecting 1.0.0 that caused games to crash with fatal error 2001-0106 on boot.
|
||||
+ Improved filenames output by the make dist target.
|
||||
+ General system stability improvements to enhance the user's experience.
|
||||
|
||||
## 0.7.1
|
||||
+ Fixed a bug preventing consoles on 4.0.0-4.1.0 from going to sleep and waking back up.
|
||||
+ Fixed a bug preventing consoles on < 4.0.0 from booting without specific KIPs on the SD card.
|
||||
+ An API was added to Atmosphère's Service Manager for deferring acquisition of all handles for specific services until after early initialization is completed.
|
||||
+ General system stability improvements to enhance the user's experience.
|
||||
|
||||
## 0.7.0
|
||||
+ First official release of Atmosphère.
|
||||
+ Supports the following featureset:
|
||||
|
||||
365
docs/cheats.md
Normal file
365
docs/cheats.md
Normal file
@@ -0,0 +1,365 @@
|
||||
# Cheats
|
||||
Atmosphère supports Action-Replay style cheat codes, with cheats loaded off of the SD card.
|
||||
|
||||
## Cheat Loading Process
|
||||
By default, Atmosphère will do the following when deciding whether to attach to a new application process:
|
||||
|
||||
+ Retrieve information about the new application process from `pm` and `loader`.
|
||||
+ Check whether a user-defined key combination is held, and stop if not.
|
||||
+ This defaults to "L is not held", and can be configured the same way as `fs.mitm` override keys.
|
||||
+ The ini key to configure this is `cheat_enable_key`.
|
||||
+ Check whether the process is a real application, and stop if not.
|
||||
+ This guards against applying cheat codes to the homebrew loader.
|
||||
+ Attempt to load cheats from `atmosphere/titles/<title_id>/cheats/<build_id>.txt`, where `build_id` is the hexadecimal representation of the first 8 bytes of the application's main executable's build id.
|
||||
+ If no cheats are found, then the cheat manager will stop.
|
||||
+ Open a kernel debug session for the new application process.
|
||||
+ Signal to a system event that a new cheat process has been attached to.
|
||||
|
||||
This behavior ensures that cheat codes are only loaded when the user would want them to.
|
||||
|
||||
In cases where dmnt has not activated the cheat manager, but the user wants to make it do so anyway, the cheat manager's service API provides a `ForceOpenCheatProcess` command that homebrew can use. This command will cause the cheat manager to try to force itself to attach to the process.
|
||||
|
||||
By default, all cheat codes listed in the loaded .txt file will be toggled on. This is configurable by the user, and the default can be set to toggled off by editing the `atmosphere!dmnt_cheats_enabled_by_default` entry to 0 instead of 1.
|
||||
|
||||
Users may use homebrew programs to toggle cheats on and off at runtime via the cheat manager's service API.
|
||||
|
||||
## Cheat Code Compatibility
|
||||
|
||||
Atmosphère manages cheat code through the execution of a small, custom virtual machine. Care has been taken to ensure that Atmosphère's cheat code format is fully backwards compatible with the pre-existing cheat code format, though new features have been added and bugs in the pre-existing cheat code applier have been fixed. Here is a short summary of the changes from the pre-existing format:
|
||||
|
||||
+ A number of bugs were fixed in the processing of conditional instructions.
|
||||
+ The pre-existing implementation was fundamentally broken, and checked for the wrong value when detecting the end of a conditional block.
|
||||
+ The pre-existing implementation also did not properly decode instructions, and instead linearly scanned for the terminator value. This caused problems if an instruction happened to encode a terminator inside its immediate values.
|
||||
+ The pre-existing implementation did not bounds check, and thus certain conditional cheat codes could cause it to read out-of-bounds memory, and potentially crash due to a data abort.
|
||||
+ Support was added for nesting conditional blocks.
|
||||
+ An instruction was added to perform much more complex arbitrary arithmetic on two registers.
|
||||
+ An instruction was added to allow writing the contents of register to a memory address specified by another register.
|
||||
+ The pre-existing implementation did not correctly synchronize with the application process, and thus would cause heavy lag under certain circumstances (especially around loading screens). This has been fixed in Atmosphère's implementation.
|
||||
|
||||
## Cheat Code Format
|
||||
|
||||
The following provides documentation of the instruction format for the virtual machine used to manage cheat codes.
|
||||
|
||||
Typically, instruction type is encoded in the upper nybble of the first instruction u32.
|
||||
|
||||
### Code Type 0: Store Static Value to Memory
|
||||
|
||||
Code type 0 allows writing a static value to a memory address.
|
||||
|
||||
#### Encoding
|
||||
|
||||
`0TMR00AA AAAAAAAA VVVVVVVV (VVVVVVVV)`
|
||||
|
||||
+ T: width of memory write (1, 2, 4, or 8 bytes)
|
||||
+ M: memory region to write to (0 = Main NSO, 1 = Heap)
|
||||
+ R: Register to use as an offset from memory region base.
|
||||
+ A: Immediate offset to use from memory region base.
|
||||
+ V: Value to write.
|
||||
|
||||
---
|
||||
|
||||
### Code Type 1: Begin Conditional Block
|
||||
|
||||
Code type 1 performs a comparison of the contents of memory to a static value.
|
||||
|
||||
If the condition is not met, all instructions until the appropriate conditional block terminator are skipped.
|
||||
|
||||
#### Encoding
|
||||
|
||||
`1TMC00AA AAAAAAAA VVVVVVVV (VVVVVVVV)`
|
||||
|
||||
+ T: width of memory write (1, 2, 4, or 8 bytes)
|
||||
+ M: memory region to write to (0 = Main NSO, 1 = Heap)
|
||||
+ C: Condition to use, see below.
|
||||
+ A: Immediate offset to use from memory region base.
|
||||
+ V: Value to compare to.
|
||||
|
||||
#### Conditions
|
||||
|
||||
+ 1: >
|
||||
+ 2: >=
|
||||
+ 3: <
|
||||
+ 4: <=
|
||||
+ 5: ==
|
||||
+ 6: !=
|
||||
|
||||
---
|
||||
|
||||
### Code Type 2: End Conditional Block
|
||||
|
||||
Code type 2 marks the end of a conditional block (started by Code Type 1 or Code Type 8).
|
||||
|
||||
#### Encoding
|
||||
|
||||
`20000000`
|
||||
|
||||
---
|
||||
|
||||
### Code Type 3: Start/End Loop
|
||||
|
||||
Code type 3 allows for iterating in a loop a fixed number of times.
|
||||
|
||||
#### Start Loop Encoding
|
||||
|
||||
`300R0000 VVVVVVVV`
|
||||
|
||||
+ R: Register to use as loop counter.
|
||||
+ V: Number of iterations to loop.
|
||||
|
||||
#### End Loop Encoding
|
||||
|
||||
`310R0000`
|
||||
|
||||
+ R: Register to use as loop counter.
|
||||
|
||||
---
|
||||
|
||||
### Code Type 4: Load Register with Static Value
|
||||
|
||||
Code type 4 allows setting a register to a constant value.
|
||||
|
||||
#### Encoding
|
||||
|
||||
`400R0000 VVVVVVVV VVVVVVVV`
|
||||
|
||||
+ R: Register to use.
|
||||
+ V: Value to load.
|
||||
|
||||
---
|
||||
|
||||
### Code Type 5: Load Register with Memory Value
|
||||
|
||||
Code type 5 allows loading a value from memory into a register, either using a fixed address or by dereferencing the destination register.
|
||||
|
||||
#### Load From Fixed Address Encoding
|
||||
|
||||
`5TMR00AA AAAAAAAA`
|
||||
|
||||
+ T: width of memory read (1, 2, 4, or 8 bytes)
|
||||
+ M: memory region to write to (0 = Main NSO, 1 = Heap)
|
||||
+ R: Register to load value into.
|
||||
+ A: Immediate offset to use from memory region base.
|
||||
|
||||
#### Load from Register Address Encoding
|
||||
|
||||
`5TMR10AA AAAAAAAA`
|
||||
|
||||
+ T: width of memory read (1, 2, 4, or 8 bytes)
|
||||
+ M: memory region to write to (0 = Main NSO, 1 = Heap)
|
||||
+ R: Register to load value into.
|
||||
+ A: Immediate offset to use from register R.
|
||||
|
||||
---
|
||||
|
||||
### Code Type 6: Store Static Value to Register Memory Address
|
||||
|
||||
Code type 6 allows writing a fixed value to a memory address specified by a register.
|
||||
|
||||
#### Encoding
|
||||
|
||||
`6T0RIor0 VVVVVVVV VVVVVVVV`
|
||||
|
||||
+ T: width of memory write (1, 2, 4, or 8 bytes)
|
||||
+ R: Register used as base memory address.
|
||||
+ I: Increment register flag (0 = do not increment R, 1 = increment R by T).
|
||||
+ o: Offset register enable flag (0 = do not add r to address, 1 = add r to address).
|
||||
+ r: Register used as offset when o is 1.
|
||||
+ V: Value to write to memory.
|
||||
|
||||
---
|
||||
|
||||
### Code Type 7: Legacy Arithmetic
|
||||
|
||||
Code type 7 allows performing arithmetic on registers.
|
||||
|
||||
However, it has been deprecated by Code type 9, and is only kept for backwards compatibility.
|
||||
|
||||
#### Encoding
|
||||
|
||||
`7T0RC000 VVVVVVVV`
|
||||
|
||||
+ T: width of arithmetic operation (1, 2, 4, or 8 bytes)
|
||||
+ R: Register to apply arithmetic to.
|
||||
+ C: Arithmetic operation to apply, see below.
|
||||
+ V: Value to use for arithmetic operation.
|
||||
|
||||
#### Arithmetic Types
|
||||
|
||||
+ 0: Addition
|
||||
+ 1: Subtraction
|
||||
+ 2: Multiplication
|
||||
+ 3: Left Shift
|
||||
+ 4: Right Shift
|
||||
|
||||
---
|
||||
|
||||
### Code Type 8: Begin Keypress Conditional Block
|
||||
|
||||
Code type 8 enters or skips a conditional block based on whether a key combination is pressed.
|
||||
|
||||
#### Encoding
|
||||
|
||||
`8kkkkkkk`
|
||||
|
||||
+ k: Keypad mask to check against, see below.
|
||||
|
||||
Note that for multiple button combinations, the bitmasks should be ORd together.
|
||||
|
||||
#### Keypad Values
|
||||
|
||||
Note: This is the direct output of `hidKeysDown()`.
|
||||
|
||||
+ 0000001: A
|
||||
+ 0000002: B
|
||||
+ 0000004: X
|
||||
+ 0000008: Y
|
||||
+ 0000010: Left Stick Pressed
|
||||
+ 0000020: Right Stick Pressed
|
||||
+ 0000040: L
|
||||
+ 0000080: R
|
||||
+ 0000100: ZL
|
||||
+ 0000200: ZR
|
||||
+ 0000400: Plus
|
||||
+ 0000800: Minus
|
||||
+ 0001000: Left
|
||||
+ 0002000: Up
|
||||
+ 0004000: Right
|
||||
+ 0008000: Down
|
||||
+ 0010000: Left Stick Left
|
||||
+ 0020000: Left Stick Up
|
||||
+ 0040000: Left Stick Right
|
||||
+ 0080000: Left Stick Down
|
||||
+ 0100000: Right Stick Left
|
||||
+ 0200000: Right Stick Up
|
||||
+ 0400000: Right Stick Right
|
||||
+ 0800000: Right Stick Down
|
||||
+ 1000000: SL
|
||||
+ 2000000: SR
|
||||
|
||||
---
|
||||
|
||||
### Code Type 9: Perform Arithmetic
|
||||
|
||||
Code type 9 allows performing arithmetic on registers.
|
||||
|
||||
#### Register Arithmetic Encoding
|
||||
|
||||
`9TCRS0s0`
|
||||
|
||||
+ T: width of arithmetic operation (1, 2, 4, or 8 bytes)
|
||||
+ C: Arithmetic operation to apply, see below.
|
||||
+ R: Register to store result in.
|
||||
+ S: Register to use as left-hand operand.
|
||||
+ s: Register to use as right-hand operand.
|
||||
|
||||
#### Immediate Value Arithmetic Encoding
|
||||
|
||||
`9TCRS100 VVVVVVVV (VVVVVVVV)`
|
||||
|
||||
+ T: width of arithmetic operation (1, 2, 4, or 8 bytes)
|
||||
+ C: Arithmetic operation to apply, see below.
|
||||
+ R: Register to store result in.
|
||||
+ S: Register to use as left-hand operand.
|
||||
+ V: Value to use as right-hand operand.
|
||||
|
||||
#### Arithmetic Types
|
||||
|
||||
+ 0: Addition
|
||||
+ 1: Subtraction
|
||||
+ 2: Multiplication
|
||||
+ 3: Left Shift
|
||||
+ 4: Right Shift
|
||||
+ 5: Logical And
|
||||
+ 6: Logical Or
|
||||
+ 7: Logical Not (discards right-hand operand)
|
||||
+ 8: Logical Xor
|
||||
+ 9: None/Move (discards right-hand operand)
|
||||
|
||||
---
|
||||
|
||||
### Code Type 10: Store Register to Memory Address
|
||||
|
||||
Code type 10 allows writing a register to memory.
|
||||
|
||||
#### Encoding
|
||||
|
||||
`ATSRIOxa (aaaaaaaa)`
|
||||
|
||||
+ T: width of memory write (1, 2, 4, or 8 bytes)
|
||||
+ S: Register to write to memory.
|
||||
+ R: Register to use as base address.
|
||||
+ I: Increment register flag (0 = do not increment R, 1 = increment R by T).
|
||||
+ O: Offset type, see below.
|
||||
+ x: Register used as offset when O is 1, Memory type when O is 3, 4 or 5.
|
||||
+ a: Value used as offset when O is 2, 4 or 5.
|
||||
|
||||
#### Offset Types
|
||||
|
||||
+ 0: No Offset
|
||||
+ 1: Use Offset Register
|
||||
+ 2: Use Fixed Offset
|
||||
+ 3: Memory Region + Base Register
|
||||
+ 4: Memory Region + Relative Address (ignore address register)
|
||||
+ 5: Memory Region + Relative Address + Offset Register
|
||||
---
|
||||
|
||||
### Code Type 11: Reserved
|
||||
|
||||
Code Type 11 is currently reserved for future use.
|
||||
|
||||
---
|
||||
|
||||
### Code Type 12-15: Extended-Width Instruction
|
||||
|
||||
Code Types 12-15 signal to the VM to treat the upper two nybbles of the first dword as instruction type, instead of just the upper nybble.
|
||||
|
||||
This reserves an additional 64 opcodes for future use.
|
||||
|
||||
---
|
||||
|
||||
### Code Type 0xC0: Begin Register Conditional Block
|
||||
|
||||
Code type 0xC0 performs a comparison of the contents of a register and another value. This code support multiple operand types, see below.
|
||||
|
||||
If the condition is not met, all instructions until the appropriate conditional block terminator are skipped.
|
||||
|
||||
#### Encoding
|
||||
|
||||
```
|
||||
C0TcSX##
|
||||
C0TcS0Ma aaaaaaaa
|
||||
C0TcS1Mr
|
||||
C0TcS2Ra aaaaaaaa
|
||||
C0TcS3Rr
|
||||
C0TcS400 VVVVVVVV (VVVVVVVV)
|
||||
C0TcS5X0
|
||||
```
|
||||
|
||||
+ T: width of memory write (1, 2, 4, or 8 bytes)
|
||||
+ c: Condition to use, see below.
|
||||
+ S: Source Register
|
||||
+ X: Operand Type, see below.
|
||||
+ M: Memory Type (operand types 0 and 1)
|
||||
+ R: Address Register (operand types 2 and 3)
|
||||
+ a: Relative Address (operand types 0 and 2)
|
||||
+ r: Offset Register (operand types 1 and 3)
|
||||
+ X: Other Register (used for operand type 5)
|
||||
+ V: Value to compare to (operand type 4)
|
||||
|
||||
#### Operand Type
|
||||
|
||||
+ 0: Memory Base + Relative Offset
|
||||
+ 1: Memory Base + Offset Register
|
||||
+ 2: Register + Relative Offset
|
||||
+ 3: Register + Offset Register
|
||||
+ 4: Static Value
|
||||
+ 5: Other Register
|
||||
|
||||
#### Conditions
|
||||
|
||||
+ 1: >
|
||||
+ 2: >=
|
||||
+ 3: <
|
||||
+ 4: <=
|
||||
+ 5: ==
|
||||
+ 6: !=
|
||||
@@ -1,19 +1,51 @@
|
||||
# BCT.ini
|
||||
BCT.ini is the configuration file used by fusée-primary and fusée-secondary. It is read by fusee-primary.bin to setup and boot fusee-secondary.bin and is also read by fusee-secondary.bin to configure Exosphère or to specify the environment it should boot.
|
||||
BCT.ini is the configuration file used by fusée-primary and fusée-secondary. It is read by fusee-primary.bin to setup and boot fusee-secondary.bin and is also read by fusee-secondary.bin to configure Exosphère, specify the environment it should boot, or configure other miscellaneous options such as setting a custom boot splashscreen.
|
||||
|
||||
## Configuration
|
||||
This file is located at the root of your SD.
|
||||
This file is located in the `atmosphere` folder on your SD card. The default configuration file will look similar to this.
|
||||
```
|
||||
BCT0
|
||||
[stage1]
|
||||
stage2_path = fusee-secondary.bin
|
||||
stage2_path = atmosphere/fusee-secondary.bin
|
||||
stage2_addr = 0xF0000000
|
||||
stage2_entrypoint = 0xF0000000
|
||||
|
||||
[exosphere]
|
||||
; Note: Disabling debugmode will cause parts of ams.tma to not work, in the future.
|
||||
debugmode = 1
|
||||
debugmode_user = 0
|
||||
|
||||
[stratosphere]
|
||||
; To force-enable nogc, add nogc = 1
|
||||
; To force-disable nogc, add nogc = 0
|
||||
```
|
||||
Add the following lines and replace the `X` according to the following list if you have trouble booting past the firmware version detection.
|
||||
|
||||
## Adding a Custom Boot Splashscreen
|
||||
Add the following lines to BCT.ini and change the value of `custom_splash` to the actual path and filename of your boot splashscreen.
|
||||
```
|
||||
[stage2]
|
||||
custom_splash = /path/to/your/bootlogo.bmp
|
||||
```
|
||||
|
||||
The boot splashscreen must be a BMP file, it must be 720x1280 (1280x720 rotated 90 degrees left/counterclockwise/anti-clockwise) resolution, and be in 32-bit ARGB format. You can use image editing software such as GIMP or Photoshop to export the image in this format.
|
||||
|
||||
## Configuring "nogc" Protection
|
||||
Nogc is a feature provided by fusée-secondary which disables the Nintendo Switch's Game Card reader. Its purpose is to prevent the reader from being updated when the console has been updated without burning fuses from a firmware lower than 4.0.0, to a newer firmware that is at least 4.0.0 or higher. By default, Atmosphère will protect the Game Card reader automatically, but you are free to change it.
|
||||
|
||||
To change its functionality, add the following line to the `stratosphere` section and change the value of `X` according to the following list.
|
||||
```
|
||||
nogc = X
|
||||
```
|
||||
```
|
||||
1 = force-enable nogc, so Atmosphère will always disable the Game Card reader.
|
||||
0 = force-disable nogc, so Atmosphère will always enable the Game Card reader.
|
||||
```
|
||||
|
||||
|
||||
## Changing Target Firmware
|
||||
Add the following line to the `exosphere` section and replace the `X` according to the following list if you have trouble booting past the firmware version detection.
|
||||
`target_firmware` is the OFW major version.
|
||||
```
|
||||
[exosphere]
|
||||
target_firmware = X
|
||||
```
|
||||
```
|
||||
@@ -22,5 +54,20 @@ target_firmware = X
|
||||
3.X.X = 3
|
||||
4.X.X = 4
|
||||
5.X.X = 5
|
||||
6.0.0 = 6
|
||||
6.X.X = 6
|
||||
6.2.0 = 7
|
||||
7.X.X = 8
|
||||
```
|
||||
|
||||
Note that 6.X.X indicates 6.0.0 through 6.1.0.
|
||||
|
||||
## Configuring Debugging Modes
|
||||
By default, Atmosphère signals to the Horizon kernel that debugging is enabled while leaving usermode debugging disabled, since this can cause undesirable side-effects. If you wish to change these behaviours, go to the `exosphere` section and change the value of `X` according to the following list.
|
||||
```
|
||||
debugmode = X
|
||||
debugmode_user = X
|
||||
```
|
||||
```
|
||||
1 = enable
|
||||
0 = disable
|
||||
```
|
||||
|
||||
15
docs/components/fusee/sept.md
Normal file
15
docs/components/fusee/sept.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# sept
|
||||
Sept is a payload that facilitates booting Atmosphère when targeting firmware version 7.0.0+.
|
||||
|
||||
It consists of a primary and a secondary payload.
|
||||
|
||||
## Sept-Primary
|
||||
Sept-primary is essentially a stand-in for Nintendo's package1ldr, on 7.0.0+. To use it, the caller (normally Fusée-secondary) loads the sept-primary binary to `0x4003F000`,
|
||||
loads the 7.0.0+ TSEC firmware to `0x40010F00`, and loads a signed, encrypted payload to `0x40016FE0`.
|
||||
|
||||
This signed, encrypted payload is normally Sept-secondary.
|
||||
|
||||
## Sept-Secondary
|
||||
Sept-secondary is a payload that performs 7.0.0+ key derivation, and then chainloads to `sept/payload.bin`.
|
||||
|
||||
It is normally stored encrypted/signed; if one wishes to build sept-secondary instead of using release builds, one must bring his/her own keys.
|
||||
@@ -1,6 +1,4 @@
|
||||
# Thermosphère
|
||||
Thermosphère is a hypervisor based implementation of emuNAND. An emuNAND is a copy of the firmware on the Switch’s internal memory (sysNAND), and is typically installed on an external SD Card.
|
||||
Thermosphère is a hypervisor based implementation of emuNAND.
|
||||
|
||||
An emuNAND operates completely independently of the sysNAND. This allows one to make or test various modifications and homebrew safely without needing to restore their NAND backup afterwards by testing things on the emuNAND, and switching back to the sysNAND when finished. In the case of past Nintendo systems such as the 3DS, an emuNAND could also be used to update your system to the latest firmware while keeping your sysNAND on a lower version, however this may be more difficult to do on the Switch due to Nintendo using efuse technology for major system updates.
|
||||
|
||||
Thermosphère is currently planned to be included in the 1.0 release of Atmosphère.
|
||||
Thermosphère is currently planned to be included in a future release of Atmosphère.
|
||||
|
||||
12
docs/flags.md
Normal file
12
docs/flags.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# Flags
|
||||
Atmosphère supports customizing CFW behavior based on the presence of `flags` on the SD card.
|
||||
|
||||
The following flags are supported on a per-title basis, by placing `<flag_name>.flag` inside `/atmosphere/titles/<title_id>/flags/`:
|
||||
+ `boot2`, which indicates to PM that the title should be launched during the `boot2` process.
|
||||
+ `fsmitm`, which indicates that `fs.mitm` should override contents for the title even if it otherwise wouldn't.
|
||||
+ `fsmitm_disable`, which indicates that `fs.mitm` should not override contents for the title, even it it otherwise would.
|
||||
+ `bis_write`, which indicates that `fs.mitm` should allow the title to write to BIS partitions.
|
||||
+ `cal_read`, which indicates that `fs.mitm` should allow the title to read the CAL0/PRODINFO partition.
|
||||
|
||||
The following global flags are supported, by placing `<flag name>.flag` inside `/atmosphere/flags/`:
|
||||
+ `hbl_bis_write` and `hbl_cal_read` enable the BIS write and CAL0 read functionality for HBL, without needing to specify its title id.
|
||||
38
docs/modules/dmnt.md
Normal file
38
docs/modules/dmnt.md
Normal file
@@ -0,0 +1,38 @@
|
||||
# dmnt
|
||||
|
||||
dmnt is a reimplementation of Nintendo's debug monitor. It provides Atmosphère a rich set of debugging functionality, so that users can easily analyze the behaviors of programs. In addition, Atmosphère implements an extension in dmnt to provide cheat code functionality.
|
||||
|
||||
## Atmosphère Cheat Extension
|
||||
|
||||
In addition to the functionality provided by Nintendo's debug monitor, Atmosphère's dmnt has an extension for providing cheat code functionality. A HIPC Service API is provided for interacting with the cheat code manager, through the service `dmnt:cht`.
|
||||
|
||||
Those looking for more information on the cheat code functionality may wish to read `cheats.md`.
|
||||
|
||||
The SwIPC definition for `dmnt:cht` follows.
|
||||
```
|
||||
interface DmntCheatService is dmnt:cht {
|
||||
[65000] HasCheatProcess() -> bool;
|
||||
[65001] GetCheatProcessEvent() -> KObject;
|
||||
[65002] GetCheatProcessMetadata() -> CheatProcessMetadata;
|
||||
[65003] ForceOpenCheatProcess();
|
||||
|
||||
[65100] GetCheatProcessMappingCount() -> u64;
|
||||
[65101] GetCheatProcessMappings(u64 offset) -> buffer<MemoryInfo, 6>, u64 count;
|
||||
[65102] ReadCheatProcessMemory(u64 address, u64 size) -> buffer<u8, 6> data;
|
||||
[65103] WriteCheatProcessMemory(u64 address, u64 size, buffer<u8, 5> data);
|
||||
[65104] QueryCheatProcessMemory(u64 address) -> MemoryInfo;
|
||||
|
||||
[65200] GetCheatCount() -> u64;
|
||||
[65201] GetCheats(u64 offset) -> buffer<CheatEntry, 6>, u64 count;
|
||||
[65202] GetCheatById(u32 cheat_id) -> buffer<CheatEntry, 6> cheat;
|
||||
[65203] ToggleCheat(u32 cheat_id);
|
||||
[65204] AddCheat(buffer<CheatDefinition, 5> cheat, bool enabled) -> u32 cheat_id;
|
||||
[65203] RemoveCheat(u32 cheat_id);
|
||||
|
||||
[65300] GetFrozenAddressCount() -> u64;
|
||||
[65301] GetFrozenAddresses(u64 offset) -> buffer<FrozenAddressEntry, 6>, u64 count;
|
||||
[65302] GetFrozenAddress(u64 address) -> FrozenAddressEntry;
|
||||
[65303] EnableFrozenAddress(u64 address, u64 width) -> u64 value;
|
||||
[65304] DisableFrozenAddress(u64 address);
|
||||
}
|
||||
```
|
||||
@@ -1,2 +1,2 @@
|
||||
# fs_mitm
|
||||
fs_mitm is a sysmodule that enables intercepting file system operations. This module can log, deny, delay, replace, or redirect any request made to the filesystem. It enables LayeredFS to function, which allows for game mods.
|
||||
fs_mitm is a sysmodule that enables intercepting file system operations. This module can log, deny, delay, replace, or redirect any request made to the filesystem. It enables LayeredFS to function, which allows for replacement of game assets.
|
||||
@@ -55,14 +55,72 @@ When authoring patches, [hactool](https://github.com/SciresM/hactool) can be use
|
||||
|
||||
Atmosphère can use the loader module in order to turn any game on your Switch's home menu into a launchpoint for the Homebrew Menu, rather than launching it through the album applet. This allows one to launch the Homebrew Menu with access to the ~3.2GB of RAM that the Switch reserves for games and applications, as opposed to the 442MB of RAM we are limited to when launching the Homebrew Menu from the album. This also means that it is no longer necessary to install homebrew as `.nsp` files on your Switch so long as you are using this method, as the only reason to do so is to allow the homebrew to access all of the Switch's available memory.
|
||||
|
||||
In order to setup this method you will need the latest release of [hbmenu](https://github.com/switchbrew/nx-hbmenu/releases), and the latest release of [hbloader](https://github.com/switchbrew/nx-hbloader/releases). Place `hbmenu.nro` on the root of your Switch's SD Card, and place `hbl.nsp` in the atmosphere folder. From there, simply configure `loader.ini` in the atmosphere folder by replacing the Title ID in the ini (hbl_tid) (it is the Title ID for the album by default) with the Title ID of whatever game you wish to use to launch the Homebrew Menu. A list of Title IDs for Switch Games can be found [here](https://switchbrew.org/wiki/Title_list/Games). Afterwards you may reinsert your SD Card into your Switch and boot into Atmosphère as you normally would. You should now be able to boot into the Homebrew Menu by launching your designated game of choice.
|
||||
In order to setup this method you will need the latest release of [hbmenu](https://github.com/switchbrew/nx-hbmenu/releases), and the latest release of [hbloader](https://github.com/switchbrew/nx-hbloader/releases). Place `hbmenu.nro` on the root of your Switch's SD Card, and place `hbl.nsp` in the atmosphere folder. From there, simply launch any title while holding the button specified in `loader.ini`.
|
||||
|
||||
In addition, loader has extensions to enable homebrew to launch web applets. This normally requires the application launching the applet have HTML Manual content inside an installed NCA; Atmosphère's loader will automatically ensure that the commands used to check this succeed, and will (in tandem with `fs.mitm`) redirect the relevant filesystem to the `sdmc:/atmosphere/hbl_html/` subdirectory.
|
||||
|
||||
### Button Overrides
|
||||
|
||||
By default `loader.ini` is configured to launch the Homebrew Menu when launching the game normally, and launching the game when selecting the game while holding down R. If you wish to change this, you can modify the override_key section of `loader.ini`. Placing an exclamation point in front of whatever button you wish to use will make it so that you will only launch the actual game while holding down that button, otherwise you will go into the Homebrew Menu. Removing the exclamation point will reverse this, meaning that you will boot into the Homebrew Menu only while holding down the assigned button when launching the game.
|
||||
By default `loader.ini` is configured to launch the Homebrew Menu when launching any game while holding down the override key (defaults to R). If you wish to change this, you can modify the override_key section of `loader.ini`. Alternatively, if you would like to only allow hbmenu on a specific app, configure `loader.ini` in the atmosphere folder by replacing the Title ID in the ini (title_id in the [hbl_config] section, it is the Title ID for the album by default) with the Title ID of whatever game you wish to use to launch the Homebrew Menu, and set override_any_app to false. A list of Title IDs for Switch Games can be found [here](https://switchbrew.org/wiki/Title_list/Games).
|
||||
|
||||
For example, `override_key=!R` will run the game only while holding down R when launching it, otherwise it will boot into the Homebrew Menu. `override_key=R` will only boot into the Homebrew Menu while holding down R when launching the game, otherwise it will launch the game as normal.
|
||||
To invert the behaviour of the override key, place an exclamation point in front of whatever button you wish to use. It will launch the actual game while holding down that button, instead of going into the Homebrew Menu. For example, `override_key=!R` will run the game only while holding down R when launching it, otherwise it will boot into the Homebrew Menu. Afterwards you may reinsert your SD Card into your Switch and boot into Atmosphère as you normally would. You should now be able to boot into the Homebrew Menu by launching your designated title of choice.
|
||||
|
||||
A list of valid buttons can be found here:
|
||||
|
||||
| Formal Name | .ini Name |
|
||||
| ----------- | --------- |
|
||||
| A Button | A |
|
||||
| B Button | B |
|
||||
| X Button | X |
|
||||
| Y Button | Y |
|
||||
| Left Stick | LS |
|
||||
| Right Stick | RS |
|
||||
| L Button | L |
|
||||
| R Button | R |
|
||||
| ZL Button | ZL |
|
||||
| ZR Button | ZR |
|
||||
| + Button | PLUS |
|
||||
| - Button | MINUS |
|
||||
| Left Dpad | DLEFT |
|
||||
| Up Dpad | DUP |
|
||||
| Right Dpad | DRIGHT |
|
||||
| Down Dpad | DDOWN |
|
||||
| SL Button | SL |
|
||||
| SR Button | SR |
|
||||
|
||||
### SM MITM Integration
|
||||
|
||||
When the Stratosphere implementation of loader creates a new process, it notifies [sm](sm.md) through the `AtmosphereAssociatePidTidForMitm` command to notify any MITM services of new processes' identities.
|
||||
|
||||
### IPC: AtmosphereSetExternalContentSource and AtmosphereClearExternalContentSource
|
||||
|
||||
Two additional commands are added to the [`ldr:shel`](https://reswitched.github.io/SwIPC/ifaces.html#nn::ro::detail::ILdrShellInterface) interface, called `AtmosphereSetExternalContentSource` and `AtmosphereClearExternalContentSource`.
|
||||
Their command IDs are `65000` and `65001` on all system firmware versions.
|
||||
|
||||
`AtmosphereSetExternalContentSource` takes a `u64 tid` and returns a server-side session handle.
|
||||
The client is expected to implement the `IFileSystem` interface on the returned handle. The next
|
||||
time the title specified by the given title ID is launched, its ExeFS contents will be loaded from
|
||||
the custom `IFileSystem` instead of from SD card or original ExeFS. NSOs loaded from external
|
||||
content source may still be subject to exefs IPS patches. After the title is launched successfuly,
|
||||
the `IFileSystem` is closed and the external content source override is removed. If
|
||||
`AtmosphereSetExternalContentSource` is called on a title that already has an external content
|
||||
source set for it, the existing one will be removed and replaced with the new one. It is illegal to
|
||||
call `AtmosphereSetExternalContentSource` while the title is being launched.
|
||||
|
||||
If title launching fails, the external content source remains registered. The
|
||||
`AtmosphereClearExternalContentSource` command can be used to clear an external content source if
|
||||
title launch fails.
|
||||
|
||||
The `IFileSystem` only needs to implement `OpenFile` and `GetFileTimeStampRaw`. The paths received
|
||||
by the `IFileSystem`'s `OpenFile` command begin with slashes, as in `/main`, `/rtld`, and `/main.npdm`.
|
||||
A result code of 0x202 should be returned if the file does not exist. `GetFileTimeStampRaw` can just
|
||||
be a stub. The `IFile`s returned from `OpenFile` only need to implement `Read` and `GetSize`.
|
||||
|
||||
The SwIPC definitions for the extension commands follow.
|
||||
```
|
||||
interface nn::ldr::detail::IShellInterface is ldr:shel {
|
||||
...
|
||||
[65000] AtmosphereSetExternalContentSource(u64 tid) -> handle<copy, session_server> ifilesystem_handle;
|
||||
[65001] AtmosphereClearExternalContentSource(u64 tid);
|
||||
}
|
||||
```
|
||||
|
||||
@@ -14,7 +14,7 @@ The SwIPC definition for this command follows.
|
||||
```
|
||||
interface nn::pm::detail::IDebugMonitorInterface is pm:dmnt {
|
||||
...
|
||||
[65000] AtmosphereGetProcessHandle(u64 pid) -> handle<copy, process> process_handle;
|
||||
[65000] AtmosphereGetProcessInfo(u64 pid) -> handle<copy, process> process_handle, u64 title_id, u64 storage_id;
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
79
docs/modules/set_mitm.md
Normal file
79
docs/modules/set_mitm.md
Normal file
@@ -0,0 +1,79 @@
|
||||
# set_mitm
|
||||
set_mitm is a sysmodule that enables intercepting requests to the system settings service.
|
||||
|
||||
## Atmosphère Extensions
|
||||
|
||||
set_mitm intercepts the `GetFirmwareVersion` command, if the requester is `qlaunch` or `maintenance`.\
|
||||
It modifies the `display_version` field of the returned system version, causing the version to display\
|
||||
in settings as `#.#.# (AMS #.#.#)`. This allows users to easily verify what version of Atmosphère they are running.
|
||||
|
||||
set_mitm also intercepts the `GetSettingsItemValueSize` and `GetSettingsItemValue` commands for all requesters.\
|
||||
It does so in order to enable user configuration of system settings, which are parsed from `atmosphere/system_settings.ini` on boot.\
|
||||
The format for settings is described below.
|
||||
|
||||
### Atmosphère Settings Format
|
||||
|
||||
Settings are parsed from the `atmosphere/system_settings.ini` file during the boot process. This file is a normal ini file,\
|
||||
with some specific interpretations.
|
||||
|
||||
The standard representation of a system setting's identifier takes the form `name!key`. This is represented within\
|
||||
`system_settings.ini` as a section `name`, with an entry `key`. For example:
|
||||
|
||||
```
|
||||
[name]
|
||||
key = ...
|
||||
```
|
||||
|
||||
System settings can have variable types (strings, integral values, byte arrays, etc). To accommodate this, `system_settings.ini`\
|
||||
must store values as a `type_identifier!value_store` pair. A number of different types are supported, with identifiers detailed below.\
|
||||
Please note that a malformed value string will cause a fatal error to occur on boot. A full example of a custom setting is given below\
|
||||
(setting `eupld!upload_enabled = 0`), for posterity:
|
||||
|
||||
```
|
||||
[eupld]
|
||||
upload_enabled = u8!0x0
|
||||
```
|
||||
|
||||
### Supported Types
|
||||
|
||||
* Strings
|
||||
* Type identifiers: `str`, `string`
|
||||
* The value string is used directly as the setting, with null terminator appended.
|
||||
* Integral types
|
||||
* Type identifiers: `u8`, `u16`, `u32`, `u64`
|
||||
* The value string is parsed via a call to `strtoul(value, NULL, 0)`.
|
||||
* Setting bitwidth is determined by the identifier (8 for 1 byte, 16 for 2 bytes, and so on).
|
||||
* Raw bytes
|
||||
* Type identifiers: `hex`, `bytes`
|
||||
* The value string is parsed as a hexadecimal string.
|
||||
* The value string must be of even length, or a fatal error will be thrown on parse.
|
||||
|
||||
### Atmosphère Custom Settings
|
||||
|
||||
At the time of writing, Atmosphère implements two custom settings, found in the `atmosphere` section.\
|
||||
|
||||
While not used for set_mitm, `power_menu_reboot_function` is loaded and controls the reboot behaviour of the console. By default, this value\
|
||||
is "payload", where the console will automatically reboot into the RCM payload stored in `sdmc:/atmosphere/reboot_payload.bin`.\
|
||||
(This payload is also used for fatal, upon a serious crash.) Setting the value to "rcm" reboots directly into RCM, and setting the value\
|
||||
to "normal" skips these behaviours.
|
||||
|
||||
```
|
||||
[atmosphere]
|
||||
power_menu_reboot_function = str!payload
|
||||
```
|
||||
|
||||
`dmnt_cheats_enabled_by_default` controls the behaviour of dmnt's cheat functionality. By default, this value is "0x1", enabling any cheats\
|
||||
defined by the user. Check [cheats](../cheats.md) for more information about Atmosphère's cheat functionality.
|
||||
|
||||
```
|
||||
[atmosphere]
|
||||
dmnt_cheats_enabled_by_default = u8!0x1
|
||||
```
|
||||
|
||||
`dmnt_always_save_cheat_toggles` controls the behaviour of dmnt's cheat toggle functionality. By default, this value is "0x0", causing toggles to\
|
||||
only be saved on game quit if a toggle file existed on game boot. Check [cheats](../cheats.md) for more information about Atmosphère's cheat functionality.
|
||||
|
||||
```
|
||||
[atmosphere]
|
||||
dmnt_always_save_cheat_toggles = u8!0x0
|
||||
```
|
||||
@@ -20,6 +20,18 @@ interface nn::sm::detail::IUserInterface is sm: {
|
||||
}
|
||||
```
|
||||
|
||||
Additionally, an interface `sm:dmnt` has been created to allow a debug monitor to query sm's state.
|
||||
|
||||
Its SwIPC definition follows.
|
||||
```
|
||||
interface nn::sm::detail::IDebugMonitorInterface is sm:dmnt {
|
||||
[65000] AtmosphereGetServiceRecord(ServiceName name) -> SmServiceRecord;
|
||||
[65001] AtmosphereListServiceRecords(u64 offset) -> buffer<SmServiceRecord, 6>, u64 count;
|
||||
[65002] AtmosphereGetServiceRecordSize() -> u64 record_size;
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
#### AtmosphereInstallMitm
|
||||
|
||||
This command alters the registration for the named service, in order to allow services to intercept communication between client processes and their intended services. It is used by [fs_mitm](fs_mitm.md).
|
||||
@@ -40,11 +52,11 @@ The `AssociatePidTid` command is invoked on all MITM query sessions whenever a n
|
||||
|
||||
If the process that installed the MITM attempts to connect to the service, it will always connect to the original service.
|
||||
|
||||
This command requires that the session be initialized, returning error code 0x415 if it is not.
|
||||
If the given service name is invalid, error code 0xC15 is returned.
|
||||
If the user does not have service registration permission for the named service, error code 0x1015 is returned.
|
||||
If the service has not yet been registered, error code 0xE15 is returned.
|
||||
If the service already has an MITM installed, error code 0x815 is returned.
|
||||
This command requires that the session be initialized, returning error code 0x415 if it is not.\
|
||||
If the given service name is invalid, error code 0xC15 is returned.\
|
||||
If the user does not have service registration permission for the named service, error code 0x1015 is returned.\
|
||||
If the service already has an MITM installed, error code 0x815 is returned.\
|
||||
If the service has not yet been registered, the request will be deferred until the service is registered in the same manner as IUserInterface::GetService.
|
||||
|
||||
#### AtmosphereUninstallMitm
|
||||
|
||||
@@ -58,6 +70,50 @@ This command is used internally by the Stratosphere implementation of the [loade
|
||||
|
||||
If the given process ID refers to a kernel internal process, error code 0x1015 is returned. This command requires that the session be initialized, returning error code 0x415 if it is not.
|
||||
|
||||
#### AtmosphereGetServiceRecordSize
|
||||
|
||||
Retrieves `sizeof(SmServiceRecord)` for a service. The current format of `SmServiceRecord` structure follows.
|
||||
|
||||
```
|
||||
struct SmServiceRecord {
|
||||
uint64_t service_name;
|
||||
uint64_t owner_pid;
|
||||
uint64_t max_sessions;
|
||||
uint64_t mitm_pid;
|
||||
uint64_t mitm_waiting_ack_pid;
|
||||
bool is_light;
|
||||
bool mitm_waiting_ack;
|
||||
};
|
||||
```
|
||||
|
||||
#### AtmosphereGetServiceRecord
|
||||
|
||||
Retrieves a service registration record for a service.
|
||||
|
||||
#### AtmosphereListServiceRecords
|
||||
|
||||
Provides a list of service registrations records.
|
||||
|
||||
The command will return an array of `SmServiceRecord`s, skipping `offset` records. The number of records returned is indicated by `count`.
|
||||
If `count` is less than the size of the buffer divided by `sizeof(SmServiceRecord)` (the buffer was not completely filled), the end of the service registration list has been reached. Otherwise, client code
|
||||
should increment `offset` by `count` and call again. Client code should retrieve a record size using `AtmosphereGetServiceRecordSize`, and either make sure that the size of a record matches what it expects,
|
||||
or should make sure to use the correct size as the stride while iterating over the array of returned records. Example pseudocode is shown below.
|
||||
|
||||
```
|
||||
offset = 0;
|
||||
record_size = AtmosphereGetServiceRecordSize();
|
||||
do {
|
||||
SmServiceRecord records[16];
|
||||
count = AtmosphereListServiceRecords(offset, buffer(records));
|
||||
for (i = 0; i < count; i++) {
|
||||
SmServiceRecord record = {0};
|
||||
memcpy(&record, &records[i], min(record_size, sizeof(SmServiceRecord));
|
||||
/* process record */
|
||||
offset++;
|
||||
}
|
||||
} while(count == sizeof(records) / record_size);
|
||||
```
|
||||
|
||||
### Minimum Session Limit
|
||||
|
||||
When a service is registered, the sysmodule registering it must specify a limit on the number of sessions that are allowed to be active for that service at a time. This is used to ensure that services like `fs-pr`, `fs-ldr`, and `ldr:pm` can only be connected to once, adding an additional layer of safety over the regular service verification to ensure that those services are only connected to by the highly priveleged process they are intended to be used by.
|
||||
@@ -66,4 +122,4 @@ By default, the Stratosphere implementation of PM will raise any session limits
|
||||
|
||||
### Weak Service Verification
|
||||
|
||||
In system firmware versions before 3.0.1, if a process did not call the [Initialize](https://reswitched.github.io/SwIPC/ifaces.html#nn::sm::detail::IUserInterface(0)) command on its `sm:` session, normally used to inform sm of the process's identity, sm would assume that the process was a kernel internal process and skip any service registration or access checks. The Stratosphere implementation of sm reimplements this vulnerability, allowing homebrew processes to skip service registration and access checks.
|
||||
In system firmware versions before 3.0.1, if a process did not call the [Initialize](https://reswitched.github.io/SwIPC/ifaces.html#nn::sm::detail::IUserInterface(0)) command on its `sm:` session, normally used to inform sm of the process's identity, sm would assume that the process was a kernel internal process and skip any service registration or access checks. The Stratosphere implementation of sm does not implement this vulnerability, and initialization is required on all firmware versions.
|
||||
|
||||
9
emummc/.gitignore
vendored
Normal file
9
emummc/.gitignore
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
*.kip
|
||||
*.data
|
||||
*.elf
|
||||
build
|
||||
.vscode/ipch
|
||||
.vscode/settings.json
|
||||
*.exe
|
||||
*.kip*
|
||||
emummc.caps
|
||||
12
emummc/.gitrepo
Normal file
12
emummc/.gitrepo
Normal file
@@ -0,0 +1,12 @@
|
||||
; DO NOT EDIT (unless you know what you are doing)
|
||||
;
|
||||
; This subdirectory is a git "subrepo", and this file is maintained by the
|
||||
; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme
|
||||
;
|
||||
[subrepo]
|
||||
remote = https://github.com/m4xw/emuMMC
|
||||
branch = develop
|
||||
commit = bd81a674a946c30b566e1732a95c18f19b701558
|
||||
parent = 6ee525201ccef107c61d81ba73c891e3eb5f0215
|
||||
method = rebase
|
||||
cmdver = 0.4.0
|
||||
35
emummc/.vscode/c_cpp_properties.json
vendored
Normal file
35
emummc/.vscode/c_cpp_properties.json
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Switch",
|
||||
"includePath": [
|
||||
"/opt/devkitpro/devkitA64/aarch64-none-elf/include",
|
||||
"/opt/devkitpro/devkitA64/lib/gcc/aarch64-none-elf/8.3.0/include",
|
||||
"${workspaceFolder}/libnx-patched/nx/include",
|
||||
"/opt/devkitpro/portlibs/switch/include",
|
||||
"/opt/devkitpro/portlibs/switch/include/freetype2",
|
||||
"${workspaceFolder}/source",
|
||||
"${workspaceFolder}/source/emmc",
|
||||
"${workspaceFolder}/source/libs/fatfs",
|
||||
"${workspaceFolder}/source/power",
|
||||
"${workspaceFolder}/source/soc",
|
||||
"${workspaceFolder}/source/utils",
|
||||
"${workspaceFolder}/**"
|
||||
],
|
||||
"defines": [
|
||||
"_DEBUG",
|
||||
"UNICODE",
|
||||
"_UNICODE",
|
||||
"__aarch64__",
|
||||
"__SWITCH__",
|
||||
"INNER_HEAP_SIZE=0x80000"
|
||||
],
|
||||
"windowsSdkVersion": "10.0.17763.0",
|
||||
"compilerPath": "/opt/devkitpro/devkitA64/bin/aarch64-none-elf-gcc",
|
||||
"cStandard": "c11",
|
||||
"cppStandard": "c++11",
|
||||
"intelliSenseMode": "gcc-x64"
|
||||
}
|
||||
],
|
||||
"version": 4
|
||||
}
|
||||
339
emummc/LICENSE
Normal file
339
emummc/LICENSE
Normal file
@@ -0,0 +1,339 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the 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 Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
114
emummc/Makefile
Normal file
114
emummc/Makefile
Normal file
@@ -0,0 +1,114 @@
|
||||
.SUFFIXES:
|
||||
|
||||
ifeq ($(strip $(DEVKITPRO)),)
|
||||
$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>/devkitpro")
|
||||
endif
|
||||
|
||||
TARGET := emummc
|
||||
BUILD := build
|
||||
SOURCES := source/nx source source/utils source/emmc source/soc source/power source/emuMMC source/FS source/libs/fatfs
|
||||
DATA := data
|
||||
INCLUDES := include
|
||||
EXEFS_SRC := exefs_src
|
||||
|
||||
ifneq ($(BUILD),$(notdir $(CURDIR)))
|
||||
EMUMMCDIR ?= $(CURDIR)
|
||||
else
|
||||
EMUMMCDIR ?= $(CURDIR)/../
|
||||
endif
|
||||
|
||||
include $(DEVKITPRO)/libnx/switch_rules
|
||||
|
||||
ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE
|
||||
|
||||
DEFINES := -DINNER_HEAP_SIZE=0x80000
|
||||
|
||||
CFLAGS := -Wall -O2 -ffunction-sections -Wno-unused-function \
|
||||
$(ARCH) $(DEFINES)
|
||||
|
||||
CFLAGS += $(INCLUDE) -D__SWITCH__
|
||||
|
||||
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++17
|
||||
|
||||
ASFLAGS := -g $(ARCH)
|
||||
LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
|
||||
|
||||
ifneq ($(BUILD),$(notdir $(CURDIR)))
|
||||
|
||||
export OUTPUT := $(CURDIR)/$(TARGET)
|
||||
export TOPDIR := $(EMUMMCDIR)
|
||||
|
||||
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
|
||||
$(foreach dir,$(DATA),$(CURDIR)/$(dir))
|
||||
|
||||
export DEPSDIR := $(CURDIR)/$(BUILD)
|
||||
|
||||
CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
|
||||
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
|
||||
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
|
||||
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
|
||||
|
||||
ifeq ($(strip $(CPPFILES)),)
|
||||
export LD := $(CC)
|
||||
else
|
||||
export LD := $(CXX)
|
||||
endif
|
||||
|
||||
export OFILES_BIN := $(addsuffix .o,$(BINFILES))
|
||||
export OFILES_SRC := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
|
||||
export OFILES := $(OFILES_BIN) $(OFILES_SRC)
|
||||
export HFILES_BIN := $(addsuffix .h,$(subst .,_,$(BINFILES)))
|
||||
|
||||
export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
|
||||
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
|
||||
-I$(CURDIR)/$(BUILD)
|
||||
|
||||
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib)
|
||||
|
||||
export BUILD_EXEFS_SRC := $(TOPDIR)/$(EXEFS_SRC)
|
||||
|
||||
ifeq ($(strip $(CONFIG_JSON)),)
|
||||
jsons := $(wildcard *.json)
|
||||
ifneq (,$(findstring $(TARGET).json,$(jsons)))
|
||||
export APP_JSON := $(TOPDIR)/$(TARGET).json
|
||||
else
|
||||
ifneq (,$(findstring config.json,$(jsons)))
|
||||
export APP_JSON := $(TOPDIR)/config.json
|
||||
endif
|
||||
endif
|
||||
else
|
||||
export APP_JSON := $(TOPDIR)/$(CONFIG_JSON)
|
||||
endif
|
||||
|
||||
.PHONY: $(BUILD) clean all
|
||||
|
||||
all: $(BUILD)
|
||||
|
||||
$(BUILD):
|
||||
@[ -d $@ ] || mkdir -p $@
|
||||
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
|
||||
|
||||
clean:
|
||||
@echo clean ...
|
||||
@rm -fr $(BUILD) $(TARGET).elf $(TARGET).kip
|
||||
|
||||
else
|
||||
.PHONY: all
|
||||
|
||||
DEPENDS := $(OFILES:.o=.d)
|
||||
|
||||
all : $(OUTPUT).kip
|
||||
|
||||
$(OUTPUT).kip : $(OUTPUT).elf
|
||||
|
||||
$(OUTPUT).elf : $(OFILES)
|
||||
|
||||
$(OFILES_SRC) : $(HFILES_BIN)
|
||||
|
||||
%.bin.o %_bin.h : %.bin
|
||||
@echo $(notdir $<)
|
||||
@$(bin2o)
|
||||
|
||||
-include $(DEPENDS)
|
||||
|
||||
endif
|
||||
36
emummc/README.md
Normal file
36
emummc/README.md
Normal file
@@ -0,0 +1,36 @@
|
||||
# emuMMC
|
||||
*A SDMMC driver replacement for Nintendo's Filesystem Services, by **m4xw***
|
||||
|
||||
### Supported Horizon Versions
|
||||
**1.0.0 - 9.1.0**
|
||||
|
||||
## Features
|
||||
* Arbitrary SDMMC backend selection
|
||||
**This allows loading eMMC from SD or even SD from eMMC**
|
||||
* On the fly hooking / patching, fully self-infesting
|
||||
**Only one payload required for all versions!**
|
||||
* File-based SDMMC backend support (from SD)
|
||||
**This allows loading eMMC images from hekate-backups (split or not)**
|
||||
* SDMMC device based sector offset (*currently eMMC only*)
|
||||
**Raw partition support for eMMC from SD with less performance overhead**
|
||||
* Full support for `/Nintendo` folder redirection to a arbitrary path
|
||||
**No 8 char length restriction!**
|
||||
* exosphere based context configuration
|
||||
**This includes full support for multiple emuMMC images**
|
||||
|
||||
## Compiling
|
||||
### hekate
|
||||
Run `./build.sh` and copy the produced kipm (Kernel Initial Process Modification) file to `/bootloader/sys/`
|
||||
|
||||
### Atmosphere
|
||||
Run `make`, the resulting kip can be used for code injection via fusee (place at `/atmosphere/emummc.kip`)
|
||||
|
||||
## License
|
||||
**emuMMC is released as GPLv2**
|
||||
|
||||
## Credits
|
||||
* **CTCaer** - The CTCaer hekate fork, file-based emuMMC support, SDMMC driver fixes among other things
|
||||
* **SciresM, hexkyz** - The Atmosphere project, FS offsets, additional research related to newer FS versions
|
||||
* **naehrwert** - The hekate project, its SDMMC driver and being very helpful in the early research phase
|
||||
* **jakibaki** - KIP Inject PoC, used in the early dev phase
|
||||
* **switchbrew/devkitPro** - devkitA64 and libnx sources
|
||||
9
emummc/build.sh
Normal file
9
emummc/build.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
make clean
|
||||
make -j
|
||||
./hactool.exe -t kip emummc.kip --uncompressed emummc_unpacked.kip
|
||||
python2.7 tools/kip1converter.py emummc_unpacked.kip emummc.data
|
||||
cat emummc.caps emummc.data > emummc.kipm
|
||||
133
emummc/emummc.json
Normal file
133
emummc/emummc.json
Normal file
@@ -0,0 +1,133 @@
|
||||
{
|
||||
"name": "FS",
|
||||
"title_id": "0x0100000000000000",
|
||||
"main_thread_stack_size": "0x00008000",
|
||||
"main_thread_priority": 45,
|
||||
"default_cpu_id": 3,
|
||||
"process_category": 1,
|
||||
"kernel_capabilities": [
|
||||
{
|
||||
"type": "map_page",
|
||||
"value": "0x60006000"
|
||||
},
|
||||
{
|
||||
"type": "map",
|
||||
"value": {
|
||||
"address": "0x6000D000",
|
||||
"size": "0x1000",
|
||||
"is_ro": false,
|
||||
"is_io": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "map",
|
||||
"value": {
|
||||
"address": "0x700b0000",
|
||||
"is_ro": false,
|
||||
"size": "0x00005000",
|
||||
"is_io": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "map",
|
||||
"value": {
|
||||
"address": "0x7000C000",
|
||||
"is_ro": false,
|
||||
"size": "0x00002000",
|
||||
"is_io": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "map",
|
||||
"value": {
|
||||
"address": "0x70000000",
|
||||
"is_ro": false,
|
||||
"size": "0x00004000",
|
||||
"is_io": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "handle_table_size",
|
||||
"value": 256
|
||||
},
|
||||
{
|
||||
"type": "irq_pair",
|
||||
"value": [
|
||||
46,
|
||||
47
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "irq_pair",
|
||||
"value": [
|
||||
51,
|
||||
63
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "syscalls",
|
||||
"value": {
|
||||
"svcSetHeapSize": "0x01",
|
||||
"svcSetMemoryPermission": "0x02",
|
||||
"svcSetMemoryAttribute": "0x03",
|
||||
"svcMapMemory": "0x04",
|
||||
"svcUnmapMemory": "0x05",
|
||||
"svcQueryMemory": "0x06",
|
||||
"svcExitProcess": "0x07",
|
||||
"svcCreateThread": "0x08",
|
||||
"svcStartThread": "0x09",
|
||||
"svcExitThread": "0x0a",
|
||||
"svcSleepThread": "0x0b",
|
||||
"svcGetThreadPriority": "0x0c",
|
||||
"svcSetThreadPriority": "0x0d",
|
||||
"svcGetThreadCoreMask": "0x0e",
|
||||
"svcSetThreadCoreMask": "0x0f",
|
||||
"svcGetCurrentProcessorNumber": "0x10",
|
||||
"svcSignalEvent": "0x11",
|
||||
"svcClearEvent": "0x12",
|
||||
"svcMapSharedMemory": "0x13",
|
||||
"svcUnmapSharedMemory": "0x14",
|
||||
"svcCreateTransferMemory": "0x15",
|
||||
"svcCloseHandle": "0x16",
|
||||
"svcResetSignal": "0x17",
|
||||
"svcWaitSynchronization": "0x18",
|
||||
"svcCancelSynchronization": "0x19",
|
||||
"svcArbitrateLock": "0x1a",
|
||||
"svcArbitrateUnlock": "0x1b",
|
||||
"svcWaitProcessWideKeyAtomic": "0x1c",
|
||||
"svcSignalProcessWideKey": "0x1d",
|
||||
"svcGetSystemTick": "0x1e",
|
||||
"svcConnectToNamedPort": "0x1f",
|
||||
"svcSendSyncRequestLight": "0x20",
|
||||
"svcSendSyncRequest": "0x21",
|
||||
"svcSendSyncRequestWithUserBuffer": "0x22",
|
||||
"svcSendAsyncRequestWithUserBuffer": "0x23",
|
||||
"svcGetProcessId": "0x24",
|
||||
"svcGetThreadId": "0x25",
|
||||
"svcBreak": "0x26",
|
||||
"svcOutputDebugString": "0x27",
|
||||
"svcReturnFromException": "0x28",
|
||||
"svcGetInfo": "0x29",
|
||||
"svcWaitForAddress": "0x34",
|
||||
"svcSignalToAddress": "0x35",
|
||||
"svcCreateSession": "0x40",
|
||||
"svcAcceptSession": "0x41",
|
||||
"svcReplyAndReceiveLight": "0x42",
|
||||
"svcReplyAndReceive": "0x43",
|
||||
"svcReplyAndReceiveWithUserBuffer": "0x44",
|
||||
"svcCreateEvent": "0x45",
|
||||
"svcReadWriteRegister": "0x4E",
|
||||
"svcCreateInterruptEvent": "0x53",
|
||||
"svcQueryIoMapping": "0x55",
|
||||
"svcCreateDeviceAddressSpace": "0x56",
|
||||
"svcAttachDeviceAddressSpace": "0x57",
|
||||
"svcDetachDeviceAddressSpace": "0x58",
|
||||
"svcMapDeviceAddressSpaceAligned": "0x5a",
|
||||
"svcUnmapDeviceAddressSpace": "0x5c",
|
||||
"svcGetSystemInfo": "0x6f",
|
||||
"svcSetProcessMemoryPermission": "0x73",
|
||||
"svcCallSecureMonitor": "0x7f"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
40
emummc/source/FS/FS.h
Normal file
40
emummc/source/FS/FS.h
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||
* Copyright (c) 2019 Atmosphere-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __FS_H__
|
||||
#define __FS_H__
|
||||
|
||||
// TODO
|
||||
#include "../emmc/sdmmc_t210.h"
|
||||
|
||||
#include "FS_versions.h"
|
||||
#include "FS_offsets.h"
|
||||
#include "FS_structs.h"
|
||||
|
||||
#define FS_SDMMC_EMMC 0
|
||||
#define FS_SDMMC_SD 1
|
||||
#define FS_SDMMC_GC 2
|
||||
|
||||
#define FS_EMMC_PARTITION_GPP 0
|
||||
#define FS_EMMC_PARTITION_BOOT0 1
|
||||
#define FS_EMMC_PARTITION_BOOT1 2
|
||||
#define FS_EMMC_PARTITION_INVALID 3
|
||||
|
||||
#define BOOT_PARTITION_SIZE 0x2000
|
||||
#define FS_READ_WRITE_ERROR 1048
|
||||
|
||||
#endif /* __FS_H__ */
|
||||
167
emummc/source/FS/FS_offsets.c
Normal file
167
emummc/source/FS/FS_offsets.c
Normal file
@@ -0,0 +1,167 @@
|
||||
/*
|
||||
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||
* Copyright (c) 2019 Atmosphere-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "FS_offsets.h"
|
||||
#include "offsets/100.h"
|
||||
#include "offsets/200.h"
|
||||
#include "offsets/200_exfat.h"
|
||||
#include "offsets/210.h"
|
||||
#include "offsets/210_exfat.h"
|
||||
#include "offsets/300.h"
|
||||
#include "offsets/300_exfat.h"
|
||||
#include "offsets/301.h"
|
||||
#include "offsets/301_exfat.h"
|
||||
#include "offsets/400.h"
|
||||
#include "offsets/400_exfat.h"
|
||||
#include "offsets/410.h"
|
||||
#include "offsets/410_exfat.h"
|
||||
#include "offsets/500.h"
|
||||
#include "offsets/500_exfat.h"
|
||||
#include "offsets/510.h"
|
||||
#include "offsets/510_exfat.h"
|
||||
#include "offsets/600.h"
|
||||
#include "offsets/600_exfat.h"
|
||||
#include "offsets/700.h"
|
||||
#include "offsets/700_exfat.h"
|
||||
#include "offsets/800.h"
|
||||
#include "offsets/800_exfat.h"
|
||||
#include "offsets/810.h"
|
||||
#include "offsets/810_exfat.h"
|
||||
#include "offsets/900.h"
|
||||
#include "offsets/900_exfat.h"
|
||||
#include "offsets/910.h"
|
||||
#include "offsets/910_exfat.h"
|
||||
#include "../utils/fatal.h"
|
||||
|
||||
#define GET_OFFSET_STRUCT_NAME(vers) g_offsets##vers
|
||||
|
||||
#define DEFINE_OFFSET_STRUCT(vers) \
|
||||
static const fs_offsets_t GET_OFFSET_STRUCT_NAME(vers) = { \
|
||||
.sdmmc_accessor_gc = FS_OFFSET##vers##_SDMMC_ACCESSOR_GC, \
|
||||
.sdmmc_accessor_sd = FS_OFFSET##vers##_SDMMC_ACCESSOR_SD, \
|
||||
.sdmmc_accessor_nand = FS_OFFSET##vers##_SDMMC_ACCESSOR_NAND, \
|
||||
.sdmmc_wrapper_read = FS_OFFSET##vers##_SDMMC_WRAPPER_READ, \
|
||||
.sdmmc_wrapper_write = FS_OFFSET##vers##_SDMMC_WRAPPER_WRITE, \
|
||||
.clkrst_set_min_v_clock_rate = FS_OFFSET##vers##_CLKRST_SET_MIN_V_CLK_RATE, \
|
||||
.rtld = FS_OFFSET##vers##_RTLD, \
|
||||
.rtld_destination = FS_OFFSET##vers##_RTLD_DESTINATION, \
|
||||
.lock_mutex = FS_OFFSET##vers##_LOCK_MUTEX, \
|
||||
.unlock_mutex = FS_OFFSET##vers##_UNLOCK_MUTEX, \
|
||||
.sd_mutex = FS_OFFSET##vers##_SD_MUTEX, \
|
||||
.nand_mutex = FS_OFFSET##vers##_NAND_MUTEX, \
|
||||
.active_partition = FS_OFFSET##vers##_ACTIVE_PARTITION, \
|
||||
.sdmmc_das_handle = FS_OFFSET##vers##_SDMMC_DAS_HANDLE, \
|
||||
.sdmmc_accessor_controller_close = FS_OFFSET##vers##_SDMMC_WRAPPER_CONTROLLER_CLOSE, \
|
||||
.sd_das_init = FS_OFFSET##vers##_SD_DAS_INIT, \
|
||||
.nintendo_paths = FS_OFFSET##vers##_NINTENDO_PATHS, \
|
||||
}
|
||||
|
||||
// Actually define offset structs
|
||||
DEFINE_OFFSET_STRUCT(_100);
|
||||
DEFINE_OFFSET_STRUCT(_200);
|
||||
DEFINE_OFFSET_STRUCT(_200_EXFAT);
|
||||
DEFINE_OFFSET_STRUCT(_210);
|
||||
DEFINE_OFFSET_STRUCT(_210_EXFAT);
|
||||
DEFINE_OFFSET_STRUCT(_300);
|
||||
DEFINE_OFFSET_STRUCT(_300_EXFAT);
|
||||
DEFINE_OFFSET_STRUCT(_301);
|
||||
DEFINE_OFFSET_STRUCT(_301_EXFAT);
|
||||
DEFINE_OFFSET_STRUCT(_400);
|
||||
DEFINE_OFFSET_STRUCT(_400_EXFAT);
|
||||
DEFINE_OFFSET_STRUCT(_410);
|
||||
DEFINE_OFFSET_STRUCT(_410_EXFAT);
|
||||
DEFINE_OFFSET_STRUCT(_500);
|
||||
DEFINE_OFFSET_STRUCT(_500_EXFAT);
|
||||
DEFINE_OFFSET_STRUCT(_510);
|
||||
DEFINE_OFFSET_STRUCT(_510_EXFAT);
|
||||
DEFINE_OFFSET_STRUCT(_600);
|
||||
DEFINE_OFFSET_STRUCT(_600_EXFAT);
|
||||
DEFINE_OFFSET_STRUCT(_700);
|
||||
DEFINE_OFFSET_STRUCT(_700_EXFAT);
|
||||
DEFINE_OFFSET_STRUCT(_800);
|
||||
DEFINE_OFFSET_STRUCT(_800_EXFAT);
|
||||
DEFINE_OFFSET_STRUCT(_810);
|
||||
DEFINE_OFFSET_STRUCT(_810_EXFAT);
|
||||
DEFINE_OFFSET_STRUCT(_900);
|
||||
DEFINE_OFFSET_STRUCT(_900_EXFAT);
|
||||
DEFINE_OFFSET_STRUCT(_910);
|
||||
DEFINE_OFFSET_STRUCT(_910_EXFAT);
|
||||
|
||||
const fs_offsets_t *get_fs_offsets(enum FS_VER version) {
|
||||
switch (version) {
|
||||
case FS_VER_1_0_0:
|
||||
return &(GET_OFFSET_STRUCT_NAME(_100));
|
||||
case FS_VER_2_0_0:
|
||||
return &(GET_OFFSET_STRUCT_NAME(_200));
|
||||
case FS_VER_2_0_0_EXFAT:
|
||||
return &(GET_OFFSET_STRUCT_NAME(_200_EXFAT));
|
||||
case FS_VER_2_1_0:
|
||||
return &(GET_OFFSET_STRUCT_NAME(_210));
|
||||
case FS_VER_2_1_0_EXFAT:
|
||||
return &(GET_OFFSET_STRUCT_NAME(_210_EXFAT));
|
||||
case FS_VER_3_0_0:
|
||||
return &(GET_OFFSET_STRUCT_NAME(_300));
|
||||
case FS_VER_3_0_0_EXFAT:
|
||||
return &(GET_OFFSET_STRUCT_NAME(_300_EXFAT));
|
||||
case FS_VER_3_0_1:
|
||||
return &(GET_OFFSET_STRUCT_NAME(_301));
|
||||
case FS_VER_3_0_1_EXFAT:
|
||||
return &(GET_OFFSET_STRUCT_NAME(_301_EXFAT));
|
||||
case FS_VER_4_0_0:
|
||||
return &(GET_OFFSET_STRUCT_NAME(_400));
|
||||
case FS_VER_4_0_0_EXFAT:
|
||||
return &(GET_OFFSET_STRUCT_NAME(_400_EXFAT));
|
||||
case FS_VER_4_1_0:
|
||||
return &(GET_OFFSET_STRUCT_NAME(_410));
|
||||
case FS_VER_4_1_0_EXFAT:
|
||||
return &(GET_OFFSET_STRUCT_NAME(_410_EXFAT));
|
||||
case FS_VER_5_0_0:
|
||||
return &(GET_OFFSET_STRUCT_NAME(_500));
|
||||
case FS_VER_5_0_0_EXFAT:
|
||||
return &(GET_OFFSET_STRUCT_NAME(_500_EXFAT));
|
||||
case FS_VER_5_1_0:
|
||||
return &(GET_OFFSET_STRUCT_NAME(_510));
|
||||
case FS_VER_5_1_0_EXFAT:
|
||||
return &(GET_OFFSET_STRUCT_NAME(_510_EXFAT));
|
||||
case FS_VER_6_0_0:
|
||||
return &(GET_OFFSET_STRUCT_NAME(_600));
|
||||
case FS_VER_6_0_0_EXFAT:
|
||||
return &(GET_OFFSET_STRUCT_NAME(_600_EXFAT));
|
||||
case FS_VER_7_0_0:
|
||||
return &(GET_OFFSET_STRUCT_NAME(_700));
|
||||
case FS_VER_7_0_0_EXFAT:
|
||||
return &(GET_OFFSET_STRUCT_NAME(_700_EXFAT));
|
||||
case FS_VER_8_0_0:
|
||||
return &(GET_OFFSET_STRUCT_NAME(_800));
|
||||
case FS_VER_8_0_0_EXFAT:
|
||||
return &(GET_OFFSET_STRUCT_NAME(_800_EXFAT));
|
||||
case FS_VER_8_1_0:
|
||||
return &(GET_OFFSET_STRUCT_NAME(_810));
|
||||
case FS_VER_8_1_0_EXFAT:
|
||||
return &(GET_OFFSET_STRUCT_NAME(_810_EXFAT));
|
||||
case FS_VER_9_0_0:
|
||||
return &(GET_OFFSET_STRUCT_NAME(_900));
|
||||
case FS_VER_9_0_0_EXFAT:
|
||||
return &(GET_OFFSET_STRUCT_NAME(_900_EXFAT));
|
||||
case FS_VER_9_1_0:
|
||||
return &(GET_OFFSET_STRUCT_NAME(_910));
|
||||
case FS_VER_9_1_0_EXFAT:
|
||||
return &(GET_OFFSET_STRUCT_NAME(_910_EXFAT));
|
||||
default:
|
||||
fatal_abort(Fatal_UnknownVersion);
|
||||
}
|
||||
}
|
||||
58
emummc/source/FS/FS_offsets.h
Normal file
58
emummc/source/FS/FS_offsets.h
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||
* Copyright (c) 2019 Atmosphere-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __FS_OFFSETS_H__
|
||||
#define __FS_OFFSETS_H__
|
||||
|
||||
#include <stdint.h>
|
||||
#include "FS_versions.h"
|
||||
|
||||
typedef struct {
|
||||
int opcode_reg;
|
||||
uint32_t adrp_offset;
|
||||
uint32_t add_rel_offset;
|
||||
} fs_offsets_nintendo_path_t;
|
||||
|
||||
typedef struct {
|
||||
// Accessor vtable getters
|
||||
uintptr_t sdmmc_accessor_gc;
|
||||
uintptr_t sdmmc_accessor_sd;
|
||||
uintptr_t sdmmc_accessor_nand;
|
||||
// Hooks
|
||||
uintptr_t sdmmc_wrapper_read;
|
||||
uintptr_t sdmmc_wrapper_write;
|
||||
uintptr_t rtld;
|
||||
uintptr_t rtld_destination;
|
||||
uintptr_t clkrst_set_min_v_clock_rate;
|
||||
// Misc funcs
|
||||
uintptr_t lock_mutex;
|
||||
uintptr_t unlock_mutex;
|
||||
uintptr_t sdmmc_accessor_controller_close;
|
||||
// Misc data
|
||||
uintptr_t sd_mutex;
|
||||
uintptr_t nand_mutex;
|
||||
uintptr_t active_partition;
|
||||
uintptr_t sdmmc_das_handle;
|
||||
// NOPs
|
||||
uintptr_t sd_das_init;
|
||||
// Nintendo Paths
|
||||
fs_offsets_nintendo_path_t nintendo_paths[];
|
||||
} fs_offsets_t;
|
||||
|
||||
const fs_offsets_t *get_fs_offsets(enum FS_VER version);
|
||||
|
||||
#endif // __FS_OFFSETS_H__
|
||||
61
emummc/source/FS/FS_structs.h
Normal file
61
emummc/source/FS/FS_structs.h
Normal file
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||
* Copyright (c) 2019 Atmosphere-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __FS_STRUCTS_H__
|
||||
#define __FS_STRUCTS_H__
|
||||
|
||||
#include "../utils/types.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *device_addr_buffer;
|
||||
uint64_t device_addr_buffer_size;
|
||||
char *device_addr_buffer_masked;
|
||||
} sdmmc_dma_buffer_t;
|
||||
|
||||
_Static_assert(__alignof(sdmmc_dma_buffer_t) == 8, "sdmmc_dma_buffer_t definition");
|
||||
|
||||
typedef struct sdmmc_accessor_vt
|
||||
{
|
||||
void *ctor;
|
||||
void *dtor;
|
||||
void *map_device_addr_space;
|
||||
void *unmap_device_addr_space;
|
||||
void *controller_open;
|
||||
uint64_t (*sdmmc_accessor_controller_close)(void *);
|
||||
uint64_t (*read_write)(void *, uint64_t, uint64_t, void *, uint64_t, uint64_t);
|
||||
// More not included because we don't use it.
|
||||
} sdmmc_accessor_vt_t;
|
||||
|
||||
_Static_assert(__alignof(sdmmc_accessor_vt_t) == 8, "sdmmc_accessor_vt_t definition");
|
||||
|
||||
typedef struct
|
||||
{
|
||||
void *vtab;
|
||||
t210_sdmmc_t *io_map;
|
||||
sdmmc_dma_buffer_t dmaBuffers[3];
|
||||
// More not included because we don't use it.
|
||||
} mmc_obj_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
sdmmc_accessor_vt_t *vtab;
|
||||
mmc_obj_t *parent;
|
||||
// More not included because we don't use it.
|
||||
} sdmmc_accessor_t;
|
||||
|
||||
#endif // __FS_STRUCTS_H__
|
||||
71
emummc/source/FS/FS_versions.h
Normal file
71
emummc/source/FS/FS_versions.h
Normal file
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||
* Copyright (c) 2019 Atmosphere-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __FS_VERSIONS_H__
|
||||
#define __FS_VERSIONS_H__
|
||||
|
||||
// FS Version enum
|
||||
enum FS_VER
|
||||
{
|
||||
FS_VER_1_0_0 = 0,
|
||||
|
||||
FS_VER_2_0_0,
|
||||
FS_VER_2_0_0_EXFAT,
|
||||
|
||||
FS_VER_2_1_0,
|
||||
FS_VER_2_1_0_EXFAT,
|
||||
|
||||
FS_VER_3_0_0,
|
||||
FS_VER_3_0_0_EXFAT,
|
||||
|
||||
FS_VER_3_0_1,
|
||||
FS_VER_3_0_1_EXFAT,
|
||||
|
||||
FS_VER_4_0_0,
|
||||
FS_VER_4_0_0_EXFAT,
|
||||
|
||||
FS_VER_4_1_0,
|
||||
FS_VER_4_1_0_EXFAT,
|
||||
|
||||
FS_VER_5_0_0,
|
||||
FS_VER_5_0_0_EXFAT,
|
||||
|
||||
FS_VER_5_1_0,
|
||||
FS_VER_5_1_0_EXFAT,
|
||||
|
||||
FS_VER_6_0_0,
|
||||
FS_VER_6_0_0_EXFAT,
|
||||
|
||||
FS_VER_7_0_0,
|
||||
FS_VER_7_0_0_EXFAT,
|
||||
|
||||
FS_VER_8_0_0,
|
||||
FS_VER_8_0_0_EXFAT,
|
||||
|
||||
FS_VER_8_1_0,
|
||||
FS_VER_8_1_0_EXFAT,
|
||||
|
||||
FS_VER_9_0_0,
|
||||
FS_VER_9_0_0_EXFAT,
|
||||
|
||||
FS_VER_9_1_0,
|
||||
FS_VER_9_1_0_EXFAT,
|
||||
|
||||
FS_VER_MAX,
|
||||
};
|
||||
|
||||
#endif // __FS_VERSIONS_H__
|
||||
58
emummc/source/FS/offsets/100.h
Normal file
58
emummc/source/FS/offsets/100.h
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||
* Copyright (c) 2019 Atmosphere-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __FS_100_H__
|
||||
#define __FS_100_H__
|
||||
|
||||
// Accessor vtable getters
|
||||
#define FS_OFFSET_100_SDMMC_ACCESSOR_GC 0x6F850
|
||||
#define FS_OFFSET_100_SDMMC_ACCESSOR_SD 0x6F65C
|
||||
#define FS_OFFSET_100_SDMMC_ACCESSOR_NAND 0x6F230
|
||||
|
||||
// Hooks
|
||||
#define FS_OFFSET_100_SDMMC_WRAPPER_READ 0x6A930
|
||||
#define FS_OFFSET_100_SDMMC_WRAPPER_WRITE 0x6A9F0
|
||||
#define FS_OFFSET_100_RTLD 0x534
|
||||
#define FS_OFFSET_100_RTLD_DESTINATION 0xA0
|
||||
|
||||
#define FS_OFFSET_100_CLKRST_SET_MIN_V_CLK_RATE 0x0
|
||||
|
||||
// Misc funcs
|
||||
#define FS_OFFSET_100_LOCK_MUTEX 0x2884
|
||||
#define FS_OFFSET_100_UNLOCK_MUTEX 0x28F0
|
||||
|
||||
#define FS_OFFSET_100_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x6A8AC
|
||||
|
||||
// Misc Data
|
||||
#define FS_OFFSET_100_SD_MUTEX 0xE36058
|
||||
#define FS_OFFSET_100_NAND_MUTEX 0xE30610
|
||||
#define FS_OFFSET_100_ACTIVE_PARTITION 0xE30650
|
||||
#define FS_OFFSET_100_SDMMC_DAS_HANDLE 0xE2F730
|
||||
|
||||
// NOPs
|
||||
#define FS_OFFSET_100_SD_DAS_INIT 0x0
|
||||
|
||||
// Nintendo Paths
|
||||
#define FS_OFFSET_100_NINTENDO_PATHS \
|
||||
{ \
|
||||
{.opcode_reg = 9, .adrp_offset = 0x00032C58, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 8, .adrp_offset = 0x00032C60, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 9, .adrp_offset = 0x00032F3C, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 8, .adrp_offset = 0x00032F44, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
||||
}
|
||||
|
||||
#endif // __FS_100_H__
|
||||
57
emummc/source/FS/offsets/200.h
Normal file
57
emummc/source/FS/offsets/200.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||
* Copyright (c) 2019 Atmosphere-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __FS_200_H__
|
||||
#define __FS_200_H__
|
||||
|
||||
// Accessor vtable getters
|
||||
#define FS_OFFSET_200_SDMMC_ACCESSOR_GC 0x78BAC
|
||||
#define FS_OFFSET_200_SDMMC_ACCESSOR_SD 0x7894C
|
||||
#define FS_OFFSET_200_SDMMC_ACCESSOR_NAND 0x784BC
|
||||
|
||||
// Hooks
|
||||
#define FS_OFFSET_200_SDMMC_WRAPPER_READ 0x73478
|
||||
#define FS_OFFSET_200_SDMMC_WRAPPER_WRITE 0x73538
|
||||
#define FS_OFFSET_200_RTLD 0x500
|
||||
#define FS_OFFSET_200_RTLD_DESTINATION 0x98
|
||||
|
||||
#define FS_OFFSET_200_CLKRST_SET_MIN_V_CLK_RATE 0x0
|
||||
|
||||
// Misc funcs
|
||||
#define FS_OFFSET_200_LOCK_MUTEX 0x3264
|
||||
#define FS_OFFSET_200_UNLOCK_MUTEX 0x32D0
|
||||
|
||||
#define FS_OFFSET_200_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x733F4
|
||||
|
||||
// Misc Data
|
||||
#define FS_OFFSET_200_SD_MUTEX 0xE42268
|
||||
#define FS_OFFSET_200_NAND_MUTEX 0xE3CED0
|
||||
#define FS_OFFSET_200_ACTIVE_PARTITION 0xE3CF10
|
||||
#define FS_OFFSET_200_SDMMC_DAS_HANDLE 0xE3BDD0
|
||||
|
||||
// NOPs
|
||||
#define FS_OFFSET_200_SD_DAS_INIT 0x0
|
||||
|
||||
// Nintendo Paths
|
||||
#define FS_OFFSET_200_NINTENDO_PATHS \
|
||||
{ \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00033F08, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00035084, .add_rel_offset = 0x0000000C}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0003537C, .add_rel_offset = 0x0000000C}, \
|
||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
||||
}
|
||||
|
||||
#endif // __FS_200_H__
|
||||
57
emummc/source/FS/offsets/200_exfat.h
Normal file
57
emummc/source/FS/offsets/200_exfat.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||
* Copyright (c) 2019 Atmosphere-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __FS_200_EXFAT_H__
|
||||
#define __FS_200_EXFAT_H__
|
||||
|
||||
// Accessor vtable getters
|
||||
#define FS_OFFSET_200_EXFAT_SDMMC_ACCESSOR_GC 0x78BAC
|
||||
#define FS_OFFSET_200_EXFAT_SDMMC_ACCESSOR_SD 0x7894C
|
||||
#define FS_OFFSET_200_EXFAT_SDMMC_ACCESSOR_NAND 0x784BC
|
||||
|
||||
// Hooks
|
||||
#define FS_OFFSET_200_EXFAT_SDMMC_WRAPPER_READ 0x73478
|
||||
#define FS_OFFSET_200_EXFAT_SDMMC_WRAPPER_WRITE 0x73538
|
||||
#define FS_OFFSET_200_EXFAT_RTLD 0x500
|
||||
#define FS_OFFSET_200_EXFAT_RTLD_DESTINATION 0x98
|
||||
|
||||
#define FS_OFFSET_200_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x0
|
||||
|
||||
// Misc funcs
|
||||
#define FS_OFFSET_200_EXFAT_LOCK_MUTEX 0x3264
|
||||
#define FS_OFFSET_200_EXFAT_UNLOCK_MUTEX 0x32D0
|
||||
|
||||
#define FS_OFFSET_200_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x733F4
|
||||
|
||||
// Misc Data
|
||||
#define FS_OFFSET_200_EXFAT_SD_MUTEX 0xF22268
|
||||
#define FS_OFFSET_200_EXFAT_NAND_MUTEX 0xF1CED0
|
||||
#define FS_OFFSET_200_EXFAT_ACTIVE_PARTITION 0xF1CF10
|
||||
#define FS_OFFSET_200_EXFAT_SDMMC_DAS_HANDLE 0xF1BDD0
|
||||
|
||||
// NOPs
|
||||
#define FS_OFFSET_200_EXFAT_SD_DAS_INIT 0x0
|
||||
|
||||
// Nintendo Paths
|
||||
#define FS_OFFSET_200_EXFAT_NINTENDO_PATHS \
|
||||
{ \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00033F08, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00035084, .add_rel_offset = 0x0000000C}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0003537C, .add_rel_offset = 0x0000000C}, \
|
||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
||||
}
|
||||
|
||||
#endif // __FS_200_EXFAT_H__
|
||||
57
emummc/source/FS/offsets/210.h
Normal file
57
emummc/source/FS/offsets/210.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||
* Copyright (c) 2019 Atmosphere-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __FS_210_H__
|
||||
#define __FS_210_H__
|
||||
|
||||
// Accessor vtable getters
|
||||
#define FS_OFFSET_210_SDMMC_ACCESSOR_GC 0x78F8C
|
||||
#define FS_OFFSET_210_SDMMC_ACCESSOR_SD 0x78D2C
|
||||
#define FS_OFFSET_210_SDMMC_ACCESSOR_NAND 0x7889C
|
||||
|
||||
// Hooks
|
||||
#define FS_OFFSET_210_SDMMC_WRAPPER_READ 0x73858
|
||||
#define FS_OFFSET_210_SDMMC_WRAPPER_WRITE 0x73918
|
||||
#define FS_OFFSET_210_RTLD 0x500
|
||||
#define FS_OFFSET_210_RTLD_DESTINATION 0x98
|
||||
|
||||
#define FS_OFFSET_210_CLKRST_SET_MIN_V_CLK_RATE 0x0
|
||||
|
||||
// Misc funcs
|
||||
#define FS_OFFSET_210_LOCK_MUTEX 0x3264
|
||||
#define FS_OFFSET_210_UNLOCK_MUTEX 0x32D0
|
||||
|
||||
#define FS_OFFSET_210_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x737D4
|
||||
|
||||
// Misc Data
|
||||
#define FS_OFFSET_210_SD_MUTEX 0xE43268
|
||||
#define FS_OFFSET_210_NAND_MUTEX 0xE3DED0
|
||||
#define FS_OFFSET_210_ACTIVE_PARTITION 0xE3DF10
|
||||
#define FS_OFFSET_210_SDMMC_DAS_HANDLE 0xE3CDD0
|
||||
|
||||
// NOPs
|
||||
#define FS_OFFSET_210_SD_DAS_INIT 0x0
|
||||
|
||||
// Nintendo Paths
|
||||
#define FS_OFFSET_210_NINTENDO_PATHS \
|
||||
{ \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x000342E0, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0003545C, .add_rel_offset = 0x0000000C}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00035754, .add_rel_offset = 0x0000000C}, \
|
||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
||||
}
|
||||
|
||||
#endif // __FS_210_H__
|
||||
57
emummc/source/FS/offsets/210_exfat.h
Normal file
57
emummc/source/FS/offsets/210_exfat.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||
* Copyright (c) 2019 Atmosphere-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __FS_210_EXFAT_H__
|
||||
#define __FS_210_EXFAT_H__
|
||||
|
||||
// Accessor vtable getters
|
||||
#define FS_OFFSET_210_EXFAT_SDMMC_ACCESSOR_GC 0x78F8C
|
||||
#define FS_OFFSET_210_EXFAT_SDMMC_ACCESSOR_SD 0x78D2C
|
||||
#define FS_OFFSET_210_EXFAT_SDMMC_ACCESSOR_NAND 0x7889C
|
||||
|
||||
// Hooks
|
||||
#define FS_OFFSET_210_EXFAT_SDMMC_WRAPPER_READ 0x73858
|
||||
#define FS_OFFSET_210_EXFAT_SDMMC_WRAPPER_WRITE 0x73918
|
||||
#define FS_OFFSET_210_EXFAT_RTLD 0x500
|
||||
#define FS_OFFSET_210_EXFAT_RTLD_DESTINATION 0x98
|
||||
|
||||
#define FS_OFFSET_210_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x0
|
||||
|
||||
// Misc funcs
|
||||
#define FS_OFFSET_210_EXFAT_LOCK_MUTEX 0x3264
|
||||
#define FS_OFFSET_210_EXFAT_UNLOCK_MUTEX 0x32D0
|
||||
|
||||
#define FS_OFFSET_210_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x737D4
|
||||
|
||||
// Misc Data
|
||||
#define FS_OFFSET_210_EXFAT_SD_MUTEX 0xF22268
|
||||
#define FS_OFFSET_210_EXFAT_NAND_MUTEX 0xF1CED0
|
||||
#define FS_OFFSET_210_EXFAT_ACTIVE_PARTITION 0xF1CF10
|
||||
#define FS_OFFSET_210_EXFAT_SDMMC_DAS_HANDLE 0xF1BDD0
|
||||
|
||||
// NOPs
|
||||
#define FS_OFFSET_210_EXFAT_SD_DAS_INIT 0x0
|
||||
|
||||
// Nintendo Paths
|
||||
#define FS_OFFSET_210_EXFAT_NINTENDO_PATHS \
|
||||
{ \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x000342E0, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0003545C, .add_rel_offset = 0x0000000C}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00035754, .add_rel_offset = 0x0000000C}, \
|
||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
||||
}
|
||||
|
||||
#endif // __FS_210_EXFAT_H__
|
||||
57
emummc/source/FS/offsets/300.h
Normal file
57
emummc/source/FS/offsets/300.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||
* Copyright (c) 2019 Atmosphere-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __FS_300_H__
|
||||
#define __FS_300_H__
|
||||
|
||||
// Accessor vtable getters
|
||||
#define FS_OFFSET_300_SDMMC_ACCESSOR_GC 0x8FAAC
|
||||
#define FS_OFFSET_300_SDMMC_ACCESSOR_SD 0x8F84C
|
||||
#define FS_OFFSET_300_SDMMC_ACCESSOR_NAND 0x8F3B8
|
||||
|
||||
// Hooks
|
||||
#define FS_OFFSET_300_SDMMC_WRAPPER_READ 0x8A2F4
|
||||
#define FS_OFFSET_300_SDMMC_WRAPPER_WRITE 0x8A3B4
|
||||
#define FS_OFFSET_300_RTLD 0x4E8
|
||||
#define FS_OFFSET_300_RTLD_DESTINATION 0x8C
|
||||
|
||||
#define FS_OFFSET_300_CLKRST_SET_MIN_V_CLK_RATE 0x0
|
||||
|
||||
// Misc funcs
|
||||
#define FS_OFFSET_300_LOCK_MUTEX 0x35CC
|
||||
#define FS_OFFSET_300_UNLOCK_MUTEX 0x3638
|
||||
|
||||
#define FS_OFFSET_300_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x8A270
|
||||
|
||||
// Misc Data
|
||||
#define FS_OFFSET_300_SD_MUTEX 0xE69268
|
||||
#define FS_OFFSET_300_NAND_MUTEX 0xE646F0
|
||||
#define FS_OFFSET_300_ACTIVE_PARTITION 0xE64730
|
||||
#define FS_OFFSET_300_SDMMC_DAS_HANDLE 0xE635A0
|
||||
|
||||
// NOPs
|
||||
#define FS_OFFSET_300_SD_DAS_INIT 0x0
|
||||
|
||||
// Nintendo Paths
|
||||
#define FS_OFFSET_300_NINTENDO_PATHS \
|
||||
{ \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x000391F4, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0003A480, .add_rel_offset = 0x0000000C}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0003A778, .add_rel_offset = 0x0000000C}, \
|
||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
||||
}
|
||||
|
||||
#endif // __FS_300_H__
|
||||
57
emummc/source/FS/offsets/300_exfat.h
Normal file
57
emummc/source/FS/offsets/300_exfat.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||
* Copyright (c) 2019 Atmosphere-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __FS_300_EXFAT_H__
|
||||
#define __FS_300_EXFAT_H__
|
||||
|
||||
// Accessor vtable getters
|
||||
#define FS_OFFSET_300_EXFAT_SDMMC_ACCESSOR_GC 0x8FAAC
|
||||
#define FS_OFFSET_300_EXFAT_SDMMC_ACCESSOR_SD 0x8F84C
|
||||
#define FS_OFFSET_300_EXFAT_SDMMC_ACCESSOR_NAND 0x8F3B8
|
||||
|
||||
// Hooks
|
||||
#define FS_OFFSET_300_EXFAT_SDMMC_WRAPPER_READ 0x8A2F4
|
||||
#define FS_OFFSET_300_EXFAT_SDMMC_WRAPPER_WRITE 0x8A3B4
|
||||
#define FS_OFFSET_300_EXFAT_RTLD 0x4E8
|
||||
#define FS_OFFSET_300_EXFAT_RTLD_DESTINATION 0x8C
|
||||
|
||||
#define FS_OFFSET_300_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x0
|
||||
|
||||
// Misc funcs
|
||||
#define FS_OFFSET_300_EXFAT_LOCK_MUTEX 0x35CC
|
||||
#define FS_OFFSET_300_EXFAT_UNLOCK_MUTEX 0x3638
|
||||
|
||||
#define FS_OFFSET_300_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x8A270
|
||||
|
||||
// Misc Data
|
||||
#define FS_OFFSET_300_EXFAT_SD_MUTEX 0xF4C268
|
||||
#define FS_OFFSET_300_EXFAT_NAND_MUTEX 0xF476F0
|
||||
#define FS_OFFSET_300_EXFAT_ACTIVE_PARTITION 0xF47730
|
||||
#define FS_OFFSET_300_EXFAT_SDMMC_DAS_HANDLE 0xF465A0
|
||||
|
||||
// NOPs
|
||||
#define FS_OFFSET_300_EXFAT_SD_DAS_INIT 0x0
|
||||
|
||||
// Nintendo Paths
|
||||
#define FS_OFFSET_300_EXFAT_NINTENDO_PATHS \
|
||||
{ \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x000391F4, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0003A480, .add_rel_offset = 0x0000000C}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0003A778, .add_rel_offset = 0x0000000C}, \
|
||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
||||
}
|
||||
|
||||
#endif // __FS_300_EXFAT_H__
|
||||
57
emummc/source/FS/offsets/301.h
Normal file
57
emummc/source/FS/offsets/301.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||
* Copyright (c) 2019 Atmosphere-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __FS_301_H__
|
||||
#define __FS_301_H__
|
||||
|
||||
// Accessor vtable getters
|
||||
#define FS_OFFSET_301_SDMMC_ACCESSOR_GC 0x8FB68
|
||||
#define FS_OFFSET_301_SDMMC_ACCESSOR_SD 0x8F908
|
||||
#define FS_OFFSET_301_SDMMC_ACCESSOR_NAND 0x8F474
|
||||
|
||||
// Hooks
|
||||
#define FS_OFFSET_301_SDMMC_WRAPPER_READ 0x8A3B0
|
||||
#define FS_OFFSET_301_SDMMC_WRAPPER_WRITE 0x8A470
|
||||
#define FS_OFFSET_301_RTLD 0x4E8
|
||||
#define FS_OFFSET_301_RTLD_DESTINATION 0x8C
|
||||
|
||||
#define FS_OFFSET_301_CLKRST_SET_MIN_V_CLK_RATE 0x0
|
||||
|
||||
// Misc funcs
|
||||
#define FS_OFFSET_301_LOCK_MUTEX 0x3638
|
||||
#define FS_OFFSET_301_UNLOCK_MUTEX 0x36A4
|
||||
|
||||
#define FS_OFFSET_301_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x8A32C
|
||||
|
||||
// Misc Data
|
||||
#define FS_OFFSET_301_SD_MUTEX 0xE69268
|
||||
#define FS_OFFSET_301_NAND_MUTEX 0xE646F0
|
||||
#define FS_OFFSET_301_ACTIVE_PARTITION 0xE64730
|
||||
#define FS_OFFSET_301_SDMMC_DAS_HANDLE 0xE635A0
|
||||
|
||||
// NOPs
|
||||
#define FS_OFFSET_301_SD_DAS_INIT 0x0
|
||||
|
||||
// Nintendo Paths
|
||||
#define FS_OFFSET_301_NINTENDO_PATHS \
|
||||
{ \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00039260, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0003A4EC, .add_rel_offset = 0x0000000C}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0003A7E4, .add_rel_offset = 0x0000000C}, \
|
||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
||||
}
|
||||
|
||||
#endif // __FS_301_H__
|
||||
57
emummc/source/FS/offsets/301_exfat.h
Normal file
57
emummc/source/FS/offsets/301_exfat.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||
* Copyright (c) 2019 Atmosphere-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __FS_301_EXFAT_H__
|
||||
#define __FS_301_EXFAT_H__
|
||||
|
||||
// Accessor vtable getters
|
||||
#define FS_OFFSET_301_EXFAT_SDMMC_ACCESSOR_GC 0x8FB68
|
||||
#define FS_OFFSET_301_EXFAT_SDMMC_ACCESSOR_SD 0x8F908
|
||||
#define FS_OFFSET_301_EXFAT_SDMMC_ACCESSOR_NAND 0x8F474
|
||||
|
||||
// Hooks
|
||||
#define FS_OFFSET_301_EXFAT_SDMMC_WRAPPER_READ 0x8A3B0
|
||||
#define FS_OFFSET_301_EXFAT_SDMMC_WRAPPER_WRITE 0x8A470
|
||||
#define FS_OFFSET_301_EXFAT_RTLD 0x4E8
|
||||
#define FS_OFFSET_301_EXFAT_RTLD_DESTINATION 0x8C
|
||||
|
||||
#define FS_OFFSET_301_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x0
|
||||
|
||||
// Misc funcs
|
||||
#define FS_OFFSET_301_EXFAT_LOCK_MUTEX 0x3638
|
||||
#define FS_OFFSET_301_EXFAT_UNLOCK_MUTEX 0x36A4
|
||||
|
||||
#define FS_OFFSET_301_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x8A32C
|
||||
|
||||
// Misc Data
|
||||
#define FS_OFFSET_301_EXFAT_SD_MUTEX 0xF4C268
|
||||
#define FS_OFFSET_301_EXFAT_NAND_MUTEX 0xF476F0
|
||||
#define FS_OFFSET_301_EXFAT_ACTIVE_PARTITION 0xF47730
|
||||
#define FS_OFFSET_301_EXFAT_SDMMC_DAS_HANDLE 0xF465A0
|
||||
|
||||
// NOPs
|
||||
#define FS_OFFSET_301_EXFAT_SD_DAS_INIT 0x0
|
||||
|
||||
// Nintendo Paths
|
||||
#define FS_OFFSET_301_EXFAT_NINTENDO_PATHS \
|
||||
{ \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00039260, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0003A4EC, .add_rel_offset = 0x0000000C}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0003A7E4, .add_rel_offset = 0x0000000C}, \
|
||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
||||
}
|
||||
|
||||
#endif // __FS_301_EXFAT_H__
|
||||
57
emummc/source/FS/offsets/400.h
Normal file
57
emummc/source/FS/offsets/400.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||
* Copyright (c) 2019 Atmosphere-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __FS_400_H__
|
||||
#define __FS_400_H__
|
||||
|
||||
// Accessor vtable getters
|
||||
#define FS_OFFSET_400_SDMMC_ACCESSOR_GC 0xA3374
|
||||
#define FS_OFFSET_400_SDMMC_ACCESSOR_SD 0xA3114
|
||||
#define FS_OFFSET_400_SDMMC_ACCESSOR_NAND 0xA2C80
|
||||
|
||||
// Hooks
|
||||
#define FS_OFFSET_400_SDMMC_WRAPPER_READ 0x9DBCC
|
||||
#define FS_OFFSET_400_SDMMC_WRAPPER_WRITE 0x9DC8C
|
||||
#define FS_OFFSET_400_RTLD 0x4DC
|
||||
#define FS_OFFSET_400_RTLD_DESTINATION 0x98
|
||||
|
||||
#define FS_OFFSET_400_CLKRST_SET_MIN_V_CLK_RATE 0x0
|
||||
|
||||
// Misc funcs
|
||||
#define FS_OFFSET_400_LOCK_MUTEX 0x39A0
|
||||
#define FS_OFFSET_400_UNLOCK_MUTEX 0x3A0C
|
||||
|
||||
#define FS_OFFSET_400_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x9DB48
|
||||
|
||||
// Misc Data
|
||||
#define FS_OFFSET_400_SD_MUTEX 0xE80268
|
||||
#define FS_OFFSET_400_NAND_MUTEX 0xE7BC60
|
||||
#define FS_OFFSET_400_ACTIVE_PARTITION 0xE7BCA0
|
||||
#define FS_OFFSET_400_SDMMC_DAS_HANDLE 0xE7ABF0
|
||||
|
||||
// NOPs
|
||||
#define FS_OFFSET_400_SD_DAS_INIT 0x0
|
||||
|
||||
// Nintendo Paths
|
||||
#define FS_OFFSET_400_NINTENDO_PATHS \
|
||||
{ \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0002023C, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00021BE8, .add_rel_offset = 0x0000000C}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00021EC4, .add_rel_offset = 0x0000000C}, \
|
||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
||||
}
|
||||
|
||||
#endif // __FS_400_H__
|
||||
57
emummc/source/FS/offsets/400_exfat.h
Normal file
57
emummc/source/FS/offsets/400_exfat.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||
* Copyright (c) 2019 Atmosphere-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __FS_400_EXFAT_H__
|
||||
#define __FS_400_EXFAT_H__
|
||||
|
||||
// Accessor vtable getters
|
||||
#define FS_OFFSET_400_EXFAT_SDMMC_ACCESSOR_GC 0xA3374
|
||||
#define FS_OFFSET_400_EXFAT_SDMMC_ACCESSOR_SD 0xA3114
|
||||
#define FS_OFFSET_400_EXFAT_SDMMC_ACCESSOR_NAND 0xA2C80
|
||||
|
||||
// Hooks
|
||||
#define FS_OFFSET_400_EXFAT_SDMMC_WRAPPER_READ 0x9DBCC
|
||||
#define FS_OFFSET_400_EXFAT_SDMMC_WRAPPER_WRITE 0x9DC8C
|
||||
#define FS_OFFSET_400_EXFAT_RTLD 0x4DC
|
||||
#define FS_OFFSET_400_EXFAT_RTLD_DESTINATION 0x98
|
||||
|
||||
#define FS_OFFSET_400_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x0
|
||||
|
||||
// Misc funcs
|
||||
#define FS_OFFSET_400_EXFAT_LOCK_MUTEX 0x39A0
|
||||
#define FS_OFFSET_400_EXFAT_UNLOCK_MUTEX 0x3A0C
|
||||
|
||||
#define FS_OFFSET_400_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x9DB48
|
||||
|
||||
// Misc Data
|
||||
#define FS_OFFSET_400_EXFAT_SD_MUTEX 0xF63268
|
||||
#define FS_OFFSET_400_EXFAT_NAND_MUTEX 0xF5EC60
|
||||
#define FS_OFFSET_400_EXFAT_ACTIVE_PARTITION 0xF5ECA0
|
||||
#define FS_OFFSET_400_EXFAT_SDMMC_DAS_HANDLE 0xF5DBF0
|
||||
|
||||
// NOPs
|
||||
#define FS_OFFSET_400_EXFAT_SD_DAS_INIT 0x0
|
||||
|
||||
// Nintendo Paths
|
||||
#define FS_OFFSET_400_EXFAT_NINTENDO_PATHS \
|
||||
{ \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0002023C, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00021BE8, .add_rel_offset = 0x0000000C}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00021EC4, .add_rel_offset = 0x0000000C}, \
|
||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
||||
}
|
||||
|
||||
#endif // __FS_400_EXFAT_H__
|
||||
57
emummc/source/FS/offsets/410.h
Normal file
57
emummc/source/FS/offsets/410.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||
* Copyright (c) 2019 Atmosphere-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __FS_410_H__
|
||||
#define __FS_410_H__
|
||||
|
||||
// Accessor vtable getters
|
||||
#define FS_OFFSET_410_SDMMC_ACCESSOR_GC 0xA33D8
|
||||
#define FS_OFFSET_410_SDMMC_ACCESSOR_SD 0xA3178
|
||||
#define FS_OFFSET_410_SDMMC_ACCESSOR_NAND 0xA2CE4
|
||||
|
||||
// Hooks
|
||||
#define FS_OFFSET_410_SDMMC_WRAPPER_READ 0x9DC30
|
||||
#define FS_OFFSET_410_SDMMC_WRAPPER_WRITE 0x9DCF0
|
||||
#define FS_OFFSET_410_RTLD 0x4DC
|
||||
#define FS_OFFSET_410_RTLD_DESTINATION 0x98
|
||||
|
||||
#define FS_OFFSET_410_CLKRST_SET_MIN_V_CLK_RATE 0x0
|
||||
|
||||
// Misc funcs
|
||||
#define FS_OFFSET_410_LOCK_MUTEX 0x39A0
|
||||
#define FS_OFFSET_410_UNLOCK_MUTEX 0x3A0C
|
||||
|
||||
#define FS_OFFSET_410_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x9DBAC
|
||||
|
||||
// Misc Data
|
||||
#define FS_OFFSET_410_SD_MUTEX 0xE80268
|
||||
#define FS_OFFSET_410_NAND_MUTEX 0xE7BC60
|
||||
#define FS_OFFSET_410_ACTIVE_PARTITION 0xE7BCA0
|
||||
#define FS_OFFSET_410_SDMMC_DAS_HANDLE 0xE7ABF0
|
||||
|
||||
// NOPs
|
||||
#define FS_OFFSET_410_SD_DAS_INIT 0x0
|
||||
|
||||
// Nintendo Paths
|
||||
#define FS_OFFSET_410_NINTENDO_PATHS \
|
||||
{ \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0002023C, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00021BE8, .add_rel_offset = 0x0000000C}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00021EC4, .add_rel_offset = 0x0000000C}, \
|
||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
||||
}
|
||||
|
||||
#endif // __FS_410_H__
|
||||
57
emummc/source/FS/offsets/410_exfat.h
Normal file
57
emummc/source/FS/offsets/410_exfat.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||
* Copyright (c) 2019 Atmosphere-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __FS_410_EXFAT_H__
|
||||
#define __FS_410_EXFAT_H__
|
||||
|
||||
// Accessor vtable getters
|
||||
#define FS_OFFSET_410_EXFAT_SDMMC_ACCESSOR_GC 0xA33D8
|
||||
#define FS_OFFSET_410_EXFAT_SDMMC_ACCESSOR_SD 0xA3178
|
||||
#define FS_OFFSET_410_EXFAT_SDMMC_ACCESSOR_NAND 0xA2CE4
|
||||
|
||||
// Hooks
|
||||
#define FS_OFFSET_410_EXFAT_SDMMC_WRAPPER_READ 0x9DC30
|
||||
#define FS_OFFSET_410_EXFAT_SDMMC_WRAPPER_WRITE 0x9DCF0
|
||||
#define FS_OFFSET_410_EXFAT_RTLD 0x4DC
|
||||
#define FS_OFFSET_410_EXFAT_RTLD_DESTINATION 0x98
|
||||
|
||||
#define FS_OFFSET_410_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x0
|
||||
|
||||
// Misc funcs
|
||||
#define FS_OFFSET_410_EXFAT_LOCK_MUTEX 0x39A0
|
||||
#define FS_OFFSET_410_EXFAT_UNLOCK_MUTEX 0x3A0C
|
||||
|
||||
#define FS_OFFSET_410_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x9DBAC
|
||||
|
||||
// Misc Data
|
||||
#define FS_OFFSET_410_EXFAT_SD_MUTEX 0xF63268
|
||||
#define FS_OFFSET_410_EXFAT_NAND_MUTEX 0xF5EC60
|
||||
#define FS_OFFSET_410_EXFAT_ACTIVE_PARTITION 0xF5ECA0
|
||||
#define FS_OFFSET_410_EXFAT_SDMMC_DAS_HANDLE 0xF5DBF0
|
||||
|
||||
// NOPs
|
||||
#define FS_OFFSET_410_EXFAT_SD_DAS_INIT 0x0
|
||||
|
||||
// Nintendo Paths
|
||||
#define FS_OFFSET_410_EXFAT_NINTENDO_PATHS \
|
||||
{ \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0002023C, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00021BE8, .add_rel_offset = 12}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00021EC4, .add_rel_offset = 12}, \
|
||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
||||
}
|
||||
|
||||
#endif // __FS_410_EXFAT_H__
|
||||
57
emummc/source/FS/offsets/500.h
Normal file
57
emummc/source/FS/offsets/500.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||
* Copyright (c) 2019 Atmosphere-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __FS_500_H__
|
||||
#define __FS_500_H__
|
||||
|
||||
// Accessor vtable getters
|
||||
#define FS_OFFSET_500_SDMMC_ACCESSOR_GC 0xCF250
|
||||
#define FS_OFFSET_500_SDMMC_ACCESSOR_SD 0xCEFD0
|
||||
#define FS_OFFSET_500_SDMMC_ACCESSOR_NAND 0xCE990
|
||||
|
||||
// Hooks
|
||||
#define FS_OFFSET_500_SDMMC_WRAPPER_READ 0xC9420
|
||||
#define FS_OFFSET_500_SDMMC_WRAPPER_WRITE 0xC9500
|
||||
#define FS_OFFSET_500_RTLD 0x584
|
||||
#define FS_OFFSET_500_RTLD_DESTINATION 0x94
|
||||
|
||||
#define FS_OFFSET_500_CLKRST_SET_MIN_V_CLK_RATE 0x0
|
||||
|
||||
// Misc funcs
|
||||
#define FS_OFFSET_500_LOCK_MUTEX 0x4080
|
||||
#define FS_OFFSET_500_UNLOCK_MUTEX 0x40D0
|
||||
|
||||
#define FS_OFFSET_500_SDMMC_WRAPPER_CONTROLLER_CLOSE 0xC9380
|
||||
|
||||
// Misc Data
|
||||
#define FS_OFFSET_500_SD_MUTEX 0xEC3268
|
||||
#define FS_OFFSET_500_NAND_MUTEX 0xEBDE58
|
||||
#define FS_OFFSET_500_ACTIVE_PARTITION 0xEBDE98
|
||||
#define FS_OFFSET_500_SDMMC_DAS_HANDLE 0xEBCE30
|
||||
|
||||
// NOPs
|
||||
#define FS_OFFSET_500_SD_DAS_INIT 0x0
|
||||
|
||||
// Nintendo Paths
|
||||
#define FS_OFFSET_500_NINTENDO_PATHS \
|
||||
{ \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00028980, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0002ACE4, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0002B220, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
||||
}
|
||||
|
||||
#endif // __FS_500_H__
|
||||
57
emummc/source/FS/offsets/500_exfat.h
Normal file
57
emummc/source/FS/offsets/500_exfat.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||
* Copyright (c) 2019 Atmosphere-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __FS_500_EXFAT_H__
|
||||
#define __FS_500_EXFAT_H__
|
||||
|
||||
// Accessor vtable getters
|
||||
#define FS_OFFSET_500_EXFAT_SDMMC_ACCESSOR_GC 0xCF250
|
||||
#define FS_OFFSET_500_EXFAT_SDMMC_ACCESSOR_SD 0xCEFD0
|
||||
#define FS_OFFSET_500_EXFAT_SDMMC_ACCESSOR_NAND 0xCE990
|
||||
|
||||
// Hooks
|
||||
#define FS_OFFSET_500_EXFAT_SDMMC_WRAPPER_READ 0xC9420
|
||||
#define FS_OFFSET_500_EXFAT_SDMMC_WRAPPER_WRITE 0xC9500
|
||||
#define FS_OFFSET_500_EXFAT_RTLD 0x584
|
||||
#define FS_OFFSET_500_EXFAT_RTLD_DESTINATION 0x94
|
||||
|
||||
#define FS_OFFSET_500_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x0
|
||||
|
||||
// Misc funcs
|
||||
#define FS_OFFSET_500_EXFAT_LOCK_MUTEX 0x4080
|
||||
#define FS_OFFSET_500_EXFAT_UNLOCK_MUTEX 0x40D0
|
||||
|
||||
#define FS_OFFSET_500_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0xC9380
|
||||
|
||||
// Misc Data
|
||||
#define FS_OFFSET_500_EXFAT_SD_MUTEX 0xFA8268
|
||||
#define FS_OFFSET_500_EXFAT_NAND_MUTEX 0xFA2E58
|
||||
#define FS_OFFSET_500_EXFAT_ACTIVE_PARTITION 0xFA2E98
|
||||
#define FS_OFFSET_500_EXFAT_SDMMC_DAS_HANDLE 0xFA1E30
|
||||
|
||||
// NOPs
|
||||
#define FS_OFFSET_500_EXFAT_SD_DAS_INIT 0x0
|
||||
|
||||
// Nintendo Paths
|
||||
#define FS_OFFSET_500_EXFAT_NINTENDO_PATHS \
|
||||
{ \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00028980, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0002ACE4, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0002B220, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
||||
}
|
||||
|
||||
#endif // __FS_500_EXFAT_H__
|
||||
57
emummc/source/FS/offsets/510.h
Normal file
57
emummc/source/FS/offsets/510.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||
* Copyright (c) 2019 Atmosphere-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __FS_510_H__
|
||||
#define __FS_510_H__
|
||||
|
||||
// Accessor vtable getters
|
||||
#define FS_OFFSET_510_SDMMC_ACCESSOR_GC 0xCF620
|
||||
#define FS_OFFSET_510_SDMMC_ACCESSOR_SD 0xCF3A0
|
||||
#define FS_OFFSET_510_SDMMC_ACCESSOR_NAND 0xCED60
|
||||
|
||||
// Hooks
|
||||
#define FS_OFFSET_510_SDMMC_WRAPPER_READ 0xC97F0
|
||||
#define FS_OFFSET_510_SDMMC_WRAPPER_WRITE 0xC98D0
|
||||
#define FS_OFFSET_510_RTLD 0x584
|
||||
#define FS_OFFSET_510_RTLD_DESTINATION 0x94
|
||||
|
||||
#define FS_OFFSET_510_CLKRST_SET_MIN_V_CLK_RATE 0x0
|
||||
|
||||
// Misc funcs
|
||||
#define FS_OFFSET_510_LOCK_MUTEX 0x4080
|
||||
#define FS_OFFSET_510_UNLOCK_MUTEX 0x40D0
|
||||
|
||||
#define FS_OFFSET_510_SDMMC_WRAPPER_CONTROLLER_CLOSE 0xC9750
|
||||
|
||||
// Misc Data
|
||||
#define FS_OFFSET_510_SD_MUTEX 0xEC4268
|
||||
#define FS_OFFSET_510_NAND_MUTEX 0xEBEE58
|
||||
#define FS_OFFSET_510_ACTIVE_PARTITION 0xEBEE98
|
||||
#define FS_OFFSET_510_SDMMC_DAS_HANDLE 0xEBDE30
|
||||
|
||||
// NOPs
|
||||
#define FS_OFFSET_510_SD_DAS_INIT 0x0
|
||||
|
||||
// Nintendo Paths
|
||||
#define FS_OFFSET_510_NINTENDO_PATHS \
|
||||
{ \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x000289B0, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0002AD14, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0002B250, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
||||
}
|
||||
|
||||
#endif // __FS_510_H__
|
||||
57
emummc/source/FS/offsets/510_exfat.h
Normal file
57
emummc/source/FS/offsets/510_exfat.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||
* Copyright (c) 2019 Atmosphere-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __FS_510_EXFAT_H__
|
||||
#define __FS_510_EXFAT_H__
|
||||
|
||||
// Accessor vtable getters
|
||||
#define FS_OFFSET_510_EXFAT_SDMMC_ACCESSOR_GC 0xCF620
|
||||
#define FS_OFFSET_510_EXFAT_SDMMC_ACCESSOR_SD 0xCF3A0
|
||||
#define FS_OFFSET_510_EXFAT_SDMMC_ACCESSOR_NAND 0xCED60
|
||||
|
||||
// Hooks
|
||||
#define FS_OFFSET_510_EXFAT_SDMMC_WRAPPER_READ 0xC97F0
|
||||
#define FS_OFFSET_510_EXFAT_SDMMC_WRAPPER_WRITE 0xC98D0
|
||||
#define FS_OFFSET_510_EXFAT_RTLD 0x584
|
||||
#define FS_OFFSET_510_EXFAT_RTLD_DESTINATION 0x94
|
||||
|
||||
#define FS_OFFSET_510_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x0
|
||||
|
||||
// Misc funcs
|
||||
#define FS_OFFSET_510_EXFAT_LOCK_MUTEX 0x4080
|
||||
#define FS_OFFSET_510_EXFAT_UNLOCK_MUTEX 0x40D0
|
||||
|
||||
#define FS_OFFSET_510_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0xC9750
|
||||
|
||||
// Misc Data
|
||||
#define FS_OFFSET_510_EXFAT_SD_MUTEX 0xFA9268
|
||||
#define FS_OFFSET_510_EXFAT_NAND_MUTEX 0xFA3E58
|
||||
#define FS_OFFSET_510_EXFAT_ACTIVE_PARTITION 0xFA3E98
|
||||
#define FS_OFFSET_510_EXFAT_SDMMC_DAS_HANDLE 0xFA2E30
|
||||
|
||||
// NOPs
|
||||
#define FS_OFFSET_510_EXFAT_SD_DAS_INIT 0x0
|
||||
|
||||
// Nintendo Paths
|
||||
#define FS_OFFSET_510_EXFAT_NINTENDO_PATHS \
|
||||
{ \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x000289B0, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0002AD14, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0002B250, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
||||
}
|
||||
|
||||
#endif // __FS_510_EXFAT_H__
|
||||
58
emummc/source/FS/offsets/600.h
Normal file
58
emummc/source/FS/offsets/600.h
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||
* Copyright (c) 2019 Atmosphere-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __FS_600_H__
|
||||
#define __FS_600_H__
|
||||
|
||||
// Accessor vtable getters
|
||||
#define FS_OFFSET_600_SDMMC_ACCESSOR_GC 0x153780
|
||||
#define FS_OFFSET_600_SDMMC_ACCESSOR_SD 0x1534F0
|
||||
#define FS_OFFSET_600_SDMMC_ACCESSOR_NAND 0x14F990
|
||||
|
||||
// Hooks
|
||||
#define FS_OFFSET_600_SDMMC_WRAPPER_READ 0x1485A0
|
||||
#define FS_OFFSET_600_SDMMC_WRAPPER_WRITE 0x148680
|
||||
#define FS_OFFSET_600_RTLD 0x5B0
|
||||
#define FS_OFFSET_600_RTLD_DESTINATION 0x98
|
||||
|
||||
#define FS_OFFSET_600_CLKRST_SET_MIN_V_CLK_RATE 0x0
|
||||
|
||||
// Misc funcs
|
||||
#define FS_OFFSET_600_LOCK_MUTEX 0x1412C0
|
||||
#define FS_OFFSET_600_UNLOCK_MUTEX 0x141310
|
||||
|
||||
#define FS_OFFSET_600_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x148500
|
||||
|
||||
// Misc Data
|
||||
#define FS_OFFSET_600_SD_MUTEX 0xF06268
|
||||
#define FS_OFFSET_600_NAND_MUTEX 0xF01BA0
|
||||
#define FS_OFFSET_600_ACTIVE_PARTITION 0xF01BE0
|
||||
#define FS_OFFSET_600_SDMMC_DAS_HANDLE 0xE01670
|
||||
|
||||
// NOPs
|
||||
#define FS_OFFSET_600_SD_DAS_INIT 0x0
|
||||
|
||||
// Nintendo Paths
|
||||
#define FS_OFFSET_600_NINTENDO_PATHS \
|
||||
{ \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x000790DC, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0007A924, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0007AB18, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0007AEF4, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0} \
|
||||
}
|
||||
|
||||
#endif // __FS_600_H__
|
||||
58
emummc/source/FS/offsets/600_exfat.h
Normal file
58
emummc/source/FS/offsets/600_exfat.h
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||
* Copyright (c) 2019 Atmosphere-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __FS_600_EXFAT_H__
|
||||
#define __FS_600_EXFAT_H__
|
||||
|
||||
// Accessor vtable getters
|
||||
#define FS_OFFSET_600_EXFAT_SDMMC_ACCESSOR_GC 0x15EE80
|
||||
#define FS_OFFSET_600_EXFAT_SDMMC_ACCESSOR_SD 0x15EBF0
|
||||
#define FS_OFFSET_600_EXFAT_SDMMC_ACCESSOR_NAND 0x15B090
|
||||
|
||||
// Hooks
|
||||
#define FS_OFFSET_600_EXFAT_SDMMC_WRAPPER_READ 0x153CA0
|
||||
#define FS_OFFSET_600_EXFAT_SDMMC_WRAPPER_WRITE 0x153D80
|
||||
#define FS_OFFSET_600_EXFAT_RTLD 0x5B0
|
||||
#define FS_OFFSET_600_EXFAT_RTLD_DESTINATION 0x98
|
||||
|
||||
#define FS_OFFSET_600_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x0
|
||||
|
||||
// Misc funcs
|
||||
#define FS_OFFSET_600_EXFAT_LOCK_MUTEX 0x14C9C0
|
||||
#define FS_OFFSET_600_EXFAT_UNLOCK_MUTEX 0x14CA10
|
||||
|
||||
#define FS_OFFSET_600_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x153C00
|
||||
|
||||
// Misc Data
|
||||
#define FS_OFFSET_600_EXFAT_SD_MUTEX 0xFEB268
|
||||
#define FS_OFFSET_600_EXFAT_NAND_MUTEX 0xFE6BA0
|
||||
#define FS_OFFSET_600_EXFAT_ACTIVE_PARTITION 0xFE6BE0
|
||||
#define FS_OFFSET_600_EXFAT_SDMMC_DAS_HANDLE 0xEE6670
|
||||
|
||||
// NOPs
|
||||
#define FS_OFFSET_600_EXFAT_SD_DAS_INIT 0x0
|
||||
|
||||
// Nintendo Paths
|
||||
#define FS_OFFSET_600_EXFAT_NINTENDO_PATHS \
|
||||
{ \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x000847DC, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00086024, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00086218, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x000865F4, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0} \
|
||||
}
|
||||
|
||||
#endif // __FS_600_EXFAT_H__
|
||||
59
emummc/source/FS/offsets/700.h
Normal file
59
emummc/source/FS/offsets/700.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||
* Copyright (c) 2019 Atmosphere-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __FS_700_H__
|
||||
#define __FS_700_H__
|
||||
|
||||
// Accessor vtable getters
|
||||
#define FS_OFFSET_700_SDMMC_ACCESSOR_GC 0x15BD90
|
||||
#define FS_OFFSET_700_SDMMC_ACCESSOR_SD 0x15BB00
|
||||
#define FS_OFFSET_700_SDMMC_ACCESSOR_NAND 0x157FF0
|
||||
|
||||
// Hooks
|
||||
#define FS_OFFSET_700_SDMMC_WRAPPER_READ 0x14FDF0
|
||||
#define FS_OFFSET_700_SDMMC_WRAPPER_WRITE 0x14FED0
|
||||
#define FS_OFFSET_700_RTLD 0x5B4
|
||||
#define FS_OFFSET_700_RTLD_DESTINATION 0x9C
|
||||
|
||||
#define FS_OFFSET_700_CLKRST_SET_MIN_V_CLK_RATE 0x0
|
||||
|
||||
// Misc funcs
|
||||
#define FS_OFFSET_700_LOCK_MUTEX 0x148A90
|
||||
#define FS_OFFSET_700_UNLOCK_MUTEX 0x148AE0
|
||||
|
||||
#define FS_OFFSET_700_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x14FD50
|
||||
|
||||
// Misc Data
|
||||
#define FS_OFFSET_700_SD_MUTEX 0xF123E8
|
||||
#define FS_OFFSET_700_NAND_MUTEX 0xF0DBE8
|
||||
#define FS_OFFSET_700_ACTIVE_PARTITION 0xF0DC28
|
||||
#define FS_OFFSET_700_SDMMC_DAS_HANDLE 0xE0E7A0
|
||||
|
||||
// NOPs
|
||||
#define FS_OFFSET_700_SD_DAS_INIT 0x85FE8
|
||||
|
||||
// Nintendo Paths
|
||||
#define FS_OFFSET_700_NINTENDO_PATHS \
|
||||
{ \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0007DA90, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0007F344, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0007F538, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0007F914, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 4, .adrp_offset = 0x0007FAD8, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
||||
}
|
||||
|
||||
#endif // __FS_700_H__
|
||||
59
emummc/source/FS/offsets/700_exfat.h
Normal file
59
emummc/source/FS/offsets/700_exfat.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||
* Copyright (c) 2019 Atmosphere-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __FS_700_EXFAT_H__
|
||||
#define __FS_700_EXFAT_H__
|
||||
|
||||
// Accessor vtable getters
|
||||
#define FS_OFFSET_700_EXFAT_SDMMC_ACCESSOR_GC 0x167340
|
||||
#define FS_OFFSET_700_EXFAT_SDMMC_ACCESSOR_SD 0x1670B0
|
||||
#define FS_OFFSET_700_EXFAT_SDMMC_ACCESSOR_NAND 0x1635A0
|
||||
|
||||
// Hooks
|
||||
#define FS_OFFSET_700_EXFAT_SDMMC_WRAPPER_READ 0x15B3A0
|
||||
#define FS_OFFSET_700_EXFAT_SDMMC_WRAPPER_WRITE 0x15B480
|
||||
#define FS_OFFSET_700_EXFAT_RTLD 0x5B4
|
||||
#define FS_OFFSET_700_EXFAT_RTLD_DESTINATION 0x9C
|
||||
|
||||
#define FS_OFFSET_700_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x0
|
||||
|
||||
// Misc funcs
|
||||
#define FS_OFFSET_700_EXFAT_LOCK_MUTEX 0x154040
|
||||
#define FS_OFFSET_700_EXFAT_UNLOCK_MUTEX 0x154090
|
||||
|
||||
#define FS_OFFSET_700_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x15B300
|
||||
|
||||
// Misc Data
|
||||
#define FS_OFFSET_700_EXFAT_SD_MUTEX 0xFF73E8
|
||||
#define FS_OFFSET_700_EXFAT_NAND_MUTEX 0xFF2BE8
|
||||
#define FS_OFFSET_700_EXFAT_ACTIVE_PARTITION 0xFF2C28
|
||||
#define FS_OFFSET_700_EXFAT_SDMMC_DAS_HANDLE 0xEF3A00
|
||||
|
||||
// NOPs
|
||||
#define FS_OFFSET_700_EXFAT_SD_DAS_INIT 0x91598
|
||||
|
||||
// Nintendo Paths
|
||||
#define FS_OFFSET_700_EXFAT_NINTENDO_PATHS \
|
||||
{ \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00089040, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0008A8F4, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0008AAE8, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0008AEC4, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 4, .adrp_offset = 0x0008B088, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
||||
}
|
||||
|
||||
#endif // __FS_700_EXFAT_H__
|
||||
59
emummc/source/FS/offsets/800.h
Normal file
59
emummc/source/FS/offsets/800.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||
* Copyright (c) 2019 Atmosphere-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __FS_800_H__
|
||||
#define __FS_800_H__
|
||||
|
||||
// Accessor vtable getters
|
||||
#define FS_OFFSET_800_SDMMC_ACCESSOR_GC 0x15EA20
|
||||
#define FS_OFFSET_800_SDMMC_ACCESSOR_SD 0x15E790
|
||||
#define FS_OFFSET_800_SDMMC_ACCESSOR_NAND 0x15AC80
|
||||
|
||||
// Hooks
|
||||
#define FS_OFFSET_800_SDMMC_WRAPPER_READ 0x152A80
|
||||
#define FS_OFFSET_800_SDMMC_WRAPPER_WRITE 0x152B60
|
||||
#define FS_OFFSET_800_RTLD 0x5B4
|
||||
#define FS_OFFSET_800_RTLD_DESTINATION 0x9C
|
||||
|
||||
#define FS_OFFSET_800_CLKRST_SET_MIN_V_CLK_RATE 0x16F370
|
||||
|
||||
// Misc funcs
|
||||
#define FS_OFFSET_800_LOCK_MUTEX 0x14B6D0
|
||||
#define FS_OFFSET_800_UNLOCK_MUTEX 0x14B720
|
||||
|
||||
#define FS_OFFSET_800_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x1529E0
|
||||
|
||||
// Misc Data
|
||||
#define FS_OFFSET_800_SD_MUTEX 0xF1A3E8
|
||||
#define FS_OFFSET_800_NAND_MUTEX 0xF15BE8
|
||||
#define FS_OFFSET_800_ACTIVE_PARTITION 0xF15C28
|
||||
#define FS_OFFSET_800_SDMMC_DAS_HANDLE 0xE167C0
|
||||
|
||||
// NOPs
|
||||
#define FS_OFFSET_800_SD_DAS_INIT 0x87D58
|
||||
|
||||
// Nintendo Paths
|
||||
#define FS_OFFSET_800_NINTENDO_PATHS \
|
||||
{ \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0007F5F0, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00081084, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00081278, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00081654, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 4, .adrp_offset = 0x00081818, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0} \
|
||||
}
|
||||
|
||||
#endif // __FS_800_H__
|
||||
59
emummc/source/FS/offsets/800_exfat.h
Normal file
59
emummc/source/FS/offsets/800_exfat.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||
* Copyright (c) 2019 Atmosphere-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __FS_800_EXFAT_H__
|
||||
#define __FS_800_EXFAT_H__
|
||||
|
||||
// Accessor vtable getters
|
||||
#define FS_OFFSET_800_EXFAT_SDMMC_ACCESSOR_GC 0x169FD0
|
||||
#define FS_OFFSET_800_EXFAT_SDMMC_ACCESSOR_SD 0x169D40
|
||||
#define FS_OFFSET_800_EXFAT_SDMMC_ACCESSOR_NAND 0x166230
|
||||
|
||||
// Hooks
|
||||
#define FS_OFFSET_800_EXFAT_SDMMC_WRAPPER_READ 0x15E030
|
||||
#define FS_OFFSET_800_EXFAT_SDMMC_WRAPPER_WRITE 0x15E110
|
||||
#define FS_OFFSET_800_EXFAT_RTLD 0x5B4
|
||||
#define FS_OFFSET_800_EXFAT_RTLD_DESTINATION 0x9C
|
||||
|
||||
#define FS_OFFSET_800_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x17A920
|
||||
|
||||
// Misc funcs
|
||||
#define FS_OFFSET_800_EXFAT_LOCK_MUTEX 0x156C80
|
||||
#define FS_OFFSET_800_EXFAT_UNLOCK_MUTEX 0x156CD0
|
||||
|
||||
#define FS_OFFSET_800_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x15DF90
|
||||
|
||||
// Misc Data
|
||||
#define FS_OFFSET_800_EXFAT_SD_MUTEX 0xFFE3E8
|
||||
#define FS_OFFSET_800_EXFAT_NAND_MUTEX 0xFF9BE8
|
||||
#define FS_OFFSET_800_EXFAT_ACTIVE_PARTITION 0xFF9C28
|
||||
#define FS_OFFSET_800_EXFAT_SDMMC_DAS_HANDLE 0xEFAA20
|
||||
|
||||
// NOPs
|
||||
#define FS_OFFSET_800_EXFAT_SD_DAS_INIT 0x93308
|
||||
|
||||
// Nintendo Paths
|
||||
#define FS_OFFSET_800_EXFAT_NINTENDO_PATHS \
|
||||
{ \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0008ABA0, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0008C634, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0008C828, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0008CC04, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 4, .adrp_offset = 0x0008CDC8, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0} \
|
||||
}
|
||||
|
||||
#endif // __FS_800_EXFAT_H__
|
||||
59
emummc/source/FS/offsets/810.h
Normal file
59
emummc/source/FS/offsets/810.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||
* Copyright (c) 2019 Atmosphere-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __FS_810_H__
|
||||
#define __FS_810_H__
|
||||
|
||||
// Accessor vtable getters
|
||||
#define FS_OFFSET_810_SDMMC_ACCESSOR_GC 0x15EA20
|
||||
#define FS_OFFSET_810_SDMMC_ACCESSOR_SD 0x15E790
|
||||
#define FS_OFFSET_810_SDMMC_ACCESSOR_NAND 0x15AC80
|
||||
|
||||
// Hooks
|
||||
#define FS_OFFSET_810_SDMMC_WRAPPER_READ 0x152A80
|
||||
#define FS_OFFSET_810_SDMMC_WRAPPER_WRITE 0x152B60
|
||||
#define FS_OFFSET_810_RTLD 0x5B4
|
||||
#define FS_OFFSET_810_RTLD_DESTINATION 0x9C
|
||||
|
||||
#define FS_OFFSET_810_CLKRST_SET_MIN_V_CLK_RATE 0x16F370
|
||||
|
||||
// Misc funcs
|
||||
#define FS_OFFSET_810_LOCK_MUTEX 0x14B6D0
|
||||
#define FS_OFFSET_810_UNLOCK_MUTEX 0x14B720
|
||||
|
||||
#define FS_OFFSET_810_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x1529E0
|
||||
|
||||
// Misc Data
|
||||
#define FS_OFFSET_810_SD_MUTEX 0xF1A3E8
|
||||
#define FS_OFFSET_810_NAND_MUTEX 0xF15BE8
|
||||
#define FS_OFFSET_810_ACTIVE_PARTITION 0xF15C28
|
||||
#define FS_OFFSET_810_SDMMC_DAS_HANDLE 0xE167C0
|
||||
|
||||
// NOPs
|
||||
#define FS_OFFSET_810_SD_DAS_INIT 0x87D58
|
||||
|
||||
// Nintendo Paths
|
||||
#define FS_OFFSET_810_NINTENDO_PATHS \
|
||||
{ \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0007F5F0, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00081084, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00081278, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00081654, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 4, .adrp_offset = 0x00081818, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0} \
|
||||
}
|
||||
|
||||
#endif // __FS_810_H__
|
||||
59
emummc/source/FS/offsets/810_exfat.h
Normal file
59
emummc/source/FS/offsets/810_exfat.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||
* Copyright (c) 2019 Atmosphere-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __FS_810_EXFAT_H__
|
||||
#define __FS_810_EXFAT_H__
|
||||
|
||||
// Accessor vtable getters
|
||||
#define FS_OFFSET_810_EXFAT_SDMMC_ACCESSOR_GC 0x169FD0
|
||||
#define FS_OFFSET_810_EXFAT_SDMMC_ACCESSOR_SD 0x169D40
|
||||
#define FS_OFFSET_810_EXFAT_SDMMC_ACCESSOR_NAND 0x166230
|
||||
|
||||
// Hooks
|
||||
#define FS_OFFSET_810_EXFAT_SDMMC_WRAPPER_READ 0x15E030
|
||||
#define FS_OFFSET_810_EXFAT_SDMMC_WRAPPER_WRITE 0x15E110
|
||||
#define FS_OFFSET_810_EXFAT_RTLD 0x5B4
|
||||
#define FS_OFFSET_810_EXFAT_RTLD_DESTINATION 0x9C
|
||||
|
||||
#define FS_OFFSET_810_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x17A920
|
||||
|
||||
// Misc funcs
|
||||
#define FS_OFFSET_810_EXFAT_LOCK_MUTEX 0x156C80
|
||||
#define FS_OFFSET_810_EXFAT_UNLOCK_MUTEX 0x156CD0
|
||||
|
||||
#define FS_OFFSET_810_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x15DF90
|
||||
|
||||
// Misc Data
|
||||
#define FS_OFFSET_810_EXFAT_SD_MUTEX 0xFFE3E8
|
||||
#define FS_OFFSET_810_EXFAT_NAND_MUTEX 0xFF9BE8
|
||||
#define FS_OFFSET_810_EXFAT_ACTIVE_PARTITION 0xFF9C28
|
||||
#define FS_OFFSET_810_EXFAT_SDMMC_DAS_HANDLE 0xEFAA20
|
||||
|
||||
// NOPs
|
||||
#define FS_OFFSET_810_EXFAT_SD_DAS_INIT 0x93308
|
||||
|
||||
// Nintendo Paths
|
||||
#define FS_OFFSET_810_EXFAT_NINTENDO_PATHS \
|
||||
{ \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0008ABA0, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0008C634, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0008C828, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0008CC04, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 4, .adrp_offset = 0x0008CDC8, .add_rel_offset = 4}, \
|
||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0} \
|
||||
}
|
||||
|
||||
#endif // __FS_810_EXFAT_H__
|
||||
59
emummc/source/FS/offsets/900.h
Normal file
59
emummc/source/FS/offsets/900.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||
* Copyright (c) 2019 Atmosphere-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __FS_900_H__
|
||||
#define __FS_900_H__
|
||||
|
||||
// Accessor vtable getters
|
||||
#define FS_OFFSET_900_SDMMC_ACCESSOR_GC 0x1430F0
|
||||
#define FS_OFFSET_900_SDMMC_ACCESSOR_SD 0x141200
|
||||
#define FS_OFFSET_900_SDMMC_ACCESSOR_NAND 0x13C080
|
||||
|
||||
// Hooks
|
||||
#define FS_OFFSET_900_SDMMC_WRAPPER_READ 0x1377E0
|
||||
#define FS_OFFSET_900_SDMMC_WRAPPER_WRITE 0x1378C0
|
||||
#define FS_OFFSET_900_RTLD 0x454
|
||||
#define FS_OFFSET_900_RTLD_DESTINATION 0x9C
|
||||
|
||||
#define FS_OFFSET_900_CLKRST_SET_MIN_V_CLK_RATE 0x136A00
|
||||
|
||||
// Misc funcs
|
||||
#define FS_OFFSET_900_LOCK_MUTEX 0x25280
|
||||
#define FS_OFFSET_900_UNLOCK_MUTEX 0x252D0
|
||||
|
||||
#define FS_OFFSET_900_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x137740
|
||||
|
||||
// Misc Data
|
||||
#define FS_OFFSET_900_SD_MUTEX 0xE1D3E8
|
||||
#define FS_OFFSET_900_NAND_MUTEX 0xE18258
|
||||
#define FS_OFFSET_900_ACTIVE_PARTITION 0xE18298
|
||||
#define FS_OFFSET_900_SDMMC_DAS_HANDLE 0xDFEFA0
|
||||
|
||||
// NOPs
|
||||
#define FS_OFFSET_900_SD_DAS_INIT 0x1472BC
|
||||
|
||||
// Nintendo Paths
|
||||
#define FS_OFFSET_900_NINTENDO_PATHS \
|
||||
{ \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00068A60, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00070A40, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00081CB4, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00081EF4, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 4, .adrp_offset = 0x0008211C, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
||||
}
|
||||
|
||||
#endif // __FS_900_H__
|
||||
59
emummc/source/FS/offsets/900_exfat.h
Normal file
59
emummc/source/FS/offsets/900_exfat.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||
* Copyright (c) 2019 Atmosphere-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __FS_900_EXFAT_H__
|
||||
#define __FS_900_EXFAT_H__
|
||||
|
||||
// Accessor vtable getters
|
||||
#define FS_OFFSET_900_EXFAT_SDMMC_ACCESSOR_GC 0x1430F0
|
||||
#define FS_OFFSET_900_EXFAT_SDMMC_ACCESSOR_SD 0x141200
|
||||
#define FS_OFFSET_900_EXFAT_SDMMC_ACCESSOR_NAND 0x13C080
|
||||
|
||||
// Hooks
|
||||
#define FS_OFFSET_900_EXFAT_SDMMC_WRAPPER_READ 0x1377E0
|
||||
#define FS_OFFSET_900_EXFAT_SDMMC_WRAPPER_WRITE 0x1378C0
|
||||
#define FS_OFFSET_900_EXFAT_RTLD 0x454
|
||||
#define FS_OFFSET_900_EXFAT_RTLD_DESTINATION 0x9C
|
||||
|
||||
#define FS_OFFSET_900_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x136A00
|
||||
|
||||
// Misc funcs
|
||||
#define FS_OFFSET_900_EXFAT_LOCK_MUTEX 0x25280
|
||||
#define FS_OFFSET_900_EXFAT_UNLOCK_MUTEX 0x252D0
|
||||
|
||||
#define FS_OFFSET_900_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x137740
|
||||
|
||||
// Misc Data
|
||||
#define FS_OFFSET_900_EXFAT_SD_MUTEX 0xE2B3E8
|
||||
#define FS_OFFSET_900_EXFAT_NAND_MUTEX 0xE26258
|
||||
#define FS_OFFSET_900_EXFAT_ACTIVE_PARTITION 0xE26298
|
||||
#define FS_OFFSET_900_EXFAT_SDMMC_DAS_HANDLE 0xE0CFA0
|
||||
|
||||
// NOPs
|
||||
#define FS_OFFSET_900_EXFAT_SD_DAS_INIT 0x1472BC
|
||||
|
||||
// Nintendo Paths
|
||||
#define FS_OFFSET_900_EXFAT_NINTENDO_PATHS \
|
||||
{ \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00068A60, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00070A40, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00081CB4, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00081EF4, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 4, .adrp_offset = 0x0008211C, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
||||
}
|
||||
|
||||
#endif // __FS_900_EXFAT_H__
|
||||
59
emummc/source/FS/offsets/910.h
Normal file
59
emummc/source/FS/offsets/910.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||
* Copyright (c) 2019 Atmosphere-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __FS_910_H__
|
||||
#define __FS_910_H__
|
||||
|
||||
// Accessor vtable getters
|
||||
#define FS_OFFSET_910_SDMMC_ACCESSOR_GC 0x143100
|
||||
#define FS_OFFSET_910_SDMMC_ACCESSOR_SD 0x141210
|
||||
#define FS_OFFSET_910_SDMMC_ACCESSOR_NAND 0x13C090
|
||||
|
||||
// Hooks
|
||||
#define FS_OFFSET_910_SDMMC_WRAPPER_READ 0x1377F0
|
||||
#define FS_OFFSET_910_SDMMC_WRAPPER_WRITE 0x1378D0
|
||||
#define FS_OFFSET_910_RTLD 0x454
|
||||
#define FS_OFFSET_910_RTLD_DESTINATION 0x9C
|
||||
|
||||
#define FS_OFFSET_910_CLKRST_SET_MIN_V_CLK_RATE 0x136A10
|
||||
|
||||
// Misc funcs
|
||||
#define FS_OFFSET_910_LOCK_MUTEX 0x25280
|
||||
#define FS_OFFSET_910_UNLOCK_MUTEX 0x252D0
|
||||
|
||||
#define FS_OFFSET_910_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x137750
|
||||
|
||||
// Misc Data
|
||||
#define FS_OFFSET_910_SD_MUTEX 0xE1D3E8
|
||||
#define FS_OFFSET_910_NAND_MUTEX 0xE18258
|
||||
#define FS_OFFSET_910_ACTIVE_PARTITION 0xE18298
|
||||
#define FS_OFFSET_910_SDMMC_DAS_HANDLE 0xDFEFA0
|
||||
|
||||
// NOPs
|
||||
#define FS_OFFSET_910_SD_DAS_INIT 0x1472CC
|
||||
|
||||
// Nintendo Paths
|
||||
#define FS_OFFSET_910_NINTENDO_PATHS \
|
||||
{ \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00068A70, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00070A50, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00081CC4, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00081F04, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 4, .adrp_offset = 0x0008212C, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
||||
}
|
||||
|
||||
#endif // __FS_910_H__
|
||||
59
emummc/source/FS/offsets/910_exfat.h
Normal file
59
emummc/source/FS/offsets/910_exfat.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||
* Copyright (c) 2019 Atmosphere-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef __FS_910_EXFAT_H__
|
||||
#define __FS_910_EXFAT_H__
|
||||
|
||||
// Accessor vtable getters
|
||||
#define FS_OFFSET_910_EXFAT_SDMMC_ACCESSOR_GC 0x143100
|
||||
#define FS_OFFSET_910_EXFAT_SDMMC_ACCESSOR_SD 0x141210
|
||||
#define FS_OFFSET_910_EXFAT_SDMMC_ACCESSOR_NAND 0x13C090
|
||||
|
||||
// Hooks
|
||||
#define FS_OFFSET_910_EXFAT_SDMMC_WRAPPER_READ 0x1377F0
|
||||
#define FS_OFFSET_910_EXFAT_SDMMC_WRAPPER_WRITE 0x1378D0
|
||||
#define FS_OFFSET_910_EXFAT_RTLD 0x454
|
||||
#define FS_OFFSET_910_EXFAT_RTLD_DESTINATION 0x9C
|
||||
|
||||
#define FS_OFFSET_910_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x136A10
|
||||
|
||||
// Misc funcs
|
||||
#define FS_OFFSET_910_EXFAT_LOCK_MUTEX 0x25280
|
||||
#define FS_OFFSET_910_EXFAT_UNLOCK_MUTEX 0x252D0
|
||||
|
||||
#define FS_OFFSET_910_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x137750
|
||||
|
||||
// Misc Data
|
||||
#define FS_OFFSET_910_EXFAT_SD_MUTEX 0xE2B3E8
|
||||
#define FS_OFFSET_910_EXFAT_NAND_MUTEX 0xE26258
|
||||
#define FS_OFFSET_910_EXFAT_ACTIVE_PARTITION 0xE26298
|
||||
#define FS_OFFSET_910_EXFAT_SDMMC_DAS_HANDLE 0xE0CFA0
|
||||
|
||||
// NOPs
|
||||
#define FS_OFFSET_910_EXFAT_SD_DAS_INIT 0x1472CC
|
||||
|
||||
// Nintendo Paths
|
||||
#define FS_OFFSET_910_EXFAT_NINTENDO_PATHS \
|
||||
{ \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00068A70, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00070A50, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00081CC4, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x00081F04, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 4, .adrp_offset = 0x0008212C, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
||||
}
|
||||
|
||||
#endif // __FS_910_EXFAT_H__
|
||||
432
emummc/source/emmc/mmc.h
Normal file
432
emummc/source/emmc/mmc.h
Normal file
@@ -0,0 +1,432 @@
|
||||
/*
|
||||
* Header for MultiMediaCard (MMC)
|
||||
*
|
||||
* Copyright 2002 Hewlett-Packard Company
|
||||
*
|
||||
* Use consistent with the GNU GPL is permitted,
|
||||
* provided that this copyright notice is
|
||||
* preserved in its entirety in all copies and derived works.
|
||||
*
|
||||
* HEWLETT-PACKARD COMPANY MAKES NO WARRANTIES, EXPRESSED OR IMPLIED,
|
||||
* AS TO THE USEFULNESS OR CORRECTNESS OF THIS CODE OR ITS
|
||||
* FITNESS FOR ANY PARTICULAR PURPOSE.
|
||||
*
|
||||
* Many thanks to Alessandro Rubini and Jonathan Corbet!
|
||||
*
|
||||
* Based strongly on code by:
|
||||
*
|
||||
* Author: Yong-iL Joh <tolkien@mizi.com>
|
||||
*
|
||||
* Author: Andrew Christian
|
||||
* 15 May 2002
|
||||
*/
|
||||
|
||||
#ifndef LINUX_MMC_MMC_H
|
||||
#define LINUX_MMC_MMC_H
|
||||
|
||||
/* Standard MMC commands (4.1) type argument response */
|
||||
/* class 1 */
|
||||
#define MMC_GO_IDLE_STATE 0 /* bc */
|
||||
#define MMC_SEND_OP_COND 1 /* bcr [31:0] OCR R3 */
|
||||
#define MMC_ALL_SEND_CID 2 /* bcr R2 */
|
||||
#define MMC_SET_RELATIVE_ADDR 3 /* ac [31:16] RCA R1 */
|
||||
#define MMC_SET_DSR 4 /* bc [31:16] RCA */
|
||||
#define MMC_SLEEP_AWAKE 5 /* ac [31:16] RCA 15:flg R1b */
|
||||
#define MMC_SWITCH 6 /* ac [31:0] See below R1b */
|
||||
#define MMC_SELECT_CARD 7 /* ac [31:16] RCA R1 */
|
||||
#define MMC_SEND_EXT_CSD 8 /* adtc R1 */
|
||||
#define MMC_SEND_CSD 9 /* ac [31:16] RCA R2 */
|
||||
#define MMC_SEND_CID 10 /* ac [31:16] RCA R2 */
|
||||
#define MMC_READ_DAT_UNTIL_STOP 11 /* adtc [31:0] dadr R1 */
|
||||
#define MMC_STOP_TRANSMISSION 12 /* ac R1b */
|
||||
#define MMC_SEND_STATUS 13 /* ac [31:16] RCA R1 */
|
||||
#define MMC_BUS_TEST_R 14 /* adtc R1 */
|
||||
#define MMC_GO_INACTIVE_STATE 15 /* ac [31:16] RCA */
|
||||
#define MMC_BUS_TEST_W 19 /* adtc R1 */
|
||||
#define MMC_SPI_READ_OCR 58 /* spi spi_R3 */
|
||||
#define MMC_SPI_CRC_ON_OFF 59 /* spi [0:0] flag spi_R1 */
|
||||
|
||||
/* class 2 */
|
||||
#define MMC_SET_BLOCKLEN 16 /* ac [31:0] block len R1 */
|
||||
#define MMC_READ_SINGLE_BLOCK 17 /* adtc [31:0] data addr R1 */
|
||||
#define MMC_READ_MULTIPLE_BLOCK 18 /* adtc [31:0] data addr R1 */
|
||||
#define MMC_SEND_TUNING_BLOCK 19 /* adtc R1 */
|
||||
#define MMC_SEND_TUNING_BLOCK_HS200 21 /* adtc R1 */
|
||||
|
||||
/* class 3 */
|
||||
#define MMC_WRITE_DAT_UNTIL_STOP 20 /* adtc [31:0] data addr R1 */
|
||||
|
||||
/* class 4 */
|
||||
#define MMC_SET_BLOCK_COUNT 23 /* adtc [31:0] data addr R1 */
|
||||
#define MMC_WRITE_BLOCK 24 /* adtc [31:0] data addr R1 */
|
||||
#define MMC_WRITE_MULTIPLE_BLOCK 25 /* adtc R1 */
|
||||
#define MMC_PROGRAM_CID 26 /* adtc R1 */
|
||||
#define MMC_PROGRAM_CSD 27 /* adtc R1 */
|
||||
|
||||
/* class 6 */
|
||||
#define MMC_SET_WRITE_PROT 28 /* ac [31:0] data addr R1b */
|
||||
#define MMC_CLR_WRITE_PROT 29 /* ac [31:0] data addr R1b */
|
||||
#define MMC_SEND_WRITE_PROT 30 /* adtc [31:0] wpdata addr R1 */
|
||||
|
||||
/* class 5 */
|
||||
#define MMC_ERASE_GROUP_START 35 /* ac [31:0] data addr R1 */
|
||||
#define MMC_ERASE_GROUP_END 36 /* ac [31:0] data addr R1 */
|
||||
#define MMC_ERASE 38 /* ac R1b */
|
||||
|
||||
/* class 9 */
|
||||
#define MMC_FAST_IO 39 /* ac <Complex> R4 */
|
||||
#define MMC_GO_IRQ_STATE 40 /* bcr R5 */
|
||||
|
||||
/* class 7 */
|
||||
#define MMC_LOCK_UNLOCK 42 /* adtc R1b */
|
||||
|
||||
/* class 8 */
|
||||
#define MMC_APP_CMD 55 /* ac [31:16] RCA R1 */
|
||||
#define MMC_GEN_CMD 56 /* adtc [0] RD/WR R1 */
|
||||
|
||||
/* class 11 */
|
||||
#define MMC_QUE_TASK_PARAMS 44 /* ac [20:16] task id R1 */
|
||||
#define MMC_QUE_TASK_ADDR 45 /* ac [31:0] data addr R1 */
|
||||
#define MMC_EXECUTE_READ_TASK 46 /* adtc [20:16] task id R1 */
|
||||
#define MMC_EXECUTE_WRITE_TASK 47 /* adtc [20:16] task id R1 */
|
||||
#define MMC_CMDQ_TASK_MGMT 48 /* ac [20:16] task id R1b */
|
||||
|
||||
/*
|
||||
* MMC_SWITCH argument format:
|
||||
*
|
||||
* [31:26] Always 0
|
||||
* [25:24] Access Mode
|
||||
* [23:16] Location of target Byte in EXT_CSD
|
||||
* [15:08] Value Byte
|
||||
* [07:03] Always 0
|
||||
* [02:00] Command Set
|
||||
*/
|
||||
|
||||
/*
|
||||
MMC status in R1, for native mode (SPI bits are different)
|
||||
Type
|
||||
e : error bit
|
||||
s : status bit
|
||||
r : detected and set for the actual command response
|
||||
x : detected and set during command execution. the host must poll
|
||||
the card by sending status command in order to read these bits.
|
||||
Clear condition
|
||||
a : according to the card state
|
||||
b : always related to the previous command. Reception of
|
||||
a valid command will clear it (with a delay of one command)
|
||||
c : clear by read
|
||||
*/
|
||||
|
||||
#define R1_OUT_OF_RANGE (1 << 31) /* er, c */
|
||||
#define R1_ADDRESS_ERROR (1 << 30) /* erx, c */
|
||||
#define R1_BLOCK_LEN_ERROR (1 << 29) /* er, c */
|
||||
#define R1_ERASE_SEQ_ERROR (1 << 28) /* er, c */
|
||||
#define R1_ERASE_PARAM (1 << 27) /* ex, c */
|
||||
#define R1_WP_VIOLATION (1 << 26) /* erx, c */
|
||||
#define R1_CARD_IS_LOCKED (1 << 25) /* sx, a */
|
||||
#define R1_LOCK_UNLOCK_FAILED (1 << 24) /* erx, c */
|
||||
#define R1_COM_CRC_ERROR (1 << 23) /* er, b */
|
||||
#define R1_ILLEGAL_COMMAND (1 << 22) /* er, b */
|
||||
#define R1_CARD_ECC_FAILED (1 << 21) /* ex, c */
|
||||
#define R1_CC_ERROR (1 << 20) /* erx, c */
|
||||
#define R1_ERROR (1 << 19) /* erx, c */
|
||||
#define R1_UNDERRUN (1 << 18) /* ex, c */
|
||||
#define R1_OVERRUN (1 << 17) /* ex, c */
|
||||
#define R1_CID_CSD_OVERWRITE (1 << 16) /* erx, c, CID/CSD overwrite */
|
||||
#define R1_WP_ERASE_SKIP (1 << 15) /* sx, c */
|
||||
#define R1_CARD_ECC_DISABLED (1 << 14) /* sx, a */
|
||||
#define R1_ERASE_RESET (1 << 13) /* sr, c */
|
||||
#define R1_STATUS(x) (x & 0xFFFFE000)
|
||||
#define R1_CURRENT_STATE(x) ((x & 0x00001E00) >> 9) /* sx, b (4 bits) */
|
||||
#define R1_READY_FOR_DATA (1 << 8) /* sx, a */
|
||||
#define R1_SWITCH_ERROR (1 << 7) /* sx, c */
|
||||
#define R1_EXCEPTION_EVENT (1 << 6) /* sr, a */
|
||||
#define R1_APP_CMD (1 << 5) /* sr, c */
|
||||
|
||||
#define R1_STATE_IDLE 0
|
||||
#define R1_STATE_READY 1
|
||||
#define R1_STATE_IDENT 2
|
||||
#define R1_STATE_STBY 3
|
||||
#define R1_STATE_TRAN 4
|
||||
#define R1_STATE_DATA 5
|
||||
#define R1_STATE_RCV 6
|
||||
#define R1_STATE_PRG 7
|
||||
#define R1_STATE_DIS 8
|
||||
|
||||
/*
|
||||
* MMC/SD in SPI mode reports R1 status always, and R2 for SEND_STATUS
|
||||
* R1 is the low order byte; R2 is the next highest byte, when present.
|
||||
*/
|
||||
#define R1_SPI_IDLE (1 << 0)
|
||||
#define R1_SPI_ERASE_RESET (1 << 1)
|
||||
#define R1_SPI_ILLEGAL_COMMAND (1 << 2)
|
||||
#define R1_SPI_COM_CRC (1 << 3)
|
||||
#define R1_SPI_ERASE_SEQ (1 << 4)
|
||||
#define R1_SPI_ADDRESS (1 << 5)
|
||||
#define R1_SPI_PARAMETER (1 << 6)
|
||||
/* R1 bit 7 is always zero */
|
||||
#define R2_SPI_CARD_LOCKED (1 << 8)
|
||||
#define R2_SPI_WP_ERASE_SKIP (1 << 9) /* or lock/unlock fail */
|
||||
#define R2_SPI_LOCK_UNLOCK_FAIL R2_SPI_WP_ERASE_SKIP
|
||||
#define R2_SPI_ERROR (1 << 10)
|
||||
#define R2_SPI_CC_ERROR (1 << 11)
|
||||
#define R2_SPI_CARD_ECC_ERROR (1 << 12)
|
||||
#define R2_SPI_WP_VIOLATION (1 << 13)
|
||||
#define R2_SPI_ERASE_PARAM (1 << 14)
|
||||
#define R2_SPI_OUT_OF_RANGE (1 << 15) /* or CSD overwrite */
|
||||
#define R2_SPI_CSD_OVERWRITE R2_SPI_OUT_OF_RANGE
|
||||
|
||||
/*
|
||||
* OCR bits are mostly in host.h
|
||||
*/
|
||||
#define MMC_CARD_BUSY 0x80000000 /* Card Power up status bit */
|
||||
|
||||
/*
|
||||
* Card Command Classes (CCC)
|
||||
*/
|
||||
#define CCC_BASIC (1<<0) /* (0) Basic protocol functions */
|
||||
/* (CMD0,1,2,3,4,7,9,10,12,13,15) */
|
||||
/* (and for SPI, CMD58,59) */
|
||||
#define CCC_STREAM_READ (1<<1) /* (1) Stream read commands */
|
||||
/* (CMD11) */
|
||||
#define CCC_BLOCK_READ (1<<2) /* (2) Block read commands */
|
||||
/* (CMD16,17,18) */
|
||||
#define CCC_STREAM_WRITE (1<<3) /* (3) Stream write commands */
|
||||
/* (CMD20) */
|
||||
#define CCC_BLOCK_WRITE (1<<4) /* (4) Block write commands */
|
||||
/* (CMD16,24,25,26,27) */
|
||||
#define CCC_ERASE (1<<5) /* (5) Ability to erase blocks */
|
||||
/* (CMD32,33,34,35,36,37,38,39) */
|
||||
#define CCC_WRITE_PROT (1<<6) /* (6) Able to write protect blocks */
|
||||
/* (CMD28,29,30) */
|
||||
#define CCC_LOCK_CARD (1<<7) /* (7) Able to lock down card */
|
||||
/* (CMD16,CMD42) */
|
||||
#define CCC_APP_SPEC (1<<8) /* (8) Application specific */
|
||||
/* (CMD55,56,57,ACMD*) */
|
||||
#define CCC_IO_MODE (1<<9) /* (9) I/O mode */
|
||||
/* (CMD5,39,40,52,53) */
|
||||
#define CCC_SWITCH (1<<10) /* (10) High speed switch */
|
||||
/* (CMD6,34,35,36,37,50) */
|
||||
/* (11) Reserved */
|
||||
/* (CMD?) */
|
||||
|
||||
/*
|
||||
* CSD field definitions
|
||||
*/
|
||||
|
||||
#define CSD_STRUCT_VER_1_0 0 /* Valid for system specification 1.0 - 1.2 */
|
||||
#define CSD_STRUCT_VER_1_1 1 /* Valid for system specification 1.4 - 2.2 */
|
||||
#define CSD_STRUCT_VER_1_2 2 /* Valid for system specification 3.1 - 3.2 - 3.31 - 4.0 - 4.1 */
|
||||
#define CSD_STRUCT_EXT_CSD 3 /* Version is coded in CSD_STRUCTURE in EXT_CSD */
|
||||
|
||||
#define CSD_SPEC_VER_0 0 /* Implements system specification 1.0 - 1.2 */
|
||||
#define CSD_SPEC_VER_1 1 /* Implements system specification 1.4 */
|
||||
#define CSD_SPEC_VER_2 2 /* Implements system specification 2.0 - 2.2 */
|
||||
#define CSD_SPEC_VER_3 3 /* Implements system specification 3.1 - 3.2 - 3.31 */
|
||||
#define CSD_SPEC_VER_4 4 /* Implements system specification 4.0 - 4.1 */
|
||||
|
||||
/*
|
||||
* EXT_CSD fields
|
||||
*/
|
||||
|
||||
#define EXT_CSD_CMDQ_MODE_EN 15 /* R/W */
|
||||
#define EXT_CSD_FLUSH_CACHE 32 /* W */
|
||||
#define EXT_CSD_CACHE_CTRL 33 /* R/W */
|
||||
#define EXT_CSD_POWER_OFF_NOTIFICATION 34 /* R/W */
|
||||
#define EXT_CSD_PACKED_FAILURE_INDEX 35 /* RO */
|
||||
#define EXT_CSD_PACKED_CMD_STATUS 36 /* RO */
|
||||
#define EXT_CSD_EXP_EVENTS_STATUS 54 /* RO, 2 bytes */
|
||||
#define EXT_CSD_EXP_EVENTS_CTRL 56 /* R/W, 2 bytes */
|
||||
#define EXT_CSD_DATA_SECTOR_SIZE 61 /* R */
|
||||
#define EXT_CSD_GP_SIZE_MULT 143 /* R/W */
|
||||
#define EXT_CSD_PARTITION_SETTING_COMPLETED 155 /* R/W */
|
||||
#define EXT_CSD_PARTITION_ATTRIBUTE 156 /* R/W */
|
||||
#define EXT_CSD_PARTITION_SUPPORT 160 /* RO */
|
||||
#define EXT_CSD_HPI_MGMT 161 /* R/W */
|
||||
#define EXT_CSD_RST_N_FUNCTION 162 /* R/W */
|
||||
#define EXT_CSD_BKOPS_EN 163 /* R/W */
|
||||
#define EXT_CSD_BKOPS_START 164 /* W */
|
||||
#define EXT_CSD_SANITIZE_START 165 /* W */
|
||||
#define EXT_CSD_WR_REL_PARAM 166 /* RO */
|
||||
#define EXT_CSD_RPMB_MULT 168 /* RO */
|
||||
#define EXT_CSD_FW_CONFIG 169 /* R/W */
|
||||
#define EXT_CSD_BOOT_WP 173 /* R/W */
|
||||
#define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */
|
||||
#define EXT_CSD_PART_CONFIG 179 /* R/W */
|
||||
#define EXT_CSD_ERASED_MEM_CONT 181 /* RO */
|
||||
#define EXT_CSD_BUS_WIDTH 183 /* R/W */
|
||||
#define EXT_CSD_STROBE_SUPPORT 184 /* RO */
|
||||
#define EXT_CSD_HS_TIMING 185 /* R/W */
|
||||
#define EXT_CSD_POWER_CLASS 187 /* R/W */
|
||||
#define EXT_CSD_REV 192 /* RO */
|
||||
#define EXT_CSD_STRUCTURE 194 /* RO */
|
||||
#define EXT_CSD_CARD_TYPE 196 /* RO */
|
||||
#define EXT_CSD_DRIVER_STRENGTH 197 /* RO */
|
||||
#define EXT_CSD_OUT_OF_INTERRUPT_TIME 198 /* RO */
|
||||
#define EXT_CSD_PART_SWITCH_TIME 199 /* RO */
|
||||
#define EXT_CSD_PWR_CL_52_195 200 /* RO */
|
||||
#define EXT_CSD_PWR_CL_26_195 201 /* RO */
|
||||
#define EXT_CSD_PWR_CL_52_360 202 /* RO */
|
||||
#define EXT_CSD_PWR_CL_26_360 203 /* RO */
|
||||
#define EXT_CSD_SEC_CNT 212 /* RO, 4 bytes */
|
||||
#define EXT_CSD_S_A_TIMEOUT 217 /* RO */
|
||||
#define EXT_CSD_REL_WR_SEC_C 222 /* RO */
|
||||
#define EXT_CSD_HC_WP_GRP_SIZE 221 /* RO */
|
||||
#define EXT_CSD_ERASE_TIMEOUT_MULT 223 /* RO */
|
||||
#define EXT_CSD_HC_ERASE_GRP_SIZE 224 /* RO */
|
||||
#define EXT_CSD_BOOT_MULT 226 /* RO */
|
||||
#define EXT_CSD_SEC_TRIM_MULT 229 /* RO */
|
||||
#define EXT_CSD_SEC_ERASE_MULT 230 /* RO */
|
||||
#define EXT_CSD_SEC_FEATURE_SUPPORT 231 /* RO */
|
||||
#define EXT_CSD_TRIM_MULT 232 /* RO */
|
||||
#define EXT_CSD_PWR_CL_200_195 236 /* RO */
|
||||
#define EXT_CSD_PWR_CL_200_360 237 /* RO */
|
||||
#define EXT_CSD_PWR_CL_DDR_52_195 238 /* RO */
|
||||
#define EXT_CSD_PWR_CL_DDR_52_360 239 /* RO */
|
||||
#define EXT_CSD_BKOPS_STATUS 246 /* RO */
|
||||
#define EXT_CSD_POWER_OFF_LONG_TIME 247 /* RO */
|
||||
#define EXT_CSD_GENERIC_CMD6_TIME 248 /* RO */
|
||||
#define EXT_CSD_CACHE_SIZE 249 /* RO, 4 bytes */
|
||||
#define EXT_CSD_PWR_CL_DDR_200_360 253 /* RO */
|
||||
#define EXT_CSD_FIRMWARE_VERSION 254 /* RO, 8 bytes */
|
||||
#define EXT_CSD_DEVICE_VERSION 262 /* RO, 2 bytes */
|
||||
#define EXT_CSD_PRE_EOL_INFO 267 /* RO */
|
||||
#define EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_A 268 /* RO */
|
||||
#define EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_B 269 /* RO */
|
||||
#define EXT_CSD_CMDQ_DEPTH 307 /* RO */
|
||||
#define EXT_CSD_CMDQ_SUPPORT 308 /* RO */
|
||||
#define EXT_CSD_SUPPORTED_MODE 493 /* RO */
|
||||
#define EXT_CSD_TAG_UNIT_SIZE 498 /* RO */
|
||||
#define EXT_CSD_DATA_TAG_SUPPORT 499 /* RO */
|
||||
#define EXT_CSD_MAX_PACKED_WRITES 500 /* RO */
|
||||
#define EXT_CSD_MAX_PACKED_READS 501 /* RO */
|
||||
#define EXT_CSD_BKOPS_SUPPORT 502 /* RO */
|
||||
#define EXT_CSD_HPI_FEATURES 503 /* RO */
|
||||
|
||||
/*
|
||||
* EXT_CSD field definitions
|
||||
*/
|
||||
|
||||
#define EXT_CSD_WR_REL_PARAM_EN (1<<2)
|
||||
|
||||
#define EXT_CSD_BOOT_WP_B_PWR_WP_DIS (0x40)
|
||||
#define EXT_CSD_BOOT_WP_B_PERM_WP_DIS (0x10)
|
||||
#define EXT_CSD_BOOT_WP_B_PERM_WP_EN (0x04)
|
||||
#define EXT_CSD_BOOT_WP_B_PWR_WP_EN (0x01)
|
||||
|
||||
#define EXT_CSD_PART_CONFIG_ACC_MASK (0x7)
|
||||
#define EXT_CSD_PART_CONFIG_ACC_BOOT0 (0x1)
|
||||
#define EXT_CSD_PART_CONFIG_ACC_RPMB (0x3)
|
||||
#define EXT_CSD_PART_CONFIG_ACC_GP0 (0x4)
|
||||
|
||||
#define EXT_CSD_PART_SETTING_COMPLETED (0x1)
|
||||
#define EXT_CSD_PART_SUPPORT_PART_EN (0x1)
|
||||
|
||||
#define EXT_CSD_CMD_SET_NORMAL (1<<0)
|
||||
#define EXT_CSD_CMD_SET_SECURE (1<<1)
|
||||
#define EXT_CSD_CMD_SET_CPSECURE (1<<2)
|
||||
|
||||
#define EXT_CSD_CARD_TYPE_HS_26 (1<<0) /* Card can run at 26MHz */
|
||||
#define EXT_CSD_CARD_TYPE_HS_52 (1<<1) /* Card can run at 52MHz */
|
||||
#define EXT_CSD_CARD_TYPE_HS (EXT_CSD_CARD_TYPE_HS_26 | \
|
||||
EXT_CSD_CARD_TYPE_HS_52)
|
||||
#define EXT_CSD_CARD_TYPE_DDR_1_8V (1<<2) /* Card can run at 52MHz */
|
||||
/* DDR mode @1.8V or 3V I/O */
|
||||
#define EXT_CSD_CARD_TYPE_DDR_1_2V (1<<3) /* Card can run at 52MHz */
|
||||
/* DDR mode @1.2V I/O */
|
||||
#define EXT_CSD_CARD_TYPE_DDR_52 (EXT_CSD_CARD_TYPE_DDR_1_8V \
|
||||
| EXT_CSD_CARD_TYPE_DDR_1_2V)
|
||||
#define EXT_CSD_CARD_TYPE_HS200_1_8V (1<<4) /* Card can run at 200MHz */
|
||||
#define EXT_CSD_CARD_TYPE_HS200_1_2V (1<<5) /* Card can run at 200MHz */
|
||||
/* SDR mode @1.2V I/O */
|
||||
#define EXT_CSD_CARD_TYPE_HS200 (EXT_CSD_CARD_TYPE_HS200_1_8V | \
|
||||
EXT_CSD_CARD_TYPE_HS200_1_2V)
|
||||
#define EXT_CSD_CARD_TYPE_HS400_1_8V (1<<6) /* Card can run at 200MHz DDR, 1.8V */
|
||||
#define EXT_CSD_CARD_TYPE_HS400_1_2V (1<<7) /* Card can run at 200MHz DDR, 1.2V */
|
||||
#define EXT_CSD_CARD_TYPE_HS400 (EXT_CSD_CARD_TYPE_HS400_1_8V | \
|
||||
EXT_CSD_CARD_TYPE_HS400_1_2V)
|
||||
#define EXT_CSD_CARD_TYPE_HS400ES (1<<8) /* Card can run at HS400ES */
|
||||
|
||||
#define EXT_CSD_BUS_WIDTH_1 0 /* Card is in 1 bit mode */
|
||||
#define EXT_CSD_BUS_WIDTH_4 1 /* Card is in 4 bit mode */
|
||||
#define EXT_CSD_BUS_WIDTH_8 2 /* Card is in 8 bit mode */
|
||||
#define EXT_CSD_DDR_BUS_WIDTH_4 5 /* Card is in 4 bit DDR mode */
|
||||
#define EXT_CSD_DDR_BUS_WIDTH_8 6 /* Card is in 8 bit DDR mode */
|
||||
#define EXT_CSD_BUS_WIDTH_STROBE (1<<7) /* Enhanced strobe mode */
|
||||
|
||||
#define EXT_CSD_TIMING_BC 0 /* Backwards compatility */
|
||||
#define EXT_CSD_TIMING_HS 1 /* High speed */
|
||||
#define EXT_CSD_TIMING_HS200 2 /* HS200 */
|
||||
#define EXT_CSD_TIMING_HS400 3 /* HS400 */
|
||||
#define EXT_CSD_DRV_STR_SHIFT 4 /* Driver Strength shift */
|
||||
|
||||
#define EXT_CSD_SEC_ER_EN (1<<0)
|
||||
#define EXT_CSD_SEC_BD_BLK_EN (1<<2)
|
||||
#define EXT_CSD_SEC_GB_CL_EN (1<<4)
|
||||
#define EXT_CSD_SEC_SANITIZE (1<<6) /* v4.5 only */
|
||||
|
||||
#define EXT_CSD_RST_N_EN_MASK 0x3
|
||||
#define EXT_CSD_RST_N_ENABLED 1 /* RST_n is enabled on card */
|
||||
|
||||
#define EXT_CSD_NO_POWER_NOTIFICATION 0
|
||||
#define EXT_CSD_POWER_ON 1
|
||||
#define EXT_CSD_POWER_OFF_SHORT 2
|
||||
#define EXT_CSD_POWER_OFF_LONG 3
|
||||
|
||||
#define EXT_CSD_PWR_CL_8BIT_MASK 0xF0 /* 8 bit PWR CLS */
|
||||
#define EXT_CSD_PWR_CL_4BIT_MASK 0x0F /* 8 bit PWR CLS */
|
||||
#define EXT_CSD_PWR_CL_8BIT_SHIFT 4
|
||||
#define EXT_CSD_PWR_CL_4BIT_SHIFT 0
|
||||
|
||||
#define EXT_CSD_PACKED_EVENT_EN (1<<3)
|
||||
|
||||
/*
|
||||
* EXCEPTION_EVENT_STATUS field
|
||||
*/
|
||||
#define EXT_CSD_URGENT_BKOPS (1<<0)
|
||||
#define EXT_CSD_DYNCAP_NEEDED (1<<1)
|
||||
#define EXT_CSD_SYSPOOL_EXHAUSTED (1<<2)
|
||||
#define EXT_CSD_PACKED_FAILURE (1<<3)
|
||||
|
||||
#define EXT_CSD_PACKED_GENERIC_ERROR (1<<0)
|
||||
#define EXT_CSD_PACKED_INDEXED_ERROR (1<<1)
|
||||
|
||||
/*
|
||||
* BKOPS status level
|
||||
*/
|
||||
#define EXT_CSD_BKOPS_LEVEL_2 0x2
|
||||
|
||||
/*
|
||||
* BKOPS modes
|
||||
*/
|
||||
#define EXT_CSD_MANUAL_BKOPS_MASK 0x01
|
||||
#define EXT_CSD_AUTO_BKOPS_MASK 0x02
|
||||
|
||||
/*
|
||||
* Command Queue
|
||||
*/
|
||||
#define EXT_CSD_CMDQ_MODE_ENABLED (1<<0)
|
||||
#define EXT_CSD_CMDQ_DEPTH_MASK 0x1F
|
||||
#define EXT_CSD_CMDQ_SUPPORTED (1<<0)
|
||||
|
||||
/*
|
||||
* MMC_SWITCH access modes
|
||||
*/
|
||||
#define MMC_SWITCH_MODE_CMD_SET 0x00 /* Change the command set */
|
||||
#define MMC_SWITCH_MODE_SET_BITS 0x01 /* Set bits which are 1 in value */
|
||||
#define MMC_SWITCH_MODE_CLEAR_BITS 0x02 /* Clear bits which are 1 in value */
|
||||
#define MMC_SWITCH_MODE_WRITE_BYTE 0x03 /* Set target to value */
|
||||
|
||||
/*
|
||||
* Erase/trim/discard
|
||||
*/
|
||||
#define MMC_ERASE_ARG 0x00000000
|
||||
#define MMC_SECURE_ERASE_ARG 0x80000000
|
||||
#define MMC_TRIM_ARG 0x00000001
|
||||
#define MMC_DISCARD_ARG 0x00000003
|
||||
#define MMC_SECURE_TRIM1_ARG 0x80000001
|
||||
#define MMC_SECURE_TRIM2_ARG 0x80008000
|
||||
#define MMC_SECURE_ARGS 0x80000000
|
||||
#define MMC_TRIM_ARGS 0x00008001
|
||||
|
||||
#endif /* LINUX_MMC_MMC_H */
|
||||
35
emummc/source/emmc/nx_emmc.c
Normal file
35
emummc/source/emmc/nx_emmc.c
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (c) 2018 naehrwert
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include "../utils/types.h"
|
||||
#include "nx_emmc.h"
|
||||
|
||||
int nx_emmc_part_read(sdmmc_storage_t *storage, emmc_part_t *part, u32 sector_off, u32 num_sectors, void *buf)
|
||||
{
|
||||
// The last LBA is inclusive.
|
||||
if (part->lba_start + sector_off > part->lba_end)
|
||||
return 0;
|
||||
return sdmmc_storage_read(storage, part->lba_start + sector_off, num_sectors, buf);
|
||||
}
|
||||
|
||||
int nx_emmc_part_write(sdmmc_storage_t *storage, emmc_part_t *part, u32 sector_off, u32 num_sectors, void *buf)
|
||||
{
|
||||
// The last LBA is inclusive.
|
||||
if (part->lba_start + sector_off > part->lba_end)
|
||||
return 0;
|
||||
return sdmmc_storage_write(storage, part->lba_start + sector_off, num_sectors, buf);
|
||||
}
|
||||
67
emummc/source/emmc/nx_emmc.h
Normal file
67
emummc/source/emmc/nx_emmc.h
Normal file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Copyright (c) 2018 naehrwert
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _NX_EMMC_H_
|
||||
#define _NX_EMMC_H_
|
||||
|
||||
#include "../utils/types.h"
|
||||
#include "sdmmc.h"
|
||||
|
||||
typedef struct _gpt_entry_t
|
||||
{
|
||||
u8 type_guid[0x10];
|
||||
u8 part_guid[0x10];
|
||||
u64 lba_start;
|
||||
u64 lba_end;
|
||||
u64 attrs;
|
||||
u16 name[36];
|
||||
} gpt_entry_t;
|
||||
|
||||
typedef struct _gpt_header_t
|
||||
{
|
||||
u64 signature;
|
||||
u32 revision;
|
||||
u32 size;
|
||||
u32 crc32;
|
||||
u32 res1;
|
||||
u64 my_lba;
|
||||
u64 alt_lba;
|
||||
u64 first_use_lba;
|
||||
u64 last_use_lba;
|
||||
u8 disk_guid[0x10];
|
||||
u64 part_ent_lba;
|
||||
u32 num_part_ents;
|
||||
u32 part_ent_size;
|
||||
u32 part_ents_crc32;
|
||||
u8 res2[420];
|
||||
} gpt_header_t;
|
||||
|
||||
#define NX_GPT_FIRST_LBA 1
|
||||
#define NX_GPT_NUM_BLOCKS 33
|
||||
#define NX_EMMC_BLOCKSIZE 512
|
||||
|
||||
typedef struct _emmc_part_t
|
||||
{
|
||||
u32 lba_start;
|
||||
u32 lba_end;
|
||||
u64 attrs;
|
||||
s8 name[37];
|
||||
} emmc_part_t;
|
||||
|
||||
int nx_emmc_part_read(sdmmc_storage_t *storage, emmc_part_t *part, u32 sector_off, u32 num_sectors, void *buf);
|
||||
int nx_emmc_part_write(sdmmc_storage_t *storage, emmc_part_t *part, u32 sector_off, u32 num_sectors, void *buf);
|
||||
|
||||
#endif
|
||||
124
emummc/source/emmc/sd.h
Normal file
124
emummc/source/emmc/sd.h
Normal file
@@ -0,0 +1,124 @@
|
||||
/*
|
||||
* include/linux/mmc/sd.h
|
||||
*
|
||||
* Copyright (C) 2005-2007 Pierre Ossman, All Rights Reserved.
|
||||
* Copyright (C) 2018 CTCaer
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*/
|
||||
|
||||
#ifndef LINUX_MMC_SD_H
|
||||
#define LINUX_MMC_SD_H
|
||||
|
||||
/* SD commands type argument response */
|
||||
/* class 0 */
|
||||
/* This is basically the same command as for MMC with some quirks. */
|
||||
#define SD_SEND_RELATIVE_ADDR 3 /* bcr R6 */
|
||||
#define SD_SEND_IF_COND 8 /* bcr [11:0] See below R7 */
|
||||
#define SD_SWITCH_VOLTAGE 11 /* ac R1 */
|
||||
|
||||
/* class 10 */
|
||||
#define SD_SWITCH 6 /* adtc [31:0] See below R1 */
|
||||
|
||||
/* class 5 */
|
||||
#define SD_ERASE_WR_BLK_START 32 /* ac [31:0] data addr R1 */
|
||||
#define SD_ERASE_WR_BLK_END 33 /* ac [31:0] data addr R1 */
|
||||
|
||||
/* Application commands */
|
||||
#define SD_APP_SET_BUS_WIDTH 6 /* ac [1:0] bus width R1 */
|
||||
#define SD_APP_SD_STATUS 13 /* adtc R1 */
|
||||
#define SD_APP_SEND_NUM_WR_BLKS 22 /* adtc R1 */
|
||||
#define SD_APP_OP_COND 41 /* bcr [31:0] OCR R3 */
|
||||
#define SD_APP_SET_CLR_CARD_DETECT 42
|
||||
#define SD_APP_SEND_SCR 51 /* adtc R1 */
|
||||
|
||||
/* OCR bit definitions */
|
||||
#define SD_OCR_S18R (1 << 24) /* 1.8V switching request */
|
||||
#define SD_ROCR_S18A SD_OCR_S18R /* 1.8V switching accepted by card */
|
||||
#define SD_OCR_XPC (1 << 28) /* SDXC power control */
|
||||
#define SD_OCR_CCS (1 << 30) /* Card Capacity Status */
|
||||
#define SD_OCR_VDD_32_33 (1 << 20) /* VDD voltage 3.2 ~ 3.3 */
|
||||
|
||||
/*
|
||||
* SD_SWITCH argument format:
|
||||
*
|
||||
* [31] Check (0) or switch (1)
|
||||
* [30:24] Reserved (0)
|
||||
* [23:20] Function group 6
|
||||
* [19:16] Function group 5
|
||||
* [15:12] Function group 4
|
||||
* [11:8] Function group 3
|
||||
* [7:4] Function group 2
|
||||
* [3:0] Function group 1
|
||||
*/
|
||||
|
||||
/*
|
||||
* SD_SEND_IF_COND argument format:
|
||||
*
|
||||
* [31:12] Reserved (0)
|
||||
* [11:8] Host Voltage Supply Flags
|
||||
* [7:0] Check Pattern (0xAA)
|
||||
*/
|
||||
|
||||
/*
|
||||
* SCR field definitions
|
||||
*/
|
||||
#define SCR_SPEC_VER_0 0 /* Implements system specification 1.0 - 1.01 */
|
||||
#define SCR_SPEC_VER_1 1 /* Implements system specification 1.10 */
|
||||
#define SCR_SPEC_VER_2 2 /* Implements system specification 2.00-3.0X */
|
||||
#define SD_SCR_BUS_WIDTH_1 (1<<0)
|
||||
#define SD_SCR_BUS_WIDTH_4 (1<<2)
|
||||
|
||||
/*
|
||||
* SD bus widths
|
||||
*/
|
||||
#define SD_BUS_WIDTH_1 0
|
||||
#define SD_BUS_WIDTH_4 2
|
||||
|
||||
/*
|
||||
* SD bus speeds
|
||||
*/
|
||||
#define UHS_SDR12_BUS_SPEED 0
|
||||
#define HIGH_SPEED_BUS_SPEED 1
|
||||
#define UHS_SDR25_BUS_SPEED 1
|
||||
#define UHS_SDR50_BUS_SPEED 2
|
||||
#define UHS_SDR104_BUS_SPEED 3
|
||||
#define UHS_DDR50_BUS_SPEED 4
|
||||
#define HS400_BUS_SPEED 5
|
||||
|
||||
#define SD_MODE_HIGH_SPEED (1 << HIGH_SPEED_BUS_SPEED)
|
||||
#define SD_MODE_UHS_SDR12 (1 << UHS_SDR12_BUS_SPEED)
|
||||
#define SD_MODE_UHS_SDR25 (1 << UHS_SDR25_BUS_SPEED)
|
||||
#define SD_MODE_UHS_SDR50 (1 << UHS_SDR50_BUS_SPEED)
|
||||
#define SD_MODE_UHS_SDR104 (1 << UHS_SDR104_BUS_SPEED)
|
||||
#define SD_MODE_UHS_DDR50 (1 << UHS_DDR50_BUS_SPEED)
|
||||
|
||||
#define SD_DRIVER_TYPE_B 0x01
|
||||
#define SD_DRIVER_TYPE_A 0x02
|
||||
|
||||
#define SD_SET_CURRENT_LIMIT_200 0
|
||||
#define SD_SET_CURRENT_LIMIT_400 1
|
||||
#define SD_SET_CURRENT_LIMIT_600 2
|
||||
#define SD_SET_CURRENT_LIMIT_800 3
|
||||
|
||||
/*
|
||||
* SD_SWITCH mode
|
||||
*/
|
||||
#define SD_SWITCH_CHECK 0
|
||||
#define SD_SWITCH_SET 1
|
||||
|
||||
/*
|
||||
* SD_SWITCH function groups
|
||||
*/
|
||||
#define SD_SWITCH_GRP_ACCESS 0
|
||||
|
||||
/*
|
||||
* SD_SWITCH access modes
|
||||
*/
|
||||
#define SD_SWITCH_ACCESS_DEF 0
|
||||
#define SD_SWITCH_ACCESS_HS 1
|
||||
|
||||
#endif /* LINUX_MMC_SD_H */
|
||||
1416
emummc/source/emmc/sdmmc.c
Normal file
1416
emummc/source/emmc/sdmmc.c
Normal file
File diff suppressed because it is too large
Load Diff
120
emummc/source/emmc/sdmmc.h
Normal file
120
emummc/source/emmc/sdmmc.h
Normal file
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
* Copyright (c) 2018 naehrwert
|
||||
* Copyright (C) 2018 CTCaer
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _SDMMC_H_
|
||||
#define _SDMMC_H_
|
||||
|
||||
#include "../utils/types.h"
|
||||
#include "../FS/FS.h"
|
||||
#include "sdmmc_driver.h"
|
||||
|
||||
typedef struct _mmc_cid
|
||||
{
|
||||
u32 manfid;
|
||||
u8 prod_name[8];
|
||||
u8 card_bga;
|
||||
u8 prv;
|
||||
u32 serial;
|
||||
u16 oemid;
|
||||
u16 year;
|
||||
u8 hwrev;
|
||||
u8 fwrev;
|
||||
u8 month;
|
||||
} mmc_cid_t;
|
||||
|
||||
typedef struct _mmc_csd
|
||||
{
|
||||
u8 structure;
|
||||
u8 mmca_vsn;
|
||||
u16 cmdclass;
|
||||
u32 c_size;
|
||||
u32 r2w_factor;
|
||||
u32 max_dtr;
|
||||
u32 erase_size; /* In sectors */
|
||||
u32 read_blkbits;
|
||||
u32 write_blkbits;
|
||||
u32 capacity;
|
||||
u8 write_protect;
|
||||
u16 busspeed;
|
||||
} mmc_csd_t;
|
||||
|
||||
typedef struct _mmc_ext_csd
|
||||
{
|
||||
u8 rev;
|
||||
u32 sectors;
|
||||
int bkops; /* background support bit */
|
||||
int bkops_en; /* manual bkops enable bit */
|
||||
u8 ext_struct; /* 194 */
|
||||
u8 card_type; /* 196 */
|
||||
u8 bkops_status; /* 246 */
|
||||
u16 dev_version;
|
||||
u8 boot_mult;
|
||||
u8 rpmb_mult;
|
||||
} mmc_ext_csd_t;
|
||||
|
||||
typedef struct _sd_scr
|
||||
{
|
||||
u8 sda_vsn;
|
||||
u8 sda_spec3;
|
||||
u8 bus_widths;
|
||||
u8 cmds;
|
||||
} sd_scr_t;
|
||||
|
||||
typedef struct _sd_ssr
|
||||
{
|
||||
u8 bus_width;
|
||||
u8 speed_class;
|
||||
u8 uhs_grade;
|
||||
u8 video_class;
|
||||
u8 app_class;
|
||||
} sd_ssr_t;
|
||||
|
||||
/*! SDMMC storage context. */
|
||||
typedef struct _sdmmc_storage_t
|
||||
{
|
||||
sdmmc_t *sdmmc;
|
||||
u32 rca;
|
||||
int has_sector_access;
|
||||
u32 sec_cnt;
|
||||
int is_low_voltage;
|
||||
u32 partition;
|
||||
u8 raw_cid[0x10];
|
||||
u8 raw_csd[0x10];
|
||||
u8 raw_scr[8];
|
||||
u8 raw_ssr[0x40];
|
||||
mmc_cid_t cid;
|
||||
mmc_csd_t csd;
|
||||
mmc_ext_csd_t ext_csd;
|
||||
sd_scr_t scr;
|
||||
sd_ssr_t ssr;
|
||||
} sdmmc_storage_t;
|
||||
|
||||
extern sdmmc_accessor_t *_current_accessor;
|
||||
extern bool sdmmc_memcpy_buf;
|
||||
|
||||
int sdmmc_storage_end(sdmmc_storage_t *storage);
|
||||
int sdmmc_storage_read(sdmmc_storage_t *storage, u32 sector, u32 num_sectors, void *buf);
|
||||
int sdmmc_storage_write(sdmmc_storage_t *storage, u32 sector, u32 num_sectors, void *buf);
|
||||
int sdmmc_storage_init_mmc(sdmmc_storage_t *storage, sdmmc_t *sdmmc, u32 id, u32 bus_width, u32 type);
|
||||
int sdmmc_storage_set_mmc_partition(sdmmc_storage_t *storage, u32 partition);
|
||||
int sdmmc_storage_init_sd(sdmmc_storage_t *storage, sdmmc_t *sdmmc, u32 id, u32 bus_width, u32 type);
|
||||
int sdmmc_storage_init_gc(sdmmc_storage_t *storage, sdmmc_t *sdmmc);
|
||||
intptr_t sdmmc_calculate_dma_addr(sdmmc_accessor_t *_this, void *buf, unsigned int num_sectors);
|
||||
int sdmmc_calculate_dma_index(sdmmc_accessor_t *_this, void *buf, unsigned int num_sectors);
|
||||
int sdmmc_calculate_fitting_dma_index(sdmmc_accessor_t *_this, unsigned int num_sectors);
|
||||
|
||||
#endif
|
||||
1166
emummc/source/emmc/sdmmc_driver.c
Normal file
1166
emummc/source/emmc/sdmmc_driver.c
Normal file
File diff suppressed because it is too large
Load Diff
127
emummc/source/emmc/sdmmc_driver.h
Normal file
127
emummc/source/emmc/sdmmc_driver.h
Normal file
@@ -0,0 +1,127 @@
|
||||
/*
|
||||
* Copyright (c) 2018 naehrwert
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _SDMMC_DRIVER_H_
|
||||
#define _SDMMC_DRIVER_H_
|
||||
|
||||
#include "../utils/types.h"
|
||||
#include "sdmmc_t210.h"
|
||||
|
||||
/*! SDMMC controller IDs. */
|
||||
#define SDMMC_1 0
|
||||
#define SDMMC_2 1
|
||||
#define SDMMC_3 2
|
||||
#define SDMMC_4 3
|
||||
|
||||
/*! SDMMC power types. */
|
||||
#define SDMMC_POWER_OFF 0
|
||||
#define SDMMC_POWER_1_8 1
|
||||
#define SDMMC_POWER_3_3 2
|
||||
|
||||
/*! SDMMC bus widths. */
|
||||
#define SDMMC_BUS_WIDTH_1 0
|
||||
#define SDMMC_BUS_WIDTH_4 1
|
||||
#define SDMMC_BUS_WIDTH_8 2
|
||||
|
||||
/*! SDMMC response types. */
|
||||
#define SDMMC_RSP_TYPE_0 0
|
||||
#define SDMMC_RSP_TYPE_1 1
|
||||
#define SDMMC_RSP_TYPE_2 2
|
||||
#define SDMMC_RSP_TYPE_3 3
|
||||
#define SDMMC_RSP_TYPE_4 4
|
||||
#define SDMMC_RSP_TYPE_5 5
|
||||
|
||||
/*! SDMMC mask interrupt status. */
|
||||
#define SDMMC_MASKINT_MASKED 0
|
||||
#define SDMMC_MASKINT_NOERROR -1
|
||||
#define SDMMC_MASKINT_ERROR -2
|
||||
|
||||
/*! SDMMC host control 2 */
|
||||
#define SDHCI_CTRL_UHS_MASK 0xFFF8
|
||||
#define SDHCI_CTRL_VDD_330 0xFFF7
|
||||
#define SDHCI_CTRL_VDD_180 8
|
||||
#define SDHCI_CTRL_EXEC_TUNING 0x40
|
||||
#define SDHCI_CTRL_TUNED_CLK 0x80
|
||||
#define SDHCI_HOST_VERSION_4_EN 0x1000
|
||||
#define SDHCI_ADDRESSING_64BIT_EN 0x2000
|
||||
#define SDHCI_CTRL_PRESET_VAL_EN 0x8000
|
||||
|
||||
/*! SD bus speeds. */
|
||||
#define UHS_SDR12_BUS_SPEED 0
|
||||
#define HIGH_SPEED_BUS_SPEED 1
|
||||
#define UHS_SDR25_BUS_SPEED 1
|
||||
#define UHS_SDR50_BUS_SPEED 2
|
||||
#define UHS_SDR104_BUS_SPEED 3
|
||||
#define UHS_DDR50_BUS_SPEED 4
|
||||
#define HS400_BUS_SPEED 5
|
||||
|
||||
/*! Helper for SWITCH command argument. */
|
||||
#define SDMMC_SWITCH(mode, index, value) (((mode) << 24) | ((index) << 16) | ((value) << 8))
|
||||
|
||||
/*! SDMMC controller context. */
|
||||
typedef struct _sdmmc_t
|
||||
{
|
||||
t210_sdmmc_t *regs;
|
||||
u32 id;
|
||||
u32 divisor;
|
||||
u32 clock_stopped;
|
||||
int no_sd;
|
||||
int sd_clock_enabled;
|
||||
int venclkctl_set;
|
||||
u32 venclkctl_tap;
|
||||
u32 expected_rsp_type;
|
||||
u64 last_dma_idx;
|
||||
u64 dma_addr_next;
|
||||
u32 rsp[4];
|
||||
u32 rsp3;
|
||||
} sdmmc_t;
|
||||
|
||||
/*! SDMMC command. */
|
||||
typedef struct _sdmmc_cmd_t
|
||||
{
|
||||
u16 cmd;
|
||||
u32 arg;
|
||||
u32 rsp_type;
|
||||
u32 check_busy;
|
||||
} sdmmc_cmd_t;
|
||||
|
||||
/*! SDMMC request. */
|
||||
typedef struct _sdmmc_req_t
|
||||
{
|
||||
void *buf;
|
||||
u32 blksize;
|
||||
u32 num_sectors;
|
||||
int is_write;
|
||||
int is_multi_block;
|
||||
int is_auto_cmd12;
|
||||
} sdmmc_req_t;
|
||||
|
||||
int sdmmc_get_voltage(sdmmc_t *sdmmc);
|
||||
u32 sdmmc_get_bus_width(sdmmc_t *sdmmc);
|
||||
void sdmmc_set_bus_width(sdmmc_t *sdmmc, u32 bus_width);
|
||||
void sdmmc_get_venclkctl(sdmmc_t *sdmmc);
|
||||
int sdmmc_setup_clock(sdmmc_t *sdmmc, u32 type);
|
||||
void sdmmc_sd_clock_ctrl(sdmmc_t *sdmmc, int no_sd);
|
||||
int sdmmc_get_rsp(sdmmc_t *sdmmc, u32 *rsp, u32 size, u32 type);
|
||||
int sdmmc_config_tuning(sdmmc_t *sdmmc, u32 type, u32 cmd);
|
||||
int sdmmc_stop_transmission(sdmmc_t *sdmmc, u32 *rsp);
|
||||
int sdmmc_init(sdmmc_t *sdmmc, u32 id, u32 power, u32 bus_width, u32 type, int no_sd);
|
||||
void sdmmc_end(sdmmc_t *sdmmc);
|
||||
void sdmmc_init_cmd(sdmmc_cmd_t *cmdbuf, u16 cmd, u32 arg, u32 rsp_type, u32 check_busy);
|
||||
int sdmmc_execute_cmd(sdmmc_t *sdmmc, sdmmc_cmd_t *cmd, sdmmc_req_t *req, u32 *blkcnt_out);
|
||||
int sdmmc_enable_low_voltage(sdmmc_t *sdmmc);
|
||||
|
||||
#endif
|
||||
132
emummc/source/emmc/sdmmc_t210.h
Normal file
132
emummc/source/emmc/sdmmc_t210.h
Normal file
@@ -0,0 +1,132 @@
|
||||
/*
|
||||
* Copyright (c) 2018 naehrwert
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _SDMMC_T210_H_
|
||||
#define _SDMMC_T210_H_
|
||||
|
||||
#include "../utils/types.h"
|
||||
|
||||
#define TEGRA_MMC_PWRCTL_SD_BUS_POWER 0x1
|
||||
#define TEGRA_MMC_PWRCTL_SD_BUS_VOLTAGE_V1_8 0xA
|
||||
#define TEGRA_MMC_PWRCTL_SD_BUS_VOLTAGE_V3_0 0xC
|
||||
#define TEGRA_MMC_PWRCTL_SD_BUS_VOLTAGE_V3_3 0xE
|
||||
#define TEGRA_MMC_PWRCTL_SD_BUS_VOLTAGE_MASK 0xF1
|
||||
|
||||
#define TEGRA_MMC_HOSTCTL_1BIT 0x00
|
||||
#define TEGRA_MMC_HOSTCTL_4BIT 0x02
|
||||
#define TEGRA_MMC_HOSTCTL_8BIT 0x20
|
||||
|
||||
#define TEGRA_MMC_CLKCON_INTERNAL_CLOCK_ENABLE 0x1
|
||||
#define TEGRA_MMC_CLKCON_INTERNAL_CLOCK_STABLE 0x2
|
||||
#define TEGRA_MMC_CLKCON_SD_CLOCK_ENABLE 0x4
|
||||
#define TEGRA_MMC_CLKCON_CLKGEN_SELECT 0x20
|
||||
|
||||
#define TEGRA_MMC_SWRST_SW_RESET_FOR_ALL 0x1
|
||||
#define TEGRA_MMC_SWRST_SW_RESET_FOR_CMD_LINE 0x2
|
||||
#define TEGRA_MMC_SWRST_SW_RESET_FOR_DAT_LINE 0x4
|
||||
|
||||
#define TEGRA_MMC_TRNMOD_DMA_ENABLE 0x1
|
||||
#define TEGRA_MMC_TRNMOD_BLOCK_COUNT_ENABLE 0x2
|
||||
#define TEGRA_MMC_TRNMOD_AUTO_CMD12 0x4
|
||||
#define TEGRA_MMC_TRNMOD_DATA_XFER_DIR_SEL_WRITE 0x0
|
||||
#define TEGRA_MMC_TRNMOD_DATA_XFER_DIR_SEL_READ 0x10
|
||||
#define TEGRA_MMC_TRNMOD_MULTI_BLOCK_SELECT 0x20
|
||||
|
||||
#define TEGRA_MMC_TRNMOD_CMD_CRC_CHECK 0x8
|
||||
#define TEGRA_MMC_TRNMOD_CMD_INDEX_CHECK 0x10
|
||||
#define TEGRA_MMC_TRNMOD_DATA_PRESENT_SELECT_DATA_TRANSFER 0x20
|
||||
|
||||
#define TEGRA_MMC_CMDREG_RESP_TYPE_SELECT_MASK 0x3
|
||||
#define TEGRA_MMC_CMDREG_RESP_TYPE_SELECT_NO_RESPONSE 0x0
|
||||
#define TEGRA_MMC_CMDREG_RESP_TYPE_SELECT_LENGTH_136 0x1
|
||||
#define TEGRA_MMC_CMDREG_RESP_TYPE_SELECT_LENGTH_48 0x2
|
||||
#define TEGRA_MMC_CMDREG_RESP_TYPE_SELECT_LENGTH_48_BUSY 0x3
|
||||
|
||||
#define TEGRA_MMC_NORINTSTS_CMD_COMPLETE 0x1
|
||||
#define TEGRA_MMC_NORINTSTS_XFER_COMPLETE 0x2
|
||||
#define TEGRA_MMC_NORINTSTS_DMA_INTERRUPT 0x8
|
||||
#define TEGRA_MMC_NORINTSTS_ERR_INTERRUPT 0x8000
|
||||
#define TEGRA_MMC_NORINTSTS_CMD_TIMEOUT 0x10000
|
||||
|
||||
#define TEGRA_MMC_NORINTSTSEN_BUFFER_READ_READY 0x20
|
||||
|
||||
typedef struct _t210_sdmmc_t
|
||||
{
|
||||
vu32 sysad;
|
||||
vu16 blksize;
|
||||
vu16 blkcnt;
|
||||
vu32 argument;
|
||||
vu16 trnmod;
|
||||
vu16 cmdreg;
|
||||
vu32 rspreg0;
|
||||
vu32 rspreg1;
|
||||
vu32 rspreg2;
|
||||
vu32 rspreg3;
|
||||
vu32 bdata;
|
||||
vu32 prnsts;
|
||||
vu8 hostctl;
|
||||
vu8 pwrcon;
|
||||
vu8 blkgap;
|
||||
vu8 wakcon;
|
||||
vu16 clkcon;
|
||||
vu8 timeoutcon;
|
||||
vu8 swrst;
|
||||
vu16 norintsts;
|
||||
vu16 errintsts;
|
||||
vu16 norintstsen;
|
||||
vu16 errintstsen;
|
||||
vu16 norintsigen;
|
||||
vu16 errintsigen;
|
||||
vu16 acmd12errsts;
|
||||
vu16 hostctl2;
|
||||
vu32 capareg;
|
||||
vu32 capareg_1;
|
||||
vu32 maxcurr;
|
||||
vu8 res3[4];
|
||||
vu16 setacmd12err;
|
||||
vu16 setinterr;
|
||||
vu8 admaerr;
|
||||
vu8 res4[3];
|
||||
vu32 admaaddr;
|
||||
vu32 admaaddr_hi;
|
||||
vu8 res5[156];
|
||||
vu16 slotintstatus;
|
||||
vu16 hcver;
|
||||
vu32 venclkctl;
|
||||
vu32 venspictl;
|
||||
vu32 venspiintsts;
|
||||
vu32 venceatactl;
|
||||
vu32 venbootctl;
|
||||
vu32 venbootacktout;
|
||||
vu32 venbootdattout;
|
||||
vu32 vendebouncecnt;
|
||||
vu32 venmiscctl;
|
||||
vu32 res6[34];
|
||||
vu32 veniotrimctl;
|
||||
vu32 vendllcal;
|
||||
vu8 res7[8];
|
||||
vu32 dllcfgstatus;
|
||||
vu32 ventunctl0;
|
||||
vu32 field_1C4;
|
||||
vu8 field_1C8[24];
|
||||
vu32 sdmemcmppadctl;
|
||||
vu32 autocalcfg;
|
||||
vu32 autocalintval;
|
||||
vu32 autocalsts;
|
||||
vu32 iospare;
|
||||
} t210_sdmmc_t;
|
||||
|
||||
#endif
|
||||
481
emummc/source/emuMMC/emummc.c
Normal file
481
emummc/source/emuMMC/emummc.c
Normal file
@@ -0,0 +1,481 @@
|
||||
/*
|
||||
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||
* Copyright (c) 2019 Atmosphere-NX
|
||||
* Copyright (c) 2019 CTCaer
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "../soc/gpio.h"
|
||||
#include "../utils/fatal.h"
|
||||
#include "../libs/fatfs/diskio.h"
|
||||
#include "emummc.h"
|
||||
#include "emummc_ctx.h"
|
||||
|
||||
static bool sdmmc_first_init = false;
|
||||
static bool storageMMCinitialized = false;
|
||||
static bool storageSDinitialized = false;
|
||||
|
||||
// hekate sdmmmc vars
|
||||
sdmmc_t sdmmc;
|
||||
sdmmc_storage_t storage;
|
||||
sdmmc_t sd_sdmmc;
|
||||
sdmmc_storage_t sd_storage;
|
||||
|
||||
// init vars
|
||||
bool custom_driver = true;
|
||||
extern const volatile emuMMC_ctx_t emuMMC_ctx;
|
||||
|
||||
// FS funcs
|
||||
_sdmmc_accessor_gc sdmmc_accessor_gc;
|
||||
_sdmmc_accessor_sd sdmmc_accessor_sd;
|
||||
_sdmmc_accessor_nand sdmmc_accessor_nand;
|
||||
_lock_mutex lock_mutex;
|
||||
_unlock_mutex unlock_mutex;
|
||||
|
||||
// FS misc
|
||||
void *sd_mutex;
|
||||
void *nand_mutex;
|
||||
volatile int *active_partition;
|
||||
volatile Handle *sdmmc_das_handle;
|
||||
|
||||
// FatFS
|
||||
static bool fat_mounted = false;
|
||||
static file_based_ctxt f_emu;
|
||||
|
||||
static void _sdmmc_ensure_device_attached(void)
|
||||
{
|
||||
// This ensures that the sd device address space handle is always attached,
|
||||
// even if FS hasn't attached it
|
||||
static bool did_attach = false;
|
||||
if (!did_attach)
|
||||
{
|
||||
svcAttachDeviceAddressSpace(DeviceName_SDMMC1A, *sdmmc_das_handle);
|
||||
did_attach = true;
|
||||
}
|
||||
}
|
||||
|
||||
static void _sdmmc_ensure_initialized(void)
|
||||
{
|
||||
static bool init_done = false;
|
||||
|
||||
// First Initial init
|
||||
if (!sdmmc_first_init)
|
||||
{
|
||||
sdmmc_initialize();
|
||||
sdmmc_first_init = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// The boot sysmodule will eventually kill power to SD. Detect this, and reinitialize when it happens.
|
||||
if (!init_done)
|
||||
{
|
||||
if (gpio_read(GPIO_PORT_E, GPIO_PIN_4) == 0)
|
||||
{
|
||||
sdmmc_finalize();
|
||||
sdmmc_initialize();
|
||||
init_done = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void _file_based_update_filename(char *outFilename, u32 sd_path_len, u32 part_idx)
|
||||
{
|
||||
snprintf(outFilename + sd_path_len, 3, "%02d", part_idx);
|
||||
}
|
||||
|
||||
static void _file_based_emmc_finalize(void)
|
||||
{
|
||||
if ((emuMMC_ctx.EMMC_Type == emuMMC_SD_File) && fat_mounted)
|
||||
{
|
||||
// Close all open handles.
|
||||
f_close(&f_emu.fp_boot0);
|
||||
f_close(&f_emu.fp_boot1);
|
||||
|
||||
for (int i = 0; i < f_emu.parts; i++)
|
||||
{
|
||||
f_close(&f_emu.fp_gpp[i]);
|
||||
}
|
||||
|
||||
// Force unmount FAT volume.
|
||||
f_mount(NULL, "", 1);
|
||||
|
||||
fat_mounted = false;
|
||||
}
|
||||
}
|
||||
|
||||
void sdmmc_finalize(void)
|
||||
{
|
||||
_file_based_emmc_finalize();
|
||||
|
||||
if (!sdmmc_storage_end(&sd_storage))
|
||||
{
|
||||
fatal_abort(Fatal_InitSD);
|
||||
}
|
||||
|
||||
storageSDinitialized = false;
|
||||
}
|
||||
|
||||
static void _file_based_emmc_initialize(void)
|
||||
{
|
||||
char path[sizeof(emuMMC_ctx.storagePath) + 0x20];
|
||||
memset(&path, 0, sizeof(path));
|
||||
memset(&f_emu, 0, sizeof(file_based_ctxt));
|
||||
|
||||
memcpy(path, (void *)emuMMC_ctx.storagePath, sizeof(emuMMC_ctx.storagePath));
|
||||
strcat(path, "/eMMC/");
|
||||
int path_len = strlen(path);
|
||||
|
||||
// Open BOOT0 physical partition.
|
||||
memcpy(path + path_len, "BOOT0", 6);
|
||||
if (f_open(&f_emu.fp_boot0, path, FA_READ | FA_WRITE) != FR_OK)
|
||||
fatal_abort(Fatal_InitSD);
|
||||
|
||||
// Open BOOT1 physical partition.
|
||||
memcpy(path + path_len, "BOOT1", 6);
|
||||
if (f_open(&f_emu.fp_boot1, path, FA_READ | FA_WRITE) != FR_OK)
|
||||
fatal_abort(Fatal_InitSD);
|
||||
|
||||
// Open handles for GPP physical partition files.
|
||||
_file_based_update_filename(path, path_len, 00);
|
||||
|
||||
if (f_open(&f_emu.fp_gpp[0], path, FA_READ | FA_WRITE) != FR_OK)
|
||||
fatal_abort(Fatal_InitSD);
|
||||
|
||||
f_emu.part_size = f_size(&f_emu.fp_gpp[0]) >> 9;
|
||||
|
||||
// Iterate folder for split parts and stop if next doesn't exist.
|
||||
// Supports up to 32 parts of any size.
|
||||
// TODO: decide on max parts and define them. (hekate produces up to 30 parts on 1GB mode.)
|
||||
for (f_emu.parts = 1; f_emu.parts < 32; f_emu.parts++)
|
||||
{
|
||||
_file_based_update_filename(path, path_len, f_emu.parts);
|
||||
|
||||
if (f_open(&f_emu.fp_gpp[f_emu.parts], path, FA_READ | FA_WRITE) != FR_OK)
|
||||
{
|
||||
// Check if single file.
|
||||
if (f_emu.parts == 1)
|
||||
f_emu.parts = 0;
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool sdmmc_initialize(void)
|
||||
{
|
||||
if (!storageMMCinitialized)
|
||||
{
|
||||
if (sdmmc_storage_init_mmc(&storage, &sdmmc, SDMMC_4, SDMMC_BUS_WIDTH_8, 4))
|
||||
{
|
||||
if (sdmmc_storage_set_mmc_partition(&storage, FS_EMMC_PARTITION_GPP))
|
||||
storageMMCinitialized = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
fatal_abort(Fatal_InitMMC);
|
||||
}
|
||||
}
|
||||
|
||||
if (!storageSDinitialized)
|
||||
{
|
||||
int retries = 5;
|
||||
while (retries)
|
||||
{
|
||||
if (sdmmc_storage_init_sd(&sd_storage, &sd_sdmmc, SDMMC_1, SDMMC_BUS_WIDTH_4, 11))
|
||||
{
|
||||
storageSDinitialized = true;
|
||||
|
||||
// File based emummc.
|
||||
if ((emuMMC_ctx.EMMC_Type == emuMMC_SD_File) && !fat_mounted)
|
||||
{
|
||||
f_emu.sd_fs = (FATFS *)malloc(sizeof(FATFS));
|
||||
if (f_mount(f_emu.sd_fs, "", 1) != FR_OK)
|
||||
fatal_abort(Fatal_InitSD);
|
||||
else
|
||||
fat_mounted = true;
|
||||
|
||||
_file_based_emmc_initialize();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
retries--;
|
||||
msleep(100);
|
||||
}
|
||||
|
||||
if (!storageSDinitialized)
|
||||
{
|
||||
fatal_abort(Fatal_InitSD);
|
||||
}
|
||||
}
|
||||
|
||||
return storageMMCinitialized && storageSDinitialized;
|
||||
}
|
||||
|
||||
sdmmc_accessor_t *sdmmc_accessor_get(int mmc_id)
|
||||
{
|
||||
sdmmc_accessor_t *_this;
|
||||
switch (mmc_id)
|
||||
{
|
||||
case FS_SDMMC_EMMC:
|
||||
_this = sdmmc_accessor_nand();
|
||||
break;
|
||||
case FS_SDMMC_SD:
|
||||
_this = sdmmc_accessor_sd();
|
||||
break;
|
||||
case FS_SDMMC_GC:
|
||||
_this = sdmmc_accessor_gc();
|
||||
break;
|
||||
default:
|
||||
fatal_abort(Fatal_InvalidAccessor);
|
||||
}
|
||||
|
||||
return _this;
|
||||
}
|
||||
|
||||
void mutex_lock_handler(int mmc_id)
|
||||
{
|
||||
if (custom_driver)
|
||||
{
|
||||
lock_mutex(sd_mutex);
|
||||
}
|
||||
lock_mutex(nand_mutex);
|
||||
}
|
||||
|
||||
void mutex_unlock_handler(int mmc_id)
|
||||
{
|
||||
unlock_mutex(nand_mutex);
|
||||
if (custom_driver)
|
||||
{
|
||||
unlock_mutex(sd_mutex);
|
||||
}
|
||||
}
|
||||
|
||||
int sdmmc_nand_get_active_partition_index()
|
||||
{
|
||||
switch (*active_partition)
|
||||
{
|
||||
case FS_EMMC_PARTITION_GPP:
|
||||
return 2;
|
||||
case FS_EMMC_PARTITION_BOOT1:
|
||||
return 1;
|
||||
case FS_EMMC_PARTITION_BOOT0:
|
||||
return 0;
|
||||
}
|
||||
|
||||
fatal_abort(Fatal_InvalidAccessor);
|
||||
}
|
||||
|
||||
static uint64_t emummc_read_write_inner(void *buf, unsigned int sector, unsigned int num_sectors, bool is_write)
|
||||
{
|
||||
if ((emuMMC_ctx.EMMC_Type == emuMMC_SD))
|
||||
{
|
||||
// raw partition sector offset: emuMMC_ctx.EMMC_StoragePartitionOffset.
|
||||
sector += emuMMC_ctx.EMMC_StoragePartitionOffset;
|
||||
// Set physical partition offset.
|
||||
sector += (sdmmc_nand_get_active_partition_index() * BOOT_PARTITION_SIZE);
|
||||
if (!is_write)
|
||||
return sdmmc_storage_read(&sd_storage, sector, num_sectors, buf);
|
||||
else
|
||||
return sdmmc_storage_write(&sd_storage, sector, num_sectors, buf);
|
||||
}
|
||||
|
||||
// File based emummc.
|
||||
FIL *fp_tmp = NULL;
|
||||
switch (*active_partition)
|
||||
{
|
||||
case FS_EMMC_PARTITION_GPP:
|
||||
if (f_emu.parts)
|
||||
{
|
||||
fp_tmp = &f_emu.fp_gpp[sector / f_emu.part_size];
|
||||
sector = sector % f_emu.part_size;
|
||||
}
|
||||
else
|
||||
{
|
||||
fp_tmp = &f_emu.fp_gpp[0];
|
||||
}
|
||||
break;
|
||||
case FS_EMMC_PARTITION_BOOT1:
|
||||
fp_tmp = &f_emu.fp_boot1;
|
||||
break;
|
||||
case FS_EMMC_PARTITION_BOOT0:
|
||||
fp_tmp = &f_emu.fp_boot0;
|
||||
break;
|
||||
}
|
||||
|
||||
if (f_lseek(fp_tmp, sector << 9) != FR_OK)
|
||||
{
|
||||
; //TODO. Out of range. close stuff and fatal?
|
||||
}
|
||||
|
||||
uint64_t res = 0;
|
||||
if (!is_write)
|
||||
res = !(f_read(fp_tmp, buf, num_sectors << 9, NULL));
|
||||
else
|
||||
res = !(f_write(fp_tmp, buf, num_sectors << 9, NULL));
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
// Controller close wrapper
|
||||
uint64_t sdmmc_wrapper_controller_close(int mmc_id)
|
||||
{
|
||||
sdmmc_accessor_t *_this;
|
||||
_this = sdmmc_accessor_get(mmc_id);
|
||||
|
||||
if (_this != NULL)
|
||||
{
|
||||
if (mmc_id == FS_SDMMC_SD)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (mmc_id == FS_SDMMC_EMMC)
|
||||
{
|
||||
// Close file handles and unmount
|
||||
_file_based_emmc_finalize();
|
||||
|
||||
// Close SD
|
||||
sdmmc_accessor_get(FS_SDMMC_SD)->vtab->sdmmc_accessor_controller_close(sdmmc_accessor_get(FS_SDMMC_SD));
|
||||
|
||||
// Close eMMC
|
||||
return _this->vtab->sdmmc_accessor_controller_close(_this);
|
||||
}
|
||||
|
||||
return _this->vtab->sdmmc_accessor_controller_close(_this);
|
||||
}
|
||||
|
||||
fatal_abort(Fatal_CloseAccessor);
|
||||
}
|
||||
|
||||
// FS read wrapper.
|
||||
uint64_t sdmmc_wrapper_read(void *buf, uint64_t bufSize, int mmc_id, unsigned int sector, unsigned int num_sectors)
|
||||
{
|
||||
sdmmc_accessor_t *_this;
|
||||
uint64_t read_res;
|
||||
|
||||
_this = sdmmc_accessor_get(mmc_id);
|
||||
|
||||
if (_this != NULL)
|
||||
{
|
||||
if (mmc_id == FS_SDMMC_EMMC || mmc_id == FS_SDMMC_SD)
|
||||
{
|
||||
mutex_lock_handler(mmc_id);
|
||||
// Assign FS accessor to the SDMMC driver
|
||||
_current_accessor = _this;
|
||||
// Make sure we're attached to the device address space.
|
||||
_sdmmc_ensure_device_attached();
|
||||
// Make sure we're still initialized if boot killed sd card power.
|
||||
_sdmmc_ensure_initialized();
|
||||
}
|
||||
|
||||
if (mmc_id == FS_SDMMC_EMMC)
|
||||
{
|
||||
// Call hekates driver.
|
||||
if (emummc_read_write_inner(buf, sector, num_sectors, false))
|
||||
{
|
||||
mutex_unlock_handler(mmc_id);
|
||||
return 0;
|
||||
}
|
||||
|
||||
mutex_unlock_handler(mmc_id);
|
||||
return FS_READ_WRITE_ERROR;
|
||||
}
|
||||
|
||||
if (mmc_id == FS_SDMMC_SD)
|
||||
{
|
||||
static bool first_sd_read = true;
|
||||
if (first_sd_read)
|
||||
{
|
||||
first_sd_read = false;
|
||||
// Because some SD cards have issues with emuMMC's driver
|
||||
// we currently swap to FS's driver after first SD read
|
||||
// TODO: Fix remaining driver issues
|
||||
custom_driver = false;
|
||||
// FS will handle sd mutex w/o custom driver from here on
|
||||
unlock_mutex(sd_mutex);
|
||||
}
|
||||
|
||||
// Call hekates driver.
|
||||
if (sdmmc_storage_read(&sd_storage, sector, num_sectors, buf))
|
||||
{
|
||||
mutex_unlock_handler(mmc_id);
|
||||
return 0;
|
||||
}
|
||||
|
||||
mutex_unlock_handler(mmc_id);
|
||||
return FS_READ_WRITE_ERROR;
|
||||
}
|
||||
|
||||
read_res = _this->vtab->read_write(_this, sector, num_sectors, buf, bufSize, 1);
|
||||
return read_res;
|
||||
}
|
||||
|
||||
fatal_abort(Fatal_ReadNoAccessor);
|
||||
}
|
||||
|
||||
// FS write wrapper.
|
||||
uint64_t sdmmc_wrapper_write(int mmc_id, unsigned int sector, unsigned int num_sectors, void *buf, uint64_t bufSize)
|
||||
{
|
||||
sdmmc_accessor_t *_this;
|
||||
uint64_t write_res;
|
||||
|
||||
_this = sdmmc_accessor_get(mmc_id);
|
||||
|
||||
if (_this != NULL)
|
||||
{
|
||||
if (mmc_id == FS_SDMMC_EMMC)
|
||||
{
|
||||
mutex_lock_handler(mmc_id);
|
||||
_current_accessor = _this;
|
||||
|
||||
// Call hekates driver.
|
||||
if (emummc_read_write_inner(buf, sector, num_sectors, true))
|
||||
{
|
||||
mutex_unlock_handler(mmc_id);
|
||||
return 0;
|
||||
}
|
||||
|
||||
mutex_unlock_handler(mmc_id);
|
||||
return FS_READ_WRITE_ERROR;
|
||||
}
|
||||
|
||||
if (mmc_id == FS_SDMMC_SD)
|
||||
{
|
||||
mutex_lock_handler(mmc_id);
|
||||
_current_accessor = _this;
|
||||
|
||||
sector += 0;
|
||||
|
||||
// Call hekates driver.
|
||||
if (sdmmc_storage_write(&sd_storage, sector, num_sectors, buf))
|
||||
{
|
||||
mutex_unlock_handler(mmc_id);
|
||||
return 0;
|
||||
}
|
||||
|
||||
mutex_unlock_handler(mmc_id);
|
||||
return FS_READ_WRITE_ERROR;
|
||||
}
|
||||
|
||||
write_res = _this->vtab->read_write(_this, sector, num_sectors, buf, bufSize, 0);
|
||||
return write_res;
|
||||
}
|
||||
|
||||
fatal_abort(Fatal_WriteNoAccessor);
|
||||
}
|
||||
73
emummc/source/emuMMC/emummc.h
Normal file
73
emummc/source/emuMMC/emummc.h
Normal file
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
|
||||
* Copyright (c) 2019 Atmosphere-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __EMUMMC_H__
|
||||
#define __EMUMMC_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <malloc.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "../emmc/sdmmc.h"
|
||||
#include "../soc/i2c.h"
|
||||
#include "../soc/gpio.h"
|
||||
#include "../utils/util.h"
|
||||
#include "../FS/FS.h"
|
||||
#include "../libs/fatfs/ff.h"
|
||||
|
||||
// FS typedefs
|
||||
typedef sdmmc_accessor_t *(*_sdmmc_accessor_gc)();
|
||||
typedef sdmmc_accessor_t *(*_sdmmc_accessor_sd)();
|
||||
typedef sdmmc_accessor_t *(*_sdmmc_accessor_nand)();
|
||||
typedef void (*_lock_mutex)(void *mtx);
|
||||
typedef void (*_unlock_mutex)(void *mtx);
|
||||
|
||||
bool sdmmc_initialize(void);
|
||||
void sdmmc_finalize(void);
|
||||
int sdmmc_nand_get_active_partition_index();
|
||||
sdmmc_accessor_t *sdmmc_accessor_get(int mmc_id);
|
||||
|
||||
void mutex_lock_handler(int mmc_id);
|
||||
void mutex_unlock_handler(int mmc_id);
|
||||
|
||||
// Hooks
|
||||
uint64_t sdmmc_wrapper_controller_close(int mmc_id);
|
||||
uint64_t sdmmc_wrapper_read(void *buf, uint64_t bufSize, int mmc_id, unsigned int sector, unsigned int num_sectors);
|
||||
uint64_t sdmmc_wrapper_write(int mmc_id, unsigned int sector, unsigned int num_sectors, void *buf, uint64_t bufSize);
|
||||
|
||||
// TODO: check if FatFS internal buffers are good (perf wise) to have a x16 alignment.
|
||||
typedef struct _file_based_ctxt
|
||||
{
|
||||
uint64_t parts;
|
||||
uint64_t part_size;
|
||||
FATFS *sd_fs;
|
||||
FIL fp_boot0;
|
||||
FIL fp_boot1;
|
||||
FIL fp_gpp[32];
|
||||
} file_based_ctxt;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __EMUMMC_H__ */
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user