add GCI Loader; support GCI as download format (NTSC-J 1.0 only)

This commit is contained in:
sup39 2022-11-11 21:58:24 +09:00
parent c6fad5f383
commit 918eb0eb50
10 changed files with 150 additions and 46 deletions

View file

@ -4658,4 +4658,61 @@
040eb024 60000000
</source>
</code>
<code>
<category>misc</category>
<title lang="en-US">GCI Loader</title>
<author>sup39(サポミク)</author>
<version>0.1</version>
<date>Nov 11, 2022</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="GMSJ01">
C21069F4 0000001C
9421FFF0 7C0802A6
BFC10008 7C9F2378
38800001 90010014
7C7E1B78 3D808010
618C7B50 7D8803A6
4E800021 2C030000
40820084 807E0000
48000009 67637400
7C8802A6 7FE5FB78
3D80800A 618C3CAC
7D8803A6 4E800021
2C030000 40820058
38A00000 38C00000
60A5E000 3C80817F
7FE3FB78 3D80800A
618C4640 7D8803A6
4E800021 2C030000
40820018 3D20817F
3D40534D 6129DFFC
614A53FF 91490000
7FE3FB78 3D80800A
618C3E24 7D8803A6
4E800021 80010014
7FE4FB78 7FC3F378
83E1000C 83C10008
38210010 3D808010
618C72F4 7D8803A6
4E800021 00000000
C0000000 0000000C
3CA0803E 88A56008
28050004 4D800020
3CA0534D 60A553FF
3C608180 8003DFFC
7C002840 4C820020
3CA000D0 60A5C0DE
3C608180 8403B000
7C002840 4C820020
80030004 7C002840
4C820020 7C0F2214
9003FFFC 39E30008
7DE47850 4E800020
</source>
</code>
</codes>

View file

@ -1,4 +1,8 @@
# Changelog
## Nov 11, 2022
- Add GCI Loader (NTSC-J 1.0 only)
- Support GCI as download format (NTSC-J 1.0 only)
## Nov 9, 2022
### Added 'Fast Piantissimo'
To make Piantissimo go as fast as he will in a level, you need to beat him with an in-game time under 25 seconds and grab his Shine. Or you could just use this code.

View file

@ -1,41 +1,41 @@
{
"name": "gctgenerator",
"version": "3.0.1",
"description": "Super Mario Sunshine Practice File Generator",
"main": "index.js",
"authors": {
"name": "Matteias Collet",
"email": "matteias.collet@bluewin.ch"
},
"repository": "https://github.com/BitPatty/gctGenerator/gctGenerator",
"scripts": {
"dev": "npm run codes:inject && npm run translations:compare && vuepress dev site",
"build": "node ./scripts/inject_codes.js && npm run translations:compare && vuepress build site",
"format": "prettier --write ./site/**/*{.md,.js,.json}",
"translations:compare": "node ./scripts/compare_translations.js",
"codes:inject": "node ./scripts/inject_codes.js && npm run format",
"codes:clean": "node ./scripts/clean_codes.js && npm run format",
"precommit": "npm run codes:clean && git add .",
"serve": "serve ./site/.vuepress/dist"
},
"license": "Apache-2.0",
"devDependencies": {
"@sup39/markdown-it-attr": "1.2.2",
"@sup39/markdown-it-inline-tag": "1.0.1",
"@types/encoding-japanese": "^2.0.1",
"@vuepress/plugin-back-to-top": "1.9.7",
"@vuepress/plugin-medium-zoom": "1.9.7",
"encoding-japanese": "^2.0.0",
"jsdom": "20.0.2",
"pre-commit": "1.2.2",
"prettier": "2.7.1",
"serve": "14.1.1",
"vuepress": "1.9.7"
},
"dependencies": {
"vuedraggable": "2.24.3"
},
"pre-commit": [
"precommit"
]
}
{
"name": "gctgenerator",
"version": "3.0.1",
"description": "Super Mario Sunshine Practice File Generator",
"main": "index.js",
"authors": {
"name": "Matteias Collet",
"email": "matteias.collet@bluewin.ch"
},
"repository": "https://github.com/BitPatty/gctGenerator/gctGenerator",
"scripts": {
"dev": "npm run codes:inject && npm run translations:compare && vuepress dev site",
"build": "node ./scripts/inject_codes.js && npm run translations:compare && vuepress build site",
"format": "prettier --write ./site/**/*{.md,.js,.json}",
"translations:compare": "node ./scripts/compare_translations.js",
"codes:inject": "node ./scripts/inject_codes.js && npm run format",
"codes:clean": "node ./scripts/clean_codes.js && npm run format",
"precommit": "npm run codes:clean && git add .",
"serve": "serve ./site/.vuepress/dist"
},
"license": "Apache-2.0",
"devDependencies": {
"@sup39/markdown-it-attr": "1.2.2",
"@sup39/markdown-it-inline-tag": "1.0.1",
"@types/encoding-japanese": "^2.0.1",
"@vuepress/plugin-back-to-top": "1.9.7",
"@vuepress/plugin-medium-zoom": "1.9.7",
"encoding-japanese": "^2.0.0",
"jsdom": "20.0.2",
"pre-commit": "1.2.2",
"prettier": "2.7.1",
"serve": "14.1.1",
"vuepress": "1.9.7"
},
"dependencies": {
"vuedraggable": "2.24.3"
},
"pre-commit": [
"precommit"
]
}

View file

@ -86,6 +86,9 @@ export default {
this.alertDolphinCodeSize(codeSize);
this.generateCheatManagerTXT(c, fileName);
break;
case 'gci':
this.generateGCI(c, fileName);
break;
}
},
alertGCTCodeSize(size) {
@ -144,6 +147,35 @@ 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;
}
let code = '00D0C0DE00D0C0DE';
codes.forEach((c) => (code += c.source));
code += 'F000000000000000';
const blockCount = 7; // TODO
const gciSize = 0x40+0x2000*blockCount;
const padSize = 0xB040; // TODO
let rawData = new Uint8Array(gciSize);
for (let iD=padSize, iC=0; iD<rawData.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);
// 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`);
},
downloadFile(data, filename) {
var file = new Blob([data], {
type: 'application/octet-stream',

View file

@ -114,7 +114,10 @@ const makeInstXS = (op, op2) => (rA, rS, rB, Rc) => InstX(op, rA, rS, rB, op2, +
/** @type {(op: number) => InstM} */
const makeInstM = (op) => (rA, rS, SH, MB, ME, Rc) => InstM(op, rA, rS, SH, MB, ME, +Rc);
/** @type {(op: number) => InstI} */
const makeInstI = (op) => (LL, LK, AA = 0) => InstI(op, LL >> 2, +AA, +LK);
const makeInstI =
(op) =>
(LL, LK, AA = 0) =>
InstI(op, LL >> 2, +AA, +LK);
export const ASM = {
// store rT, rA, D

View file

@ -10,5 +10,9 @@
{
"target": "gcm",
"i18nKey": "generatorconfig.downloadformat.options.gcm"
},
{
"target": "gci",
"i18nKey": "generatorconfig.downloadformat.options.gci"
}
]

View file

@ -44,7 +44,8 @@
"options": {
"gct": "GCT",
"dolphin": "Dolphin INI",
"gcm": "CheatManager TXT"
"gcm": "CheatManager TXT",
"gci": "GCI"
}
},
"categories": {

View file

@ -44,7 +44,8 @@
"options": {
"gct": "GCT",
"dolphin": "Dolphin INI",
"gcm": "CheatManager TXT"
"gcm": "CheatManager TXT",
"gci": "GCI"
}
},
"alert": {

View file

@ -29,7 +29,8 @@
"options": {
"gct": "GCT",
"dolphin": "Dolphin INI",
"gcm": "CheatManager TXT"
"gcm": "CheatManager TXT",
"gci": "GCI"
}
}
},

View file

@ -29,7 +29,8 @@
"options": {
"gct": "GCT",
"dolphin": "Dolphin INI",
"gcm": "CheatManager TXT"
"gcm": "CheatManager TXT",
"gci": "GCI"
}
},
"alert": {