Save Format

From CloudModding MM Wiki
Jump to: navigation, search

SRAM Layout

Japanese Releases

Start End Description
000000 004000 File 1
004000 008000 File 2
008000 00C000 File 3
00C000 010000 128-byte settings
010000 014000 File 1 backup
014000 018000 File 2 backup
018000 01C000 File 3 backup
01C000 020000 128-byte settings backup

International Releases

Start End Description
000000 004000 File 1 (truncated to 8 KiB + backup 8 KiB)
004000 008000 File 2 (truncated to 8 KiB + backup 8 KiB)
008000 00C000 File 1 owl buffer (+ 0x2000 for Pictograph Box color buffer)
00C000 010000 File 1 owl backup (+ 0x2000 for Pictograph Box color buffer)
010000 014000 File 2 owl buffer (+ 0x2000 for Pictograph Box color buffer)
014000 018000 File 2 owl backup (+ 0x2000 for Pictograph Box color buffer)
018000 01C000 128-byte global settings
01C000 020000 reserved

Save Context

The "Save Context" is a term used to reference the z_common_data structure, or the home address of the variables saved by the game. Since the save file is created by copying the 0x???? bytes from the start of the save context, it's possible to peek in ram to determine what each save variable does.

Location in Ram
U 1.0 801EF672

Save Format

Offset Data Type Usage Additional Info
0x0000 int16 Entrance index Stores the entrance Link starts/respawns at. Check the Entrance Table for a listing of all values.
0x0002 byte Mask Stores the Mask ID Link is wearing
0x0008 int16 Cutscene Number Used to trigger cutscenes. Values FFF0 - FFFF trigger cutscenes 0-F.
0x000A int16 World Time Sets the current time for the world clock
0x0011 byte ? Night Flag Denotes that it's night time.
0x0019 byte ? Current Day Stores the current day (0-4)
0x001E byte Age Modifier 4 = Link, 3 = Deku, 2 = Zora, 1 = Goron, 0 = Fierce Deity
0x0022 char[6] Unknown Contains the string "ZELDA3". If different, the save will be considered corrupt even if the checksum is valid
0x0032 int16 Heart containers 0x10 is equivalent to 1 heart container
0x0034 int16 Health 0x10 is equivalent to 1 full heart
0x0036 int8 Magic meter size automatically sets itself to 0,1 or 2 depending on your upgrades
0x0037 byte Current magic amount 0x30 = half bar, 0x60 = full bar
0x0038 uint16_t Rupees
0x00D1 byte Double Defense Hearts Sets how many hearts should be displayed as being "Double Defense" hearts.

Structs

Scene Flags

There are two sets of scene flags in Majora's Mask, permanent and the cycle scene flags. Permanent scene flags start at Save Context + 0x00F8, and persist for the lifetime of the save, while cycle scene flags are located at Save Context + 0x42F4 in the Japanese version and Save Context + 0x3F68 in the international releases and persist until the end of the current 3 day cycle. Both share a similar structure:

0x00 Chest Flags
0x04 Switch Flags (0x00)
0x08 Switch Flags (0x20)
0x0C Room Clear Flags
0x10 Collectible Flags (0x00)
## 0x14 //size of the cycle scene flags
## 0x1C //size of the permanent scene flags