A dev version of (A practice file generator for everyone's favorite game: Super Mario Sunshine)
Find a file
2022-04-11 08:49:10 +02:00
.devcontainer making life easier [skip ci] 2022-02-03 14:46:35 +00:00
.github Update dependabot.yml 2022-04-04 12:59:32 +02:00
.vscode minor formatting 2022-02-22 00:25:49 +00:00
dockerfiles Presets and categories (#73) 2021-10-10 15:45:53 +02:00
docs use markdown table for memory map 2021-12-28 16:02:23 +00:00
scripts Add fallback value for customizable codes 2022-04-08 23:02:51 +09:00
site update nintendont code limit in troubleshooting guide 2022-04-11 06:24:02 +00:00
utils remove stage randomizer and remove save boxes 2021-08-13 18:08:21 +02:00
.dockerignore wip 2020-07-01 08:52:12 +02:00
.editorconfig switch from azure-pipelines to github actions 2020-06-29 23:31:44 +02:00
.gitattributes update cheat table file extension 2021-08-14 17:20:16 +00:00
.gitignore init vuepress 2020-06-29 23:31:44 +02:00
.nvmrc minor cleanup 2022-01-16 18:17:07 +00:00
.prettierignore add .prettierignore 2020-09-24 14:59:53 +02:00
.prettierrc component translation frameworking 2020-07-03 19:23:15 +02:00
changelog.md Implemented custom config of QFT 2022-04-08 16:29:24 +09:00
Codes.xml remove pattern selector from recommended preset since its use case is too specific, also remove instant restart from recommended preset since users might not realise that it is bound to a configuration 2022-04-11 08:49:10 +02:00
docker-compose.yml switch from azure-pipelines to github actions 2020-06-29 23:31:44 +02:00
LICENSE add license 2020-06-29 23:31:44 +02:00
package-lock.json Bump prettier from 2.6.1 to 2.6.2 2022-04-04 04:02:49 +00:00
package.json Bump prettier from 2.6.1 to 2.6.2 2022-04-04 04:02:49 +00:00
Readme.md Fix description of PS, update changelog 2022-03-25 11:22:02 +09:00
Removed-Codes.xml remove pattern selector from deleted codes 2022-03-25 02:18:22 +01:00

GCT Generator

GitHub license CD Pipeline

This repository contains the code behind the Super Mario Sunshine Cheatfile Generator at https://gct.zint.ch/


Features


Contributing

Updating Practice Codes

The codes are stored in the Codes.xml file. If you want to add or change codes edit the XML file. Note that GMSJ0A refers to the NTSC-J 1.1 release of Super Mario Sunshine. (It's not actually called version A but that's what we've been calling it for years due to a misconception on what the A on the back of the box means).

When adding new codes keep in mind that the English title/description are mandatory.

Reserved Memory

Some codes store some states in the games memory starting from address 0x817F0000. To avoid collisions use a memory range in the unallocated ranges:

Status Start End Description
0x0 0x7 Level Select: Stage Data
0x8 0x13 DPad Functions: Stored Position (Mario)
0x14 0x15 DPad Functions: Stored Angle (Mario)
0x16 0x1B DPad Functions: Stored Position (Camera)
0x20 0x23 Coin Count Savestate: Coin Count
0x24 0x93 Not Allocated
0x94 0xA3 QF Timer: Coordinates of the Text box (LTRB)
0xA4 0xB0 QF Timer: Timer Format String
0xB0 0xB1 QF Timer: (Unused)
0xB2 0xB2 QF Timer: Stop at QFT Offset
0xB3 0xB3 QF Timer: Restart Flag
0xB4 0xB7 QF Timer: Cumulative time of previous areas since last reset (QFT Offset)
0xB8 0xBB QF Timer: Time to display if timer freeze > 0
0xBC 0xBF QF Timer: Duration of timer freeze (in frames)
0xC0 0xFF Buffer (QF Timer)
0x100 0x100 Ingame Timer: Reset Stopwatch Flag
0x101 0x101 Ingame Timer: Disable Custom IG Timer Flag
0x102 0x10B Ingame Timer: Stopwatch Backup
0x10C 0x10C Ingame Timer: Stop Stopwatch Flag
0x10D 0x10F Buffer (Ingame Timer)
0x110 0x237 QF Timer: Timer Textbox
0x238 0x347 General Function (drawText)
0x348 0xFFF Not Allocated

Adding translations

  1. Create a new file <lang>.json in site/.vuepress/i18n, where <lang> is the language code you want to add. Copy the contents of en-US.json into your file and translate each entry in the JSON file.
  2. Create a new folder with your language code in site (such as site/de for German). Create a new markdown file for each existing page (guide.md, index.md, ios58.md, ...) and translate its contents from the English version.
  3. Create a new entry in site/.vuepress/i18n/locales.json with the site metadata and navigation items for your language.
  4. Add your locale to the translations in site/.vuepress/i18n/localeHelper.js.
  5. Open Codes.xml and add a translation for each code (<title> and <description>).

Updating Guides

You can find the guides in the site folder. Simply edit the corresponding markdown file (.md).

Note that in the code reference files everything following the <!-- injectionpoint --> tag will be removed during the next build.

Site Development

You can either use dev containers or your own setup to develop new features.

Using Dev-Containers

If you have access to codespaces simply open the repository in codespaces. Else you can set it up locally as follows:

  1. Install Docker and docker-compose.
  2. Open the project in VSCode
  3. Click the Reopen in Container button or run the command with the same name.

Using your own environment

Due to formatting rules you should use VSCode for development with the following features/extensions:

  • NodeJS 16.x (LTS)
  • npm 8.x
  • octref.vetur
  • esbenp.prettier-vscode

Development commands

# Install dependencies
npm i

# Inject codes from the Codes.xml file
npm run codes:inject

# Run project in watch mode
# This will serve the page in development mode on http://localhost:8080
npm run dev

# Remove injected codes
npm run codes:clean

# Build project for production
npm run build

# Serve the production build
npm run serve

The XML codes will be written automatically to the json file and code reference during the following actions:

  • Starting the development server with npm run dev
  • Building the site with npm run build

If you want to inject the codes at any given point you can use npm run codes:inject.

!!! Note that if npm was used, npm run codes:clean is ran automatically as a pre-commit hook, removing all injected codes and staging ALL changes. If you want to commit changes without cleaning codes first you have to commit through git commit --no-verify.

Build and preview the site (Docker)

The project root provides a docker-compose file, which creates a clean build (with the same configuration as the production build) and spins up a minimal Apache server on your local, serving the resulting build on port 8080.

# Build and serve the site on http://localhost:8080
# Press CTRL+C to stop the container
docker-compose up --build