Mario Kart 64
save_data.h
Go to the documentation of this file.
1 #ifndef SAVE_DATA_H
2 #define SAVE_DATA_H
3 
4 #include "common_structs.h"
5 
6 typedef struct {
7  // 6 little endian 3-byte records.
8  // When converted to big endian the bottom 5 nibbles can be interpreted as the centisecond count for that record.
9  // The top nibble is the character ID of the charcter used to set that record
10  // The first 5 records are the top 5 3-lap records
11  // The 6th record is the best 1-lap record
12  u8 records[6][3];
13  // It's unknown what these bytes are used for
14  // Byte 1 might be an indicator that there is a ghost available for that course
15  u8 unknownBytes[5];
17 } CourseTimeTrialRecords; // size = 0x18
18 
19 typedef struct {
20  // Each cup is made up of 4 courses
21  CourseTimeTrialRecords courseRecords[4];
22 } CupTimeTrialRecords; // size = 0x60
23 
24 typedef struct {
25  // There are 4 cups total
26  CupTimeTrialRecords cupRecords[4];
27 } AllCourseTimeTrialRecords; // size = 0x180
28 
29 typedef struct {
30  // Records 0 through 3 are for the first cup's courses
31  // Records 4 through 7 are for the second cup's courses
32  u8 bestThreelaps[8][3];
33  u8 bestSinglelaps[8][3];
34  // It's unknown what these bytes are used for
35  u8 unknownBytes[8];
36 } OnlyBestTimeTrialRecords; // size = 0x38
37 
38 typedef struct {
39  // GP Points scored for each CC mode
40  // 1st place is 3 points, 2nd is 2, etc.
41  // Lowest dibit is the Mushroom Cup, 2nd dibit is the Flower Cup, etc
42  u8 grandPrixPoints[4];
44  // It's unknown what the first byte is used for
45  u8 checksum[3];
46 } Stuff; // size = 0x8
47 
48 typedef struct {
50  /* 0x180 */ Stuff main;
57  /* 0x188 */ OnlyBestTimeTrialRecords onlyBestTimeTrialRecords[2];
63  /* 0x1F8 */ Stuff backup;
64 } SaveData; // size = 0x200
65 
66 extern SaveData gSaveData;
67 
68 #endif
SaveData gSaveData
Definition: code_80091750.c:113
Definition: save_data.h:24
Definition: save_data.h:6
u8 checksum
Definition: save_data.h:16
Definition: save_data.h:19
Definition: save_data.h:29
Definition: save_data.h:48
Stuff backup
Definition: save_data.h:63
Stuff main
Definition: save_data.h:50
AllCourseTimeTrialRecords allCourseTimeTrialRecords
Definition: save_data.h:49
Definition: save_data.h:38
u8 soundMode
Definition: save_data.h:43
unsigned char u8
Definition: ultratypes.h:12