GameData: Difference between revisions

From Luma's Workshop
Jump to navigation Jump to search
(Created page with "{{WIP}} In Super Mario Galaxy, save data is stored on the Wii's NAND, inside the file <code>GameData.bin</code>. == SMG1 == The file starts with a 16-byte long header. {| class="wikitable" !Offset !Size !Name !Description |- |0x0 |4 |Checksum |A checksum of the file's contents. |- |0x4 |4 |Version |Always 2. |- |0x8 |4 |Save Entry Count |The number of save entries inside this file. In SMG1, this value is 19. |- |0xC |4 |File Size |The size of this file, in bytes. |} Thi...")
 
(Add)
Line 18: Line 18:
|4
|4
|Version
|Version
|Always 2.
|Always 2
|-
|-
|0x8
|0x8
Line 53: Line 53:
|-
|-
|<code>mario1</code> - <code>mario6</code>
|<code>mario1</code> - <code>mario6</code>
|Mario save data.
|[[GameData#User Save Data|User Save Data.]] (Mario)
|-
|-
|<code>luigi1</code> - <code>luigi6</code>
|<code>luigi1</code> - <code>luigi6</code>
|Luigi save data.
|[[GameData#Player Save Data|User Save Data]]. (Luigi)
|-
|-
|<code>config1</code> - <code>config6</code>
|<code>config1</code> - <code>config6</code>
|Config save data shared between <code>mario</code> and <code>luigi</code> data.
|[[GameData#User Config Data|User Config Data]]. Shared between <code>mario</code> and <code>luigi</code> data.
|-
|-
|<code>sysconf</code>
|<code>sysconf</code>
|Game save data shared across all save entries.
|[[GameData#System Config Data|System Config Data]]. Shared across all save entries.
|}
|}


== <code>mario</code>/<code>luigi</code> Data ==
=== User Save Data ===
The data starts with a '''Binary Chunk Holder Header''' with the following values:
The data starts with a '''Binary Chunk Holder Header''' with the following values:
{| class="wikitable"
{| class="wikitable"
!Name
!Name
!Value
!Value
!Notes
|-
|-
|Unknown
|Unknown
|1
|1
|
|-
|-
|Chunk Count
|Chunk Count
|6
|6
|
|}
|}


=== GameDataPlayerStatus Section ===
==== <code>GameDataPlayerStatus</code> Section ====
This section stores information about the story progress, the star bit count, and the life count.<br>
This section stores information about the story progress, the star bit count, and the life count.<br>
This section starts with a '''Binary Chunk Header''' with the following values:
This section starts with a '''Binary Chunk Header''' with the following values:
Line 125: Line 122:
'''NOTE:''' The <code>Life Remaining</code> value is not used to set the mario's life count, but is instead used for 1-Up mail calculation. (This needs more research)
'''NOTE:''' The <code>Life Remaining</code> value is not used to set the mario's life count, but is instead used for 1-Up mail calculation. (This needs more research)


=== GameEventFlagStorage Section ===
==== <code>GameEventFlagStorage</code> Section ====
This section stores game event flags. A complete list of events can be found in the [[Progress checks#GameEventFlagTable|Progress Checks page]].<br>
This section stores game event flags. A complete list of events can be found in the [[Progress checks#GameEventFlagTable|Progress Checks page]].<br>
This section starts with a '''Binary Chunk Header''' with the following values:
This section starts with a '''Binary Chunk Header''' with the following values:
Line 163: Line 160:
|}
|}


=== StarPieceAlmsStorage Section ===
==== <code>StarPieceAlmsStorage</code> Section ====
This section stores information about hungry lumas.<br>
This section stores information about hungry lumas.<br>
This section starts with a '''Binary Chunk Header''' with the following values:
This section starts with a '''Binary Chunk Header''' with the following values:
Line 188: Line 185:
Furthermore, due to the<code>TicoFat</code> in <code>StarEggRoadZone</code> having an <code>Obj_arg7</code> of -1, index 0 also goes unused.
Furthermore, due to the<code>TicoFat</code> in <code>StarEggRoadZone</code> having an <code>Obj_arg7</code> of -1, index 0 also goes unused.


=== SpinDriverPathStorage Section ===
==== <code>SpinDriverPathStorage</code> Section ====
This section stores information about launch star paths.<br>
This section stores information about launch star paths.<br>
This section starts with a '''Binary Chunk Header''' with the following values:
This section starts with a '''Binary Chunk Header''' with the following values:
Line 210: Line 207:
Todo.
Todo.


=== GameEventValueStorage Section ===
==== <code>GameEventValueStorage</code> Section ====
This section stores game event values. A complete list of events can be found in the [[Progress checks#GameEventValueTable|Progress Checks page]].<br>
This section stores game event values. A complete list of events can be found in the [[Progress checks#GameEventValueTable|Progress Checks page]].<br>
This section starts with a '''Binary Chunk Header''' with the following values:
This section starts with a '''Binary Chunk Header''' with the following values:
Line 248: Line 245:
|}
|}


=== GameDataAllGalaxyStorage Section ===
==== <code>GameDataAllGalaxyStorage</code> Section ====
This section stores galaxy information, such as the collected power stars.<br>
This section stores galaxy information, such as the collected power stars.<br>
This section starts with a '''Binary Chunk Header''' with the following values:
This section starts with a '''Binary Chunk Header''' with the following values:
Line 285: Line 282:
!Name
!Name
!Value
!Value
!Notes
|-
|-
|Attribute Count
|Attribute Count
|4
|4
|
|-
|-
|Data Size
|Data Size
|20
|20
|
|}
|}
The Binary Data Content contains the following attributes:
The Binary Data Content contains the following attributes:
Line 323: Line 317:
|}
|}


=== User Config Data ===
The data starts with a '''Binary Chunk Holder Header''' with the following values:
{| class="wikitable"
!Name
!Value
|-
|Unknown
|1
|-
|Chunk Count
|3
|}
==== <code>ConfigDataCreateChunk</code> Section ====
This section defines if the file slot the config data belongs to is created.<br>
This section starts with a '''Binary Chunk Header''' with the following values:
{| class="wikitable"
!Name
!Value
!Notes
|-
|Signature
|<code>CONF</code>
|
|-
|Hash
|<code>0x2432DA</code>
|Unknown hash.
|-
|Size
|13
|
|}
This section contains a single byte which defines the creation state.
{| class="wikitable"
!Offset
!Size
!Name
!Description
|-
|0x0
|1
|Creation State
|If this file slot is created or not:
* 0 = Not Created;
* 255 = Created.
|}
==== <code>ConfigDataMii</code> Section ====
This section contains information about this file slot's icon.<br>
This section starts with a '''Binary Chunk Header''' with the following values:
{| class="wikitable"
!Name
!Value
!Notes
|-
|Signature
|<code>MII</code>
|
|-
|Hash
|<code>0x2836E9</code>
|Unknown hash.
|-
|Size
|22
|
|}
This section's data is the following:
{| class="wikitable"
!Offset
!Size
!Name
!Description
|-
|0x0
|1
|Icon Flag
|1 = Uses Mii ID; 2 = Uses Icon ID (Needs further research)
|-
|0x1
|8
|Mii ID
|Todo.
|-
|0x9
|1
|Icon ID
|Todo.
|}
==== <code>ConfigDataMisc</code> Section ====
This section contains information about this file slot's icon.<br>
This section starts with a '''Binary Chunk Header''' with the following values:
{| class="wikitable"
!Name
!Value
!Notes
|-
|Signature
|<code>MISC</code>
|
|-
|Hash
|<code>0x1</code>
|
|-
|Size
|21
|
|}
This section's data is the following:
{| class="wikitable"
!Offset
!Size
!Name
!Description
|-
|0x0
|1
|Flags
|A bitfield of flags.
* Last Loaded Mario = 1;
* Completed Mario Ending = 2;
* Completed Luigi Ending = 4.
|-
|0x1
|8
|Last Modified
|The <code>OSTime</code> since this file was last modified.
|}
=== System Config Data ===
The data starts with a '''Binary Chunk Holder Header''' with the following values:
{| class="wikitable"
!Name
!Value
|-
|Unknown
|1
|-
|Chunk Count
|1
|}
==== <code>SysConfigChunk</code> Section ====
This section contains game-wide information about Wii mail data.<br>
This section starts with a '''Binary Chunk Header''' with the following values:
{| class="wikitable"
!Name
!Value
!Notes
|-
|Signature
|<code>SYSC</code>
|
|-
|Hash
|<code>0x1</code>
|
|-
|Size
|48
|
|}
This section uses the '''Binary Data Content''' system to write its data:
{| class="wikitable"
!Name
!Value
|-
|Attribute Count
|3
|-
|Data Size
|20
|}
The Binary Data Content contains the following attributes:
{| class="wikitable"
!Offset
!Size
!Name
!Description
|-
|0x0
|8
|<code>mTimeAnnounced</code>
|The last <code>OSTime</code> the PAL60 mode warning was displayed.
|-
|0x8
|8
|<code>mTimeSent</code>
|The last <code>OSTime</code> a mail was sent to the Wii.
|-
|0x10
|4
|<code>mSentBytes</code>
|The size, in bytes, of the last mail sent to the Wii.
|}
== SMG2 ==
== SMG2 ==
Todo.
Todo.
Line 340: Line 533:
|1
|1
|Unknown
|Unknown
|Always 1.
|1 in SMG1, and 2 in SMG2. Could be a version number.
|-
|-
|0x1
|0x1

Revision as of 23:20, 13 August 2025

This page is in progress and may contain incomplete information or editor's notes.

In Super Mario Galaxy, save data is stored on the Wii's NAND, inside the file GameData.bin.

SMG1

The file starts with a 16-byte long header.

Offset Size Name Description
0x0 4 Checksum A checksum of the file's contents.
0x4 4 Version Always 2
0x8 4 Save Entry Count The number of save entries inside this file. In SMG1, this value is 19.
0xC 4 File Size The size of this file, in bytes.

This is followed up by a list of entry headers, each one with this structure:

Offset Size Name Description
0x0 12 Name The name of this entry.
0xC 4 Offset The offset to this entry's data.

In SMG1, the following entries can be found:

Name Description
mario1 - mario6 User Save Data. (Mario)
luigi1 - luigi6 User Save Data. (Luigi)
config1 - config6 User Config Data. Shared between mario and luigi data.
sysconf System Config Data. Shared across all save entries.

User Save Data

The data starts with a Binary Chunk Holder Header with the following values:

Name Value
Unknown 1
Chunk Count 6

GameDataPlayerStatus Section

This section stores information about the story progress, the star bit count, and the life count.
This section starts with a Binary Chunk Header with the following values:

Name Value Notes
Signature PLAY
Hash 0x27C90F Unknown hash.
Size 19

The actual data is structured as follows:

Offset Size Name Description
0x0 1 Story Progress The story progress value. Corresponds to the progressvalue of Unlabeled Table 1.
0x1 4 Star Bit Count The number of star bits owned.
0x5 2 Life Remaining The player's life count.

NOTE: The Life Remaining value is not used to set the mario's life count, but is instead used for 1-Up mail calculation. (This needs more research)

GameEventFlagStorage Section

This section stores game event flags. A complete list of events can be found in the Progress Checks page.
This section starts with a Binary Chunk Header with the following values:

Name Value Notes
Signature FLG1
Hash 0x65020442 Hash code of the string "2bytes/flag"
Size 126

This section's data is made up of multiple 2-byte numbers:

Offset Bit Count Name Description
0 1 Value If this flag is enabled or not.
1 15 Hash A shortened hash code of the flag's name.

StarPieceAlmsStorage Section

This section stores information about hungry lumas.
This section starts with a Binary Chunk Header with the following values:

Name Value Notes
Signature PCE1
Hash 0xF5DE1DC0 Hash code of the string "StarPieceAlmsStorage" multiplied by 32.
Size 44

The data is an array of 16 2-byte values, each one corresponding to the amount of star bits fed to hungry lumas.
TicoFat and TicoGalaxy use their Obj_arg7 to indicate what index they get/set their star bit count from, although TicoGalaxy uses Obj_arg7 + 8 for the index.
Due to TicoFat and TicoGalaxy having 7 occurrences each, this means that the values at index 7 and 15 go unused.
Furthermore, due to theTicoFat in StarEggRoadZone having an Obj_arg7 of -1, index 0 also goes unused.

SpinDriverPathStorage Section

This section stores information about launch star paths.
This section starts with a Binary Chunk Header with the following values:

Name Value Notes
Signature SPN1
Hash 0x12345679 Unknown hash.
Size 998

Todo.

GameEventValueStorage Section

This section stores game event values. A complete list of events can be found in the Progress Checks page.
This section starts with a Binary Chunk Header with the following values:

Name Value Notes
Signature VLE1
Hash 0x564C4531 The string "VLE1".
Size 112

This section's data is made up of key-value pairs:

Offset Size Name Description
0x0 2 Hash The hash of the event's name.
0x1 2 Value The value of this event.

GameDataAllGalaxyStorage Section

This section stores galaxy information, such as the collected power stars.
This section starts with a Binary Chunk Header with the following values:

Name Value Notes
Signature GALA
Hash 0xBF0640EE Unknown hash.
Size 874

This section uses the Binary Data Content system to write its data.
This section starts with a galaxy count:

Offset Size Name Description
0x0 2 Galaxy Count The number of galaxies. In SMG1, this value is 42.

Followed by a Binary Data Content header:

Name Value
Attribute Count 4
Data Size 20

The Binary Data Content contains the following attributes:

Offset Size Name Description
0x0 2 mGalaxyName The name of the galaxy.
0x2 1 mPowerStarFlag The power star collection flags. Each bit corresponds to a power star.
0x3 1 mFirstPlayFlag Todo.
0x4 16 mMaxCoinNum Todo.

User Config Data

The data starts with a Binary Chunk Holder Header with the following values:

Name Value
Unknown 1
Chunk Count 3

ConfigDataCreateChunk Section

This section defines if the file slot the config data belongs to is created.
This section starts with a Binary Chunk Header with the following values:

Name Value Notes
Signature CONF
Hash 0x2432DA Unknown hash.
Size 13

This section contains a single byte which defines the creation state.

Offset Size Name Description
0x0 1 Creation State If this file slot is created or not:
  • 0 = Not Created;
  • 255 = Created.

ConfigDataMii Section

This section contains information about this file slot's icon.
This section starts with a Binary Chunk Header with the following values:

Name Value Notes
Signature MII
Hash 0x2836E9 Unknown hash.
Size 22

This section's data is the following:

Offset Size Name Description
0x0 1 Icon Flag 1 = Uses Mii ID; 2 = Uses Icon ID (Needs further research)
0x1 8 Mii ID Todo.
0x9 1 Icon ID Todo.

ConfigDataMisc Section

This section contains information about this file slot's icon.
This section starts with a Binary Chunk Header with the following values:

Name Value Notes
Signature MISC
Hash 0x1
Size 21

This section's data is the following:

Offset Size Name Description
0x0 1 Flags A bitfield of flags.
  • Last Loaded Mario = 1;
  • Completed Mario Ending = 2;
  • Completed Luigi Ending = 4.
0x1 8 Last Modified The OSTime since this file was last modified.

System Config Data

The data starts with a Binary Chunk Holder Header with the following values:

Name Value
Unknown 1
Chunk Count 1

SysConfigChunk Section

This section contains game-wide information about Wii mail data.
This section starts with a Binary Chunk Header with the following values:

Name Value Notes
Signature SYSC
Hash 0x1
Size 48

This section uses the Binary Data Content system to write its data:

Name Value
Attribute Count 3
Data Size 20

The Binary Data Content contains the following attributes:

Offset Size Name Description
0x0 8 mTimeAnnounced The last OSTime the PAL60 mode warning was displayed.
0x8 8 mTimeSent The last OSTime a mail was sent to the Wii.
0x10 4 mSentBytes The size, in bytes, of the last mail sent to the Wii.

SMG2

Todo.

Binary Chunk System

To write save entry data, a system was created to read, write, and manage writing sub-sections of the data.

Binary Chunk Holder Header

A 4-byte header used throughout all save entries.

Offset Size Name Description
0x0 1 Unknown 1 in SMG1, and 2 in SMG2. Could be a version number.
0x1 1 Chunk Count The number of chunks in the data.
0x2 2 Padding

Binary Chunk Header

A 12-byte header used for identifying the sub-sections of data.

Offset Size Name Description
0x0 4 Signature A 4-byte long ASCII string
0x4 4 Hash An additional identifier for the chunk.
0x8 4 Size The size of this chunk, in bytes, from the start of this header.

NOTE: The Hash value is not always a hash code, as some chunks simply use 1 as the value.

Binary Data Content

The save file's dynamic data serialization system. The data starts with a 8-byte long header.

Offset Size Name Description
0x0 2 Attribute Count The number of attributes in the data structure.
0x2 2 Data Size The size of the data structure.

This is followed by multiple attribute headers.

Offset Size Name Description
0x0 2 Hash The hash of the attribute's name.
0x2 2 Offset The offset from the start of the data structure.

As for the data, its structure is dinamically created by the attributes. Furthermore, multiple data structures can be written to the data buffer.

Tools

  • TKSaveEditor - A currently WIP tool by VTXG.