-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathAsmHooks.asm
1902 lines (1737 loc) · 31.8 KB
/
AsmHooks.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
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
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
.thumb
.macro blh to, reg=r3
ldr \reg, =\to
mov lr, \reg
.short 0xf800
.endm
@.global __aeabi_idivmod
@.type __aeabi_idivmod, %function
.global Mod
.type Mod, %function
__aeabi_idivmod:
Mod:
cmp r1, #0
bne ContinueMod
mov r0, #0
bx lr
ContinueMod:
swi 6
mov r0, r1
bx lr
.ltorg
@.global __aeabi_idiv
@.type __aeabi_idiv, %function
.global Div1
.type Div1, %function
__aeabi_idiv:
Div1:
cmp r1, #0
bne ContinueDiv
mov r0, #0
bx lr
ContinueDiv:
swi 6
bx lr
.ltorg
.global CallBreak
.type CallBreak, %function
CallBreak:
mov r11, r11
bx lr
.ltorg
.global DisableMouthFrames_FE6
.type DisableMouthFrames_FE6, %function
DisableMouthFrames_FE6:
push {r4, lr}
ldr r3, [r4, #0x3C]
ldrh r5, [r4, #0x38]
str r5, [sp]
blh 0x8007DE0, r4
ldr r0, [r7]
mov r1, #0x40
ldrh r1, [r0, r1]
cmp r1, #0xFF
bgt NoMouthFrames
blh 0x80080EC @ UpdateFaceTalk
NoMouthFrames:
pop {r4}
pop {r3}
bx r3
.ltorg
.global MaybeChargeAtPlayer
.type MaybeChargeAtPlayer, %function
MaybeChargeAtPlayer:
push {lr}
ldrb r1, [r0]
add r1, #1
strb r1, [r0]
bl MaybeChangeAi2
pop {r0}
bx r0
.ltorg
.equ StatScreenStruct, 0x02003BFC
.global PressSelectFE8Something
.type PressSelectFE8Something, %function
PressSelectFE8Something:
ldr r1,=StatScreenStruct
ldrb r0,[r1]
cmp r0,#0x0 @stat screen
bne NotStatScreen
ldr r2,[r1,#0xC]
ldrb r2,[r2,#0xB]
mov r3,#0xC0
tst r2,r3
bne NotStatScreen
sub r1,#0x2
mov r3,#0x1
strb r3,[r1]
ldrb r2,[r1,#0x1]
mov r3,#0x1
eor r2,r3
strb r2,[r1,#0x1]
mov r0, #1
bx lr
NotStatScreen:
mov r0, #0
bx lr
.global GetStatScreenPage
.type GetStatScreenPage, %function
GetStatScreenPage:
ldr r3, =0x2003BFC
ldrb r0, [r3]
mov r1, #3
and r0, r1
bx lr
.global PreventPhantomTrading
.type PreventPhantomTrading, %function
PreventPhantomTrading:
push {lr}
@ r4 unitA r5 g_unitB*
ldr r0, [r4]
ldrb r0, [r0, #4]
cmp r0, #0x3b
beq CannotTrade
cmp r0, #0x3e
beq CannotTrade
cmp r0, #0x3f
beq CannotTrade
ldr r0, [r5]
ldr r0, [r0] @ we have pointer to unit struct in r5
ldrb r0, [r0, #4]
cmp r0, #0x3b
beq CannotTrade
cmp r0, #0x3e
beq CannotTrade
cmp r0, #0x3f
beq CannotTrade
CanTrade:
mov r0, #1
b EndTradeCheck
CannotTrade:
mov r0, #0
EndTradeCheck:
cmp r0, #0
ldr r2, [r5]
ldr r3, [r4]
pop {r1}
bx r1
.ltorg
.global ShouldKarlaAppear
.type ShouldKarlaAppear, %function
ShouldKarlaAppear:
push {r4, lr}
@mov r0, #0x28 @ Bartre portrait
@bl GetReorderedCharacterPortraitByPortrait
@mov r4, r0
@ldrb r0, [r0, #4] @ real unit ID
mov r0, #9
blh 0x8017D34 @ /GetUnitByCharId
cmp r0, #0
beq KarlaWontAppear
mov r4, r0 @ unit struct
ldr r0, [r4, #0]
ldr r1, [r4, #4] @ class
ldr r0, [r0, #0x28]
ldr r1, [r1, #0x28]
orr r0, r1 @ attributes
mov r1, #1
lsl r1, #8 @ promoted bitflag
tst r0, r1
beq KarlaWontAppear
ldrb r0, [r4, #8] @ level
cmp r0, #4
ble KarlaWontAppear
mov r0, #1
b ExitKarla
KarlaWontAppear:
mov r0, #0
ExitKarla:
pop {r4}
pop {r1}
bx r1
.ltorg
.global TitleScreen_FE6
.type TitleScreen_FE6, %function
TitleScreen_FE6:
push {r4, lr}
mov r4, r0
mov r0, #0
bl DrawVersionNumber
mov r2, r4
mov r3, #0x64
add r3, r2
pop {r4}
@ no pop lr
ldr r0, =0x809B555
bx r0
.ltorg
.global SaveScreen_FE6
.type SaveScreen_FE6, %function
SaveScreen_FE6:
push {lr}
mov r0, #1
bl DrawVersionNumber
mov r1, r4
add r1, #0x2d
mov r0, #1
strb r0, [r1]
pop {r3}
ldr r3, =0x80881D5
bx r3
.ltorg
.global TitleScreen_FE7
.type TitleScreen_FE7, %function
TitleScreen_FE7:
push {lr}
mov r5, r0
mov r0, #0
bl DrawVersionNumber
mov r4, r5
add r4, #0x66
ldrh r1, [r4]
lsl r0, r1, #0x10
asr r0, #0x11
pop {r3}
bx r3
.ltorg
.global SaveScreen_FE7
.type SaveScreen_FE7, %function
SaveScreen_FE7:
push {lr}
mov r0, #1
bl DrawVersionNumber
mov r1, r5
add r1, #0x2e
mov r0, #2
strb r0, [r1]
pop {r3}
ldr r3, =0x80a3a05
bx r3
.ltorg
.global TitleScreen_FE8
.type TitleScreen_FE8, %function
TitleScreen_FE8:
push {lr}
mov r5, r0
mov r0, #0
bl DrawVersionNumber
ldr r4, =0x8AA6774
mov r0, #0x80
lsl r0, #6
pop {r3}
ldr r3, =0x80C544D
bx r3
.ltorg
.global SaveScreen_FE8
.type SaveScreen_FE8, %function
SaveScreen_FE8:
push {lr}
mov r0, #1
bl DrawVersionNumber
mov r1, r5
add r1, #0x2e
mov r0, #2
strb r0, [r1]
pop {r3}
ldr r3, =0x80a9031
bx r3
.ltorg
.global UniqueAnimationHook_FE7
.type UniqueAnimationHook_FE7, %function
UniqueAnimationHook_FE7:
push {lr}
orr r0, r1
lsr r0, #8
mov r1, #1
and r0, r1
add r2, #0x25
add r2, r0
ldrb r0, [r2]
push {r0}
mov r0, r5
bl IsClassOrRecruitmentRandomized
mov r1, r0
pop {r0}
cmp r1, #0
beq DoUniqueAnim_FE7
mov r0, #0
DoUniqueAnim_FE7:
cmp r0, #0
pop {r3}
bx r3
.ltorg
.global BarLengthHook_A_FE8
.type BarLengthHook_A_FE8, %function
BarLengthHook_A_FE8:
mov r6, r9
mov r5, r8
mov r4, r11
push {r4-r7}
mov r10, r0
mov r8, r1
mov r7, r3
sub sp, #0x10
str r2, [sp, #0xC]
ldr r5, [sp, #0x34]
push {r2}
push {lr}
bl GetGlobalStatCap
mov r11, r0
pop {r0}
pop {r2}
bx r0
.ltorg
.global BarLengthHook_B_FE8
.type BarLengthHook_B_FE8, %function
BarLengthHook_B_FE8:
add sp, #0x10
pop {r3-r6}
mov r11, r3
mov r8, r4
mov r9, r5
mov r10, r6
ldr r0, =0x8087171
bx r0
.ltorg
.global RoyPromoHook
.type RoyPromoHook, %function
RoyPromoHook:
push {r4-r6, lr}
mov r6, r0 @ event engine
mov r0, #1 @ Roy
blh 0x8017ABC @ GetUnitByCharId
mov r4, r0
mov r5, #0xF @ binding blade default
ldr r0, [r4, #4] @ class
ldrb r1, [r0, #4] @ class id
cmp r1, #1
bne ExitRoyPromoHook
@ldr r1, [r0, #0x24] @ attributes
@mov r2, #1
@lsl r2, #8 @ 0x100 promoted
@tst r1, r2
@bne ExitRoyPromoHook @ already promoted
ldrb r0, [r0, #5] @ promotion class
cmp r0, #0
beq ExitRoyPromoHook
mov r1, #0x26
ldrb r0, [r4, r1] @ sword exp
cmp r0, #0
bne StartPromoNow
mov r5, #0 @ no item equipped
StartPromoNow:
blh 0x8073324 @ prepare graphics
mov r0, r4 @ unit
mov r1, r5 @ equipped item
blh 0x8027Db4 @ promotion
@mov r1, #0x48
@mov r0, #5
@lsl r0, #8 @ 0x500 / 1280 frames
@strh r0, [r6, r1] @ stal for this many frames
@b SpecialExitRoy
ExitRoyPromoHook:
pop {r4-r6}
pop {r0}
bx r0
.ltorg
SpecialExitRoy:
pop {r4-r6}
pop {r0}
pop {r0}
pop {r7}
pop {r1}
mov r0, #2
bx r1
.ltorg
@ ORG $2cc88
.global FE7PromoHook
.type FE7PromoHook, %function
FE7PromoHook:
push {r4-r7, lr}
mov r6, r9
mov r5, r8
push {r5-r6}
MOV r6 ,r0 @ unit
mov r7, r1 @ item (might be 0)
LDR r4, =0x203A3F0 @ pointer:0802CD14 -> 0203A3F0 ([email protected] )
LDR r5, =0x203A470 @ pointer:0802CD18 -> 0203A470 ([email protected] )
ldr r0, [r6, #0]
ldr r1, [r6, #4]
ldr r0, [r0, #0x28]
ldr r1, [r1, #0x28]
orr r0, r1
mov r1, #1
lsl r1, #8 @ 0x100
tst r0, r1
bne ExitFE7ForcedPromo @ already promoted
ldr r1, [r6, #4]
ldrb r0, [r1, #5] @ default promotion
cmp r0, #0
beq ExitFE7ForcedPromo
MOV r0 ,r5
ADD r0, #0x4A
MOV r2, #0x0
MOV r9, r2
MOV r2, #0x0
MOV r8, r2
STRH r7, [r0, #0x0] @[email protected]
LDR r2, =0xFFFF @ pointer:0802CD1C -> 0000FFFF
MOV r0 ,r2
MOV r2 ,r7
AND r2 ,r0
MOV r0 ,r4
ADD r0, #0x4A
STRH r2, [r0, #0x0] @[email protected]
MOV r0 ,r5
ADD r0, #0x48
STRH r7, [r0, #0x0] @[email protected]
MOV r0 ,r4
ADD r0, #0x48
STRH r2, [r0, #0x0] @[email protected]
MOV r0 ,r5
MOV r1 ,r6
blh 0x080285D4 @CopyUnitToBattleStruct
MOV r0 ,r6
blh 0x08029818 @ApplyUnitDefaultPromotion
MOV r0 ,r4
MOV r1 ,r6
blh 0x080285D4 @CopyUnitToBattleStruct
MOV r0 ,r4
MOV r1 ,r5
blh 0x08029904
MOV r0 ,r4
blh 0x08028728 @BattleSetupTerrainData
MOV r0 ,r5
blh 0x08028728 @BattleSetupTerrainData
LDR r0, =0x203A4F0 @ pointer:0802CD20 -> 0203A4F0 (ITEMSTOCK@Storage[64].Item ID )
MOV r1, r8
STRH r1, [r0, #0x0] @ITEMSTOCK@Storage[64].Item ID
MOV r1, #0x80
STRB r1, [r0, #0x2] @ITEMSTOCK@Storage[65].Item ID
MOV r2, r9
STRB r2, [r0, #0x3] @ITEMSTOCK@Storage[65].Number of items
LDR r1, =0x203A3D8 @ pointer:0802CD24 -> 0203A3D8 ([email protected] (0x2='battle hasn't started yet', 0x20=arena, 0x80=Promotion, 0x200=Ring))
MOV r0, #0x10
STRH r0, [r1, #0x0] @[email protected] (0x2='battle hasn't started yet', 0x20=arena, 0x80=Promotion, 0x200=Ring)
blh 0x0802A3B0 @BeginBattleAnimations
LDR r0, [r6, #0xC]
MOV r1, #0x1
ORR r0 ,r1
STR r0, [r6, #0xC]
ExitFE7ForcedPromo:
POP {r3,r4}
MOV r8, r3
MOV r9, r4
POP {r4-r7}
POP {r0}
BX r0
.ltorg
.global FE8_ForcedPromotionHook @ 10b80 hook
.type FE8_ForcedPromotionHook, %function
FE8_ForcedPromotionHook:
push {lr}
mov r6, r0
ldr r0, [r6, #0x38]
ldrh r0, [r0, #2]
blh 0x800BC50 @ get unit struct
cmp r0, #0
beq FE8_NoPromo
mov r3, r0
ldr r0, [r3, #0]
ldr r1, [r3, #4]
ldr r0, [r0, #0x28]
ldr r1, [r1, #0x28]
orr r0, r1
mov r1, #1
lsl r1, #8 @ 0x100
tst r0, r1
bne FE8_NoPromo @ already promoted
ldr r1, [r3, #4]
ldrb r0, [r1, #5] @ default promotion
cmp r0, #0
beq FE8_NoPromo
FE8_Promo:
ldr r0, [r6, #0x38]
ldrh r5, [r0, #2]
ldrh r1, [r0, #4]
pop {r3}
ldr r3, =0x8010b89
bx r3
.ltorg
FE8_NoPromo:
mov r0, #0
pop {r3}
ldr r3, =0x8010BDD
bx r3
.ltorg
.global Arm_DecompText
.type Arm_DecompText, %function
Arm_DecompText:
push {lr}
push {r1}
ldr r2, [r2]
bl CallViaR2
mov r0, r1 @ huffman decoding happens to have the text buffer offset in r1 afterwards
pop {r1}
sub r0, r1 @ bytes used
pop {r1}
bx r1
CallViaR2:
bx r2
.ltorg
.global CallEndEvent_FE6
.type CallEndEvent_FE6, %function
CallEndEvent_FE6:
push {lr}
mov r0, #0xE
ldr r3, =0x0202AA48
ldsb r0, [r3, r0]
blh 0x802BBA0
ldr r0, [r0, #0x18]
blh 0x800D978
pop {r3}
bx r3
.ltorg
.global HookLoadFace_FE6
.type HookLoadFace_FE6, %function
HookLoadFace_FE6:
push {r4, lr}
lsl r4, r1, #8
ldr r0, [r7, #8]
mov r1, #0
bl GetRandomizedPortrait
add r4, r0
str r4, [r7, #8]
mov r0, r4
pop {r4}
pop {r3}
bx r3
.ltorg
.global HookLoadFace_FE8
.type HookLoadFace_FE8, %function
HookLoadFace_FE8:
push {lr}
ldr r0, [r4]
ldr r0, [r0]
ldrb r4, [r0, #1]
lsl r4, #8
ldrb r0, [r0]
mov r1, #0
bl GetRandomizedPortrait
add r4, r0
pop {r3}
bx r3
.ltorg
.global HookWMStartFace_FE6
.type HookWMStartFace_FE6, %function
HookWMStartFace_FE6:
push {r4, lr}
mov r4, r0 @ proc
mov r0, r1
mov r1, #0
bl GetRandomizedPortrait
mov r2, r0
mov r0, r4
pop {r4}
pop {r3}
bx r3
.ltorg
.global HookWMStartFace_FE7
.type HookWMStartFace_FE7, %function
HookWMStartFace_FE7:
str r1, [sp] @ probably unnecessary, but vanilla code does this before bl to 7bcc as 5th param
push {r4, lr}
sub sp, #4
str r1, [sp]
mov r0, r9 @ portrait id
mov r4, r2
mov r1, #0
bl GetRandomizedPortrait
mov r1, r0
mov r2, r4
mov r0, r7
mov r3, #0x28 @ idk
blh 0x8007bcc, r4
add sp, #4
pop {r4}
pop {r3}
bx r3
.ltorg
.global HookWMStartFace_FE8
.type HookWMStartFace_FE8, %function
HookWMStartFace_FE8:
push {lr}
lsl r2, #0x10
lsr r4, r2, #0x10
mov r0, r1 @ face ID
mov r1, #0
bl GetRandomizedPortrait
mov r6, r0
ldr r0, =0x8A3D700
blh 0x8002e9c
pop {r3}
bx r3
.ltorg
.global HookGetUnitPortraitId_FE8
.type HookGetUnitPortraitId_FE8, %function
HookGetUnitPortraitId_FE8:
push {r4, lr}
mov r4, r0
ldr r0, [r1]
ldrh r0, [r0, #6]
cmp r0, #0
beq ExitGeneric_Fe8
mov r1, #0
bl GetRandomizedPortrait
mov r2, r0
mov r1, r4
pop {r4}
pop {r3}
ldr r3, =0x80192C5
bx r3
ExitGeneric_Fe8:
mov r1, r4
ldr r1, [r1, #4]
pop {r4}
pop {r3}
ldr r3, =0x80192E5
bx r3
.ltorg
.global GetUnitPortraitId_FE7
.type GetUnitPortraitId_FE7, %function
GetUnitPortraitId_FE7:
push {r4, lr}
mov r4, r0
ldr r1, [r4]
ldrh r0, [r1, #6]
cmp r0, #0
beq GetClassPortraitId_FE7
mov r1, #0
bl GetRandomizedPortrait
b ExitPortrait_FE7
GetClassPortraitId_FE7:
ldr r1, [r4, #4]
ldrh r0, [r1, #8]
ExitPortrait_FE7:
pop {r4}
pop {r3}
bx r3
.ltorg
.global GetUnitMiniPortraitId_FE7
.type GetUnitMiniPortraitId_FE7, %function
GetUnitMiniPortraitId_FE7:
push {r4, lr}
mov r4, r0
ldr r1, [r4]
ldrb r0, [r1, #8]
cmp r0, #0
bne UseGenericMiniPortrait_FE7
mov r0, r4
bl GetUnitPortraitId_FE7
b ExitMiniPortrait_FE7
UseGenericMiniPortrait_FE7:
mov r0, #0xFE
lsl r0, #7
ldrb r1, [r1, #8]
orr r0, r1
ExitMiniPortrait_FE7:
pop {r4}
pop {r3}
bx r3
.ltorg
.global HookGetUnitMiniPortraitId_FE8
.type HookGetUnitMiniPortraitId_FE8, %function
HookGetUnitMiniPortraitId_FE8:
push {r4, lr}
mov r4, r2 @ unit
ldrh r1, [r1, #6]
cmp r1, #0
beq ExitGenericMini_Fe8
mov r0, r1
mov r1, #0
bl GetRandomizedPortrait
mov r1, r0
ldr r0, =0x202BCF0 @ gChData
mov r2, r4 @ unit
pop {r4}
pop {r3}
ldr r3, =0x8019311
bx r3
ExitGenericMini_Fe8:
mov r2, r4
ldr r2, [r2, #4]
pop {r4}
pop {r3}
ldr r3, =0x8019331
bx r3
.ltorg
.global GetMapLevelUpPortraitId_FE6
.type GetMapLevelUpPortraitId_FE6, %function
GetMapLevelUpPortraitId_FE6:
push {lr}
lsl r1, r2, #2
add r0, r1
ldr r0, [r0]
ldr r0, [r0]
ldrh r0, [r0, #6] @ portrait ID
mov r1, #0
bl GetRandomizedPortrait
mov r1, r0
mov r0, #0x42
pop {r3}
bx r3
.ltorg
.global GetBattleLevelUpPortraitId_FE6
.type GetBattleLevelUpPortraitId_FE6, %function
GetBattleLevelUpPortraitId_FE6:
push {lr}
ldr r0, [r1]
ldrh r0, [r0, #6] @ portrait
mov r1, #0
bl GetRandomizedPortrait
mov r4, r0
ldr r0, =0x860618c
blh 0x8008030
mov r0, #0x42
pop {r3}
bx r3
.ltorg
.global GetBattleLevelUpPortraitId_FE7
.type GetBattleLevelUpPortraitId_FE7, %function
GetBattleLevelUpPortraitId_FE7:
push {lr}
ldrh r0, [r0, #6] @ portrait
mov r1, #0
bl GetRandomizedPortrait
mov r4, r0
ldr r0, =0x8BDb59C
blh 0x8006b50
pop {r3}
ldr r3, =0x8069381
bx r3
.ltorg
.global GetMapLevelUpPortraitId_FE7
.type GetMapLevelUpPortraitId_FE7, %function
GetMapLevelUpPortraitId_FE7:
push {lr}
ldr r1, [r0]
ldr r0, [r1]
ldrh r0, [r0, #6] @ portrait ID
mov r1, #0
bl GetRandomizedPortrait
mov r1, r0
ldr r0, [r7]
mov r3, #0x32
ldsh r2, [r0, r3]
pop {r3}
bx r3
.ltorg
.global GetTraineePromoPortraitId_FE8
.type GetTraineePromoPortraitId_FE8, %function
GetTraineePromoPortraitId_FE8:
push {lr}
ldr r0, [r0]
ldrh r0, [r0, #6] @ portrait ID
mov r1, #0
bl GetRandomizedPortrait
mov r1, #0x2e
add r1, r4
strb r0, [r1]
pop {r3}
ldr r3, =0x80Cd6dd
bx r3
.ltorg
.global GetBattleLevelUpPortraitId_FE8
.type GetBattleLevelUpPortraitId_FE8, %function
GetBattleLevelUpPortraitId_FE8:
push {lr}
ldrh r0, [r0, #6] @ portrait
mov r1, #0
bl GetRandomizedPortrait
mov r4, r0
ldr r0, =0x87592cc
blh 0x8005544
pop {r3}
ldr r0, =0x8073E08
ldr r0, [r0]
str r0, [sp]
bx r3
.ltorg
.global GetMapLevelUpPortraitId_FE8
.type GetMapLevelUpPortraitId_FE8, %function
GetMapLevelUpPortraitId_FE8:
push {lr}
lsl r0, #2
add r0, r2
ldr r0, [r0]
ldr r0, [r0]
ldrh r0, [r0, #6] @ portrait ID
mov r1, #0
bl GetRandomizedPortrait
mov r1, r0
mov r2, #0x32
pop {r3}
bx r3
.ltorg
.global DisplayStealOrDropIcon_FE6
.type DisplayStealOrDropIcon_FE6, %function
DisplayStealOrDropIcon_FE6:
push {lr} @ 2257C
mov r0, r4 @ unit
bl MaybeDisplayStealOrDropIcon
cmp r0, #0
beq ExitIconFE6
mov r0, #0x10
ldrh r7, [r4, #0xC] @ state
and r0, r7
ExitIconFE6:
cmp r0, #0
pop {r3}
ldr r3, =0x8022585
bx r3
.ltorg
.global DisplayStealOrDropIcon_FE7
.type DisplayStealOrDropIcon_FE7, %function
DisplayStealOrDropIcon_FE7:
push {lr} @ 25E04
mov r0, r4 @ unit
bl MaybeDisplayStealOrDropIcon
cmp r0, #0
beq ExitIconFE7
mov r1, #0x10
ldr r0, [r4, #0xC] @ state
and r0, r1
ExitIconFE7:
cmp r0, #0
pop {r3}
ldr r3, =0x8025e0d
bx r3
.ltorg
.global DisplayStealOrDropIcon_FE8
.type DisplayStealOrDropIcon_FE8, %function
DisplayStealOrDropIcon_FE8:
push {lr} @ 278AC
mov r0, r4 @ unit
bl MaybeDisplayStealOrDropIcon
cmp r0, #0
beq ExitIconFE8
mov r1, #0x10
ldr r0, [r4, #0xC] @ state
and r0, r1
ExitIconFE8:
cmp r0, #0
pop {r3}
ldr r3, =0x80278B5
bx r3
.ltorg
.global MakeStolenItemDroppable_FE6
.type MakeStolenItemDroppable_FE6, %function
MakeStolenItemDroppable_FE6:
push {lr}
blh 0x8018658 @ remove item
mov r0, r5
mov r1, r8
blh 0x8012178
ldr r3, =gActiveUnit
ldr r3, [r3]
ldrh r2, [r3, #0xC] @ state
mov r1, #0x10
lsl r1, #8
orr r2, r1
strh r2, [r3, #0xC]
pop {r3}
bx r3
.ltorg
.global MakeStolenItemDroppable_FE7
.type MakeStolenItemDroppable_FE7, %function
MakeStolenItemDroppable_FE7:
push {lr}
blh 0x8018D50 @ remove item
mov r0, r5
mov r1, r8
blh 0x800EEF4
ldr r3, =gActiveUnit
ldr r3, [r3]
ldr r2, [r3, #0xC] @ state
mov r1, #0x10
lsl r1, #8
orr r2, r1
str r2, [r3, #0xC]
pop {r3}
bx r3
.ltorg
.global MakeStolenItemDroppable_FE8
.type MakeStolenItemDroppable_FE8, %function
MakeStolenItemDroppable_FE8:
push {lr}
mov r0, r6
blh 0x8019484 @ remove item
mov r0, r5
mov r1, r8
blh 0x8011694
ldr r3, =gActiveUnit
ldr r3, [r3]
ldr r2, [r3, #0xC] @ state
mov r1, #0x10
lsl r1, #8
orr r2, r1
str r2, [r3, #0xC]
pop {r3}
bx r3
.ltorg
.global DroppableItemHook_FE7
.type DroppableItemHook_FE7, %function
DroppableItemHook_FE7:
lsr r1, #0x10
ldr r2, [sp]
mov r0, r2
mov r2, r7
push {lr}
bl NewPopup_ItemGot_NoRand
pop {r0}
bx r0
.ltorg
.global DroppableItemHook_FE8
.type DroppableItemHook_FE8, %function
DroppableItemHook_FE8:
mov r0, r4
mov r1, r5
push {lr}
bl NewPopup_ItemGot_NoRand
pop {r0}