-
Notifications
You must be signed in to change notification settings - Fork 2
/
save.h
160 lines (150 loc) · 3.65 KB
/
save.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#pragma once
#include "continuegame.h"
#include "npc.h"
#include "pokemon.h"
#include "roaming_pokemon.h"
#include "types.h"
#include "uncategorized.h"
typedef char string9[9];
typedef char string12[12];
typedef char string21[21];
struct message { string12 text; };
struct sav1
{
struct coords16 camera_position;
struct warpdata location;
struct warpdata saved_warp;
struct warpdata field_14;
u16 field_1C;
u8 unknown_1E[6];
struct warpdata save_warp_2;
u16 some_music_id;
u8 weather_probably;
u8 unknown_2F[1];
u8 flash_used_on_map;
u8 unknown_31[1];
u16 mapdata_idx_plus_1;
u8 num_party_pokemon;
u8 unknown_35[3];
struct pokemon_extended party_pokemon[6];
u32 money_maybe;
u8 pcitems[124];
u32 bag_probably[42];
u8 ghu_2_x3B8[120];
u32 field_430[13];
u8 ghu_1_x464[232];
u8 field_54C[172];
u8 pokemon_flags_1[52];
u8 field_62C[12];
u16 field_638;
u32 field_63A;
u8 field_63E[98];
struct npc_state npc_states[16];
struct rom_npc rom_npcs[64];
u8 field_EE0[64];
u32 field_F20;
u8 field_F24[220];
u16 var_4000[256];
u8 secure_data[256];
struct prev_quest_story questlog[4];
struct message messages[4];
struct npc_state more_messages_maybe[16];
u8 field_2F10[112];
u32 daycare_data;
u8 field_2F84[332];
struct roaming_pokemon_info roaming_pokemon_inf;
u8 field_30EC[28];
u16 engima_berry_data[9];
u8 field_311A[458];
u8 mevent_related_1[332];
u32 field_3430;
u8 mevent_related_2[332];
u8 field_3580[156];
u32 ereader_script;
u8 field_3620[4];
u8 field_3624[1012];
u8 pokemon_flags_2[52];
u8 rivals_name[8];
u8 field_3A54;
u8 unknown_3A55[127];
string21 words[10];
u8 unknown_3BA6[398];
u8 field_3D34[14];
u8 field_3D42[12];
u8 field_3D4E[153];
u8 last_field;
};
// sav2->option_button_style value:
#define L_IS_A 2
struct sav2
{
u8 name[8];
u8 gender;
u8 savebits;
u16 trainerid;
u16 secretid;
u16 playtime_hours;
u8 playtime_minutes;
u8 playtime_seconds;
u8 playtime_frames;
u8 options_button_style;
u8 options_text_speed_maybe;
u8 field_15[7];
u32 first_seen_unown_pid;
u32 first_seen_spinda_pid;
u8 field_24;
u8 unknown_25[3];
u8 pokemon_flags_caught[52];
u8 pokemon_flags_seen[52];
u8 unknown_90[24];
u32 field_A8;
u8 gamecode;
u8 field_AD;
u8 unknown_AE[2];
u8 field_B0[1012];
u8 fourCharacters[4];
u8 field_4A8[1008];
u8 mapdata[600];
u16 field_AF0;
u16 field_AF2;
u16 field_AF4;
u16 field_AF6;
u8 field_AF8[1064];
u32 obfuscation_xor_key;
u8 field_F24[127];
u8 last_byte_in_sav2;
};
struct sav3 {
u8 preferred_box;
u8 unknown_1[3];
u8 unknown_4[33600];
string9 box_names[14];
u8 box_background[14];
};
// 02024588
extern struct sav2 stdsav2;
// 0202552C
extern struct sav1 stdsav1;
// 02029314
extern struct sav3 stdsav3;
extern struct sav1 *sav1i;
extern struct sav2 *sav2i;
extern struct sav3 *sav3i;
// TODO: Correct signatures (instead of (void))
extern u8 flash_timeout_reached_zero; // 03007410
extern void (*flash_read_byte_funcptr)(void); // 03007414
extern void (*flash_c_verify)(void); // 03007418
extern void (*flash_c_write_block)(void); // 0300741C
extern void (*flash_c_ptr_metrics)(void); // 03007420
extern void (*flash_c_fp0)(void); // 03007424
extern u16 word_3007428; // 03007428
extern void (*flash_c_erase_all)(void); // 0300742C
extern void (*flash_c_erase_block)(u8); // 03007430
extern void (*flash_c_f14)(void); // 03007434
void save_serialize_pokemon();
void save_deserialize_pokemon();
void save_serialize_npcs();
void save_deserialize_npcs();
void save_serialize_game();
void save_deserialize_game();
void save_game(u8 mode);