forked from BluRosie/hg-engine
-
Notifications
You must be signed in to change notification settings - Fork 1
/
bytereplacement
436 lines (354 loc) · 9.85 KB
/
bytereplacement
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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
#include "include/config.h"
#include "include/debug.h"
#include "include/constants/moves.h"
#include "include/constants/save.h"
# damage calc hook setup
# push {r5-r6}
# nop
0012 0801F738 60 B4 C0 46
# CalcAccuracy hook setup
# 0224BCC4
0012 0224BCC4 60 B4 C0 46
# CalcSpeed hook setup
# 0224FC48
0012 08018388 60 B4 C0 46
# CalcCritical hook setup
# 02257C5C
0012 0802039C 60 B4 C0 46
# MoldBreakerAbilityCheck hook setup
# 02252834
0012 0801AF74 60 B4 C0 46
# PokePasoParaSet hook setup
# 0206DED0
arm9 0806DED0 60 B4 C0 46
# CT_SwitchInMessageParamMake hook setup
# 02261464
0012 08029BA4 60 B4 C0 46
# CT_EncountSendOutMessageParamMake hook setup
# 022615F0
0012 08029D30 60 B4 C0 46
# CantEscape hook setup
0012 02252980 60 B4 C0 46
# expand evolutions to 9 per mon + form evos - GetMonEvolution hook setup
arm9 08070E34 60 B4 C0 46
#updating old moves
#Binding moves 1/8th
# 0224A112
0012 08012852 08
#ifdef ALLOW_SAVE_CHANGES
#ifdef ITEM_POCKET_EXPANSION
# bag expansion
arm9 08078240 60 B4 C0 46
arm9 080782DC 60 B4 C0 46
arm9 08078340 60 B4 C0 46
arm9 08078384 60 B4 C0 46
arm9 08078398 60 B4 C0 46
arm9 080783E0 60 B4 C0 46
arm9 08078410 60 B4 C0 46
arm9 08078434 60 B4 C0 46
arm9 08078480 60 B4 C0 46
arm9 080784B0 60 B4 C0 46
#endif
#endif
# 021F9380
# trying a few things out
0015 08000036 50
0015 08000274 C0 10 00 00
0015 08000BD0 AC
0015 08000C2C AC
0015 08000C84 C0 0E 00 00
0015 08000C8A AC
0015 08000CA2 FF
0015 08000CAA AC
0015 08000CBC FF
0015 080060BE AC
0015 080060DE AC
0015 080060FA AC
0015 080061B6 AC
0015 08006E40 C0 0E 00 00
# GiveMon hook setup
arm9 080541DC 60 B4 C0 46
# AddWildPartyPokemon hook setup
0002 080029DC 60 B4 C0 46
# NNSi_SndArcLoadBank_hook setup - it's an arm function
# push {r5-r6}
arm9 020CA054 60 00 2D E9
# expand move tutor heap
arm9 0203DFF4 8A 02
# pokewalker species limiters
0112 021ED63C FF 7F 00 00
0112 021ED668 FF 7F 00 00
0112 021EFB10 FF 7F 00 00
0112 021F126C FF 7F 00 00
0112 021F323C FF 7F 00 00
#ifdef IMPLEMENT_WILD_DOUBLE_BATTLES
# WildEnc water or something idk
0002 022474E0 60 B4 C0 46
#else
# undo wild doubles--restore the vanilla code
0002 02247424 00 B5 83 B0 00 20 00 90
0002 022474E0 18 B5 83 B0 07 9C 00 2C 09 D0 01 23
0002 02248284 0B 20 00 21 09 F6 26 FB
0012 022607BC 4A 28 0C D1 38 1C 02 21
0012 0226328E 00 21 04 A8 41 70 81 70 C1 70
0008 02222CBC 22 30 00 78 01 28 0C D1
#endif
#ifndef IMPLEMENT_CAPTURE_EXPERIENCE
# undo capture experience
0012 0224688A A0 68 07 21 EC F7 67 FB 00 28
0012 022463A0 5E 20 61 68 00 22 80 00
#endif
# ServerDoTypeCalcMod hook setup
0012 02251D28 60 B4 C0 46
# AITypeCalc hook setup
0012 02252054 60 B4 C0 46
# fix fire fang glitch - change 273 to 272 to properly check shadow force's effect
0012 0225848C 10
# make stat colors clearer
arm9 0208C848 00 03 04 00 00 05 06 00
#ifndef IMPLEMENT_NEW_EV_IV_VIEWER
# revert hooks done by above
arm9 02088B60 20 21 DC 6C 26 1C 0E 42
arm9 0208D2C4 78 21 03 23 FF F7 D8 FA
#endif
#ifndef IMPLEMENT_LEVEL_CAP
# revert IMPLEMENT_LEVEL_CAP hooks
0012 02245A28 28 F6 8A FD 64 28 00 D1
arm9 02070DB4 38 B5 82 B0 05 21 00 22
arm9 0208FEEA 64 28 05 D2 20 1C 8A F7 0C FE
#endif
# expand move relearner dedicated heap
0068 08000002 12
# make the poison check always fail to disable poison in the overworld
#ifdef UPDATE_OVERWORLD_POISON
arm9 02054474 00
#else
arm9 02054474 88
#endif
# fix encore to 3 turns
0012 02240C66 03 20
# fix disable to 4 turns
0012 0224099A 04 20
# cap total fury cutter damage increases to 3 total turns
# SBA_RESET_FURY_CUTTER handles resetting outside of using fury cutter
0012 02241F2E 03
# expand dex digits from 3 to 4
# summary screen
arm9 0208CDE8 04
# pc screen
0014 021F51E6 04
# dex various
0018 021E6C44 04
0018 021EE796 04
0018 021EEC74 04
0018 021F8D50 04
# expand metronome movepool
0012 022408F8 NUM_OF_MOVES
# pass PartyPokemon to ModifyStatByNature for recalculating PartyPokemon stats
arm9 0206E3C6 00 00 00 00
arm9 0206E406 00 00 00 00
arm9 0206E446 00 00 00 00
arm9 0206E486 00 00 00 00
arm9 0206E4C6 00 00 00 00
#ifdef ALLOW_SAVE_CHANGES
#ifdef EXPAND_PC_BOXES
# save expansion
arm9 020277BC 60 B4 C0 46
arm9 020279E8 OFFSET_sectorCleanFlag
arm9 02027CE8 OFFSET_lastGoodSector
arm9 02027E2C OFFSET_saveSlotSpecs
arm9 02027EEC 00 00 00 00
arm9 02027F92 SAVE_PAGE_MAX
arm9 02027FAE DYNAMIC_REGION_BYTEWIDE_SIZE
arm9 02028098 OFFSET_lastGoodSaveNo
arm9 0202822C OFFSET_lastGoodSaveSlot
arm9 020284A0 OFFSET_lastGoodSaveSlot
arm9 020F62AC FULL_SAVE_SIZE
arm9 020F62BC NEW_HEAP3_SIZE
arm9 020277D8 DYNAMIC_REGION_BYTEWIDE_SIZE
arm9 020277E4 DYNAMIC_REGION_BYTEWIDE_SIZE
arm9 020277F0 DYNAMIC_REGION_BYTEWIDE_SIZE
arm9 02027828 DYNAMIC_REGION_BYTEWIDE_SIZE
arm9 02027EE4 DYNAMIC_REGION_BYTEWIDE_SIZE
arm9 020F6468 SAVE_PAGE_MAX
arm9 020F6478 SAVE_PAGE_MAX_3
arm9 020F6488 SAVE_PAGE_MAX_4
arm9 020F6498 SAVE_PAGE_MAX_6
arm9 020F64A8 SAVE_PAGE_MAX_8
arm9 020F64B8 SAVE_PAGE_MAX_10
#pc box expansion
arm9 02073C6C 60 B4 C0 46
arm9 02073CC0 60 B4 C0 46
arm9 02074014 60 B4 C0 46
arm9 0202716C NUM_PC_BOXES
0014 021F0298 NUM_PC_BOXES_MINUS_ONE
0014 021F031C NUM_PC_BOXES_MINUS_ONE
0014 021F1016 NUM_PC_BOXES
0014 021F101A NUM_PC_BOXES
0014 021F101E NUM_PC_BOXES
0014 021F49D8 NUM_PC_BOXES
0014 021F6D74 NUM_PC_BOXES
0014 021F6DD2 NUM_PC_BOXES_MINUS_ONE
0014 021F720C NUM_PC_BOXES
0014 021F726A NUM_PC_BOXES_MINUS_ONE
0014 021F7760 NUM_PC_BOXES
0014 021F77BE NUM_PC_BOXES_MINUS_ONE
0014 021F6DD2 NUM_PC_BOXES_MINUS_ONE
0014 021F726A NUM_PC_BOXES_MINUS_ONE
0014 021F77BE NUM_PC_BOXES_MINUS_ONE
# for the poké ball message
0008 02222D48 NUM_PC_BOXES
# for the safari zone encounter
arm9 02050E7C NUM_PC_BOXES
# additional safari zone encounter PA is over
0012 02245314 NUM_PC_BOXES
# new heap size
#0014 080056E6 04
# new substruct size
0014 021EB0D8 E0 00 01 00
# repoint all 40C8 to 88E0
0014 021F49C4 E0 88 00 00
0014 021F4A1C E0 88 00 00
0014 021F4A60 E0 88 00 00
#endif
#endif
#ifndef EXPAND_PC_BOXES
# restore all these byte sequences we just wrote lol
arm9 020277BC DA 00 89 18 4A 68 02 49
arm9 020279E8 08 33 02 00
arm9 02027CE8 0A 33 02 00
arm9 02027E2C B4 32 02 00
arm9 02027EEC FD F7 16 FB
arm9 02027F92 23
arm9 02027FAE 23
arm9 02028098 F4 32 02 00
arm9 0202822C F0 32 02 00
arm9 020284A0 F0 32 02 00
arm9 020F62AC 00 36 02 00
arm9 020F62BC 00 D0 11 00
arm9 020277D8 23
arm9 020277E4 23
arm9 020277F0 23
arm9 02027828 23
arm9 02027EE4 23
arm9 020F6468 23
arm9 020F6478 26
arm9 020F6488 27
arm9 020F6498 29
arm9 020F64A8 2B
arm9 020F64B8 2D
#pc box expansion
arm9 02073C6C F8 B5 1F 1C 05 1C 38 1C 0C 1C 16 1C
arm9 02073CC0 F0 B5 A3 B0 0C 1C 21 03 9C 46 00 90
arm9 02074014 F8 B5 0C 1C 05 1C 16 1C 1F 1C 12 2C
arm9 0202716C 12
0014 021F0298 11
0014 021F031C 11
0014 021F1016 12
0014 021F101A 12
0014 021F101E 12
0014 021F49D8 12
0014 021F6D74 12
0014 021F6DD2 11
0014 021F720C 12
0014 021F726A 11
0014 021F7760 12
0014 021F77BE 11
0014 021F6DD2 11
0014 021F726A 11
0014 021F77BE 11
0008 02222D48 12
arm9 02050E7C 12
0012 02245314 12
# new heap size
#0014 080056E6 04
# new substruct size
0014 021EB0D8 E0 88 00 00
# repoint all 40C8 to 88E0
0014 021F49C4 C8 40 00 00
0014 021F4A1C C8 40 00 00
0014 021F4A60 C8 40 00 00
# now undo the hooks
# save expansion
arm9 020271B0 38 B5 82 B0 38 49 01 20
arm9 020272C8 38 B5 0C 1C 05 1C 2A 2C
arm9 020272F4 F8 B5 01 21 00 90 03 20
arm9 020273F0 10 B5 04 1C 20 68 00 28
arm9 0202746C 38 B5 0C 1C 05 1C 02 2C
arm9 020274A8 02 1C 01 21 05 48 91 60
arm9 02027550 0A 1C 02 49 02 4B 41 18
arm9 02027564 38 B5 0D 49 05 1C 6A 58
arm9 020275A4 01 49 02 4B 41 18 18 47
arm9 020275F4 38 B5 08 4B C3 18 0C 20
arm9 0202761C F8 B5 82 B0 18 4C 03 1C
arm9 020276C0 F8 B5 0F 4B 06 1C 17 1C
arm9 020277C0 4A 68 02 49 42 50 02 49
arm9 02027AD4 F8 B5 05 1C 20 48 2F 1C
arm9 02027B74 70 B5 0B 1C 0B 49 05 1C
arm9 02027BAC 70 B5 06 1C 09 48 33 18
arm9 02027BDC 38 B5 05 1C 0C 1C 04 F0
arm9 02027CEC 38 B5 1A 4B 04 1C 00 25
arm9 02027EFC F8 B5 82 B0 00 90 00 20
arm9 02028968 F8 B5 0C 1C 61 69 06 1C
arm9 02028AB4 78 B5 81 B0 0C 1C 05 1C
arm9 02028BA8 F8 B5 0C 1C 17 1C 05 1C
arm9 02028BF8 F0 B5 85 B0 00 90 0D 1C
arm9 02028C70 10 B5 04 1C FE F7 7C FA
arm9 02028C9C 70 B5 05 1C 00 24 FE F7
arm9 02028CD4 F8 B5 05 1C 0E 1C 00 24
#pc box expansion
arm9 02073B20 00 48 70 47 FC 22 01 00
arm9 02073B28 F8 B5 00 90 00 27 06 1C
arm9 02073BB8 F8 B5 05 1C 12 20 00 03
arm9 02073BFC F0 B5 83 B0 00 90 10 1C
arm9 02073C70 05 1C 38 1C 0C 1C 16 1C
arm9 02073CC4 0C 1C 21 03 9C 46 00 90
arm9 02073D10 38 B5 05 1C 00 20 0C 1C
arm9 02073D4C 12 21 09 03 40 58 70 47
arm9 02073D54 F8 B5 12 21 09 03 46 58
arm9 02073D9C F8 B5 0E 1C 07 1C 00 20
arm9 02073DFC F8 B5 82 B0 00 26 00 90
arm9 02073E40 F8 B5 07 1C 00 20 0D 1C
arm9 02073E84 08 B5 12 29 03 D2 12 22
arm9 02073E98 08 B5 12 29 03 D2 41 18
arm9 02073EB4 10 28 03 D3 20 28 03 D3
arm9 02073EC8 70 B5 05 1C 00 20 0C 1C
arm9 02073F00 08 B5 03 1C 00 20 C0 43
arm9 02073F34 08 B5 03 1C 00 20 C0 43
arm9 02073F64 F8 B5 00 22 D2 43 91 42
arm9 02073FA8 F8 B5 00 22 D2 43 91 42
arm9 02073FF8 70 B5 00 25 06 1C 2C 1C
arm9 02074018 05 1C 16 1C 1F 1C 12 2C
arm9 02074058 70 B5 0C 1C 05 1C 16 1C
arm9 02074094 38 B5 0C 1C 05 1C 08 2C
arm9 020740B4 38 B5 0C 1C 05 1C 08 2C
arm9 020740D8 10 B5 12 29 02 D3 B1 F7
arm9 020740F8 01 4A 02 49 42 50 70 47
arm9 02074108 01 49 00 22 42 50 70 47
arm9 02074114 01 49 40 58 70 47 C0 46
arm9 02074128 F8 B5 82 B0 00 90 00 20
#endif
# SetFixedWildEncounter_hook setup
0002 022480C0 60 B4 C0 46
# expand allowed terrain platforms
0012 02265FEE FF
# BattleSystem_CheckMoveEffect_hook setup
0012 0224C018 60 B4 C0 46
#ifdef DEBUG_ALWAYS_OBEY
0012 0224AED0 00 20 70 47
#endif
# Fix Hidden Power to 60 BP (change +30 instruction to =60)
0012 022424DC 3C 20
# StruggleCheck_hook setup
0012 022517EC 60 B4 C0 46
# ov12_02251A28_hook setup
0012 02251A28 60 B4 C0 46
# CanUseItemOnMonInParty hook setup
arm9 020902B8 60 B4 C0 46
# normal as a second type should show up in the dex/pc
0018 021F21AE C0 46
0014 021F3DB0 C0 46
#ifndef IMPLEMENT_REUSABLE_REPELS
0002 0224BAE4 10 B5 0C 1C E1 F5 6C FF
0015 021F993C 10 B5 0C 1C FF F7 F4 FF
#endif