Ported GCI Loader to all versions

This commit is contained in:
sup39 2023-02-11 03:33:39 +09:00
parent ac637e0712
commit 1b1d156d0b
6 changed files with 329 additions and 71 deletions

345
Codes.xml
View file

@ -4772,57 +4772,314 @@
<category>lib</category>
<id>GCILoader</id>
<title lang="en-US">GCI Loader</title>
<author>sup39(サポミク)</author>
<version>0.2</version>
<date>Nov 16, 2022</date>
<author>sup39(サポミク), Psychonauter</author>
<version>0.3</version>
<date>Feb 10, 2023</date>
<description lang="en-US">
Execute Gecko code loaded from GCI file.
::: warning
You will need to reset the game if you hotplug your memory card
:::
</description>
<source version="GMSE01">
077FE800 00000207
9421FFE8 7C0802A6
93C10010 7C9E2378
38800001 93810008
93A1000C 7C7C1B78
93E10014 7CDD3378
9001001C 7CBF2B78
4AAB40E5 2C030000
408200AC 807C0000
7FE4FB78 7FC5F378
4AB5AB45 7C7F1B79
40820064 3D20817F
6129E800 7D3D4850
2809BFFF 40810088
38A00000 7FA4EB78
60A5C000 38C00000
7FC3F378 4AB5B4A5
7C7F1B79 40820070
7FC3F378 4AB5AC79
8001001C 7FE3FB78
83810008 83A1000C
7C0803A6 83C10010
83E10014 38210018
4E800020 2C1FFFFC
41A2FFD8 8001001C
3BE0FFFE 7FE3FB78
83810008 83A1000C
7C0803A6 83C10010
83E10014 38210018
4E800020 3BE0FFFF
4BFFFFA8 3BE0FFFD
4BFFFFA0 3BE0FFFB
4BFFFF98 9421FFF0
3CA08180 7C0802A6
39200001 93E1000C
3FE0817F 38DF17F8
38A5E9FC 38C60008
90010014 913F17F8
4BFFFED9 2C030000
40820008 38600002
80010014 907F17F8
7C0803A6 83E1000C
38210010 4E800020
9421FFE8 93A1000C
3FA0817F 813D17F8
93C10010 7C9E2378
2C090000 93E10014
7C7F1B78 40810020
83A1000C 7FC4F378
7FE3FB78 83C10010
83E10014 38210018
4AAB3740 38DD17F8
3CA08180 7C0802A6
39200001 38C60008
38A5E9FC 9001001C
913D17F8 4BFFFE4D
2C030000 4182002C
8001001C 907D17F8
7C0803A6 83A1000C
7FC4F378 7FE3FB78
83C10010 83E10014
38210018 4AAB36EC
8001001C 38600002
907D17F8 7C0803A6
4BFFFFD4 4743545F
474D5345 30310000
042A96E0 49555271
C0000000 00000005
3C60817F 840317F8
2C000002 4C820020
7C0F2214 90030004
39E30008 7DE47850
4E800020 4E800020
</source>
<source version="GMSJ01">
C21069F4 00000021
9421FFE0 BF61000C
3FA0817F 63BDE800
3F80ABCD 813D0000
639C1234 7C7E1B78
7C09E000 7C9F2378
418200B8 3D208010
38800001 39297B50
7D2903A6 4E800421
2C030000 4082009C
3D20800A 39293CAC
807E0000 7FE5FB78
48000009 67637400
7C8802A6 7D2903A6
4E800421 2C030000
40820070 3F60817F
3D20800A 39294640
637BA800 38C00000
38A04000 7F64DB78
7FE3FB78 7D2903A6
4E800421 2C030000
4082002C 813B0000
6D2AFF2F 2C0AC0DE
4082001C 3D40817F
614AA804 814A0000
7C0A4800 40A20008
939D0000 3D20800A
7FE3FB78 39293E24
7D2903A6 4E800421
3D208010 7FE4FB78
392972F4 7FC3F378
7D2903A6 4E800421
BB61000C 38210020
60000000 00000000
2C3E6008 00FF0300
217FE800 ABCD1234
C0000000 00000003
7C0F2214 3C608180
9403A7FC 39E3000C
7DE47850 4E800020
E0000000 00000000
077FE800 00000207
9421FFE8 7C0802A6
93C10010 7C9E2378
38800001 93810008
93A1000C 7C7C1B78
93E10014 7CDD3378
9001001C 7CBF2B78
4A909321 2C030000
408200AC 807C0000
7FE4FB78 7FC5F378
4A8A5465 7C7F1B79
40820064 3D20817F
6129E800 7D3D4850
2809BFFF 40810088
38A00000 7FA4EB78
60A5C000 38C00000
7FC3F378 4A8A5DC5
7C7F1B79 40820070
7FC3F378 4A8A5599
8001001C 7FE3FB78
83810008 83A1000C
7C0803A6 83C10010
83E10014 38210018
4E800020 2C1FFFFC
41A2FFD8 8001001C
3BE0FFFE 7FE3FB78
83810008 83A1000C
7C0803A6 83C10010
83E10014 38210018
4E800020 3BE0FFFF
4BFFFFA8 3BE0FFFD
4BFFFFA0 3BE0FFFB
4BFFFF98 9421FFF0
3CA08180 7C0802A6
39200001 93E1000C
3FE0817F 38DF17F8
38A5E9FC 38C60008
90010014 913F17F8
4BFFFED9 2C030000
40820008 38600002
80010014 907F17F8
7C0803A6 83E1000C
38210010 4E800020
9421FFE8 93A1000C
3FA0817F 813D17F8
93C10010 7C9E2378
2C090000 93E10014
7C7F1B78 40810020
83A1000C 7FC4F378
7FE3FB78 83C10010
83E10014 38210018
4A908964 38DD17F8
3CA08180 7C0802A6
39200001 38C60008
38A5E9FC 9001001C
913D17F8 4BFFFE4D
2C030000 4182002C
8001001C 907D17F8
7C0803A6 83A1000C
7FC4F378 7FE3FB78
83C10010 83E10014
38210018 4A908910
8001001C 38600002
907D17F8 7C0803A6
4BFFFFD4 4743545F
474D534A 30310000
041069F4 496F7F5D
C0000000 00000005
3C60817F 840317F8
2C000002 4C820020
7C0F2214 90030004
39E30008 7DE47850
4E800020 4E800020
</source>
<source version="GMSP01">
077FE800 00000207
9421FFE8 7C0802A6
93C10010 7C9E2378
38800001 93810008
93A1000C 7C7C1B78
93E10014 7CDD3378
9001001C 7CBF2B78
4AAABFF5 2C030000
408200AC 807C0000
7FE4FB78 7FC5F378
4AB52D65 7C7F1B79
40820064 3D20817F
6129E800 7D3D4850
2809BFFF 40810088
38A00000 7FA4EB78
60A5C000 38C00000
7FC3F378 4AB536C5
7C7F1B79 40820070
7FC3F378 4AB52E99
8001001C 7FE3FB78
83810008 83A1000C
7C0803A6 83C10010
83E10014 38210018
4E800020 2C1FFFFC
41A2FFD8 8001001C
3BE0FFFE 7FE3FB78
83810008 83A1000C
7C0803A6 83C10010
83E10014 38210018
4E800020 3BE0FFFF
4BFFFFA8 3BE0FFFD
4BFFFFA0 3BE0FFFB
4BFFFF98 9421FFF0
3CA08180 7C0802A6
39200001 93E1000C
3FE0817F 38DF17F8
38A5E9FC 38C60008
90010014 913F17F8
4BFFFED9 2C030000
40820008 38600002
80010014 907F17F8
7C0803A6 83E1000C
38210010 4E800020
9421FFE8 93A1000C
3FA0817F 813D17F8
93C10010 7C9E2378
2C090000 93E10014
7C7F1B78 40810020
83A1000C 7FC4F378
7FE3FB78 83C10010
83E10014 38210018
4AAAB650 38DD17F8
3CA08180 7C0802A6
39200001 38C60008
38A5E9FC 9001001C
913D17F8 4BFFFE4D
2C030000 4182002C
8001001C 907D17F8
7C0803A6 83A1000C
7FC4F378 7FE3FB78
83C10010 83E10014
38210018 4AAAB5FC
8001001C 38600002
907D17F8 7C0803A6
4BFFFFD4 4743545F
474D5350 30310000
042A96E0 49555271
C0000000 00000005
3C60817F 840317F8
2C000002 4C820020
7C0F2214 90030004
39E30008 7DE47850
4E800020 4E800020
</source>
<source version="GMSJ0A">
077FE800 00000207
9421FFE8 7C0802A6
93C10010 7C9E2378
38800001 93810008
93A1000C 7C7C1B78
93E10014 7CDD3378
9001001C 7CBF2B78
4AA93E05 2C030000
408200AC 807C0000
7FE4FB78 7FC5F378
4AB3A445 7C7F1B79
40820064 3D20817F
6129E800 7D3D4850
2809BFFF 40810088
38A00000 7FA4EB78
60A5C000 38C00000
7FC3F378 4AB3ADA5
7C7F1B79 40820070
7FC3F378 4AB3A579
8001001C 7FE3FB78
83810008 83A1000C
7C0803A6 83C10010
83E10014 38210018
4E800020 2C1FFFFC
41A2FFD8 8001001C
3BE0FFFE 7FE3FB78
83810008 83A1000C
7C0803A6 83C10010
83E10014 38210018
4E800020 3BE0FFFF
4BFFFFA8 3BE0FFFD
4BFFFFA0 3BE0FFFB
4BFFFF98 9421FFF0
3CA08180 7C0802A6
39200001 93E1000C
3FE0817F 38DF17F8
38A5E9FC 38C60008
90010014 913F17F8
4BFFFED9 2C030000
40820008 38600002
80010014 907F17F8
7C0803A6 83E1000C
38210010 4E800020
9421FFE8 93A1000C
3FA0817F 813D17F8
93C10010 7C9E2378
2C090000 93E10014
7C7F1B78 40810020
83A1000C 7FC4F378
7FE3FB78 83C10010
83E10014 38210018
4AA934A8 38DD17F8
3CA08180 7C0802A6
39200001 38C60008
38A5E9FC 9001001C
913D17F8 4BFFFE4D
2C030000 4182002C
8001001C 907D17F8
7C0803A6 83A1000C
7FC4F378 7FE3FB78
83C10010 83E10014
38210018 4AA93454
8001001C 38600002
907D17F8 7C0803A6
4BFFFFD4 4743545F
474D534A 30410000
04291538 4956D419
C0000000 00000005
3C60817F 840317F8
2C000002 4C820020
7C0F2214 90030004
39E30008 7DE47850
4E800020 4E800020
</source>
</code>
</codes>

View file

@ -1,4 +1,7 @@
# Changelog
## Feb 10, 2023
Ported GCI Loader to all versions
## Feb 08, 2023
### Updated 'Instant Level Select'
Overwrite button input value to prevent Level Select being activated when AreaLock is enabled

View file

@ -60,7 +60,7 @@ export default {
]);
} catch {}
const fileName = gameVersions.find((v) => v.identifier === this.versionIdentifier).version;
const version = gameVersions.find((v) => v.identifier === this.versionIdentifier).version;
// apply customizable codes
for (const code of codeList) {
@ -76,30 +76,30 @@ export default {
switch (this.format) {
case 'gct':
this.alertGCTCodeSize(codeSize);
this.generateGCT(codeList, fileName);
this.generateGCT(codeList, version);
break;
case 'dolphin':
this.alertDolphinCodeSize(codeSize);
this.generateDolphinINI(codeList, fileName);
this.generateDolphinINI(codeList, version);
break;
case 'gcm':
this.alertDolphinCodeSize(codeSize);
this.generateCheatManagerTXT(codeList, fileName);
this.generateCheatManagerTXT(codeList, version);
break;
case 'gci+gct':
this.generateGCI(c, fileName) &&
this.generateGCT(this.getGCILoader(), fileName);
this.generateGCI(codeList, version) &&
this.generateGCT(this.getGCILoader(), version);
break;
case 'gci+dolphin':
this.generateGCI(c, fileName) &&
this.generateDolphinINI(this.getGCILoader(), fileName);
this.generateGCI(codeList, version) &&
this.generateDolphinINI(this.getGCILoader(), version);
break;
case 'gci+gcm':
this.generateGCI(c, fileName) &&
this.generateCheatManagerTXT(this.getGCILoader(), fileName);
this.generateGCI(codeList, version) &&
this.generateCheatManagerTXT(this.getGCILoader(), version);
break;
case 'gci':
this.generateGCI(c, fileName);
this.generateGCI(codeList, version);
break;
}
},
@ -168,33 +168,31 @@ export default {
this.downloadFile(data, `${version}.txt`);
},
generateGCI(codes, version) {
if (!['GMSJ01'].includes(version)) {
alert('GCI format is not yet supported for versions other than GMSJ01');
return false; // error
}
let code = '00D0C0DE00D0C0DE';
let code = '';
codes.forEach((c) => (code += c.source));
code += 'C0000000000000023C60818081E3A7FC7DE478504E800020'; // return
code += 'C0000000000000023C60817F81E317FC7DE478504E800020'; // return
const codeSize = code.length>>1;
const blockCount = 2; // TODO
const gciSize = 0x40+0x2000*blockCount;
const padSize = 0x40; // TODO
let rawData = new Uint8Array(gciSize);
const fileName = `GCT_${version}`;
const blockCount = 6; // Math.ceil(codeSize/0x2000);
const headSize = 0x40;
const gciSize = headSize+0x2000*blockCount;
const rawData = new Uint8Array(gciSize);
for (let iD=padSize, iC=0; iD<rawData.length; iD++, iC+=2) {
for (let iD=headSize, iC=0; iC<code.length; iD++, iC+=2) {
rawData[iD] = parseInt(code.slice(iC, iC+2), 16);
}
// game id
[...new TextEncoder().encode(version), 0xff, 0x00].forEach((e, i) => rawData[i] = e);
// file name
[...new TextEncoder().encode('gct')].forEach((e, i) => rawData[0x8+i] = e);
[...new TextEncoder().encode(fileName)].forEach((e, i) => rawData[0x8+i] = e);
// block count
rawData[0x39] = blockCount;
// ff*6
for (let i=0x3A; i<0x40; i++) rawData[i] = 0xff;
this.downloadFile(rawData, `01-${version.slice(0, 4)}-gct.gci`);
this.downloadFile(rawData, `01-${version.slice(0, 4)}-${fileName}.gci`);
return true; // good
},
downloadFile(data, filename) {

View file

@ -5,4 +5,4 @@ editLink: false
# Code Referenz
<!-- injectionpoint -->
<!-- injectionpoint -->

View file

@ -5,4 +5,4 @@ editLink: false
# Référence des codes
<!-- injectionpoint -->
<!-- injectionpoint -->

View file

@ -5,4 +5,4 @@ editLink: false
# チートコード一覧
<!-- injectionpoint -->
<!-- injectionpoint -->