Skip to content
シーはディー四を取る edited this page Mar 13, 2022 · 14 revisions

This game save data editor for The Legend of Zelda: Majora's Mask has always been a command-line application, ever since its first prototype back in March 2012.

Example

A YouTube video has been contributed to demonstrate typing out a full command to change Link's Mirror Shield back into the standard Hero's Shield. (In the video, the error message "File system flash read failed." is disregarded because it was caused just by Project64 writing minimalist flash save files, unless the full 128 KiB was written by ROM. The save editor automatically bumps the file size to the correct length on first run, hence the warning.)

Multiple-Request Example

Stopping time to a frozen state, without using cheat codes (yes, just by editing the flash RAM) and renaming Link's file name, can be done with this single command for Microsoft Windows:

ZS.EXE "C:\Nemu64\Save\ZELDA MAJORA'S MASK.fla" -Z -3 -N 0x0103030701030307

Here, the syntax is self-explanatory.

  • The file system locator (e.g., "C:\Program Files...") for where the flash memory is stored is always the first parameter to zs. Without a valid file path, nothing can work.
  • Any number of optional flags may follow. The -Z -3 freezes time in Termina.
  • A second option, -N 0x0103030701030307, changes Link's name to "13371337".

First, there are a number of helpful methods to simplify this command to the human mind.

Option 1: Drop the ".exe".

Ever since MS-DOS, even the non-Unix-based command shells by Microsoft have been sufficiently intelligent to recognize the process command without a necessary .exe or .com file extension. Dropping this tidbit is shorter on text width, eases repeatability and even helps migrate save-editing commands to other operating systems which do not share the concept of the EXE file extension.

Before:

ZS.EXE "C:\Nemu64\Save\ZELDA MAJORA'S MASK.fla" -Z -3 -N 0x0103030701030307

After:

zs "C:\Nemu64\Save\ZELDA MAJORA'S MASK.fla" -Z -3 -N 0x0103030701030307

Option 2: Consider using variables.

Horizontally shorter than the above command, is just to say this:

set SAVE_FILE="C:\Nemu64\Save\ZELDA MAJORA'S MASK.fla"

zs %SAVE_FILE% -Z -3 -N 0x0103030701030307

This way, the command fits on the screen (and Notepad or whatever) more visibly. This is especially helpful if the user has a preference to split the command into two, like so:

set SAVE_FILE="C:\Nemu64\Save\ZELDA MAJORA'S MASK.fla"

zs %SAVE_FILE% -Z -3
zs %SAVE_FILE% -N 0x0103030701030307

(Note that this second style is not quite recommended, however, for efficiency reasons. In the short term, calling and re-allocating zs.exe only twice is not going to be noticeably slow, but it also multiplies the amount of access to the .FLA save file and may exponentiate the wear and tear of the computer's file system's lifespan.)

Option 3: Don't memorize the flag names; write them!

Option switches take after the traditional Unix syntax of a dash (-) preceding a single case-sensitive letter (e.g., -A, -M or -m), but any subsequent characters following those two tokens are optional and ignored by the program.

For example: If this command is so hard to remember, why write it?

zs %SAVE_FILE% -Z -3 -N 0x0103030701030307

Wouldn't it be easier to read and recognize, for example, this?

zs %SAVE_FILE% -ZeldaTimeRate -3 -NameFile1 0x0103030701030307

Either variant behaves and performs equally, but only the single-letter version is documented throughout this wiki so as not to confuse people into thinking whole words are required.

Note: It does not have to be "ZeldaTimeRate" instead of Z. The only thing that matters is just that it begins with a capital letter Z. Whatever English expansion of the letter seems most memorable is up to the user.

Option 4: Write comments.

A slightly riskier alternative to the above option is to try this:

zs %SAVE_FILE% -Z -3 "Freezes time." -N 0x0103030701030307 "File 1:  13371337"

This method works because the command-line flags are variadic and do not expect an exact, fixed number of parameters passed to them. (-Z -3 lol lolol has the same effect as just -Z -3.) This can backfire because most of the game data edit commands are, themselves, variadic in syntax and can operate differently based on how few (or how many) parameters are supplied (e.g., -Z instead of -Z -3), but that is another topic.

Better yet for Windows-only users may be to use REM for line remarks.

zs %SAVE_FILE% -Z -3
REM Freezes time.

zs %SAVE_FILE% -N 0x0103030701030307
REM Changes Link's name in File 1 to "13371337".

Option 5: Drop the C-style hexadecimal prefix 0x.

zs %SAVE_FILE% -N 0103030701030307

According to this program's documentation on changing Link's name, the (optional) parameter to the -N command switch must be a hexadecimal. Given this, the official rules of the C language's standard library functions strtoul() and strtol() permit the omission of the optional, case-insensitive "0x" prefix to a hexadecimal.

Note: This only works within command flags that specifically ask for a hexadecimal. If no base is specified in the documentation, then the 0x is needed to supply hex., a leading 0 is needed to supply octal, and the absence of both is needed to desire decimal.

Obviously, unless a specific flag is vulnerable to C-style octal interpretation (user-defined numeric base), then any number of 0s can be removed or prefixed to the numeric input. There is no reason why one couldn't change:

zs %SAVE_FILE% -N 0103030701030307

... to ...

zs %SAVE_FILE% -N  103030701030307

Where to go from here?

That's all the basic advice on how to easily use and understand the program.

Check out the game's flash memory data encoding table for information about what other game progress and other datum can be tweaked with this tool. There is also a set of more "global", basic game file manipulation commands.