-
Notifications
You must be signed in to change notification settings - Fork 1
/
sram.asm
221 lines (166 loc) · 5.2 KB
/
sram.asm
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
SECTION "Scratch", SRAM
UNION
sScratch:: ds $600
NEXTU
sEnemyFrontPicTileCount:: db
sPaddedEnemyFrontPic:: ds 7 * 7 tiles
ENDU
SECTION "SRAM Bank 0", SRAM
sPartyMail::
sPartyMon1Mail:: mailmsg sPartyMon1Mail
sPartyMon2Mail:: mailmsg sPartyMon2Mail
sPartyMon3Mail:: mailmsg sPartyMon3Mail
sPartyMon4Mail:: mailmsg sPartyMon4Mail
sPartyMon5Mail:: mailmsg sPartyMon5Mail
sPartyMon6Mail:: mailmsg sPartyMon6Mail
sPartyMailBackup::
sPartyMon1MailBackup:: mailmsg sPartyMon1MailBackup
sPartyMon2MailBackup:: mailmsg sPartyMon2MailBackup
sPartyMon3MailBackup:: mailmsg sPartyMon3MailBackup
sPartyMon4MailBackup:: mailmsg sPartyMon4MailBackup
sPartyMon5MailBackup:: mailmsg sPartyMon5MailBackup
sPartyMon6MailBackup:: mailmsg sPartyMon6MailBackup
sMailboxCount:: db
sMailbox::
for x, 1, MAILBOX_CAPACITY + 1
sMailbox{d:x}:: mailmsg sMailbox{d:x}
endr
sMailboxCountBackup:: db
sMailboxBackup::
for x, 1, MAILBOX_CAPACITY + 1
sMailbox{d:x}Backup:: mailmsg sMailbox{d:x}Backup
endr
sMysteryGiftItem:: db
sMysteryGiftUnlocked:: db
sBackupMysteryGiftItem:: db
sNumDailyMysteryGiftPartnerIDs:: db
sDailyMysteryGiftPartnerIDs:: ds 5 * 2 ; maximum 5 per day, 2 bytes per ID
sMysteryGiftDecorationsReceived:: flag_array NUM_NON_TROPHY_DECOS
ds 4
sMysteryGiftTimer:: db
sMysteryGiftTimerStartDay:: db
ds 1
sMysteryGiftTrainerHouseFlag:: db
sMysteryGiftPartnerName:: ds NAME_LENGTH
s0_ac09:: ds 1
sMysteryGiftTrainer:: ds (1 + 1 + NUM_MOVES) * PARTY_LENGTH + 2
sBackupMysteryGiftItemEnd::
sRTCStatusFlags:: ds 8
sLuckyNumberDay:: db
sLuckyIDNumber:: dw
SECTION "Saved special mons", SRAM
sSavedChatot:: box_struct sSavedChatot
sSavedChatotName:: ds MON_NAME_LENGTH
sSavedUnown:: box_struct sSavedUnown
sSavedUnownName:: ds MON_NAME_LENGTH
sSavedSpecialMonsChecksum:: dw
SECTION "Saved 16-bit conversion tables", SRAM
sConversionTables::
sPokemonIndexTable:: ds wPokemonIndexTableEnd - wPokemonIndexTable
sMoveIndexTable:: ds wMoveIndexTableEnd - wMoveIndexTable
sConversionTablesEnd::
SECTION "Save", SRAM
sOptions:: ds wOptionsEnd - wOptions
sCheckValue1:: db ; loaded with SAVE_CHECK_VALUE_1, used to check save corruption
sSaveData::
sGameData::
sPlayerData:: ds wPlayerDataEnd - wPlayerData
sCurMapData:: ds wCurMapDataEnd - wCurMapData
sPokemonData:: ds wPokemonDataEnd - wPokemonData
sGameDataEnd::
sConversionTableChecksum:: dw
sSaveDataEnd::
sChecksum:: dw
sCheckValue2:: db ; loaded with SAVE_CHECK_VALUE_2, used to check save corruption
SECTION "Active Box", SRAM
sBox:: box sBox
SECTION "Link Battle Data", SRAM
sLinkBattleResults:: ds $c
sLinkBattleStats::
sLinkBattleWins:: dw
sLinkBattleLosses:: dw
sLinkBattleDraws:: dw
sLinkBattleRecord::
sLinkBattleRecord1:: link_battle_record sLinkBattleRecord1
sLinkBattleRecord2:: link_battle_record sLinkBattleRecord2
sLinkBattleRecord3:: link_battle_record sLinkBattleRecord3
sLinkBattleRecord4:: link_battle_record sLinkBattleRecord4
sLinkBattleRecord5:: link_battle_record sLinkBattleRecord5
sLinkBattleStatsEnd::
SECTION "SRAM Hall of Fame", SRAM
sHallOfFame::
for x, 1, NUM_HOF_TEAMS + 1
sHallOfFame{d:x}:: hall_of_fame sHallOfFame{d:x}
endr
sHallOfFameEnd::
SECTION "SRAM Crystal Data", SRAM
sMobileEventIndex:: db
sCrystalData:: ds wCrystalDataEnd - wCrystalData
sMobileEventIndexBackup:: db
SECTION "SRAM Battle Tower", SRAM
; Battle Tower data must be in SRAM because you can save and leave between battles
sBattleTowerChallengeState::
; 0: normal
; 2: battle tower
db
sBattleTower::
sNrOfBeatenBattleTowerTrainers:: db
sBTChoiceOfLevelGroup:: db
; Battle Tower trainers are saved here, so nobody appears more than once
sBTTrainers:: ds BATTLETOWER_STREAK_LENGTH
sBattleTowerSaveFileFlags:: db
sBattleTowerReward:: db
; team of previous trainer
sBTMonOfTrainers::
sBTMonPrevTrainer1:: dw
sBTMonPrevTrainer2:: dw
sBTMonPrevTrainer3:: dw
; team of preprevious trainer
sBTMonPrevPrevTrainer1:: dw
sBTMonPrevPrevTrainer2:: dw
sBTMonPrevPrevTrainer3:: dw
sBTPartySelection:: ds 3
SECTION "Boxes 1-7", SRAM
sBox1:: box sBox1
sBox2:: box sBox2
sBox3:: box sBox3
sBox4:: box sBox4
sBox5:: box sBox5
sBox6:: box sBox6
sBox7:: box sBox7
sBox1PokemonIndexes:: ds 2 * MONS_PER_BOX
sBox2PokemonIndexes:: ds 2 * MONS_PER_BOX
sBox3PokemonIndexes:: ds 2 * MONS_PER_BOX
sBox4PokemonIndexes:: ds 2 * MONS_PER_BOX
sBox5PokemonIndexes:: ds 2 * MONS_PER_BOX
sBox6PokemonIndexes:: ds 2 * MONS_PER_BOX
sBox7PokemonIndexes:: ds 2 * MONS_PER_BOX
SECTION "Boxes 8-14", SRAM
sBox8:: box sBox8
sBox9:: box sBox9
sBox10:: box sBox10
sBox11:: box sBox11
sBox12:: box sBox12
sBox13:: box sBox13
sBox14:: box sBox14
sBox8PokemonIndexes:: ds 2 * MONS_PER_BOX
sBox9PokemonIndexes:: ds 2 * MONS_PER_BOX
sBox10PokemonIndexes:: ds 2 * MONS_PER_BOX
sBox11PokemonIndexes:: ds 2 * MONS_PER_BOX
sBox12PokemonIndexes:: ds 2 * MONS_PER_BOX
sBox13PokemonIndexes:: ds 2 * MONS_PER_BOX
sBox14PokemonIndexes:: ds 2 * MONS_PER_BOX
SECTION "Boxes 15-18", SRAM
sBox15:: box sBox15
sBox16:: box sBox16
sBox17:: box sBox17
sBox18:: box sBox18
sBox15PokemonIndexes:: ds 2 * MONS_PER_BOX
sBox16PokemonIndexes:: ds 2 * MONS_PER_BOX
sBox17PokemonIndexes:: ds 2 * MONS_PER_BOX
sBox18PokemonIndexes:: ds 2 * MONS_PER_BOX
SECTION "Boxes 19-20", SRAM
sBox19:: box sBox19
sBox20:: box sBox20
sBox19PokemonIndexes:: ds 2 * MONS_PER_BOX
sBox20PokemonIndexes:: ds 2 * MONS_PER_BOX