Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
versioning.h
Go to the documentation of this file.
1#ifndef _VERSIONING_H_
2#define _VERSIONING_H_
3
4#include "common.h"
5
8
9typedef struct SaveGlobals {
10 /* 0x00 */ char magicString[16]; /* "Mario Story 006" string */
11 /* 0x10 */ s8 pad[32]; /* always zero */
12 /* 0x30 */ s32 crc1;
13 /* 0x34 */ s32 crc2;
14 /* 0x38 */ s32 useMonoSound;
15 /* 0x3C */ u32 lastFileSelected;
16 /* 0x40 */ s8 reserved[64]; // unused
17} SaveGlobals; // size = 0x80
18
19typedef struct VanillaSaveFileSummary {
20 /* 0x00 */ s32 timePlayed;
21 /* 0x04 */ u8 spiritsRescued;
22 /* 0x05 */ unsigned char unk_05[1];
23 /* 0x06 */ s8 level;
24 /* 0x07 */ char filename[8];
25 /* 0x0F */ unsigned char unk_0F[9];
26} VanillaSaveFileSummary; // size = 0x18
27
29typedef struct VanillaPartnerData {
30 /* 0x00 */ u8 enabled;
31 /* 0x01 */ s8 level;
32 /* 0x02 */ s16 unk_02[3];
33} VanillaPartnerData; // size = 0x08
34
36typedef struct VanillaPlayerData {
37 /* 0x000 */ s8 bootsLevel;
38 /* 0x001 */ s8 hammerLevel;
39 /* 0x002 */ s8 curHP;
40 /* 0x003 */ s8 curMaxHP;
41 /* 0x004 */ s8 hardMaxHP;
42 /* 0x005 */ s8 curFP;
43 /* 0x006 */ s8 curMaxFP;
44 /* 0x007 */ s8 hardMaxFP;
45 /* 0x008 */ s8 maxBP;
46 /* 0x009 */ s8 level;
47 /* 0x00A */ b8 hasActionCommands;
48 /* 0x00B */ unsigned char pad_00B;
49 /* 0x00C */ s16 coins;
50 /* 0x00E */ s8 fortressKeyCount;
51 /* 0x00F */ u8 starPieces;
52 /* 0x010 */ s8 starPoints;
53 /* 0x011 */ s8 unused_011;
54 /* 0x012 */ s8 curPartner;
55 /* 0x013 */ unsigned char pad_013;
57 /* 0x074 */ s16 keyItems[32];
58 /* 0x0B4 */ s16 badges[128];
59 /* 0x1B4 */ s16 invItems[10];
60 /* 0x1C8 */ s16 storedItems[32];
61 /* 0x208 */ s16 equippedBadges[64];
62 /* 0x288 */ s8 unused_288;
63 /* 0x289 */ s8 merleeSpellType;
64 /* 0x28A */ s8 merleeCastsLeft;
65 /* 0x28B */ unsigned char pad_28B;
66 /* 0x28C */ s16 merleeTurnCount;
67 /* 0x28E */ s8 maxStarPower;
68 /* 0x28F */ unsigned char pad_28F;
69 /* 0x290 */ s16 starPower;
70 /* 0x292 */ s8 starBeamLevel;
71 /* 0x293 */ unsigned char pad_293;
72 /* 0x294 */ u16 actionCommandAttempts;
73 /* 0x296 */ u16 actionCommandSuccesses;
74 /* 0x298 */ u16 hitsTaken;
75 /* 0x29A */ u16 hitsBlocked;
76 /* 0x29C */ u16 playerFirstStrikes;
77 /* 0x29E */ u16 enemyFirstStrikes;
78 /* 0x2A0 */ u16 powerBounces;
79 /* 0x2A2 */ u16 battlesCount;
80 /* 0x2A4 */ u16 battlesWon;
81 /* 0x2A6 */ u16 fleeAttempts;
82 /* 0x2A8 */ u16 battlesFled;
83 /* 0x2AA */ u16 trainingsDone;
84 /* 0x2AC */ s32 walkingStepsTaken;
85 /* 0x2B0 */ s32 runningStepsTaken;
86 /* 0x2B4 */ u32 totalCoinsEarned;
87 /* 0x2B8 */ s16 idleFrameCounter;
88 /* 0x2BA */ unsigned char pad_2BA[2];
89 /* 0x2BC */ u32 frameCounter;
90 /* 0x2C0 */ u16 quizzesAnswered;
91 /* 0x2C2 */ u16 quizzesCorrect;
92 /* 0x2C4 */ s32 partnerUnlockedTime[12];
93 /* 0x2F4 */ s32 partnerUsedTime[12];
94 /* 0x324 */ s32 tradeEventStartTime;
95 /* 0x328 */ s32 droTreeHintTime;
96 /* 0x32C */ u16 starPiecesCollected;
97 /* 0x32E */ u16 jumpGamePlays;
98 /* 0x330 */ u32 jumpGameTotal;
99 /* 0x334 */ u16 jumpGameRecord;
100 /* 0x336 */ u16 smashGamePlays;
101 /* 0x338 */ u32 smashGameTotal;
102 /* 0x33C */ u16 smashGameRecord;
103 /* 0x340 */ unsigned char pad_33E[0xEA];
104} VanillaPlayerData; // size = 0x428
105
107typedef struct VanillaSaveData {
108 /* 0x0000 */ char magicString[16]; /* "Mario Story 006" string */
109 /* 0x0010 */ char version[32]; /* always zero for vanilla saves */
110 /* 0x0030 */ s32 crc1;
111 /* 0x0034 */ s32 crc2;
112 /* 0x0038 */ s32 saveSlot;
113 /* 0x003C */ s32 saveCount;
115 /* 0x0468 */ s16 areaID;
116 /* 0x046A */ s16 mapID;
117 /* 0x046C */ s16 entryID;
118 /* 0x046E */ unsigned char unk_46E[2];
119 /* 0x0470 */ s32 enemyDefeatFlags[60][12];
120 /* 0x0FB0 */ s32 globalFlags[64];
121 /* 0x10B0 */ s8 globalBytes[512];
122 /* 0x12B0 */ s32 areaFlags[8];
123 /* 0x12D0 */ s8 areaBytes[16];
124 /* 0x12E0 */ s8 debugEnemyContact;
125 /* 0x12E0 */ b8 debugUnused1;
126 /* 0x12E0 */ b8 debugUnused2;
127 /* 0x12E0 */ b8 musicEnabled;
128 /* 0x12E4 */ unsigned char unk_12E4[0x2];
129 /* 0x12E6 */ Vec3s savePos;
131 /* 0x1304 */ unsigned char unk_1304[0x7C];
132} VanillaSaveData; // size = 0x1380
133
134typedef struct SaveFileSummary {
135 /* 0x00 */ s32 timePlayed;
136 /* 0x04 */ u8 spiritsRescued;
137 /* 0x05 */ unsigned char unused_05[1];
138 /* 0x06 */ s8 level;
139 /* 0x07 */ char filename[8];
140 /* 0x0F */ unsigned char unused_0F[9];
141} SaveFileSummary; // size = 0x18
142
143typedef struct SaveData {
144 /* 0x0000 */ char magicString[16]; /* "Mario Story 006" string */
145 /* 0x0010 */ char modName[28]; /* always non-null for DX saves */
146 /* 0x002C */ s8 majorVersion;
147 /* 0x002D */ s8 minorVersion;
148 /* 0x002E */ s8 patchVersion;
149 /* 0x002F */ char reserved;
150 /* 0x0030 */ s32 crc1;
151 /* 0x0034 */ s32 crc2;
152 /* 0x0038 */ s32 saveSlot;
153 /* 0x003C */ s32 saveCount;
154 /* 0x0040 */ PlayerData player;
155 /* 0x0468 */ s16 areaID;
156 /* 0x046A */ s16 mapID;
157 /* 0x046C */ s16 entryID;
158 /* 0x046E */ unsigned char unk_46E[2];
159 /* 0x0470 */ s32 enemyDefeatFlags[60][12];
160 /* 0x0FB0 */ s32 globalFlags[64];
161 /* 0x10B0 */ s8 globalBytes[512];
162 /* 0x12B0 */ s32 areaFlags[8];
163 /* 0x12D0 */ s8 areaBytes[16];
164 /* 0x12E0 */ s8 debugEnemyContact;
165 /* 0x12E0 */ b8 debugUnused1;
166 /* 0x12E0 */ b8 debugUnused2;
167 /* 0x12E0 */ b8 musicEnabled;
168 /* 0x12E4 */ unsigned char unk_12E4[0x2];
169 /* 0x12E6 */ Vec3s savePos;
171 /* 0x1304 */ unsigned char unk_1304[0x7C];
172} SaveData; // size = 0x1380
173
175
176typedef struct SaveSlotMetadata {
177 /* 0x00 */ char modName[28]; /* always non-null for DX saves */
178 /* 0x29 */ b8 hasData;
179 /* 0x2A */ b8 validData;
180 /* 0x2B */ unsigned char pad[5];
181} SaveSlotMetadata; // size = 0x18
182
183#endif
s8 b8
unsigned char pad_33E[0xEA]
Definition versioning.h:103
unsigned char unk_0F[9]
Definition versioning.h:25
s8 majorVersion
Definition versioning.h:146
unsigned char unk_46E[2]
Definition versioning.h:118
char reserved
Definition versioning.h:149
char magicString[16]
Definition versioning.h:10
unsigned char unk_1304[0x7C]
Definition versioning.h:131
s32 areaFlags[8]
Definition versioning.h:162
s32 globalFlags[64]
Definition versioning.h:120
s8 pad[32]
Definition versioning.h:11
s8 minorVersion
Definition versioning.h:147
s8 debugEnemyContact
Definition versioning.h:164
char magicString[16]
Definition versioning.h:108
s32 globalFlags[64]
Definition versioning.h:160
char version[32]
Definition versioning.h:109
SaveFileSummary summary
Definition versioning.h:170
s32 enemyDefeatFlags[60][12]
Definition versioning.h:119
s32 useMonoSound
Definition versioning.h:14
unsigned char pad[5]
Definition versioning.h:180
void fio_deserialize_state()
Load game data from gCurrentSaveFile Performs version checking and supports potential migration betwe...
Definition versioning.c:36
VanillaPlayerData player
Definition versioning.h:114
unsigned char pad_293
Definition versioning.h:71
PlayerData player
Definition versioning.h:154
s8 globalBytes[512]
Definition versioning.h:121
VanillaSaveFileSummary summary
Definition versioning.h:130
b8 debugUnused1
Definition versioning.h:165
s8 globalBytes[512]
Definition versioning.h:161
s8 reserved[64]
Definition versioning.h:16
unsigned char unk_05[1]
Definition versioning.h:22
unsigned char pad_28F
Definition versioning.h:68
SaveData gCurrentSaveFile
Definition fio.c:21
char modName[28]
Definition versioning.h:145
char magicString[16]
Definition versioning.h:144
s32 enemyDefeatFlags[60][12]
Definition versioning.h:159
s32 saveSlot
Definition versioning.h:152
s16 equippedBadges[64]
Definition versioning.h:61
s32 saveCount
Definition versioning.h:153
b8 debugUnused2
Definition versioning.h:166
VanillaPartnerData partners[12]
Definition versioning.h:56
unsigned char unused_0F[9]
Definition versioning.h:140
Vec3s savePos
Definition versioning.h:169
s32 partnerUnlockedTime[12]
Definition versioning.h:92
unsigned char pad_28B
Definition versioning.h:65
s16 entryID
Definition versioning.h:157
u32 lastFileSelected
Definition versioning.h:15
unsigned char unk_12E4[0x2]
Definition versioning.h:128
unsigned char unk_46E[2]
Definition versioning.h:158
s16 storedItems[32]
Definition versioning.h:60
s8 areaBytes[16]
Definition versioning.h:163
unsigned char pad_013
Definition versioning.h:55
b8 musicEnabled
Definition versioning.h:167
unsigned char unused_05[1]
Definition versioning.h:137
s32 partnerUsedTime[12]
Definition versioning.h:93
unsigned char pad_2BA[2]
Definition versioning.h:88
void fio_serialize_state()
Store current game data to gCurrentSaveFile.
Definition versioning.c:9
s8 patchVersion
Definition versioning.h:148
unsigned char unk_12E4[0x2]
Definition versioning.h:168
unsigned char unk_1304[0x7C]
Definition versioning.h:171
unsigned char pad_00B
Definition versioning.h:48
PartnerData struct from unmodified Paper Mario.
Definition versioning.h:29
PlayerData struct from unmodified Paper Mario.
Definition versioning.h:36
SaveData struct from unmodified Paper Mario.
Definition versioning.h:107