![]() |
Super Mario 64 Source
A Super Mario 64 decompilation, brought to you by a bunch of clever folks.
|
Go to the source code of this file.
Data Structures | |
struct | SaveBlockSignature |
struct | SaveFile |
struct | MainMenuSaveData |
struct | SaveBuffer |
struct | WarpCheckpoint |
Macros | |
#define | EEPROM_SIZE 0x200 |
#define | NUM_SAVE_FILES 4 |
#define | SUBTRAHEND 6 |
#define | SAVE_FLAG_FILE_EXISTS /* 0x000001 */ (1 << 0) |
#define | SAVE_FLAG_HAVE_WING_CAP /* 0x000002 */ (1 << 1) |
#define | SAVE_FLAG_HAVE_METAL_CAP /* 0x000004 */ (1 << 2) |
#define | SAVE_FLAG_HAVE_VANISH_CAP /* 0x000008 */ (1 << 3) |
#define | SAVE_FLAG_HAVE_KEY_1 /* 0x000010 */ (1 << 4) |
#define | SAVE_FLAG_HAVE_KEY_2 /* 0x000020 */ (1 << 5) |
#define | SAVE_FLAG_UNLOCKED_BASEMENT_DOOR /* 0x000040 */ (1 << 6) |
#define | SAVE_FLAG_UNLOCKED_UPSTAIRS_DOOR /* 0x000080 */ (1 << 7) |
#define | SAVE_FLAG_DDD_MOVED_BACK /* 0x000100 */ (1 << 8) |
#define | SAVE_FLAG_MOAT_DRAINED /* 0x000200 */ (1 << 9) |
#define | SAVE_FLAG_UNLOCKED_PSS_DOOR /* 0x000400 */ (1 << 10) |
#define | SAVE_FLAG_UNLOCKED_WF_DOOR /* 0x000800 */ (1 << 11) |
#define | SAVE_FLAG_UNLOCKED_CCM_DOOR /* 0x001000 */ (1 << 12) |
#define | SAVE_FLAG_UNLOCKED_JRB_DOOR /* 0x002000 */ (1 << 13) |
#define | SAVE_FLAG_UNLOCKED_BITDW_DOOR /* 0x004000 */ (1 << 14) |
#define | SAVE_FLAG_UNLOCKED_BITFS_DOOR /* 0x008000 */ (1 << 15) |
#define | SAVE_FLAG_CAP_ON_GROUND /* 0x010000 */ (1 << 16) |
#define | SAVE_FLAG_CAP_ON_KLEPTO /* 0x020000 */ (1 << 17) |
#define | SAVE_FLAG_CAP_ON_UKIKI /* 0x040000 */ (1 << 18) |
#define | SAVE_FLAG_CAP_ON_MR_BLIZZARD /* 0x080000 */ (1 << 19) |
#define | SAVE_FLAG_UNLOCKED_50_STAR_DOOR /* 0x100000 */ (1 << 20) |
Functions | |
void | save_file_do_save (s32 fileIndex) |
void | save_file_erase (s32 fileIndex) |
void | save_file_copy (s32 srcFileIndex, s32 destFileIndex) |
void | save_file_load_all (void) |
void | save_file_reload (void) |
Reload the current save file from its backup copy, which is effectively a a cached copy of what has been written to EEPROM. More... | |
void | save_file_collect_star_or_key (s16 coinScore, s16 starIndex) |
Update the current save file after collecting a star or a key. More... | |
s32 | save_file_exists (s32 fileIndex) |
u32 | save_file_get_max_coin_score (s32 courseIndex) |
Get the maximum coin score across all files for a course. More... | |
s32 | save_file_get_course_star_count (s32 fileIndex, s32 courseIndex) |
s32 | save_file_get_total_star_count (s32 fileIndex, s32 minCourse, s32 maxCourse) |
void | save_file_set_flags (s32 flags) |
void | save_file_clear_flags (s32 flags) |
s32 | save_file_get_flags (void) |
s32 | save_file_get_star_flags (s32 fileIndex, s32 courseIndex) |
Return the bitset of obtained stars in the specified course. More... | |
void | save_file_set_star_flags (s32 fileIndex, s32 courseIndex, s32 starFlags) |
Add to the bitset of obtained stars in the specified course. More... | |
s32 | save_file_get_course_coin_score (s32 fileIndex, s32 courseIndex) |
s32 | save_file_is_cannon_unlocked (void) |
Return TRUE if the cannon is unlocked in the current course. More... | |
void | save_file_set_cannon_unlocked (void) |
Sets the cannon status to unlocked in the current course. More... | |
void | save_file_set_cap_pos (s16 x, s16 y, s16 z) |
s32 | save_file_get_cap_pos (Vec3s capPos) |
void | save_file_set_sound_mode (u16 mode) |
u16 | save_file_get_sound_mode (void) |
void | save_file_move_cap_to_default_location (void) |
void | disable_warp_checkpoint (void) |
void | check_if_should_set_warp_checkpoint (struct WarpNode *a) |
Checks the upper bit of the WarpNode->destLevel byte to see if the game should set a warp checkpoint. More... | |
s32 | check_warp_checkpoint (struct WarpNode *a) |
Checks to see if a checkpoint is properly active or not. More... | |
#define EEPROM_SIZE 0x200 |
#define NUM_SAVE_FILES 4 |
#define SAVE_FLAG_CAP_ON_GROUND /* 0x010000 */ (1 << 16) |
#define SAVE_FLAG_CAP_ON_KLEPTO /* 0x020000 */ (1 << 17) |
#define SAVE_FLAG_CAP_ON_MR_BLIZZARD /* 0x080000 */ (1 << 19) |
#define SAVE_FLAG_CAP_ON_UKIKI /* 0x040000 */ (1 << 18) |
#define SAVE_FLAG_DDD_MOVED_BACK /* 0x000100 */ (1 << 8) |
#define SAVE_FLAG_FILE_EXISTS /* 0x000001 */ (1 << 0) |
#define SAVE_FLAG_HAVE_KEY_1 /* 0x000010 */ (1 << 4) |
#define SAVE_FLAG_HAVE_KEY_2 /* 0x000020 */ (1 << 5) |
#define SAVE_FLAG_HAVE_METAL_CAP /* 0x000004 */ (1 << 2) |
#define SAVE_FLAG_HAVE_VANISH_CAP /* 0x000008 */ (1 << 3) |
#define SAVE_FLAG_HAVE_WING_CAP /* 0x000002 */ (1 << 1) |
#define SAVE_FLAG_MOAT_DRAINED /* 0x000200 */ (1 << 9) |
#define SAVE_FLAG_UNLOCKED_50_STAR_DOOR /* 0x100000 */ (1 << 20) |
#define SAVE_FLAG_UNLOCKED_BASEMENT_DOOR /* 0x000040 */ (1 << 6) |
#define SAVE_FLAG_UNLOCKED_BITDW_DOOR /* 0x004000 */ (1 << 14) |
#define SAVE_FLAG_UNLOCKED_BITFS_DOOR /* 0x008000 */ (1 << 15) |
#define SAVE_FLAG_UNLOCKED_CCM_DOOR /* 0x001000 */ (1 << 12) |
#define SAVE_FLAG_UNLOCKED_JRB_DOOR /* 0x002000 */ (1 << 13) |
#define SAVE_FLAG_UNLOCKED_PSS_DOOR /* 0x000400 */ (1 << 10) |
#define SAVE_FLAG_UNLOCKED_UPSTAIRS_DOOR /* 0x000080 */ (1 << 7) |
#define SAVE_FLAG_UNLOCKED_WF_DOOR /* 0x000800 */ (1 << 11) |
#define SUBTRAHEND 6 |
Checks the upper bit of the WarpNode->destLevel byte to see if the game should set a warp checkpoint.
Update the current save file after collecting a star or a key.
If coin score is greater than the current high score, update it.
Compares the coin score as a 16 bit value, but only writes the 8 bit
Get the maximum coin score across all files for a course.
The lower 16 bits of the returned value are the score, and the upper 16 bits are the file number of the save file with this score.
Return the bitset of obtained stars in the specified course.
If course is -1, return the bitset of obtained castle secret stars.
Return TRUE if the cannon is unlocked in the current course.
Reload the current save file from its backup copy, which is effectively a a cached copy of what has been written to EEPROM.
This is used after getting a game over.
Sets the cannon status to unlocked in the current course.
Add to the bitset of obtained stars in the specified course.
If course is -1, add ot the bitset of obtained castle secret stars.
u8 gCurrCourseStarFlags |
u8 gGotFileCoinHiScore |
u8 gLastCompletedCourseNum |
u8 gLastCompletedStarNum |
s8 gLevelToCourseNumTable[] |
s8 gMainMenuDataModified |
s8 gSaveFileModified |
u8 gSpecialTripleJump |
struct WarpCheckpoint gWarpCheckpoint |
s8 sUnusedGotGlobalCoinHiScore |