Add GCI+XXX as download format; Add return code for GCI Loader

This commit is contained in:
sup39 2022-11-16 17:20:30 +09:00
parent 918eb0eb50
commit 215af313de
8 changed files with 98 additions and 51 deletions

View file

@ -4659,60 +4659,60 @@
</source> </source>
</code> </code>
<code> <code>
<category>misc</category> <category>lib</category>
<id>GCILoader</id>
<title lang="en-US">GCI Loader</title> <title lang="en-US">GCI Loader</title>
<author>sup39(サポミク)</author> <author>sup39(サポミク)</author>
<version>0.1</version> <version>0.2</version>
<date>Nov 11, 2022</date> <date>Nov 16, 2022</date>
<description lang="en-US"> <description lang="en-US">
Execute Gecko code loaded from GCI file. Execute Gecko code loaded from GCI file.
::: warning ::: warning
You will need to reset the game if you hotplug your memory card You will need to reset the game if you hotplug your memory card
::: :::
</description> </description>
<source version="GMSJ01"> <source version="GMSJ01">
C21069F4 0000001C C21069F4 00000021
9421FFF0 7C0802A6 9421FFE0 BF61000C
BFC10008 7C9F2378 3FA0817F 63BDE800
38800001 90010014 3F80ABCD 813D0000
7C7E1B78 3D808010 639C1234 7C7E1B78
618C7B50 7D8803A6 7C09E000 7C9F2378
4E800021 2C030000 418200B8 3D208010
40820084 807E0000 38800001 39297B50
7D2903A6 4E800421
2C030000 4082009C
3D20800A 39293CAC
807E0000 7FE5FB78
48000009 67637400 48000009 67637400
7C8802A6 7FE5FB78 7C8802A6 7D2903A6
3D80800A 618C3CAC 4E800421 2C030000
7D8803A6 4E800021 40820070 3F60817F
2C030000 40820058 3D20800A 39294640
38A00000 38C00000 637BA800 38C00000
60A5E000 3C80817F 38A04000 7F64DB78
7FE3FB78 3D80800A 7FE3FB78 7D2903A6
618C4640 7D8803A6 4E800421 2C030000
4E800021 2C030000 4082002C 813B0000
40820018 3D20817F 6D2AFF2F 2C0AC0DE
3D40534D 6129DFFC 4082001C 3D40817F
614A53FF 91490000 614AA804 814A0000
7FE3FB78 3D80800A 7C0A4800 40A20008
618C3E24 7D8803A6 939D0000 3D20800A
4E800021 80010014 7FE3FB78 39293E24
7FE4FB78 7FC3F378 7D2903A6 4E800421
83E1000C 83C10008 3D208010 7FE4FB78
38210010 3D808010 392972F4 7FC3F378
618C72F4 7D8803A6 7D2903A6 4E800421
4E800021 00000000 BB61000C 38210020
C0000000 0000000C 60000000 00000000
3CA0803E 88A56008 2C3E6008 00FF0300
28050004 4D800020 217FE800 ABCD1234
3CA0534D 60A553FF C0000000 00000003
3C608180 8003DFFC 7C0F2214 3C608180
7C002840 4C820020 9403A7FC 39E3000C
3CA000D0 60A5C0DE
3C608180 8403B000
7C002840 4C820020
80030004 7C002840
4C820020 7C0F2214
9003FFFC 39E30008
7DE47850 4E800020 7DE47850 4E800020
E0000000 00000000
</source> </source>
</code> </code>
</codes> </codes>

View file

@ -1,4 +1,9 @@
# Changelog # Changelog
## Nov 16, 2022
- Add GCI+XXX as download format
- Add return code for GCI Loader
- Smaller GCI file (0xE000 bytes to 0x4000 bytes)
## Nov 11, 2022 ## Nov 11, 2022
- Add GCI Loader (NTSC-J 1.0 only) - Add GCI Loader (NTSC-J 1.0 only)
- Support GCI as download format (NTSC-J 1.0 only) - Support GCI as download format (NTSC-J 1.0 only)

View file

@ -86,6 +86,18 @@ export default {
this.alertDolphinCodeSize(codeSize); this.alertDolphinCodeSize(codeSize);
this.generateCheatManagerTXT(c, fileName); this.generateCheatManagerTXT(c, fileName);
break; break;
case 'gci+gct':
this.generateGCI(c, fileName) &&
this.generateGCT(this.getGCILoader(), fileName);
break;
case 'gci+dolphin':
this.generateGCI(c, fileName) &&
this.generateDolphinINI(this.getGCILoader(), fileName);
break;
case 'gci+gcm':
this.generateGCI(c, fileName) &&
this.generateCheatManagerTXT(this.getGCILoader(), fileName);
break;
case 'gci': case 'gci':
this.generateGCI(c, fileName); this.generateGCI(c, fileName);
break; break;
@ -102,6 +114,11 @@ export default {
alert(translate('generatorconfig.alert.dolphin', this.$lang).replaceAll('{size}', size-16)); alert(translate('generatorconfig.alert.dolphin', this.$lang).replaceAll('{size}', size-16));
} }
}, },
getGCILoader() {
const {codes} = gameVersions.find((v) => v.identifier === this.versionIdentifier);
const code = codes.find(code => code.id === 'GCILoader');
return [code];
},
generateGCT(codes, version) { generateGCT(codes, version) {
let code = '00D0C0DE00D0C0DE'; let code = '00D0C0DE00D0C0DE';
codes.forEach((c) => (code += c.source)); codes.forEach((c) => (code += c.source));
@ -150,15 +167,15 @@ export default {
generateGCI(codes, version) { generateGCI(codes, version) {
if (!['GMSJ01'].includes(version)) { if (!['GMSJ01'].includes(version)) {
alert('GCI format is not yet supported for versions other than GMSJ01'); alert('GCI format is not yet supported for versions other than GMSJ01');
return; return false; // error
} }
let code = '00D0C0DE00D0C0DE'; let code = '00D0C0DE00D0C0DE';
codes.forEach((c) => (code += c.source)); codes.forEach((c) => (code += c.source));
code += 'F000000000000000'; code += 'C0000000000000023C60818081E3A7FC7DE478504E800020'; // return
const blockCount = 7; // TODO const blockCount = 2; // TODO
const gciSize = 0x40+0x2000*blockCount; const gciSize = 0x40+0x2000*blockCount;
const padSize = 0xB040; // TODO const padSize = 0x40; // TODO
let rawData = new Uint8Array(gciSize); let rawData = new Uint8Array(gciSize);
for (let iD=padSize, iC=0; iD<rawData.length; iD++, iC+=2) { for (let iD=padSize, iC=0; iD<rawData.length; iD++, iC+=2) {
@ -175,6 +192,7 @@ export default {
for (let i=0x3A; i<0x40; i++) rawData[i] = 0xff; 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)}-gct.gci`);
return true; // good
}, },
downloadFile(data, filename) { downloadFile(data, filename) {
var file = new Blob([data], { var file = new Blob([data], {

View file

@ -11,6 +11,18 @@
"target": "gcm", "target": "gcm",
"i18nKey": "generatorconfig.downloadformat.options.gcm" "i18nKey": "generatorconfig.downloadformat.options.gcm"
}, },
{
"target": "gci+gct",
"i18nKey": "generatorconfig.downloadformat.options.gci+gct"
},
{
"target": "gci+dolphin",
"i18nKey": "generatorconfig.downloadformat.options.gci+dolphin"
},
{
"target": "gci+gcm",
"i18nKey": "generatorconfig.downloadformat.options.gci+gcm"
},
{ {
"target": "gci", "target": "gci",
"i18nKey": "generatorconfig.downloadformat.options.gci" "i18nKey": "generatorconfig.downloadformat.options.gci"

View file

@ -45,6 +45,9 @@
"gct": "GCT", "gct": "GCT",
"dolphin": "Dolphin INI", "dolphin": "Dolphin INI",
"gcm": "CheatManager TXT", "gcm": "CheatManager TXT",
"gci+gct": "GCI + GCT",
"gci+dolphin": "GCI + Dolphin INI",
"gci+gcm": "GCI + CheatManager TXT",
"gci": "GCI" "gci": "GCI"
} }
}, },

View file

@ -45,6 +45,9 @@
"gct": "GCT", "gct": "GCT",
"dolphin": "Dolphin INI", "dolphin": "Dolphin INI",
"gcm": "CheatManager TXT", "gcm": "CheatManager TXT",
"gci+gct": "GCI + GCT",
"gci+dolphin": "GCI + Dolphin INI",
"gci+gcm": "GCI + CheatManager TXT",
"gci": "GCI" "gci": "GCI"
} }
}, },

View file

@ -30,6 +30,9 @@
"gct": "GCT", "gct": "GCT",
"dolphin": "Dolphin INI", "dolphin": "Dolphin INI",
"gcm": "CheatManager TXT", "gcm": "CheatManager TXT",
"gci+gct": "GCI + GCT",
"gci+dolphin": "GCI + Dolphin INI",
"gci+gcm": "GCI + CheatManager TXT",
"gci": "GCI" "gci": "GCI"
} }
} }

View file

@ -30,6 +30,9 @@
"gct": "GCT", "gct": "GCT",
"dolphin": "Dolphin INI", "dolphin": "Dolphin INI",
"gcm": "CheatManager TXT", "gcm": "CheatManager TXT",
"gci+gct": "GCI + GCT",
"gci+dolphin": "GCI + Dolphin INI",
"gci+gcm": "GCI + CheatManager TXT",
"gci": "GCI" "gci": "GCI"
} }
}, },