NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
|
#include <game/bases/d_mj2d_data.hpp>
Represents the header of the game's save file.
The save file header contains data that is not related to a specific save slot, along with basic information required to identify the data and preserve its integrity. For the slot-specific save data, refer to dMj2dGame_c.
The header is composed by the following fields:
Read/write access to the fields related to Extra Modes is provided through dedicated functions. All other fields are handled automatically by the game, therefore developer interaction is not required.
To reset the contents of the header, call the initialize function.
Definition at line 45 of file d_mj2d_data.hpp.
Public Member Functions | |
dMj2dHeader_c () | |
Constructs the holder. | |
void | initialize () |
Initializes the header data. | |
u16 | getPlayCountFreeMode (int world, int level) const |
Gets the Free Mode play count for the given world/level. See mPlayCountFreeMode. | |
void | setPlayCountFreeMode (int world, int level, int count) |
Sets the Free Mode play count for the given world/level. See mPlayCountFreeMode. | |
u16 | getPlayCountCoinBattle (int world, int level) const |
Gets the Coin Battle play count for the given world/level. See mPlayCountCoinBattle. | |
void | setPlayCountCoinBattle (int world, int level, int count) |
Sets the Coin Battle play count for the given world/level. See mPlayCountCoinBattle. | |
void | onMultiWorldOpenFlag (int world) |
Unlocks the given world in extra modes. | |
bool | isMultiWorldOpenFlag (int world) |
Checks if the given world is unlocked in extra modes. | |
Private Member Functions | |
void | versionUpdate () |
Ensures that the save's major revision number matches the current one. | |
void | setSelectFileNo (s8 file) |
Sets the last used save data slot. | |
Private Attributes | |
char | mMagic [4] |
The savegame magic. See SAVE_MAGIC. | |
u8 | mRevision [2] |
The save revision numbers. See SAVE_REVISION_MAJOR and SAVE_REVISION_MINOR. | |
u8 | mLastSelectedFile |
The last selected save data slot. | |
u8 | mUnknown7 |
[Unused]. Padding. | |
u16 | mPlayCountFreeMode [WORLD_COUNT][STAGE_COUNT] |
The play count of each level in Free Mode. | |
u16 | mPlayCountCoinBattle [WORLD_COUNT][STAGE_COUNT] |
The play count of each level in Coin Battle. | |
u16 | mMultiWorldOpenFlag |
The worlds unlocked in Extra Modes. | |
u16 | mUnknown69A |
[Unused]. Padding. | |
u32 | mChecksum |
The CRC32 checksum of the above data (excluding mMagic). | |
dMj2dHeader_c::dMj2dHeader_c | ( | ) |
Constructs the holder.
Definition at line 267 of file d_mj2d_data.cpp.
void dMj2dHeader_c::initialize | ( | ) |
Initializes the header data.
Definition at line 270 of file d_mj2d_data.cpp.
u16 dMj2dHeader_c::getPlayCountFreeMode | ( | int | world, |
int | level ) const |
Gets the Free Mode play count for the given world/level. See mPlayCountFreeMode.
Definition at line 286 of file d_mj2d_data.cpp.
void dMj2dHeader_c::setPlayCountFreeMode | ( | int | world, |
int | level, | ||
int | count ) |
Sets the Free Mode play count for the given world/level. See mPlayCountFreeMode.
Definition at line 290 of file d_mj2d_data.cpp.
u16 dMj2dHeader_c::getPlayCountCoinBattle | ( | int | world, |
int | level ) const |
Gets the Coin Battle play count for the given world/level. See mPlayCountCoinBattle.
Definition at line 294 of file d_mj2d_data.cpp.
void dMj2dHeader_c::setPlayCountCoinBattle | ( | int | world, |
int | level, | ||
int | count ) |
Sets the Coin Battle play count for the given world/level. See mPlayCountCoinBattle.
Definition at line 298 of file d_mj2d_data.cpp.
void dMj2dHeader_c::onMultiWorldOpenFlag | ( | int | world | ) |
Unlocks the given world in extra modes.
Definition at line 302 of file d_mj2d_data.cpp.
bool dMj2dHeader_c::isMultiWorldOpenFlag | ( | int | world | ) |
Checks if the given world is unlocked in extra modes.
Definition at line 306 of file d_mj2d_data.cpp.
|
private |
Ensures that the save's major revision number matches the current one.
If the revision number does not match, the header data is reset.
Definition at line 310 of file d_mj2d_data.cpp.
|
private |
Sets the last used save data slot.
Definition at line 282 of file d_mj2d_data.cpp.
|
private |
The savegame magic. See SAVE_MAGIC.
Definition at line 72 of file d_mj2d_data.hpp.
|
private |
The save revision numbers. See SAVE_REVISION_MAJOR and SAVE_REVISION_MINOR.
Definition at line 73 of file d_mj2d_data.hpp.
|
private |
The last selected save data slot.
Definition at line 75 of file d_mj2d_data.hpp.
|
private |
[Unused]. Padding.
Definition at line 76 of file d_mj2d_data.hpp.
|
private |
The play count of each level in Free Mode.
Definition at line 77 of file d_mj2d_data.hpp.
|
private |
The play count of each level in Coin Battle.
Definition at line 78 of file d_mj2d_data.hpp.
|
private |
The worlds unlocked in Extra Modes.
Definition at line 79 of file d_mj2d_data.hpp.
|
private |
[Unused]. Padding.
Definition at line 80 of file d_mj2d_data.hpp.
|
private |
The CRC32 checksum of the above data (excluding mMagic).
Definition at line 82 of file d_mj2d_data.hpp.