summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--asm/field_specials.s2
-rw-r--r--asm/pokenav.s1051
-rw-r--r--data/event_scripts.s4
-rw-r--r--data/pokenav.s748
-rw-r--r--data/scripts/maps/AbandonedShip_Rooms2_1F.inc4
-rw-r--r--data/scripts/maps/AbandonedShip_Rooms_1F.inc2
-rw-r--r--data/scripts/maps/JaggedPass.inc4
-rw-r--r--data/scripts/maps/MeteorFalls_1F_2R.inc6
-rw-r--r--data/scripts/maps/MtChimney.inc4
-rw-r--r--data/scripts/maps/MtPyre_3F.inc2
-rw-r--r--data/scripts/maps/MtPyre_6F.inc2
-rw-r--r--data/scripts/maps/PetalburgWoods.inc4
-rw-r--r--data/scripts/maps/Route102.inc4
-rw-r--r--data/scripts/maps/Route103.inc6
-rw-r--r--data/scripts/maps/Route104.inc12
-rw-r--r--data/scripts/maps/Route105.inc2
-rw-r--r--data/scripts/maps/Route106.inc2
-rw-r--r--data/scripts/maps/Route107.inc2
-rw-r--r--data/scripts/maps/Route108.inc2
-rw-r--r--data/scripts/maps/Route109.inc4
-rw-r--r--data/scripts/maps/Route110.inc8
-rw-r--r--data/scripts/maps/Route111.inc6
-rw-r--r--data/scripts/maps/Route112.inc2
-rw-r--r--data/scripts/maps/Route113.inc4
-rw-r--r--data/scripts/maps/Route114.inc4
-rw-r--r--data/scripts/maps/Route115.inc6
-rw-r--r--data/scripts/maps/Route116.inc8
-rw-r--r--data/scripts/maps/Route117.inc12
-rw-r--r--data/scripts/maps/Route118.inc4
-rw-r--r--data/scripts/maps/Route119.inc4
-rw-r--r--data/scripts/maps/Route120.inc4
-rw-r--r--data/scripts/maps/Route121.inc6
-rw-r--r--data/scripts/maps/Route123.inc6
-rw-r--r--data/scripts/maps/Route124.inc6
-rw-r--r--data/scripts/maps/Route125.inc2
-rw-r--r--data/scripts/maps/Route126.inc2
-rw-r--r--data/scripts/maps/Route127.inc2
-rw-r--r--data/scripts/maps/Route128.inc4
-rw-r--r--data/specials.inc2
-rw-r--r--data/strings.s74
-rw-r--r--include/battle_frontier_1.h1
-rw-r--r--include/constants/flags.h1
-rw-r--r--include/match_call.h13
-rw-r--r--ld_script.txt4
-rw-r--r--src/match_call.c1275
45 files changed, 1424 insertions, 1903 deletions
diff --git a/asm/field_specials.s b/asm/field_specials.s
index 7e3185556..ca22af002 100644
--- a/asm/field_specials.s
+++ b/asm/field_specials.s
@@ -6817,7 +6817,7 @@ sub_813B4E0: @ 813B4E0
push {lr}
ldr r0, =gSpecialVar_0x8004
ldrh r0, [r0]
- bl sub_81D15CC
+ bl GetRematchIdxByTrainerIdx
cmp r0, 0
blt _0813B50C
movs r1, 0xAE
diff --git a/asm/pokenav.s b/asm/pokenav.s
index 56bf3d41f..fe96d51e7 100644
--- a/asm/pokenav.s
+++ b/asm/pokenav.s
@@ -7611,7 +7611,7 @@ _081CAD4C:
ldrh r5, [r4, 0x8]
_081CAD50:
adds r0, r5, 0
- bl sub_81D15F4
+ bl MatchCallFlagGetByIndex
cmp r0, 0
beq _081CAD80
ldrh r0, [r4, 0xA]
@@ -7834,7 +7834,7 @@ sub_81CAEBC: @ 81CAEBC
b _081CAEDC
_081CAED4:
ldrh r0, [r1, 0x1E]
- bl sub_81D1854
+ bl MatchCall_GetRematchTableIdx
adds r4, r0, 0
_081CAEDC:
cmp r4, 0x4E
@@ -7870,7 +7870,7 @@ sub_81CAF04: @ 81CAF04
cmp r0, 0
bne _081CAF34
ldrh r0, [r1, 0x1E]
- bl sub_81D15BC
+ bl GetTrainerIdxByRematchIdx
adds r4, r0, 0
ldr r1, =gTrainers
lsls r0, r4, 2
@@ -7883,7 +7883,7 @@ sub_81CAF04: @ 81CAF04
_081CAF34:
ldrh r5, [r1, 0x1E]
adds r0, r5, 0
- bl sub_81D1854
+ bl MatchCall_GetRematchTableIdx
adds r4, r0, 0
cmp r4, 0x4E
bne _081CAF58
@@ -7897,7 +7897,7 @@ _081CAF34:
.pool
_081CAF58:
adds r0, r4, 0
- bl sub_81D15BC
+ bl GetTrainerIdxByRematchIdx
adds r4, r0, 0
ldr r0, =gTrainers
lsls r1, r4, 2
@@ -7938,7 +7938,7 @@ _081CAFA4:
cmp r0, 0
bne _081CAFC4
ldrh r0, [r1, 0x1E]
- bl sub_81D15BC
+ bl GetTrainerIdxByRematchIdx
ldr r1, =gStringVar4
bl sub_81967AC
strb r0, [r6]
@@ -7947,7 +7947,7 @@ _081CAFA4:
_081CAFC4:
ldrh r0, [r1, 0x1E]
ldr r1, =gStringVar4
- bl sub_81D189C
+ bl MatchCall_GetMessage
_081CAFCC:
ldr r0, =gStringVar4
_081CAFCE:
@@ -7970,7 +7970,7 @@ sub_81CAFD8: @ 81CAFD8
cmp r0, 0
beq _081CB004
ldrh r0, [r4, 0x1E]
- bl sub_81D1854
+ bl MatchCall_GetRematchTableIdx
adds r1, r0, 0
cmp r1, 0x4E
bne _081CB006
@@ -8036,7 +8036,7 @@ sub_81CB050: @ 81CB050
cmp r0, 0
bne _081CB088
ldrh r0, [r2, 0x2]
- bl sub_81D15BC
+ bl GetTrainerIdxByRematchIdx
lsls r1, r0, 2
adds r1, r0
lsls r1, 3
@@ -8207,11 +8207,11 @@ _081CB18A:
movs r4, 0
_081CB192:
adds r0, r4, 0
- bl sub_81D15F4
+ bl MatchCallFlagGetByIndex
cmp r0, 0
beq _081CB1C0
adds r0, r4, 0
- bl sub_81D1854
+ bl MatchCall_GetRematchTableIdx
ldr r1, =gSaveBlock1Ptr
ldr r1, [r1]
ldr r2, =0x000009ca
@@ -20697,1034 +20697,7 @@ _081D156A:
.pool
thumb_func_end sub_81D1538
- thumb_func_start sub_81D1574
-sub_81D1574: @ 81D1574
- push {lr}
- ldrb r0, [r0]
- cmp r0, 0x5
- bhi _081D15A4
- lsls r0, 2
- ldr r1, =_081D158C
- adds r0, r1
- ldr r0, [r0]
- mov pc, r0
- .pool
- .align 2, 0
-_081D158C:
- .4byte _081D15A4
- .4byte _081D15A8
- .4byte _081D15AC
- .4byte _081D15B4
- .4byte _081D15B0
- .4byte _081D15A8
-_081D15A4:
- movs r0, 0
- b _081D15B6
-_081D15A8:
- movs r0, 0x1
- b _081D15B6
-_081D15AC:
- movs r0, 0x2
- b _081D15B6
-_081D15B0:
- movs r0, 0x3
- b _081D15B6
-_081D15B4:
- movs r0, 0x4
-_081D15B6:
- pop {r1}
- bx r1
- thumb_func_end sub_81D1574
-
- thumb_func_start sub_81D15BC
-sub_81D15BC: @ 81D15BC
- ldr r1, =gRematchTable
- lsls r0, 4
- adds r0, r1
- ldrh r0, [r0]
- bx lr
- .pool
- thumb_func_end sub_81D15BC
-
- thumb_func_start sub_81D15CC
-sub_81D15CC: @ 81D15CC
- push {lr}
- adds r3, r0, 0
- movs r1, 0
- ldr r2, =gRematchTable
-_081D15D4:
- ldrh r0, [r2]
- cmp r0, r3
- bne _081D15E4
- adds r0, r1, 0
- b _081D15F0
- .pool
-_081D15E4:
- adds r2, 0x10
- adds r1, 0x1
- cmp r1, 0x4D
- ble _081D15D4
- movs r0, 0x1
- negs r0, r0
-_081D15F0:
- pop {r1}
- bx r1
- thumb_func_end sub_81D15CC
-
- thumb_func_start sub_81D15F4
-sub_81D15F4: @ 81D15F4
- push {r4,lr}
- cmp r0, 0x14
- bhi _081D1620
- ldr r1, =gUnknown_086252A8
- lsls r0, 2
- adds r0, r1
- ldr r4, [r0]
- adds r0, r4, 0
- bl sub_81D1574
- ldr r1, =gUnknown_086252FC
- lsls r0, 2
- adds r0, r1
- ldr r1, [r0]
- adds r0, r4, 0
- bl _call_via_r1
- b _081D1622
- .pool
-_081D1620:
- movs r0, 0
-_081D1622:
- pop {r4}
- pop {r1}
- bx r1
- thumb_func_end sub_81D15F4
-
- thumb_func_start sub_81D1628
-sub_81D1628: @ 81D1628
- push {lr}
- adds r2, r0, 0
- ldrh r1, [r2, 0x2]
- ldr r0, =0x0000ffff
- cmp r1, r0
- beq _081D1644
- adds r0, r1, 0
- bl FlagGet
- lsls r0, 24
- lsrs r0, 24
- b _081D1646
- .pool
-_081D1644:
- movs r0, 0x1
-_081D1646:
- pop {r1}
- bx r1
- thumb_func_end sub_81D1628
-
- thumb_func_start sub_81D164C
-sub_81D164C: @ 81D164C
- push {lr}
- adds r2, r0, 0
- ldrh r1, [r2, 0x2]
- ldr r0, =0x0000ffff
- cmp r1, r0
- beq _081D1668
- adds r0, r1, 0
- bl FlagGet
- lsls r0, 24
- lsrs r0, 24
- b _081D166A
- .pool
-_081D1668:
- movs r0, 0x1
-_081D166A:
- pop {r1}
- bx r1
- thumb_func_end sub_81D164C
-
- thumb_func_start sub_81D1670
-sub_81D1670: @ 81D1670
- push {lr}
- adds r2, r0, 0
- ldrh r1, [r2, 0x2]
- ldr r0, =0x0000ffff
- cmp r1, r0
- beq _081D168C
- adds r0, r1, 0
- bl FlagGet
- lsls r0, 24
- lsrs r0, 24
- b _081D168E
- .pool
-_081D168C:
- movs r0, 0x1
-_081D168E:
- pop {r1}
- bx r1
- thumb_func_end sub_81D1670
-
- thumb_func_start sub_81D1694
-sub_81D1694: @ 81D1694
- push {lr}
- adds r2, r0, 0
- ldr r0, =gSaveBlock2Ptr
- ldr r1, [r0]
- ldrb r0, [r2, 0x1]
- ldrb r1, [r1, 0x8]
- cmp r0, r1
- beq _081D16AC
- movs r0, 0
- b _081D16C6
- .pool
-_081D16AC:
- ldrh r1, [r2, 0x2]
- ldr r0, =0x0000ffff
- cmp r1, r0
- beq _081D16C4
- adds r0, r1, 0
- bl FlagGet
- lsls r0, 24
- lsrs r0, 24
- b _081D16C6
- .pool
-_081D16C4:
- movs r0, 0x1
-_081D16C6:
- pop {r1}
- bx r1
- thumb_func_end sub_81D1694
-
- thumb_func_start sub_81D16CC
-sub_81D16CC: @ 81D16CC
- push {lr}
- ldrh r0, [r0, 0x2]
- bl FlagGet
- lsls r0, 24
- lsrs r0, 24
- pop {r1}
- bx r1
- thumb_func_end sub_81D16CC
-
- thumb_func_start sub_81D16DC
-sub_81D16DC: @ 81D16DC
- push {r4,lr}
- cmp r0, 0x14
- bhi _081D170C
- ldr r1, =gUnknown_086252A8
- lsls r0, 2
- adds r0, r1
- ldr r4, [r0]
- adds r0, r4, 0
- bl sub_81D1574
- ldr r1, =gUnknown_08625310
- lsls r0, 2
- adds r0, r1
- ldr r1, [r0]
- adds r0, r4, 0
- bl _call_via_r1
- lsls r0, 24
- lsrs r0, 24
- b _081D170E
- .pool
-_081D170C:
- movs r0, 0
-_081D170E:
- pop {r4}
- pop {r1}
- bx r1
- thumb_func_end sub_81D16DC
-
- thumb_func_start sub_81D1714
-sub_81D1714: @ 81D1714
- ldrb r0, [r0, 0x1]
- bx lr
- thumb_func_end sub_81D1714
-
- thumb_func_start sub_81D1718
-sub_81D1718: @ 81D1718
- ldrb r0, [r0, 0x1]
- bx lr
- thumb_func_end sub_81D1718
-
- thumb_func_start sub_81D171C
-sub_81D171C: @ 81D171C
- push {r4-r7,lr}
- adds r5, r0, 0
- movs r6, 0
- ldr r7, =0x0000ffff
- b _081D172E
- .pool
-_081D172C:
- adds r6, 0x1
-_081D172E:
- ldr r0, [r5, 0x10]
- lsls r4, r6, 2
- adds r1, r4, r0
- ldrh r0, [r1]
- cmp r0, r7
- beq _081D1744
- bl FlagGet
- lsls r0, 24
- cmp r0, 0
- bne _081D172C
-_081D1744:
- ldr r0, [r5, 0x10]
- adds r0, r4, r0
- ldrb r0, [r0, 0x2]
- pop {r4-r7}
- pop {r1}
- bx r1
- thumb_func_end sub_81D171C
-
- thumb_func_start sub_81D1750
-sub_81D1750: @ 81D1750
- movs r0, 0xD5
- bx lr
- thumb_func_end sub_81D1750
-
- thumb_func_start sub_81D1754
-sub_81D1754: @ 81D1754
- movs r0, 0xD5
- bx lr
- thumb_func_end sub_81D1754
-
- thumb_func_start sub_81D1758
-sub_81D1758: @ 81D1758
- push {r4,lr}
- cmp r0, 0x14
- bhi _081D1784
- ldr r1, =gUnknown_086252A8
- lsls r0, 2
- adds r0, r1
- ldr r4, [r0]
- adds r0, r4, 0
- bl sub_81D1574
- ldr r1, =gUnknown_08625324
- lsls r0, 2
- adds r0, r1
- ldr r1, [r0]
- adds r0, r4, 0
- bl _call_via_r1
- b _081D1786
- .pool
-_081D1784:
- movs r0, 0
-_081D1786:
- pop {r4}
- pop {r1}
- bx r1
- thumb_func_end sub_81D1758
-
- thumb_func_start sub_81D178C
-sub_81D178C: @ 81D178C
- movs r0, 0
- bx lr
- thumb_func_end sub_81D178C
-
- thumb_func_start sub_81D1790
-sub_81D1790: @ 81D1790
- push {lr}
- adds r1, r0, 0
- ldrh r0, [r1, 0x4]
- cmp r0, 0x48
- bhi _081D17B8
- ldr r0, =gSaveBlock1Ptr
- ldr r0, [r0]
- ldr r2, =0x000009ca
- adds r0, r2
- ldrh r1, [r1, 0x4]
- adds r0, r1
- ldrb r1, [r0]
- negs r0, r1
- orrs r0, r1
- lsrs r0, 31
- b _081D17BA
- .pool
-_081D17B8:
- movs r0, 0
-_081D17BA:
- pop {r1}
- bx r1
- thumb_func_end sub_81D1790
-
- thumb_func_start sub_81D17C0
-sub_81D17C0: @ 81D17C0
- ldr r1, =gSaveBlock1Ptr
- ldr r1, [r1]
- ldr r2, =0x000009ca
- adds r1, r2
- ldrh r0, [r0, 0x4]
- adds r1, r0
- ldrb r1, [r1]
- negs r0, r1
- orrs r0, r1
- lsrs r0, 31
- bx lr
- .pool
- thumb_func_end sub_81D17C0
-
- thumb_func_start sub_81D17E0
-sub_81D17E0: @ 81D17E0
- movs r0, 0
- bx lr
- thumb_func_end sub_81D17E0
-
- thumb_func_start sub_81D17E4
-sub_81D17E4: @ 81D17E4
- movs r0, 0
- bx lr
- thumb_func_end sub_81D17E4
-
- thumb_func_start sub_81D17E8
-sub_81D17E8: @ 81D17E8
- push {r4,r5,lr}
- adds r5, r0, 0
- cmp r5, 0x14
- bhi _081D1832
- ldr r1, =gUnknown_086252A8
- lsls r0, r5, 2
- adds r0, r1
- ldr r4, [r0]
- adds r0, r4, 0
- bl sub_81D1574
- adds r2, r0, 0
- ldr r1, =gUnknown_08625338
- lsls r0, r2, 2
- adds r0, r1
- ldr r1, [r0]
- adds r0, r4, 0
- bl _call_via_r1
- cmp r0, 0
- beq _081D1820
-_081D1812:
- movs r0, 0x1
- b _081D1834
- .pool
-_081D1820:
- movs r2, 0
- ldr r1, =gUnknown_08625388
-_081D1824:
- ldrh r0, [r1]
- cmp r0, r5
- beq _081D1812
- adds r1, 0x18
- adds r2, 0x1
- cmp r2, 0x3
- bls _081D1824
-_081D1832:
- movs r0, 0
-_081D1834:
- pop {r4,r5}
- pop {r1}
- bx r1
- .pool
- thumb_func_end sub_81D17E8
-
- thumb_func_start sub_81D1840
-sub_81D1840: @ 81D1840
- movs r0, 0
- bx lr
- thumb_func_end sub_81D1840
-
- thumb_func_start sub_81D1844
-sub_81D1844: @ 81D1844
- movs r0, 0x1
- bx lr
- thumb_func_end sub_81D1844
-
- thumb_func_start sub_81D1848
-sub_81D1848: @ 81D1848
- movs r0, 0x1
- bx lr
- thumb_func_end sub_81D1848
-
- thumb_func_start sub_81D184C
-sub_81D184C: @ 81D184C
- movs r0, 0
- bx lr
- thumb_func_end sub_81D184C
-
- thumb_func_start sub_81D1850
-sub_81D1850: @ 81D1850
- movs r0, 0
- bx lr
- thumb_func_end sub_81D1850
-
- thumb_func_start sub_81D1854
-sub_81D1854: @ 81D1854
- push {r4,lr}
- cmp r0, 0x14
- bhi _081D1880
- ldr r1, =gUnknown_086252A8
- lsls r0, 2
- adds r0, r1
- ldr r4, [r0]
- adds r0, r4, 0
- bl sub_81D1574
- ldr r1, =gUnknown_0862534C
- lsls r0, 2
- adds r0, r1
- ldr r1, [r0]
- adds r0, r4, 0
- bl _call_via_r1
- b _081D1882
- .pool
-_081D1880:
- movs r0, 0x4E
-_081D1882:
- pop {r4}
- pop {r1}
- bx r1
- thumb_func_end sub_81D1854
-
- thumb_func_start sub_81D1888
-sub_81D1888: @ 81D1888
- movs r0, 0x4E
- bx lr
- thumb_func_end sub_81D1888
-
- thumb_func_start sub_81D188C
-sub_81D188C: @ 81D188C
- ldrh r0, [r0, 0x4]
- bx lr
- thumb_func_end sub_81D188C
-
- thumb_func_start sub_81D1890
-sub_81D1890: @ 81D1890
- ldrh r0, [r0, 0x4]
- bx lr
- thumb_func_end sub_81D1890
-
- thumb_func_start sub_81D1894
-sub_81D1894: @ 81D1894
- movs r0, 0x4E
- bx lr
- thumb_func_end sub_81D1894
-
- thumb_func_start sub_81D1898
-sub_81D1898: @ 81D1898
- movs r0, 0x4E
- bx lr
- thumb_func_end sub_81D1898
-
- thumb_func_start sub_81D189C
-sub_81D189C: @ 81D189C
- push {r4,r5,lr}
- adds r5, r1, 0
- cmp r0, 0x14
- bhi _081D18C2
- ldr r1, =gUnknown_086252A8
- lsls r0, 2
- adds r0, r1
- ldr r4, [r0]
- adds r0, r4, 0
- bl sub_81D1574
- ldr r1, =gUnknown_08625360
- lsls r0, 2
- adds r0, r1
- ldr r2, [r0]
- adds r0, r4, 0
- adds r1, r5, 0
- bl _call_via_r2
-_081D18C2:
- pop {r4,r5}
- pop {r0}
- bx r0
- .pool
- thumb_func_end sub_81D189C
-
- thumb_func_start sub_81D18D0
-sub_81D18D0: @ 81D18D0
- push {lr}
- ldr r0, [r0, 0xC]
- bl sub_81D1920
- pop {r0}
- bx r0
- thumb_func_end sub_81D18D0
-
- thumb_func_start sub_81D18DC
-sub_81D18DC: @ 81D18DC
- push {lr}
- adds r3, r0, 0
- adds r2, r1, 0
- ldrb r0, [r3]
- cmp r0, 0x5
- beq _081D18F0
- ldr r0, [r3, 0x10]
- bl sub_81D1920
- b _081D18F8
-_081D18F0:
- ldr r0, [r3, 0x10]
- ldrh r1, [r3, 0x4]
- bl sub_81D199C
-_081D18F8:
- pop {r0}
- bx r0
- thumb_func_end sub_81D18DC
-
- thumb_func_start sub_81D18FC
-sub_81D18FC: @ 81D18FC
- push {lr}
- ldr r0, [r0, 0xC]
- bl sub_81D1920
- pop {r0}
- bx r0
- thumb_func_end sub_81D18FC
-
- thumb_func_start sub_81D1908
-sub_81D1908: @ 81D1908
- push {lr}
- ldr r0, [r0, 0xC]
- bl sub_81D1920
- pop {r0}
- bx r0
- thumb_func_end sub_81D1908
-
- thumb_func_start sub_81D1914
-sub_81D1914: @ 81D1914
- push {lr}
- adds r0, r1, 0
- bl sub_8197080
- pop {r0}
- bx r0
- thumb_func_end sub_81D1914
-
- thumb_func_start sub_81D1920
-sub_81D1920: @ 81D1920
- push {r4-r7,lr}
- mov r7, r9
- mov r6, r8
- push {r6,r7}
- adds r6, r0, 0
- mov r9, r1
- movs r5, 0
- ldr r0, [r6]
- cmp r0, 0
- beq _081D1940
- adds r1, r6, 0
-_081D1936:
- adds r1, 0x8
- adds r5, 0x1
- ldr r0, [r1]
- cmp r0, 0
- bne _081D1936
-_081D1940:
- cmp r5, 0
- beq _081D1946
- subs r5, 0x1
-_081D1946:
- ldr r0, =0x0000ffff
- mov r8, r0
- lsls r0, r5, 3
- adds r0, 0x4
- adds r4, r0, r6
- b _081D195C
- .pool
-_081D1958:
- subs r4, 0x8
- subs r5, 0x1
-_081D195C:
- lsls r7, r5, 3
- cmp r5, 0
- beq _081D1974
- ldrh r0, [r4]
- cmp r0, r8
- beq _081D1958
- bl FlagGet
- lsls r0, 24
- lsrs r0, 24
- cmp r0, 0x1
- bne _081D1958
-_081D1974:
- adds r4, r7, r6
- ldrh r1, [r4, 0x6]
- ldr r0, =0x0000ffff
- cmp r1, r0
- beq _081D1984
- adds r0, r1, 0
- bl FlagSet
-_081D1984:
- ldr r1, [r4]
- mov r0, r9
- bl StringExpandPlaceholders
- pop {r3,r4}
- mov r8, r3
- mov r9, r4
- pop {r4-r7}
- pop {r0}
- bx r0
- .pool
- thumb_func_end sub_81D1920
-
- thumb_func_start sub_81D199C
-sub_81D199C: @ 81D199C
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- adds r6, r0, 0
- mov r10, r2
- lsls r1, 16
- lsrs r7, r1, 16
- movs r5, 0
- ldr r0, [r6]
- cmp r0, 0
- beq _081D19E6
- ldrh r0, [r6, 0x4]
- ldr r1, =0x0000fffe
- cmp r0, r1
- beq _081D1A24
- ldr r0, =0x0000ffff
- mov r9, r0
- mov r8, r1
- adds r4, r6, 0
-_081D19C6:
- ldrh r0, [r4, 0x4]
- cmp r0, r9
- beq _081D19D6
- bl FlagGet
- lsls r0, 24
- cmp r0, 0
- beq _081D19E6
-_081D19D6:
- adds r4, 0x8
- adds r5, 0x1
- ldr r0, [r4]
- cmp r0, 0
- beq _081D19E6
- ldrh r0, [r4, 0x4]
- cmp r0, r8
- bne _081D19C6
-_081D19E6:
- lsls r0, r5, 3
- adds r0, r6
- ldrh r1, [r0, 0x4]
- ldr r0, =0x0000fffe
- cmp r1, r0
- beq _081D1A24
- cmp r5, 0
- beq _081D19F8
- subs r5, 0x1
-_081D19F8:
- lsls r0, r5, 3
- adds r4, r0, r6
- ldrh r1, [r4, 0x6]
- ldr r0, =0x0000ffff
- cmp r1, r0
- beq _081D1A0A
- adds r0, r1, 0
- bl FlagSet
-_081D1A0A:
- ldr r1, [r4]
- mov r0, r10
- bl StringExpandPlaceholders
- b _081D1A5C
- .pool
-_081D1A1C:
- adds r5, 0x2
- b _081D1A50
-_081D1A20:
- adds r5, 0x3
- b _081D1A50
-_081D1A24:
- ldr r0, =0x00000864
- bl FlagGet
- lsls r0, 24
- cmp r0, 0
- beq _081D1A50
- ldr r0, =gSaveBlock1Ptr
- ldr r0, [r0]
- ldr r1, =0x000009ca
- adds r0, r1
- adds r0, r7
- ldrb r0, [r0]
- cmp r0, 0
- bne _081D1A1C
- adds r0, r7, 0
- bl CountBattledRematchTeams
- lsls r0, 16
- lsrs r0, 16
- cmp r0, 0x1
- bhi _081D1A20
- adds r5, 0x1
-_081D1A50:
- lsls r0, r5, 3
- adds r0, r6
- ldr r1, [r0]
- mov r0, r10
- bl StringExpandPlaceholders
-_081D1A5C:
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r0}
- bx r0
- .pool
- thumb_func_end sub_81D199C
-
- thumb_func_start sub_81D1A78
-sub_81D1A78: @ 81D1A78
- push {r4-r6,lr}
- adds r5, r1, 0
- adds r6, r2, 0
- cmp r0, 0x14
- bhi _081D1AA2
- ldr r1, =gUnknown_086252A8
- lsls r0, 2
- adds r0, r1
- ldr r4, [r0]
- adds r0, r4, 0
- bl sub_81D1574
- ldr r1, =gUnknown_08625374
- lsls r0, 2
- adds r0, r1
- ldr r3, [r0]
- adds r0, r4, 0
- adds r1, r5, 0
- adds r2, r6, 0
- bl _call_via_r3
-_081D1AA2:
- pop {r4-r6}
- pop {r0}
- bx r0
- .pool
- thumb_func_end sub_81D1A78
-
- thumb_func_start sub_81D1AB0
-sub_81D1AB0: @ 81D1AB0
- ldr r3, [r0, 0x4]
- str r3, [r1]
- ldr r0, [r0, 0x8]
- str r0, [r2]
- bx lr
- thumb_func_end sub_81D1AB0
-
- thumb_func_start sub_81D1ABC
-sub_81D1ABC: @ 81D1ABC
- push {r4,r5,lr}
- adds r5, r1, 0
- adds r4, r0, 0
- ldr r0, [r4, 0xC]
- cmp r0, 0
- bne _081D1AD0
- ldrh r0, [r4, 0x4]
- bl sub_81D1B0C
- b _081D1AD2
-_081D1AD0:
- str r0, [r2]
-_081D1AD2:
- ldr r0, [r4, 0x8]
- str r0, [r5]
- pop {r4,r5}
- pop {r0}
- bx r0
- thumb_func_end sub_81D1ABC
-
- thumb_func_start sub_81D1ADC
-sub_81D1ADC: @ 81D1ADC
- push {r4,r5,lr}
- adds r4, r0, 0
- adds r5, r1, 0
- ldrh r0, [r4, 0x4]
- bl sub_81D1B0C
- ldr r0, [r4, 0x8]
- str r0, [r5]
- pop {r4,r5}
- pop {r0}
- bx r0
- thumb_func_end sub_81D1ADC
-
- thumb_func_start sub_81D1AF4
-sub_81D1AF4: @ 81D1AF4
- ldr r3, [r0, 0x4]
- str r3, [r1]
- ldr r0, [r0, 0x8]
- str r0, [r2]
- bx lr
- thumb_func_end sub_81D1AF4
-
- thumb_func_start sub_81D1B00
-sub_81D1B00: @ 81D1B00
- ldr r3, [r0, 0x4]
- str r3, [r1]
- ldr r0, [r0, 0x8]
- str r0, [r2]
- bx lr
- thumb_func_end sub_81D1B00
-
- thumb_func_start sub_81D1B0C
-sub_81D1B0C: @ 81D1B0C
- push {r4,r5,lr}
- adds r4, r1, 0
- adds r5, r2, 0
- bl sub_81D15BC
- lsls r1, r0, 2
- adds r1, r0
- lsls r1, 3
- ldr r0, =gTrainers
- adds r1, r0
- ldrb r2, [r1, 0x1]
- movs r0, 0xD
- muls r0, r2
- ldr r2, =gTrainerClassNames
- adds r0, r2
- str r0, [r4]
- adds r1, 0x4
- str r1, [r5]
- pop {r4,r5}
- pop {r0}
- bx r0
- .pool
- thumb_func_end sub_81D1B0C
-
- thumb_func_start sub_81D1B40
-sub_81D1B40: @ 81D1B40
- push {r4-r7,lr}
- mov r7, r9
- mov r6, r8
- push {r6,r7}
- adds r6, r0, 0
- movs r5, 0
- ldr r2, =gUnknown_08625388
- movs r0, 0x8
- adds r0, r2
- mov r9, r0
-_081D1B54:
- lsls r0, r5, 1
- adds r0, r5
- lsls r0, 3
- adds r0, r2
- ldrh r0, [r0]
- cmp r0, r6
- bne _081D1BBC
- adds r4, r5, 0x1
- lsls r1, 2
- mov r8, r1
- cmp r4, 0x3
- bhi _081D1BA8
- lsls r0, r4, 1
- adds r0, r4
- lsls r0, 3
- adds r0, r2
- ldrh r0, [r0]
- cmp r0, r6
- bne _081D1BA8
- ldr r7, =gUnknown_08625388
-_081D1B7C:
- lsls r0, r4, 1
- adds r0, r4
- lsls r0, 3
- adds r1, r7, 0x4
- adds r0, r1
- ldrh r0, [r0]
- bl FlagGet
- lsls r0, 24
- cmp r0, 0
- beq _081D1BA8
- adds r5, r4, 0
- adds r4, r5, 0x1
- cmp r4, 0x3
- bhi _081D1BA8
- lsls r0, r4, 1
- adds r0, r4
- lsls r0, 3
- adds r0, r7
- ldrh r0, [r0]
- cmp r0, r6
- beq _081D1B7C
-_081D1BA8:
- lsls r0, r5, 1
- adds r0, r5
- lsls r0, 3
- add r0, r8
- add r0, r9
- ldr r0, [r0]
- b _081D1BC4
- .pool
-_081D1BBC:
- adds r5, 0x1
- cmp r5, 0x3
- bls _081D1B54
- movs r0, 0
-_081D1BC4:
- pop {r3,r4}
- mov r8, r3
- mov r9, r4
- pop {r4-r7}
- pop {r1}
- bx r1
- thumb_func_end sub_81D1B40
-
- thumb_func_start sub_81D1BD0
-sub_81D1BD0: @ 81D1BD0
- push {lr}
- adds r3, r0, 0
- movs r2, 0
- ldr r1, =gUnknown_08625388
-_081D1BD8:
- ldrh r0, [r1]
- cmp r0, r3
- bne _081D1BE8
- ldrh r0, [r1, 0x2]
- b _081D1BF4
- .pool
-_081D1BE8:
- adds r1, 0x18
- adds r2, 0x1
- cmp r2, 0x3
- bls _081D1BD8
- movs r0, 0x1
- negs r0, r0
-_081D1BF4:
- pop {r1}
- bx r1
- thumb_func_end sub_81D1BD0
-
- thumb_func_start sub_81D1BF8
-sub_81D1BF8: @ 81D1BF8
- push {r4,r5,lr}
- adds r5, r0, 0
- movs r4, 0
-_081D1BFE:
- adds r0, r4, 0
- bl sub_81D1854
- cmp r0, 0x4E
- beq _081D1C10
- cmp r0, r5
- bne _081D1C10
- movs r0, 0x1
- b _081D1C18
-_081D1C10:
- adds r4, 0x1
- cmp r4, 0x14
- ble _081D1BFE
- movs r0, 0
-_081D1C18:
- pop {r4,r5}
- pop {r1}
- bx r1
- thumb_func_end sub_81D1BF8
-
- thumb_func_start sub_81D1C20
-sub_81D1C20: @ 81D1C20
- push {lr}
- ldr r0, =gSpecialVar_0x8004
- ldrh r0, [r0]
- bl sub_81D15CC
- cmp r0, 0
- blt _081D1C3C
- movs r1, 0xAE
- lsls r1, 1
- adds r0, r1
- lsls r0, 16
- lsrs r0, 16
- bl FlagSet
-_081D1C3C:
- pop {r0}
- bx r0
- .pool
- thumb_func_end sub_81D1C20
+ .section .text.after.match.call
thumb_func_start sub_81D1C44
sub_81D1C44: @ 81D1C44
diff --git a/data/event_scripts.s b/data/event_scripts.s
index f4e6b1086..22c44bee3 100644
--- a/data/event_scripts.s
+++ b/data/event_scripts.s
@@ -49,7 +49,7 @@ gStdScripts:: @ 81DC2A0
.4byte Std_5
.4byte Std_6
.4byte Std_ObtainDecoration
- .4byte Std_8
+ .4byte Std_RegisteredInMatchCall
.4byte Std_9
.4byte Std_10
@@ -4075,7 +4075,7 @@ Underwater3_EventScript_2742C0:: @ 82742C0
setescapewarp ROUTE_129, 255, 43, 20
return
-Std_8:: @ 82742C9
+Std_RegisteredInMatchCall:: @ 82742C9
buffertrainerclassname 0, VAR_0x8000
buffertrainername 1, VAR_0x8000
closemessage
diff --git a/data/pokenav.s b/data/pokenav.s
index 03c0d4b8a..9a89e2251 100644
--- a/data/pokenav.s
+++ b/data/pokenav.s
@@ -2030,754 +2030,8 @@ gUnknown_08624CF8:: @ 8624CF8
gUnknown_08624D04:: @ 8624D04
spr_template 9, 15, gUnknown_08624CB0, gDummySpriteAnimTable, NULL, gUnknown_08624CF8, SpriteCallbackDummy
-
-gUnknown_08624D1C:: @ 8624D1C
- .4byte gText_MrStone_Pokenav_2B60C0
- .2byte 0xFFFF
- .byte 0x58
- .byte 1
- .4byte gText_MrStone_Pokenav_2B61E6
- .byte 0x58
- .byte 1
- .2byte 0xFFFF
- .4byte gText_MrStone_Pokenav_2B6302
- .byte 0xBD
- .byte 0
- .2byte 0xFFFF
- .4byte gText_MrStone_Pokenav_2B63A0
- .byte 16
- .byte 1
- .2byte 0xFFFF
- .4byte gText_MrStone_Pokenav_2B64A2
- .byte 0x6A
- .byte 0
- .2byte 0xFFFF
- .4byte gText_MrStone_Pokenav_2B6526
- .byte 0xF4
- .byte 4
- .2byte 0xFFFF
- .4byte gText_MrStone_Pokenav_2B65BB
- .byte 0x97
- .byte 0
- .2byte 0xFFFF
- .4byte gText_MrStone_Pokenav_2B6664
- .byte 0x6f
- .byte 0
- .2byte 0xFFFF
- .4byte gText_MrStone_Pokenav_2B66B1
- .byte 0x70
- .byte 0
- .2byte 0xFFFF
- .4byte gText_MrStone_Pokenav_2B6703
- .byte 0xf7
- .byte 4
- .2byte 0xFFFF
- .4byte gText_MrStone_Pokenav_2B67ED
- .byte 0x64
- .byte 8
- .2byte 0xFFFF
- .4byte NULL
- .4byte 0xFFFFFFFF
-
-gUnknown_08624D7C:: @ 8624D7C
- .byte 0
- .byte 10
- .2byte 0xFFFF
- .4byte gUnknown_085EFAEF
- .4byte gUnknown_085EFAFA
- .4byte gUnknown_08624D1C
-
-gUnknown_08624D8C:: @ 8624D8C
- .4byte gText_Norman_Pokenav_2B5719
- .byte 0x32
- .byte 1
- .2byte 0xFFFF
- .4byte gText_Norman_Pokenav_2B5795
- .byte 0xF1
- .byte 4
- .2byte 0xFFFF
- .4byte gText_Norman_Pokenav_2B584D
- .byte 0xF3
- .byte 4
- .2byte 0xFFFF
- .4byte gText_Norman_Pokenav_2B58E3
- .byte 0xF4
- .byte 4
- .2byte 0xFFFF
- .4byte gText_Norman_Pokenav_2B5979
- .byte 0xD4
- .byte 0
- .2byte 0xFFFF
- .4byte gText_Norman_Pokenav_2B5A07
- .byte 0xFE
- .byte 0xFF
- .2byte 0xFFFF
- .4byte gText_Norman_Pokenav_2B5A69
- .byte 0x64
- .byte 8
- .2byte 0xFFFF
- .4byte gText_Norman_Pokenav_2B5ACF
- .byte 0x64
- .byte 8
- .2byte 0xFFFF
- .4byte gText_Norman_Pokenav_2B5B5E
- .byte 0x64
- .byte 8
- .2byte 0xFFFF
- .4byte NULL
- .4byte 0xFFFFFFFF
-
-gUnknown_08624DDC:: @ 8624DDC
- .byte 5, 7, 0x32, 1, 0x45, 0, 0, 0
- .4byte gUnknown_085EFB25
- .4byte gUnknown_085EFB47
- .4byte gUnknown_08624D8C
-
-gUnknown_08624DF0:: @ 8624DF0
- .byte 3, 0, 0x19, 1
- .4byte gUnknown_085EFBC9
- .4byte gUnknown_085E8270
-
-gUnknown_08624DFC:: @ 8624DFC
- .4byte gText_Mom_Pokenav_2B227B
- .byte 0xFF
- .byte 0xFF
- .2byte 0xFFFF
- .4byte gText_Mom_Pokenav_2B2310
- .byte 0xF4
- .byte 0x4
- .2byte 0xFFFF
- .4byte gText_Mom_Pokenav_2B23F3
- .byte 0x64
- .byte 8
- .2byte 0xFFFF
- .4byte NULL
- .4byte 0xFFFFFFFF
-
-gUnknown_08624E1C:: @ 8624E1C
- .byte 0, 0, 0xD8, 0
- .4byte gUnknown_085EFB32
- .4byte gUnknown_085EFB4B
- .4byte gUnknown_08624DFC
-
-gUnknown_08624E2C:: @ 8624E2C
- .4byte gText_Steven_Pokenav_2B5B95
- .byte 0xFF
- .byte 0xFF
- .2byte 0xFFFF
- .4byte gText_Steven_Pokenav_2B5C53
- .byte 0xC7
- .byte 0
- .2byte 0xFFFF
- .4byte gText_Steven_Pokenav_2B5CC9
- .byte 0xD4
- .byte 0
- .2byte 0xFFFF
- .4byte gText_Steven_Pokenav_2B5DB4
- .byte 0x70
- .byte 0
- .2byte 0xFFFF
- .4byte gText_Steven_Pokenav_2B5E26
- .byte 0xF6
- .byte 4
- .2byte 0xFFFF
- .4byte gText_Steven_Pokenav_2B5EA2
- .byte 0x81
- .byte 0
- .2byte 0xFFFF
- .4byte gText_Steven_Pokenav_2B5ED9
- .byte 0x64
- .byte 8
- .2byte 0xFFFF
- .4byte NULL
- .4byte 0xFFFFFFFF
-
-gUnknown_08624E6C:: @ 8624E6C
- .byte 0, 0xD5, 0x31, 1
- .4byte gUnknown_085EFB04
- .4byte gUnknown_085EFB11
- .4byte gUnknown_08624E2C
-
-gUnknown_08624E7C:: @ 8624E7C
- .4byte gText_May_Pokenav_2B3AB3
- .byte 0xFF
- .byte 0xFF
- .2byte 0xFFFF
- .4byte gText_May_Pokenav_2B3B3F
- .byte 0xF1
- .byte 0x4
- .2byte 0xFFFF
- .4byte gText_May_Pokenav_2B3C13
- .byte 0x95
- .byte 0
- .2byte 0xFFFF
- .4byte gText_May_Pokenav_2B3CF3
- .byte 0x24
- .byte 0x3
- .2byte 0xFFFF
- .4byte gText_May_Pokenav_2B3D4B
- .byte 0x6A
- .byte 0
- .2byte 0xFFFF
- .4byte gText_May_Pokenav_2B3DD1
- .byte 0xF3
- .byte 0x4
- .2byte 0xFFFF
- .4byte gText_May_Pokenav_2B3E69
- .byte 0xF4
- .byte 4
- .2byte 0xFFFF
- .4byte gText_May_Pokenav_2B3ECD
- .byte 0x97
- .byte 0
- .2byte 0xFFFF
- .4byte gText_May_Pokenav_2B3F2B
- .byte 0xD4
- .byte 0
- .2byte 0xFFFF
- .4byte gText_May_Pokenav_2B3FFB
- .byte 0x6F
- .byte 0
- .2byte 0xFFFF
- .4byte gText_May_Pokenav_2B402B
- .byte 0x61
- .byte 0
- .2byte 0xFFFF
- .4byte gText_May_Pokenav_2B414B
- .byte 0x70
- .byte 0
- .2byte 0xFFFF
- .4byte gText_May_Pokenav_2B4228
- .byte 0x81
- .byte 0
- .2byte 0xFFFF
- .4byte gText_May_Pokenav_2B42E0
- .byte 0xF7
- .byte 4
- .2byte 0xFFFF
- .4byte gText_May_Pokenav_2B4350
- .byte 0x64
- .byte 8
- .2byte 0xFFFF
- .4byte NULL
- .4byte 0xFFFFFFFF
-
-gUnknown_08624EFC:: @ 8624EFC
- .byte 4, 0, 0xFD, 0
- .4byte gUnknown_085EFB18
- .4byte gExpandedPlaceholder_May
- .4byte gUnknown_08624E7C
-
-gUnknown_08624F0C:: @ 8624F0C
- .4byte gText_Brendan_Pokenav_2B43EF
- .byte 0xFF
- .byte 0xFF
- .2byte 0xFFFF
- .4byte gText_Brendan_Pokenav_2B4486
- .byte 0xF1
- .byte 0x4
- .2byte 0xFFFF
- .4byte gText_Brendan_Pokenav_2B4560
- .byte 0x95
- .byte 0
- .2byte 0xFFFF
- .4byte gText_Brendan_Pokenav_2B463F
- .byte 0x24
- .byte 0x3
- .2byte 0xFFFF
- .4byte gText_Brendan_Pokenav_2B46B7
- .byte 0x6A
- .byte 0
- .2byte 0xFFFF
- .4byte gText_Brendan_Pokenav_2B4761
- .byte 0xF3
- .byte 0x4
- .2byte 0xFFFF
- .4byte gText_Brendan_Pokenav_2B47F4
- .byte 0xF4
- .byte 4
- .2byte 0xFFFF
- .4byte gText_Brendan_Pokenav_2B4882
- .byte 0x97
- .byte 0
- .2byte 0xFFFF
- .4byte gText_Brendan_Pokenav_2B4909
- .byte 0xD4
- .byte 0
- .2byte 0xFFFF
- .4byte gText_Brendan_Pokenav_2B49C4
- .byte 0x6F
- .byte 0
- .2byte 0xFFFF
- .4byte gText_Brendan_Pokenav_2B4A44
- .byte 0x61
- .byte 0
- .2byte 0xFFFF
- .4byte gText_Brendan_Pokenav_2B4B28
- .byte 0x70
- .byte 0
- .2byte 0xFFFF
- .4byte gText_Brendan_Pokenav_2B4C15
- .byte 0x81
- .byte 0
- .2byte 0xFFFF
- .4byte gText_Brendan_Pokenav_2B4CD8
- .byte 0xF7
- .byte 4
- .2byte 0xFFFF
- .4byte gText_Brendan_Pokenav_2B4D46
- .byte 0x64
- .byte 8
- .2byte 0xFFFF
- .4byte NULL
- .4byte 0xFFFFFFFF
-
-gUnknown_08624F8C:: @ 8624F8C
- .byte 4, 1, 0xFD, 0
- .4byte gUnknown_085EFB18
- .4byte gExpandedPlaceholder_Brendan
- .4byte gUnknown_08624F0C
-
-gUnknown_08624F9C:: @ 8624F9C
- .4byte gText_Wally_Pokenav_2B4DE2
- .byte 0xFF
- .byte 0xFF
- .2byte 0xFFFF
- .4byte gText_Wally_Pokenav_2B4E57
- .byte 0xC7
- .byte 0
- .2byte 0xFFFF
- .4byte gText_Wally_Pokenav_2B4EA5
- .byte 0xF3
- .byte 0x4
- .2byte 0xFFFF
- .4byte gText_Wally_Pokenav_2B4F41
- .byte 0x97
- .byte 0
- .2byte 0xFFFF
- .4byte gText_Wally_Pokenav_2B4FF3
- .byte 0x6F
- .byte 0
- .2byte 0xFFFF
- .4byte gText_Wally_Pokenav_2B50B1
- .byte 0x81
- .byte 0
- .2byte 0xFFFF
- .4byte gText_Wally_Pokenav_2B5100
- .byte 0x7E
- .byte 0
- .2byte 0xFFFF
- .4byte NULL
- .4byte 0xFFFFFFFF
-
-gUnknown_08624FDC:: @ 8624FDC
- .byte 0x24, 3, 5, 0
- .2byte 0x6F, 0xD5
- .byte 0x5A, 3, 0x46, 0, 0xFF, 0xFF, 0xD5, 0
-
-gUnknown_08624FEC:: @ 8624FEC
- .byte 2, 0, 0xD6, 0
- .4byte 0x40
- .4byte gUnknown_085EFB3E
- .4byte gUnknown_08624F9C
- .4byte gUnknown_08624FDC
-
-gUnknown_08624500:: @ 8624500
- .4byte gText_Scott_Pokenav_2B5184
- .byte 0xFF
- .byte 0xFF
- .2byte 0xFFFF
- .4byte gText_Scott_Pokenav_2B5275
- .byte 0x8B
- .byte 0
- .2byte 0xFFFF
- .4byte gText_Scott_Pokenav_2B5323
- .byte 0x97
- .byte 0
- .2byte 0xFFFF
- .4byte gText_Scott_Pokenav_2B53DB
- .byte 0xD4
- .byte 0
- .2byte 0xFFFF
- .4byte gText_Scott_Pokenav_2B54A5
- .byte 0x70
- .byte 0
- .2byte 0xFFFF
- .4byte gText_Scott_Pokenav_2B5541
- .byte 0xF7
- .byte 4
- .2byte 0xFFFF
- .4byte gText_Scott_Pokenav_2B56CA
- .byte 0x64
- .byte 8
- .2byte 0xFFFF
- .4byte NULL
- .4byte 0xFFFFFFFF
-
-gUnknown_08625040:: @ 8625040
- .byte 0, 0xD5, 0xD7, 0
- .4byte gUnknown_085EFB4F
- .4byte gUnknown_085EFB5C
- .4byte gUnknown_08624500
-
-gUnknown_08625050:: @ 8625050
- .4byte gText_Roxanne_Pokenav_2B2456
- .byte 0xFE
- .byte 0xFF
- .2byte 0xFFFF
- .4byte gText_Roxanne_Pokenav_2B250E
- .byte 0xFF
- .byte 0xFF
- .2byte 0xFFFF
- .4byte gText_Roxanne_Pokenav_2B25C1
- .byte 0xFF
- .byte 0xFF
- .2byte 0xFFFF
- .4byte gText_Roxanne_Pokenav_2B2607
- .byte 0x64
- .byte 0x8
- .2byte 0xFFFF
- .4byte NULL
- .4byte 0xFFFFFFFF
-
-gUnknown_08625078:: @ 8625078
- .byte 5, 10, 0xD3, 1
- .4byte 0x41
- .4byte gUnknown_085EFB62
- .4byte NULL
- .4byte gUnknown_08625050
-
-gUnknown_0862508C:: @ 862508C
- .4byte gText_Brawly_Pokenav_2B2659
- .byte 0xFE
- .byte 0xFF
- .2byte 0xFFFF
- .4byte gText_Brawly_Pokenav_2B275D
- .byte 0xFF
- .byte 0xFF
- .2byte 0xFFFF
- .4byte gText_Brawly_Pokenav_2B286F
- .byte 0xFF
- .byte 0xFF
- .2byte 0xFFFF
- .4byte gText_Brawly_Pokenav_2B28D1
- .byte 0x64
- .byte 0x8
- .2byte 0xFFFF
- .4byte NULL
- .4byte 0xFFFFFFFF
-
-gUnknown_086250B4:: @ 86250B4
- .byte 5, 2, 0xD4, 1
- .4byte 0x42
- .4byte gUnknown_085EFB6F
- .4byte NULL
- .4byte gUnknown_0862508C
-
-gUnknown_086250C8:: @ 86250C8
- .4byte gText_Wattson_Pokenav_2B2912
- .byte 0xFE
- .byte 0xFF
- .2byte 0xFFFF
- .4byte gText_Wattson_Pokenav_2B29CA
- .byte 0xFF
- .byte 0xFF
- .2byte 0xFFFF
- .4byte gText_Wattson_Pokenav_2B2AB6
- .byte 0xFF
- .byte 0xFF
- .2byte 0xFFFF
- .4byte gText_Wattson_Pokenav_2B2B01
- .byte 0x64
- .byte 0x8
- .2byte 0xFFFF
- .4byte NULL
- .4byte 0xFFFFFFFF
-
-gUnknown_086250F0:: @ 86250F0
- .byte 5, 9, 0xD5, 1
- .4byte 0x43
- .4byte gUnknown_085EFB7B
- .4byte NULL
- .4byte gUnknown_086250C8
-
-gUnknown_08625104:: @ 8625104
- .4byte gText_Flannery_Pokenav_2B2B4D
- .byte 0xFE
- .byte 0xFF
- .2byte 0xFFFF
- .4byte gText_Flannery_Pokenav_2B2C0E
- .byte 0xFF
- .byte 0xFF
- .2byte 0xFFFF
- .4byte gText_Flannery_Pokenav_2B2CF1
- .byte 0xFF
- .byte 0xFF
- .2byte 0xFFFF
- .4byte gText_Flannery_Pokenav_2B2D54
- .byte 0x64
- .byte 0x8
- .2byte 0xFFFF
- .4byte NULL
- .4byte 0xFFFFFFFF
-
-gUnknown_0862512C:: @ 862512C
- .byte 5, 3, 0xD6, 1
- .4byte 0x44
- .4byte gUnknown_085EFB87
- .4byte NULL
- .4byte gUnknown_08625104
-
-gUnknown_08625140:: @ 8625140
- .4byte gText_Winona_Pokenav_2B2DA4
- .byte 0xFE
- .byte 0xFF
- .2byte 0xFFFF
- .4byte gText_Winona_Pokenav_2B2E2B
- .byte 0xFF
- .byte 0xFF
- .2byte 0xFFFF
- .4byte gText_Winona_Pokenav_2B2EC2
- .byte 0xFF
- .byte 0xFF
- .2byte 0xFFFF
- .4byte gText_Winona_Pokenav_2B2F16
- .byte 0x64
- .byte 0x8
- .2byte 0xFFFF
- .4byte NULL
- .4byte 0xFFFFFFFF
-
-gUnknown_08625168:: @ 8625168
- .byte 5, 11, 0xD7, 1
- .4byte 0x46
- .4byte gUnknown_085EFB94
- .4byte NULL
- .4byte gUnknown_08625140
-
-gUnknown_0862517C:: @ 862517C
- .4byte gText_TateLiza_Pokenav_2B2F97
- .byte 0xFE
- .byte 0xFF
- .2byte 0xFFFF
- .4byte gText_TateLiza_Pokenav_2B306E
- .byte 0xFF
- .byte 0xFF
- .2byte 0xFFFF
- .4byte gText_TateLiza_Pokenav_2B3158
- .byte 0xFF
- .byte 0xFF
- .2byte 0xFFFF
- .4byte gText_TateLiza_Pokenav_2B31CD
- .byte 0x64
- .byte 0x8
- .2byte 0xFFFF
- .4byte NULL
- .4byte 0xFFFFFFFF
-
-gUnknown_086251A4:: @ 86251A4
- .byte 5, 13, 0xD8, 1
- .4byte 0x47
- .4byte gUnknown_085EFB9E
- .4byte NULL
- .4byte gUnknown_0862517C
-
-gUnknown_086251B8:: @ 86251B8
- .4byte gText_Juan_Pokenav_2B3249
- .byte 0xFE
- .byte 0xFF
- .2byte 0xFFFF
- .4byte gText_Juan_Pokenav_2B32EC
- .byte 0xFF
- .byte 0xFF
- .2byte 0xFFFF
- .4byte gText_Juan_Pokenav_2B33AA
- .byte 0xFF
- .byte 0xFF
- .2byte 0xFFFF
- .4byte gText_Juan_Pokenav_2B341E
- .byte 0x64
- .byte 0x8
- .2byte 0xFFFF
- .4byte NULL
- .4byte 0xFFFFFFFF
-
-gUnknown_086251E0:: @ 86251E0
- .byte 5, 14, 0xD9, 1
- .4byte 0x48
- .4byte gUnknown_085EFBA9
- .4byte NULL
- .4byte gUnknown_086251B8
-
-gUnknown_086251F4:: @ 86251F4
- .4byte gText_Sidney_Pokenav_2B34CC
- .byte 0xFF
- .byte 0xFF
- .2byte 0xFFFF
- .4byte NULL
- .4byte 0xFFFFFFFF
-
-gUnknown_08625204:: @ 8625204
- .byte 5, 15, 0xA5, 1
- .4byte 0x49
- .4byte gUnknown_085EFBB5
- .4byte NULL
- .4byte gUnknown_086251F4
-
-gUnknown_08625218:: @ 8625218
- .4byte gText_Phoebe_Pokenav_2B3561
- .byte 0xFF
- .byte 0xFF
- .2byte 0xFFFF
- .4byte NULL
- .4byte 0xFFFFFFFF
-
-gUnknown_08625228:: @ 8625228
- .byte 5, 15, 0xA6, 1
- .4byte 0x4A
- .4byte gUnknown_085EFBB5
- .4byte NULL
- .4byte gUnknown_08625218
-
-gUnknown_0862523C:: @ 862523C
- .4byte gText_Glacia_Pokenav_2B35E4
- .byte 0xFF
- .byte 0xFF
- .2byte 0xFFFF
- .4byte NULL
- .4byte 0xFFFFFFFF
-
-gUnknown_0862524C:: @ 862524C
- .byte 5, 15, 0xA7, 1
- .4byte 0x4B
- .4byte gUnknown_085EFBB5
- .4byte NULL
- .4byte gUnknown_0862523C
-
-gUnknown_08625260:: @ 8625260
- .4byte gText_Drake_Pokenav_2B368B
- .byte 0xFF
- .byte 0xFF
- .2byte 0xFFFF
- .4byte NULL
- .4byte 0xFFFFFFFF
-
-gUnknown_08625270:: @ 8625270
- .byte 5, 15, 0xA8, 1
- .4byte 0x4C
- .4byte gUnknown_085EFBB5
- .4byte NULL
- .4byte gUnknown_08625260
-
-gUnknown_08625284:: @ 8625284
- .4byte gText_Wallace_Pokenav_2B3790
- .byte 0xFF
- .byte 0xFF
- .2byte 0xFFFF
- .4byte NULL
- .4byte 0xFFFFFFFF
-
-gUnknown_08625294:: @ 8625294
- .byte 5, 15, 0xA9, 1
- .4byte 0x4D
- .4byte gUnknown_085EFBC0
- .4byte NULL
- .4byte gUnknown_08625284
-
-gUnknown_086252A8:: @ 86252A8
- .4byte gUnknown_08624D7C
- .4byte gUnknown_08624DF0
- .4byte gUnknown_08624F8C
- .4byte gUnknown_08624EFC
- .4byte gUnknown_08624FEC
- .4byte gUnknown_08624DDC
- .4byte gUnknown_08624E1C
- .4byte gUnknown_08624E6C
- .4byte gUnknown_08625040
- .4byte gUnknown_08625078
- .4byte gUnknown_086250B4
- .4byte gUnknown_086250F0
- .4byte gUnknown_0862512C
- .4byte gUnknown_08625168
- .4byte gUnknown_086251A4
- .4byte gUnknown_086251E0
- .4byte gUnknown_08625204
- .4byte gUnknown_08625228
- .4byte gUnknown_0862524C
- .4byte gUnknown_08625270
- .4byte gUnknown_08625294
-
-gUnknown_086252FC:: @ 86252FC
- .4byte sub_81D1628
- .4byte sub_81D164C
- .4byte sub_81D1670
- .4byte sub_81D1694
- .4byte sub_81D16CC
-
-gUnknown_08625310:: @ 8625310
- .4byte sub_81D1714
- .4byte sub_81D1718
- .4byte sub_81D171C
- .4byte sub_81D1750
- .4byte sub_81D1754
-
-gUnknown_08625324:: @ 8625324
- .4byte sub_81D178C
- .4byte sub_81D1790
- .4byte sub_81D17C0
- .4byte sub_81D17E0
- .4byte sub_81D17E4
-
-gUnknown_08625338:: @ 8625338
- .4byte sub_81D1840
- .4byte sub_81D1844
- .4byte sub_81D1848
- .4byte sub_81D184C
- .4byte sub_81D1850
-
-gUnknown_0862534C:: @ 862534C
- .4byte sub_81D1888
- .4byte sub_81D188C
- .4byte sub_81D1890
- .4byte sub_81D1894
- .4byte sub_81D1898
-
-gUnknown_08625360:: @ 8625360
- .4byte sub_81D18D0
- .4byte sub_81D18DC
- .4byte sub_81D18FC
- .4byte sub_81D1908
- .4byte sub_81D1914
-
-gUnknown_08625374:: @ 8625374
- .4byte sub_81D1AB0
- .4byte sub_81D1ABC
- .4byte sub_81D1ADC
- .4byte sub_81D1AF4
- .4byte sub_81D1B00
-
-gUnknown_08625388:: @ 8625388
- .2byte 7, 0x4B, 0xFFFF, 0
- .4byte gUnknown_085ED453
- .4byte gUnknown_085ED46B
- .4byte gUnknown_085ED483
- .4byte gUnknown_085ED49D
- .2byte 7, 0x4B, 0x4F6, 0
- .4byte gUnknown_085ED453
- .4byte gUnknown_085ED46B
- .4byte gUnknown_085ED4B3
- .4byte gUnknown_085ED4CE
- .2byte 2, 0X3C, 0xFFFF, 0
- .4byte gUnknown_085ED4E3
- .4byte gUnknown_085ED4FA
- .4byte gUnknown_085ED516
- .4byte gUnknown_085ED52F
- .2byte 3, 0x3F, 0xFFFF, 0
- .4byte gUnknown_085ED547
- .4byte gUnknown_085ED563
- .4byte gUnknown_085ED579
- .4byte gUnknown_085ED58F
+ .section .rodata.after.match.call
gUnknown_086253E8:: @ 86253E8
.4byte 0x8010100
diff --git a/data/scripts/maps/AbandonedShip_Rooms2_1F.inc b/data/scripts/maps/AbandonedShip_Rooms2_1F.inc
index ab710546b..2ffe3afc7 100644
--- a/data/scripts/maps/AbandonedShip_Rooms2_1F.inc
+++ b/data/scripts/maps/AbandonedShip_Rooms2_1F.inc
@@ -13,7 +13,7 @@ AbandonedShip_Rooms2_1F_EventScript_2380A7:: @ 82380A7
AbandonedShip_Rooms2_1F_EventScript_2380D7:: @ 82380D7
msgbox AbandonedShip_Rooms2_1F_Text_2383BB, 4
setvar VAR_0x8004, 642
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 642
callstd 8
release
@@ -36,7 +36,7 @@ AbandonedShip_Rooms2_1F_EventScript_23810B:: @ 823810B
AbandonedShip_Rooms2_1F_EventScript_23813B:: @ 823813B
msgbox AbandonedShip_Rooms2_1F_Text_2383BB, 4
setvar VAR_0x8004, 642
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 642
callstd 8
release
diff --git a/data/scripts/maps/AbandonedShip_Rooms_1F.inc b/data/scripts/maps/AbandonedShip_Rooms_1F.inc
index 00fde5ccb..2a6bc36b6 100644
--- a/data/scripts/maps/AbandonedShip_Rooms_1F.inc
+++ b/data/scripts/maps/AbandonedShip_Rooms_1F.inc
@@ -24,7 +24,7 @@ AbandonedShip_Rooms_1F_EventScript_237ADF:: @ 8237ADF
waitmovement 0
msgbox AbandonedShip_Rooms_1F_Text_237C2A, 4
setvar VAR_0x8004, 144
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 144
callstd 8
release
diff --git a/data/scripts/maps/JaggedPass.inc b/data/scripts/maps/JaggedPass.inc
index e5c393221..15ac1bae6 100644
--- a/data/scripts/maps/JaggedPass.inc
+++ b/data/scripts/maps/JaggedPass.inc
@@ -115,7 +115,7 @@ JaggedPass_EventScript_2307C8:: @ 82307C8
special sub_80B4808
msgbox JaggedPass_Text_230A2C, 4
setvar VAR_0x8004, 474
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 474
callstd 8
release
@@ -139,7 +139,7 @@ JaggedPass_EventScript_230827:: @ 8230827
special sub_80B4808
msgbox JaggedPass_Text_230BC6, 4
setvar VAR_0x8004, 216
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 216
callstd 8
release
diff --git a/data/scripts/maps/MeteorFalls_1F_2R.inc b/data/scripts/maps/MeteorFalls_1F_2R.inc
index 76aad489f..4f4ab7c6b 100644
--- a/data/scripts/maps/MeteorFalls_1F_2R.inc
+++ b/data/scripts/maps/MeteorFalls_1F_2R.inc
@@ -15,7 +15,7 @@ MeteorFalls_1F_2R_EventScript_22C50A:: @ 822C50A
waitmovement 0
msgbox MeteorFalls_1F_2R_Text_22C6F6, 4
setvar VAR_0x8004, 392
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 392
callstd 8
release
@@ -38,7 +38,7 @@ MeteorFalls_1F_2R_EventScript_22C540:: @ 822C540
MeteorFalls_1F_2R_EventScript_22C570:: @ 822C570
msgbox MeteorFalls_1F_2R_Text_22C99C, 4
setvar VAR_0x8004, 681
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 681
callstd 8
release
@@ -61,7 +61,7 @@ MeteorFalls_1F_2R_EventScript_22C5A4:: @ 822C5A4
MeteorFalls_1F_2R_EventScript_22C5D4:: @ 822C5D4
msgbox MeteorFalls_1F_2R_Text_22C99C, 4
setvar VAR_0x8004, 681
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 681
callstd 8
release
diff --git a/data/scripts/maps/MtChimney.inc b/data/scripts/maps/MtChimney.inc
index e445fc23f..b4825579c 100644
--- a/data/scripts/maps/MtChimney.inc
+++ b/data/scripts/maps/MtChimney.inc
@@ -500,7 +500,7 @@ MtChimney_EventScript_22F176:: @ 822F176
waitmovement 0
msgbox MtChimney_Text_2300E3, 4
setvar VAR_0x8004, 313
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 313
callstd 8
release
@@ -545,7 +545,7 @@ MtChimney_EventScript_22F234:: @ 822F234
waitmovement 0
msgbox MtChimney_Text_230557, 4
setvar VAR_0x8004, 1
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 1
callstd 8
release
diff --git a/data/scripts/maps/MtPyre_3F.inc b/data/scripts/maps/MtPyre_3F.inc
index 0d733a433..ec5373509 100644
--- a/data/scripts/maps/MtPyre_3F.inc
+++ b/data/scripts/maps/MtPyre_3F.inc
@@ -25,7 +25,7 @@ MtPyre_3F_EventScript_2317AD:: @ 82317AD
waitmovement 0
msgbox MtPyre_3F_Text_231A49, 4
setvar VAR_0x8004, 9
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 9
callstd 8
release
diff --git a/data/scripts/maps/MtPyre_6F.inc b/data/scripts/maps/MtPyre_6F.inc
index 7a98eb2ab..8d5d912c2 100644
--- a/data/scripts/maps/MtPyre_6F.inc
+++ b/data/scripts/maps/MtPyre_6F.inc
@@ -15,7 +15,7 @@ MtPyre_6F_EventScript_231D67:: @ 8231D67
waitmovement 0
msgbox MtPyre_6F_Text_231E43, 4
setvar VAR_0x8004, 108
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 108
callstd 8
release
diff --git a/data/scripts/maps/PetalburgWoods.inc b/data/scripts/maps/PetalburgWoods.inc
index 5afb12d68..907f07623 100644
--- a/data/scripts/maps/PetalburgWoods.inc
+++ b/data/scripts/maps/PetalburgWoods.inc
@@ -301,7 +301,7 @@ PetalburgWoods_EventScript_22E2C5:: @ 822E2C5
PetalburgWoods_EventScript_22E2D6:: @ 822E2D6
msgbox PetalburgWoods_Text_22E8C3, 4
setvar VAR_0x8004, 621
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 621
callstd 8
release
@@ -317,7 +317,7 @@ PetalburgWoods_EventScript_22E2EF:: @ 822E2EF
PetalburgWoods_EventScript_22E302:: @ 822E302
msgbox PetalburgWoods_Text_22E914, 4
setvar VAR_0x8004, 621
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 621
callstd 8
release
diff --git a/data/scripts/maps/Route102.inc b/data/scripts/maps/Route102.inc
index ae82ea0b4..cd817df35 100644
--- a/data/scripts/maps/Route102.inc
+++ b/data/scripts/maps/Route102.inc
@@ -41,7 +41,7 @@ Route102_EventScript_1EC146:: @ 81EC146
Route102_EventScript_1EC157:: @ 81EC157
msgbox Route102_Text_294668, 4
setvar VAR_0x8004, 318
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 318
callstd 8
release
@@ -57,7 +57,7 @@ Route102_EventScript_1EC170:: @ 81EC170
Route102_EventScript_1EC183:: @ 81EC183
msgbox Route102_Text_2945EB, 4
setvar VAR_0x8004, 318
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 318
callstd 8
release
diff --git a/data/scripts/maps/Route103.inc b/data/scripts/maps/Route103.inc
index fa055a971..d71ec729c 100644
--- a/data/scripts/maps/Route103.inc
+++ b/data/scripts/maps/Route103.inc
@@ -218,7 +218,7 @@ Route103_EventScript_1EC60B:: @ 81EC60B
Route103_EventScript_1EC63A:: @ 81EC63A
msgbox Route103_Text_294B8A, 4
setvar VAR_0x8004, 481
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 481
callstd 8
release
@@ -240,7 +240,7 @@ Route103_EventScript_1EC66E:: @ 81EC66E
Route103_EventScript_1EC69D:: @ 81EC69D
msgbox Route103_Text_294B8A, 4
setvar VAR_0x8004, 481
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 481
callstd 8
release
@@ -270,7 +270,7 @@ Route103_EventScript_1EC714:: @ 81EC714
waitmovement 0
msgbox Route103_Text_294F7E, 4
setvar VAR_0x8004, 293
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 293
callstd 8
release
diff --git a/data/scripts/maps/Route104.inc b/data/scripts/maps/Route104.inc
index e672b7ad2..314b47e1d 100644
--- a/data/scripts/maps/Route104.inc
+++ b/data/scripts/maps/Route104.inc
@@ -904,7 +904,7 @@ Route104_EventScript_1ED3CE:: @ 81ED3CE
Route104_EventScript_1ED3DF:: @ 81ED3DF
msgbox Route104_Text_29576B, 4
setvar VAR_0x8004, 604
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 604
callstd 8
release
@@ -920,7 +920,7 @@ Route104_EventScript_1ED3F8:: @ 81ED3F8
Route104_EventScript_1ED40B:: @ 81ED40B
msgbox Route104_Text_2956FF, 4
setvar VAR_0x8004, 604
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 604
callstd 8
release
@@ -955,7 +955,7 @@ Route104_EventScript_1ED47C:: @ 81ED47C
Route104_EventScript_1ED48D:: @ 81ED48D
msgbox Route104_Text_29595A, 4
setvar VAR_0x8004, 136
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 136
callstd 8
release
@@ -971,7 +971,7 @@ Route104_EventScript_1ED4A6:: @ 81ED4A6
Route104_EventScript_1ED4B9:: @ 81ED4B9
msgbox Route104_Text_2958F8, 4
setvar VAR_0x8004, 136
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 136
callstd 8
release
@@ -1006,7 +1006,7 @@ Route104_EventScript_1ED52A:: @ 81ED52A
Route104_EventScript_1ED53B:: @ 81ED53B
msgbox Route104_Text_295B60, 4
setvar VAR_0x8004, 114
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 114
callstd 8
release
@@ -1022,7 +1022,7 @@ Route104_EventScript_1ED554:: @ 81ED554
Route104_EventScript_1ED567:: @ 81ED567
msgbox Route104_Text_295B01, 4
setvar VAR_0x8004, 114
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 114
callstd 8
release
diff --git a/data/scripts/maps/Route105.inc b/data/scripts/maps/Route105.inc
index 32c6826af..3cb6d9ae6 100644
--- a/data/scripts/maps/Route105.inc
+++ b/data/scripts/maps/Route105.inc
@@ -75,7 +75,7 @@ Route105_EventScript_1EE300:: @ 81EE300
waitmovement 0
msgbox Route105_Text_296159, 4
setvar VAR_0x8004, 737
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 737
callstd 8
release
diff --git a/data/scripts/maps/Route106.inc b/data/scripts/maps/Route106.inc
index 132621cb8..fdfff0587 100644
--- a/data/scripts/maps/Route106.inc
+++ b/data/scripts/maps/Route106.inc
@@ -29,7 +29,7 @@ Route106_EventScript_1EE4ED:: @ 81EE4ED
waitmovement 0
msgbox Route106_Text_2963E3, 4
setvar VAR_0x8004, 339
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 339
callstd 8
release
diff --git a/data/scripts/maps/Route107.inc b/data/scripts/maps/Route107.inc
index b7d144ef2..2c8364592 100644
--- a/data/scripts/maps/Route107.inc
+++ b/data/scripts/maps/Route107.inc
@@ -20,7 +20,7 @@ Route107_EventScript_1EE5D8:: @ 81EE5D8
waitmovement 0
msgbox Route107_Text_29685A, 4
setvar VAR_0x8004, 155
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 155
callstd 8
release
diff --git a/data/scripts/maps/Route108.inc b/data/scripts/maps/Route108.inc
index e77006508..25657c5a4 100644
--- a/data/scripts/maps/Route108.inc
+++ b/data/scripts/maps/Route108.inc
@@ -40,7 +40,7 @@ Route108_EventScript_1EE729:: @ 81EE729
waitmovement 0
msgbox Route108_Text_296FD8, 4
setvar VAR_0x8004, 740
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 740
callstd 8
release
diff --git a/data/scripts/maps/Route109.inc b/data/scripts/maps/Route109.inc
index d708246de..123f78db1 100644
--- a/data/scripts/maps/Route109.inc
+++ b/data/scripts/maps/Route109.inc
@@ -409,7 +409,7 @@ Route109_EventScript_1EEAC5:: @ 81EEAC5
waitmovement 0
msgbox Route109_Text_2973C1, 4
setvar VAR_0x8004, 64
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 64
callstd 8
release
@@ -434,7 +434,7 @@ Route109_EventScript_1EEB27:: @ 81EEB27
waitmovement 0
msgbox Route109_Text_297520, 4
setvar VAR_0x8004, 57
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 57
callstd 8
release
diff --git a/data/scripts/maps/Route110.inc b/data/scripts/maps/Route110.inc
index 3c743fb3c..9d00303c9 100644
--- a/data/scripts/maps/Route110.inc
+++ b/data/scripts/maps/Route110.inc
@@ -188,7 +188,7 @@ Route110_EventScript_1EF44C:: @ 81EF44C
waitmovement 0
msgbox Route110_Text_298201, 4
setvar VAR_0x8004, 512
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 512
callstd 8
release
@@ -228,7 +228,7 @@ Route110_EventScript_1EF4F3:: @ 81EF4F3
waitmovement 0
msgbox Route110_Text_297CFE, 4
setvar VAR_0x8004, 353
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 353
callstd 8
release
@@ -258,7 +258,7 @@ Route110_EventScript_1EF56C:: @ 81EF56C
waitmovement 0
msgbox Route110_Text_297ECD, 4
setvar VAR_0x8004, 358
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 358
callstd 8
release
@@ -283,7 +283,7 @@ Route110_EventScript_1EF5CE:: @ 81EF5CE
waitmovement 0
msgbox Route110_Text_2983EE, 4
setvar VAR_0x8004, 302
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 302
callstd 8
release
diff --git a/data/scripts/maps/Route111.inc b/data/scripts/maps/Route111.inc
index 8e1672dfe..a23565c14 100644
--- a/data/scripts/maps/Route111.inc
+++ b/data/scripts/maps/Route111.inc
@@ -485,7 +485,7 @@ Route111_EventScript_1F128C:: @ 81F128C
waitmovement 0
msgbox Route111_Text_298C00, 4
setvar VAR_0x8004, 44
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 44
callstd 8
release
@@ -525,7 +525,7 @@ Route111_EventScript_1F1333:: @ 81F1333
waitmovement 0
msgbox Route111_Text_29903D, 4
setvar VAR_0x8004, 78
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 78
callstd 8
release
@@ -550,7 +550,7 @@ Route111_EventScript_1F1395:: @ 81F1395
waitmovement 0
msgbox Route111_Text_29921D, 4
setvar VAR_0x8004, 94
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 94
callstd 8
release
diff --git a/data/scripts/maps/Route112.inc b/data/scripts/maps/Route112.inc
index 88262fadb..0ad5ee47c 100644
--- a/data/scripts/maps/Route112.inc
+++ b/data/scripts/maps/Route112.inc
@@ -79,7 +79,7 @@ Route112_EventScript_1F1EAD:: @ 81F1EAD
waitmovement 0
msgbox Route112_Text_29993C, 4
setvar VAR_0x8004, 627
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 627
callstd 8
release
diff --git a/data/scripts/maps/Route113.inc b/data/scripts/maps/Route113.inc
index c1ce29b72..d990527a6 100644
--- a/data/scripts/maps/Route113.inc
+++ b/data/scripts/maps/Route113.inc
@@ -72,7 +72,7 @@ Route113_EventScript_1F221A:: @ 81F221A
waitmovement 0
msgbox Route113_Text_299F49, 4
setvar VAR_0x8004, 434
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 434
callstd 8
release
@@ -97,7 +97,7 @@ Route113_EventScript_1F227C:: @ 81F227C
waitmovement 0
msgbox Route113_Text_29A0A2, 4
setvar VAR_0x8004, 419
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 419
callstd 8
release
diff --git a/data/scripts/maps/Route114.inc b/data/scripts/maps/Route114.inc
index 6be6bea91..9443d35bc 100644
--- a/data/scripts/maps/Route114.inc
+++ b/data/scripts/maps/Route114.inc
@@ -122,7 +122,7 @@ Route114_EventScript_1F26C8:: @ 81F26C8
waitmovement 0
msgbox Route114_Text_29A9F7, 4
setvar VAR_0x8004, 143
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 143
callstd 8
release
@@ -147,7 +147,7 @@ Route114_EventScript_1F272A:: @ 81F272A
waitmovement 0
msgbox Route114_Text_29ABA6, 4
setvar VAR_0x8004, 206
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 206
callstd 8
release
diff --git a/data/scripts/maps/Route115.inc b/data/scripts/maps/Route115.inc
index 69edd5830..2d4f7c2e3 100644
--- a/data/scripts/maps/Route115.inc
+++ b/data/scripts/maps/Route115.inc
@@ -50,7 +50,7 @@ Route115_EventScript_1F29BA:: @ 81F29BA
waitmovement 0
msgbox Route115_Text_29B2B3, 4
setvar VAR_0x8004, 307
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 307
callstd 8
release
@@ -80,7 +80,7 @@ Route115_EventScript_1F2A33:: @ 81F2A33
waitmovement 0
msgbox Route115_Text_29B50B, 4
setvar VAR_0x8004, 183
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 183
callstd 8
release
@@ -105,7 +105,7 @@ Route115_EventScript_1F2A95:: @ 81F2A95
waitmovement 0
msgbox Route115_Text_29B6AB, 4
setvar VAR_0x8004, 427
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 427
callstd 8
release
diff --git a/data/scripts/maps/Route116.inc b/data/scripts/maps/Route116.inc
index 00bc1ff6c..a8d73397c 100644
--- a/data/scripts/maps/Route116.inc
+++ b/data/scripts/maps/Route116.inc
@@ -281,7 +281,7 @@ Route116_EventScript_1F2F03:: @ 81F2F03
waitmovement 0
msgbox Route116_Text_29BE71, 4
setvar VAR_0x8004, 273
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 273
callstd 8
release
@@ -297,7 +297,7 @@ Route116_EventScript_1F2F22:: @ 81F2F22
Route116_EventScript_1F2F35:: @ 81F2F35
msgbox Route116_Text_29BDEF, 4
setvar VAR_0x8004, 273
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 273
callstd 8
release
@@ -342,7 +342,7 @@ Route116_EventScript_1F2FDF:: @ 81F2FDF
waitmovement 0
msgbox Route116_Text_29C096, 4
setvar VAR_0x8004, 280
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 280
callstd 8
release
@@ -358,7 +358,7 @@ Route116_EventScript_1F2FFE:: @ 81F2FFE
Route116_EventScript_1F3011:: @ 81F3011
msgbox Route116_Text_29C052, 4
setvar VAR_0x8004, 280
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 280
callstd 8
release
diff --git a/data/scripts/maps/Route117.inc b/data/scripts/maps/Route117.inc
index 20240dc82..55a7b910e 100644
--- a/data/scripts/maps/Route117.inc
+++ b/data/scripts/maps/Route117.inc
@@ -52,7 +52,7 @@ Route117_EventScript_1F39FC:: @ 81F39FC
waitmovement 0
msgbox Route117_Text_29C508, 4
setvar VAR_0x8004, 538
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 538
callstd 8
release
@@ -77,7 +77,7 @@ Route117_EventScript_1F3A5E:: @ 81F3A5E
waitmovement 0
msgbox Route117_Text_29C6BC, 4
setvar VAR_0x8004, 545
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 545
callstd 8
release
@@ -102,7 +102,7 @@ Route117_EventScript_1F3AC0:: @ 81F3AC0
waitmovement 0
msgbox Route117_Text_29C846, 4
setvar VAR_0x8004, 364
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 364
callstd 8
release
@@ -127,7 +127,7 @@ Route117_EventScript_1F3B22:: @ 81F3B22
waitmovement 0
msgbox Route117_Text_29CA32, 4
setvar VAR_0x8004, 369
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 369
callstd 8
release
@@ -155,7 +155,7 @@ Route117_EventScript_1F3B6F:: @ 81F3B6F
Route117_EventScript_1F3B9F:: @ 81F3B9F
msgbox Route117_Text_29CD1D, 4
setvar VAR_0x8004, 287
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 287
callstd 8
release
@@ -178,7 +178,7 @@ Route117_EventScript_1F3BD3:: @ 81F3BD3
Route117_EventScript_1F3C03:: @ 81F3C03
msgbox Route117_Text_29CD1D, 4
setvar VAR_0x8004, 287
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 287
callstd 8
release
diff --git a/data/scripts/maps/Route118.inc b/data/scripts/maps/Route118.inc
index 4894e8187..27a2539e1 100644
--- a/data/scripts/maps/Route118.inc
+++ b/data/scripts/maps/Route118.inc
@@ -200,7 +200,7 @@ Route118_EventScript_1F3FB3:: @ 81F3FB3
waitmovement 0
msgbox Route118_Text_29D343, 4
setvar VAR_0x8004, 37
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 37
callstd 8
release
@@ -235,7 +235,7 @@ Route118_EventScript_1F4043:: @ 81F4043
waitmovement 0
msgbox Route118_Text_29D74A, 4
setvar VAR_0x8004, 196
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 196
callstd 8
release
diff --git a/data/scripts/maps/Route119.inc b/data/scripts/maps/Route119.inc
index 2f99f7c4e..5f60851b4 100644
--- a/data/scripts/maps/Route119.inc
+++ b/data/scripts/maps/Route119.inc
@@ -380,7 +380,7 @@ Route119_EventScript_1F483C:: @ 81F483C
waitmovement 0
msgbox Route119_Text_29DD1C, 4
setvar VAR_0x8004, 552
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 552
callstd 8
release
@@ -405,7 +405,7 @@ Route119_EventScript_1F489E:: @ 81F489E
waitmovement 0
msgbox Route119_Text_29DEF7, 4
setvar VAR_0x8004, 559
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 559
callstd 8
release
diff --git a/data/scripts/maps/Route120.inc b/data/scripts/maps/Route120.inc
index f89ac7e86..b3475a3ed 100644
--- a/data/scripts/maps/Route120.inc
+++ b/data/scripts/maps/Route120.inc
@@ -309,7 +309,7 @@ Route120_EventScript_1F581A:: @ 81F581A
waitmovement 0
msgbox Route120_Text_29E75D, 4
setvar VAR_0x8004, 406
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 406
callstd 8
release
@@ -344,7 +344,7 @@ Route120_EventScript_1F58AA:: @ 81F58AA
waitmovement 0
msgbox Route120_Text_29EA31, 4
setvar VAR_0x8004, 226
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 226
callstd 8
release
diff --git a/data/scripts/maps/Route121.inc b/data/scripts/maps/Route121.inc
index c813fe6ac..d579401b8 100644
--- a/data/scripts/maps/Route121.inc
+++ b/data/scripts/maps/Route121.inc
@@ -84,7 +84,7 @@ Route121_EventScript_1F5EB7:: @ 81F5EB7
waitmovement 0
msgbox Route121_Text_29F25B, 4
setvar VAR_0x8004, 254
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 254
callstd 8
release
@@ -124,7 +124,7 @@ Route121_EventScript_1F5F66:: @ 81F5F66
waitmovement 0
msgbox Route121_Text_29F69F, 4
setvar VAR_0x8004, 127
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 127
callstd 8
release
@@ -169,7 +169,7 @@ Route121_EventScript_1F6024:: @ 81F6024
waitmovement 0
msgbox Route121_Text_29F80D, 4
setvar VAR_0x8004, 767
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 767
callstd 8
release
diff --git a/data/scripts/maps/Route123.inc b/data/scripts/maps/Route123.inc
index f6d535e38..b622a931b 100644
--- a/data/scripts/maps/Route123.inc
+++ b/data/scripts/maps/Route123.inc
@@ -74,7 +74,7 @@ Route123_EventScript_1F6236:: @ 81F6236
waitmovement 0
msgbox Route123_Text_29FE70, 4
setvar VAR_0x8004, 238
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 238
callstd 8
release
@@ -99,7 +99,7 @@ Route123_EventScript_1F6298:: @ 81F6298
waitmovement 0
msgbox Route123_Text_2A0027, 4
setvar VAR_0x8004, 249
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 249
callstd 8
release
@@ -174,7 +174,7 @@ Route123_EventScript_1F63E8:: @ 81F63E8
waitmovement 0
msgbox Route123_Text_2A03C1, 4
setvar VAR_0x8004, 195
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 195
callstd 8
release
diff --git a/data/scripts/maps/Route124.inc b/data/scripts/maps/Route124.inc
index 2079c338d..b21e55417 100644
--- a/data/scripts/maps/Route124.inc
+++ b/data/scripts/maps/Route124.inc
@@ -35,7 +35,7 @@ Route124_EventScript_1F65DF:: @ 81F65DF
waitmovement 0
msgbox Route124_Text_2A0C14, 4
setvar VAR_0x8004, 449
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 449
callstd 8
release
@@ -68,7 +68,7 @@ Route124_EventScript_1F6643:: @ 81F6643
Route124_EventScript_1F6673:: @ 81F6673
msgbox Route124_Text_2A109F, 4
setvar VAR_0x8004, 687
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 687
callstd 8
release
@@ -91,7 +91,7 @@ Route124_EventScript_1F66A7:: @ 81F66A7
Route124_EventScript_1F66D7:: @ 81F66D7
msgbox Route124_Text_2A109F, 4
setvar VAR_0x8004, 687
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 687
callstd 8
release
diff --git a/data/scripts/maps/Route125.inc b/data/scripts/maps/Route125.inc
index de3ae07b5..2dda3fb2d 100644
--- a/data/scripts/maps/Route125.inc
+++ b/data/scripts/maps/Route125.inc
@@ -60,7 +60,7 @@ Route125_EventScript_1F682C:: @ 81F682C
waitmovement 0
msgbox Route125_Text_2A17CF, 4
setvar VAR_0x8004, 492
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 492
callstd 8
release
diff --git a/data/scripts/maps/Route126.inc b/data/scripts/maps/Route126.inc
index d03e08103..3ea9ba786 100644
--- a/data/scripts/maps/Route126.inc
+++ b/data/scripts/maps/Route126.inc
@@ -56,7 +56,7 @@ Route126_EventScript_1F69A3:: @ 81F69A3
waitmovement 0
msgbox Route126_Text_2A1F5A, 4
setvar VAR_0x8004, 377
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 377
callstd 8
release
diff --git a/data/scripts/maps/Route127.inc b/data/scripts/maps/Route127.inc
index cbc7d7da1..12e5bf127 100644
--- a/data/scripts/maps/Route127.inc
+++ b/data/scripts/maps/Route127.inc
@@ -75,7 +75,7 @@ Route127_EventScript_1F6B02:: @ 81F6B02
waitmovement 0
msgbox Route127_Text_2A26EE, 4
setvar VAR_0x8004, 672
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 672
callstd 8
release
diff --git a/data/scripts/maps/Route128.inc b/data/scripts/maps/Route128.inc
index 6d336e464..f62f78404 100644
--- a/data/scripts/maps/Route128.inc
+++ b/data/scripts/maps/Route128.inc
@@ -189,7 +189,7 @@ Route128_EventScript_1F6CEA:: @ 81F6CEA
waitmovement 0
msgbox Route128_Text_2A2916, 4
setvar VAR_0x8004, 376
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 376
callstd 8
release
@@ -214,7 +214,7 @@ Route128_EventScript_1F6D4C:: @ 81F6D4C
waitmovement 0
msgbox Route128_Text_2A2AF9, 4
setvar VAR_0x8004, 386
- special sub_81D1C20
+ special SetMatchCallRegisteredFlag
setorcopyvar VAR_0x8000, 386
callstd 8
release
diff --git a/data/specials.inc b/data/specials.inc
index 6c6c1b7be..8b83702ad 100644
--- a/data/specials.inc
+++ b/data/specials.inc
@@ -497,7 +497,7 @@ gSpecials:: @ 81DBA64
def_special ChangeBoxPokemonNickname
def_special get_unknown_box_id
def_special sub_813B21C
- def_special sub_81D1C20
+ def_special SetMatchCallRegisteredFlag
def_special sub_8175280
def_special sub_813B2E4
def_special sub_813B374
diff --git a/data/strings.s b/data/strings.s
index ace85665c..631eb8c19 100644
--- a/data/strings.s
+++ b/data/strings.s
@@ -51,7 +51,7 @@ gText_EggNickname:: @ 85E8264
gText_Pokemon:: @ 85E8268
.string "POKéMON$"
-gUnknown_085E8270:: @ 85E8270
+gProfBirchMatchCallName:: @ 85E8270
.string "PROF. BIRCH$"
gText_MainMenuNewGame:: @ 85E827C
@@ -3746,46 +3746,46 @@ gText_ThankYou:: @ 85ED440
gText_ByeBye:: @ 85ED44A
.string "BYE-BYE!$"
-gUnknown_085ED453:: @ 85ED453
+gMatchCallStevenStrategyText:: @ 85ED453
.string "Attack the weak points!$"
-gUnknown_085ED46B:: @ 85ED46B
+gMatchCall_StevenTrainersPokemonText:: @ 85ED46B
.string "Ultimate STEEL POKéMON.$"
-gUnknown_085ED483:: @ 85ED483
+gMatchCall_StevenSelfIntroductionText_Line1_BeforeMeteorFallsBattle:: @ 85ED483
.string "I’d climb even waterfalls$"
-gUnknown_085ED49D:: @ 85ED49D
+gMatchCall_StevenSelfIntroductionText_Line2_BeforeMeteorFallsBattle:: @ 85ED49D
.string "to find a rare stone!$"
-gUnknown_085ED4B3:: @ 85ED4B3
+gMatchCall_StevenSelfIntroductionText_Line1_AfterMeteorFallsBattle:: @ 85ED4B3
.string "I’m the strongest and most$"
-gUnknown_085ED4CE:: @ 85ED4CE
+gMatchCall_StevenSelfIntroductionText_Line2_AfterMeteorFallsBattle:: @ 85ED4CE
.string "energetic after all!$"
-gUnknown_085ED4E3:: @ 85ED4E3
+gMatchCall_BrendanStrategyText:: @ 85ED4E3
.string "Battle with knowledge!$"
-gUnknown_085ED4FA:: @ 85ED4FA
+gMatchCall_BrendanTrainersPokemonText:: @ 85ED4FA
.string "I will use various POKéMON.$"
-gUnknown_085ED516:: @ 85ED516
+gMatchCall_BrendanSelfIntroductionText_Line1:: @ 85ED516
.string "I’ll be a better POKéMON$"
-gUnknown_085ED52F:: @ 85ED52F
+gMatchCall_BrendanSelfIntroductionText_Line2:: @ 85ED52F
.string "prof than my father is!$"
-gUnknown_085ED547:: @ 85ED547
+gMatchCall_MayStrategyText:: @ 85ED547
.string "I’m not so good at battles.$"
-gUnknown_085ED563:: @ 85ED563
+gMatchCall_MayTrainersPokemonText:: @ 85ED563
.string "I’ll use any POKéMON!$"
-gUnknown_085ED579:: @ 85ED579
+gMatchCall_MaySelfIntroductionText_Line1:: @ 85ED579
.string "My POKéMON and I help$"
-gUnknown_085ED58F:: @ 85ED58F
+gMatchCall_MaySelfIntroductionText_Line2:: @ 85ED58F
.string "my father’s research.$"
gText_HatchedFromEgg:: @ 85ED5A5
@@ -5242,70 +5242,70 @@ gText_Confirm3:: @ 85EFAE0
gText_Cancel4:: @ 85EFAE8
.string "CANCEL$"
-gUnknown_085EFAEF:: @ 85EFAEF
+gMrStoneMatchCallDesc:: @ 85EFAEF
.string "DEVON PRES$"
-gUnknown_085EFAFA:: @ 85EFAFA
+gMrStoneMatchCallName:: @ 85EFAFA
.string "MR. STONE$"
-gUnknown_085EFB04:: @ 85EFB04
+gStevenMatchCallDesc:: @ 85EFB04
.string "HARD AS ROCK$"
-gUnknown_085EFB11:: @ 85EFB11
+gStevenMatchCallName:: @ 85EFB11
.string "STEVEN$"
-gUnknown_085EFB18:: @ 85EFB18
+gMayBrendanMatchCallDesc:: @ 85EFB18
.string "RAD NEIGHBOR$"
-gUnknown_085EFB25:: @ 85EFB25
+gNormanMatchCallDesc:: @ 85EFB25
.string "RELIABLE ONE$"
-gUnknown_085EFB32:: @ 85EFB32
+gMomMatchCallDesc:: @ 85EFB32
.string "CALM & KIND$"
-gUnknown_085EFB3E:: @ 85EFB3E
+gWallyMatchCallDesc:: @ 85EFB3E
.string "{PKMN} LOVER$"
-gUnknown_085EFB47:: @ 85EFB47
+gNormanMatchCallName:: @ 85EFB47
.string "DAD$"
-gUnknown_085EFB4B:: @ 85EFB4B
+gMomMatchCallName:: @ 85EFB4B
.string "MOM$"
-gUnknown_085EFB4F:: @ 85EFB4F
+gScottMatchCallDesc:: @ 85EFB4F
.string "ELUSIVE EYES$"
-gUnknown_085EFB5C:: @ 85EFB5C
+gScottMatchCallName:: @ 85EFB5C
.string "SCOTT$"
-gUnknown_085EFB62:: @ 85EFB62
+gRoxanneMatchCallDesc:: @ 85EFB62
.string "ROCKIN’ WHIZ$"
-gUnknown_085EFB6F:: @ 85EFB6F
+gBrawlyMatchCallDesc:: @ 85EFB6F
.string "THE BIG HIT$"
-gUnknown_085EFB7B:: @ 85EFB7B
+gWattsonMatchCallDesc:: @ 85EFB7B
.string "SWELL SHOCK$"
-gUnknown_085EFB87:: @ 85EFB87
+gFlanneryMatchCallDesc:: @ 85EFB87
.string "PASSION BURN$"
-gUnknown_085EFB94:: @ 85EFB94
+gWinonaMatchCallDesc:: @ 85EFB94
.string "SKY TAMER$"
-gUnknown_085EFB9E:: @ 85EFB9E
+gTateLizaMatchCallDesc:: @ 85EFB9E
.string "MYSTIC DUO$"
-gUnknown_085EFBA9:: @ 85EFBA9
+gJuanMatchCallDesc:: @ 85EFBA9
.string "DANDY CHARM$"
-gUnknown_085EFBB5:: @ 85EFBB5
+gEliteFourMatchCallDesc:: @ 85EFBB5
.string "ELITE FOUR$"
-gUnknown_085EFBC0:: @ 85EFBC0
+gChampionMatchCallDesc:: @ 85EFBC0
.string "CHAMPION$"
-gUnknown_085EFBC9:: @ 85EFBC9
+gProfBirchMatchCallDesc:: @ 85EFBC9
.string "{PKMN} PROF.$"
gText_CommStandbyAwaitingOtherPlayer:: @ 85EFBD2
diff --git a/include/battle_frontier_1.h b/include/battle_frontier_1.h
index 5483b28ef..b9c633efc 100644
--- a/include/battle_frontier_1.h
+++ b/include/battle_frontier_1.h
@@ -2,6 +2,7 @@
#define GUARD_BATTLE_FRONTIER_1_H
bool32 sub_8196094(void);
+void sub_8197080(u8 *);
void sub_8196080(const u8 *str);
#endif // GUARD_BATTLE_FRONTIER_1_H
diff --git a/include/constants/flags.h b/include/constants/flags.h
index 7f52018a1..641d74f19 100644
--- a/include/constants/flags.h
+++ b/include/constants/flags.h
@@ -348,6 +348,7 @@
#define FLAG_0x159 0x159
#define FLAG_0x15A 0x15A
#define FLAG_0x15B 0x15B
+
#define FLAG_MATCH_CALL_REGISTERED 0x15C
#define FLAG_0x15D 0x15D
#define FLAG_0x15E 0x15E
diff --git a/include/match_call.h b/include/match_call.h
new file mode 100644
index 000000000..9698e7cd3
--- /dev/null
+++ b/include/match_call.h
@@ -0,0 +1,13 @@
+#ifndef GUARD_MATCH_CALL_H
+#define GUARD_MATCH_CALL_H
+
+enum {
+ MATCH_CALL_TYPE_NON_TRAINER,
+ MATCH_CALL_TYPE_TRAINER,
+ MATCH_CALL_TYPE_WALLY,
+ MATCH_CALL_TYPE_BIRCH,
+ MATCH_CALL_TYPE_MAY_BRENDAN,
+ MATCH_CALL_TYPE_GYMLEADER_ELITEFOUR
+};
+
+#endif //GUARD_MATCH_CALL_H
diff --git a/ld_script.txt b/ld_script.txt
index aeb739376..cd30c8461 100644
--- a/ld_script.txt
+++ b/ld_script.txt
@@ -264,6 +264,8 @@ SECTIONS {
src/pokemon_summary_screen.o(.text);
asm/pokemon_summary_screen.o(.text);
asm/pokenav.o(.text);
+ src/match_call.o(.text);
+ asm/pokenav.o(.text.after.match.call);
src/rayquaza_scene.o(.text);
src/walda_phrase.o(.text);
asm/contest_link_81D9DE4.o(.text);
@@ -535,6 +537,8 @@ SECTIONS {
src/berry_fix_program.o(.rodata);
data/pokemon_summary_screen.o(.rodata);
data/pokenav.o(.rodata);
+ src/match_call.o(.rodata);
+ data/pokenav.o(.rodata.after.match.call);
src/rayquaza_scene.o(.rodata);
src/walda_phrase.o(.rodata);
src/gym_leader_rematch.o(.rodata);
diff --git a/src/match_call.c b/src/match_call.c
new file mode 100644
index 000000000..9c1e02947
--- /dev/null
+++ b/src/match_call.c
@@ -0,0 +1,1275 @@
+
+// Includes
+#include "global.h"
+#include "battle_setup.h"
+#include "event_data.h"
+#include "string_util.h"
+#include "battle.h"
+#include "battle_frontier_1.h"
+#include "gym_leader_rematch.h"
+
+extern const u8 gTrainerClassNames[][13];
+
+// Static type declarations
+
+typedef struct MatchCallTextDataStruct {
+ const u8 *text;
+ u16 flag;
+ u16 flag2;
+} match_call_text_data_t;
+
+struct MatchCallStructCommon {
+ u8 type;
+ u8 v1;
+ u16 flag;
+};
+
+struct MatchCallStruct0 {
+ u8 type;
+ u8 v1;
+ u16 flag;
+ const u8 *desc;
+ const u8 *name;
+ const match_call_text_data_t *textData;
+};
+
+struct MatchCallStruct1 {
+ u8 type;
+ u8 v1;
+ u16 flag;
+ u16 rematchTableIdx;
+ const u8 *desc;
+ const u8 *name;
+ const match_call_text_data_t *textData;
+};
+
+struct MatchCallSubstruct2 {
+ u16 flag;
+ u8 v2;
+};
+
+struct MatchCallStruct2 {
+ u8 type;
+ u8 v1;
+ u16 flag;
+ u16 rematchTableIdx;
+ const u8 *desc;
+ const match_call_text_data_t *textData;
+ const struct MatchCallSubstruct2 *v10;
+};
+
+struct MatchCallStruct3 {
+ u8 type;
+ u8 v1;
+ u16 flag;
+ const u8 *desc;
+ const u8 *name;
+};
+
+struct MatchCallStruct4 {
+ u8 type;
+ u8 gender;
+ u16 flag;
+ const u8 *desc;
+ const u8 *name;
+ const match_call_text_data_t *textData;
+};
+
+struct MatchCallStruct5 {
+ u8 type;
+ u8 v1;
+ u16 flag;
+ u16 v4;
+ const u8 *desc;
+ const u8 *name;
+ const match_call_text_data_t *textData;
+};
+
+#define MATCHCALLDEF(name, type_, ...) \
+static const struct MatchCallStruct##type_ name = { \
+ .type = type_, \
+ __VA_ARGS__ \
+};
+
+typedef union {
+ const struct MatchCallStructCommon *common;
+ const struct MatchCallStruct0 *type0;
+ const struct MatchCallStruct1 *type1;
+ const struct MatchCallStruct2 *type2;
+ const struct MatchCallStruct3 *type3;
+ const struct MatchCallStruct4 *type4;
+ const struct MatchCallStruct5 *type5;
+} match_call_t;
+
+struct UnkStruct_08625388 {
+ u16 idx;
+ u16 v2;
+ u16 v4;
+ const u8 *v8[4];
+};
+
+// Static RAM declarations
+
+// Static ROM declarations
+
+static bool32 MatchCallGetFlag_Type0(match_call_t);
+static bool32 MatchCallGetFlag_Type1(match_call_t);
+static bool32 MatchCallGetFlag_Type2(match_call_t);
+static bool32 MatchCallGetFlag_Type3(match_call_t);
+static bool32 MatchCallGetFlag_Type4(match_call_t);
+
+static u8 sub_81D1714(match_call_t);
+static u8 sub_81D1718(match_call_t);
+static u8 sub_81D171C(match_call_t);
+static u8 sub_81D1750(match_call_t);
+static u8 sub_81D1754(match_call_t);
+
+static bool32 MatchCall_IsRematchable_Type0(match_call_t);
+static bool32 MatchCall_IsRematchable_Type1(match_call_t);
+static bool32 MatchCall_IsRematchable_Type2(match_call_t);
+static bool32 MatchCall_IsRematchable_Type3(match_call_t);
+static bool32 MatchCall_IsRematchable_Type4(match_call_t);
+
+static bool32 sub_81D1840(match_call_t);
+static bool32 sub_81D1844(match_call_t);
+static bool32 sub_81D1848(match_call_t);
+static bool32 sub_81D184C(match_call_t);
+static bool32 sub_81D1850(match_call_t);
+
+static u32 MatchCall_GetRematchTableIdx_Type0(match_call_t);
+static u32 MatchCall_GetRematchTableIdx_Type1(match_call_t);
+static u32 MatchCall_GetRematchTableIdx_Type2(match_call_t);
+static u32 MatchCall_GetRematchTableIdx_Type3(match_call_t);
+static u32 MatchCall_GetRematchTableIdx_Type4(match_call_t);
+
+static void MatchCall_GetMessage_Type0(match_call_t, u8 *);
+static void MatchCall_GetMessage_Type1(match_call_t, u8 *);
+static void MatchCall_GetMessage_Type2(match_call_t, u8 *);
+static void MatchCall_GetMessage_Type3(match_call_t, u8 *);
+static void MatchCall_GetMessage_Type4(match_call_t, u8 *);
+
+static void MatchCall_GetNameAndDesc_Type0(match_call_t, const u8 **, const u8 **);
+static void MatchCall_GetNameAndDesc_Type1(match_call_t, const u8 **, const u8 **);
+static void MatchCall_GetNameAndDesc_Type2(match_call_t, const u8 **, const u8 **);
+static void MatchCall_GetNameAndDesc_Type3(match_call_t, const u8 **, const u8 **);
+static void MatchCall_GetNameAndDesc_Type4(match_call_t, const u8 **, const u8 **);
+
+static void sub_81D1920(const match_call_text_data_t *, u8 *);
+static void sub_81D199C(const match_call_text_data_t *, u16, u8 *);
+static void MatchCall_GetNameAndDescByRematchIdx(u32, const u8 **, const u8 **);
+
+extern const u8 gText_MrStone_Pokenav_2B60C0[];
+extern const u8 gText_MrStone_Pokenav_2B61E6[];
+extern const u8 gText_MrStone_Pokenav_2B6302[];
+extern const u8 gText_MrStone_Pokenav_2B63A0[];
+extern const u8 gText_MrStone_Pokenav_2B64A2[];
+extern const u8 gText_MrStone_Pokenav_2B6526[];
+extern const u8 gText_MrStone_Pokenav_2B65BB[];
+extern const u8 gText_MrStone_Pokenav_2B6664[];
+extern const u8 gText_MrStone_Pokenav_2B66B1[];
+extern const u8 gText_MrStone_Pokenav_2B6703[];
+extern const u8 gText_MrStone_Pokenav_2B67ED[];
+
+extern const u8 gMrStoneMatchCallDesc[];
+extern const u8 gMrStoneMatchCallName[];
+
+extern const u8 gText_Norman_Pokenav_2B5719[];
+extern const u8 gText_Norman_Pokenav_2B5795[];
+extern const u8 gText_Norman_Pokenav_2B584D[];
+extern const u8 gText_Norman_Pokenav_2B58E3[];
+extern const u8 gText_Norman_Pokenav_2B5979[];
+extern const u8 gText_Norman_Pokenav_2B5A07[];
+extern const u8 gText_Norman_Pokenav_2B5A69[];
+extern const u8 gText_Norman_Pokenav_2B5ACF[];
+extern const u8 gText_Norman_Pokenav_2B5B5E[];
+
+extern const u8 gNormanMatchCallDesc[];
+extern const u8 gNormanMatchCallName[];
+
+extern const u8 gProfBirchMatchCallDesc[];
+extern const u8 gProfBirchMatchCallName[];
+
+extern const u8 gText_Mom_Pokenav_2B227B[];
+extern const u8 gText_Mom_Pokenav_2B2310[];
+extern const u8 gText_Mom_Pokenav_2B23F3[];
+
+extern const u8 gMomMatchCallDesc[];
+extern const u8 gMomMatchCallName[];
+
+extern const u8 gText_Steven_Pokenav_2B5B95[];
+extern const u8 gText_Steven_Pokenav_2B5C53[];
+extern const u8 gText_Steven_Pokenav_2B5CC9[];
+extern const u8 gText_Steven_Pokenav_2B5DB4[];
+extern const u8 gText_Steven_Pokenav_2B5E26[];
+extern const u8 gText_Steven_Pokenav_2B5EA2[];
+extern const u8 gText_Steven_Pokenav_2B5ED9[];
+
+extern const u8 gStevenMatchCallDesc[];
+extern const u8 gStevenMatchCallName[];
+
+extern const u8 gText_May_Pokenav_2B3AB3[];
+extern const u8 gText_May_Pokenav_2B3B3F[];
+extern const u8 gText_May_Pokenav_2B3C13[];
+extern const u8 gText_May_Pokenav_2B3CF3[];
+extern const u8 gText_May_Pokenav_2B3D4B[];
+extern const u8 gText_May_Pokenav_2B3DD1[];
+extern const u8 gText_May_Pokenav_2B3E69[];
+extern const u8 gText_May_Pokenav_2B3ECD[];
+extern const u8 gText_May_Pokenav_2B3F2B[];
+extern const u8 gText_May_Pokenav_2B3FFB[];
+extern const u8 gText_May_Pokenav_2B402B[];
+extern const u8 gText_May_Pokenav_2B414B[];
+extern const u8 gText_May_Pokenav_2B4228[];
+extern const u8 gText_May_Pokenav_2B42E0[];
+extern const u8 gText_May_Pokenav_2B4350[];
+extern const u8 gMayBrendanMatchCallDesc[];
+extern const u8 gExpandedPlaceholder_May[];
+extern const u8 gText_Brendan_Pokenav_2B43EF[];
+extern const u8 gText_Brendan_Pokenav_2B4486[];
+extern const u8 gText_Brendan_Pokenav_2B4560[];
+extern const u8 gText_Brendan_Pokenav_2B463F[];
+extern const u8 gText_Brendan_Pokenav_2B46B7[];
+extern const u8 gText_Brendan_Pokenav_2B4761[];
+extern const u8 gText_Brendan_Pokenav_2B47F4[];
+extern const u8 gText_Brendan_Pokenav_2B4882[];
+extern const u8 gText_Brendan_Pokenav_2B4909[];
+extern const u8 gText_Brendan_Pokenav_2B49C4[];
+extern const u8 gText_Brendan_Pokenav_2B4A44[];
+extern const u8 gText_Brendan_Pokenav_2B4B28[];
+extern const u8 gText_Brendan_Pokenav_2B4C15[];
+extern const u8 gText_Brendan_Pokenav_2B4CD8[];
+extern const u8 gText_Brendan_Pokenav_2B4D46[];
+extern const u8 gExpandedPlaceholder_Brendan[];
+extern const u8 gText_Wally_Pokenav_2B4DE2[];
+extern const u8 gText_Wally_Pokenav_2B4E57[];
+extern const u8 gText_Wally_Pokenav_2B4EA5[];
+extern const u8 gText_Wally_Pokenav_2B4F41[];
+extern const u8 gText_Wally_Pokenav_2B4FF3[];
+extern const u8 gText_Wally_Pokenav_2B50B1[];
+extern const u8 gText_Wally_Pokenav_2B5100[];
+extern const u8 gWallyMatchCallDesc[];
+extern const u8 gText_Scott_Pokenav_2B5184[];
+extern const u8 gText_Scott_Pokenav_2B5275[];
+extern const u8 gText_Scott_Pokenav_2B5323[];
+extern const u8 gText_Scott_Pokenav_2B53DB[];
+extern const u8 gText_Scott_Pokenav_2B54A5[];
+extern const u8 gText_Scott_Pokenav_2B5541[];
+extern const u8 gText_Scott_Pokenav_2B56CA[];
+extern const u8 gScottMatchCallDesc[];
+extern const u8 gScottMatchCallName[];
+extern const u8 gText_Roxanne_Pokenav_2B2456[];
+extern const u8 gText_Roxanne_Pokenav_2B250E[];
+extern const u8 gText_Roxanne_Pokenav_2B25C1[];
+extern const u8 gText_Roxanne_Pokenav_2B2607[];
+extern const u8 gRoxanneMatchCallDesc[];
+extern const u8 gText_Brawly_Pokenav_2B2659[];
+extern const u8 gText_Brawly_Pokenav_2B275D[];
+extern const u8 gText_Brawly_Pokenav_2B286F[];
+extern const u8 gText_Brawly_Pokenav_2B28D1[];
+extern const u8 gBrawlyMatchCallDesc[];
+extern const u8 gText_Wattson_Pokenav_2B2912[];
+extern const u8 gText_Wattson_Pokenav_2B29CA[];
+extern const u8 gText_Wattson_Pokenav_2B2AB6[];
+extern const u8 gText_Wattson_Pokenav_2B2B01[];
+extern const u8 gWattsonMatchCallDesc[];
+extern const u8 gText_Flannery_Pokenav_2B2B4D[];
+extern const u8 gText_Flannery_Pokenav_2B2C0E[];
+extern const u8 gText_Flannery_Pokenav_2B2CF1[];
+extern const u8 gText_Flannery_Pokenav_2B2D54[];
+extern const u8 gFlanneryMatchCallDesc[];
+extern const u8 gText_Winona_Pokenav_2B2DA4[];
+extern const u8 gText_Winona_Pokenav_2B2E2B[];
+extern const u8 gText_Winona_Pokenav_2B2EC2[];
+extern const u8 gText_Winona_Pokenav_2B2F16[];
+extern const u8 gWinonaMatchCallDesc[];
+extern const u8 gText_TateLiza_Pokenav_2B2F97[];
+extern const u8 gText_TateLiza_Pokenav_2B306E[];
+extern const u8 gText_TateLiza_Pokenav_2B3158[];
+extern const u8 gText_TateLiza_Pokenav_2B31CD[];
+extern const u8 gTateLizaMatchCallDesc[];
+extern const u8 gText_Juan_Pokenav_2B3249[];
+extern const u8 gText_Juan_Pokenav_2B32EC[];
+extern const u8 gText_Juan_Pokenav_2B33AA[];
+extern const u8 gText_Juan_Pokenav_2B341E[];
+extern const u8 gJuanMatchCallDesc[];
+extern const u8 gText_Sidney_Pokenav_2B34CC[];
+extern const u8 gEliteFourMatchCallDesc[];
+extern const u8 gText_Phoebe_Pokenav_2B3561[];
+extern const u8 gText_Glacia_Pokenav_2B35E4[];
+extern const u8 gText_Drake_Pokenav_2B368B[];
+extern const u8 gText_Wallace_Pokenav_2B3790[];
+extern const u8 gChampionMatchCallDesc[];
+extern const u8 gMatchCallStevenStrategyText[];
+extern const u8 gMatchCall_StevenTrainersPokemonText[];
+extern const u8 gMatchCall_StevenSelfIntroductionText_Line1_BeforeMeteorFallsBattle[];
+extern const u8 gMatchCall_StevenSelfIntroductionText_Line2_BeforeMeteorFallsBattle[];
+extern const u8 gMatchCall_StevenSelfIntroductionText_Line1_AfterMeteorFallsBattle[];
+extern const u8 gMatchCall_StevenSelfIntroductionText_Line2_AfterMeteorFallsBattle[];
+extern const u8 gMatchCall_BrendanStrategyText[];
+extern const u8 gMatchCall_BrendanTrainersPokemonText[];
+extern const u8 gMatchCall_BrendanSelfIntroductionText_Line1[];
+extern const u8 gMatchCall_BrendanSelfIntroductionText_Line2[];
+extern const u8 gMatchCall_MayStrategyText[];
+extern const u8 gMatchCall_MayTrainersPokemonText[];
+extern const u8 gMatchCall_MaySelfIntroductionText_Line1[];
+extern const u8 gMatchCall_MaySelfIntroductionText_Line2[];
+// .rodata
+
+static const match_call_text_data_t sMrStoneTextScripts[] = {
+ { gText_MrStone_Pokenav_2B60C0, 0xFFFF, FLAG_0x158 },
+ { gText_MrStone_Pokenav_2B61E6, FLAG_0x158, 0xFFFF },
+ { gText_MrStone_Pokenav_2B6302, FLAG_0x0BD, 0xFFFF },
+ { gText_MrStone_Pokenav_2B63A0, FLAG_0x110, 0xFFFF },
+ { gText_MrStone_Pokenav_2B64A2, FLAG_0x06A, 0xFFFF },
+ { gText_MrStone_Pokenav_2B6526, FLAG_0x4F4, 0xFFFF },
+ { gText_MrStone_Pokenav_2B65BB, FLAG_0x097, 0xFFFF },
+ { gText_MrStone_Pokenav_2B6664, FLAG_0x06F, 0xFFFF },
+ { gText_MrStone_Pokenav_2B66B1, FLAG_0x070, 0xFFFF },
+ { gText_MrStone_Pokenav_2B6703, FLAG_0x4F7, 0xFFFF },
+ { gText_MrStone_Pokenav_2B67ED, FLAG_SYS_GAME_CLEAR, 0xFFFF },
+ { NULL, 0xFFFF, 0xFFFF }
+};
+
+MATCHCALLDEF(sMrStoneMatchCallHeader, 0, 10, 0xffff, gMrStoneMatchCallDesc, gMrStoneMatchCallName, sMrStoneTextScripts);
+
+static const match_call_text_data_t sNormanTextScripts[] = {
+ { gText_Norman_Pokenav_2B5719, FLAG_0x132, 0xFFFF },
+ { gText_Norman_Pokenav_2B5795, FLAG_0x4F1, 0xFFFF },
+ { gText_Norman_Pokenav_2B584D, FLAG_0x4F3, 0xFFFF },
+ { gText_Norman_Pokenav_2B58E3, FLAG_0x4F4, 0xFFFF },
+ { gText_Norman_Pokenav_2B5979, FLAG_0x0D4, 0xFFFF },
+ { gText_Norman_Pokenav_2B5A07, 0xFFFE, 0xFFFF },
+ { gText_Norman_Pokenav_2B5A69, FLAG_SYS_GAME_CLEAR, 0xFFFF },
+ { gText_Norman_Pokenav_2B5ACF, FLAG_SYS_GAME_CLEAR, 0xFFFF },
+ { gText_Norman_Pokenav_2B5B5E, FLAG_SYS_GAME_CLEAR, 0xFFFF },
+ { NULL, 0xFFFF, 0xFFFF }
+};
+
+MATCHCALLDEF(sNormanMatchCallHeader, 5, 7, FLAG_0x132, 0x45, gNormanMatchCallDesc, gNormanMatchCallName, sNormanTextScripts);
+
+MATCHCALLDEF(sProfBirchMatchCallHeader, 3, 0, FLAG_0x119, gProfBirchMatchCallDesc, gProfBirchMatchCallName)
+
+static const match_call_text_data_t sMomTextScripts[] = {
+ { gText_Mom_Pokenav_2B227B, 0xffff, 0xffff },
+ { gText_Mom_Pokenav_2B2310, FLAG_0x4F4, 0xffff },
+ { gText_Mom_Pokenav_2B23F3, FLAG_SYS_GAME_CLEAR, 0xffff },
+ { NULL, 0xffff, 0xffff }
+};
+
+MATCHCALLDEF(sMomMatchCallHeader, 0, 0, FLAG_0x0D8, gMomMatchCallDesc, gMomMatchCallName, sMomTextScripts);
+
+static const match_call_text_data_t sStevenTextScripts[] = {
+ { gText_Steven_Pokenav_2B5B95, 0xffff, 0xffff },
+ { gText_Steven_Pokenav_2B5C53, FLAG_0x0C7, 0xffff },
+ { gText_Steven_Pokenav_2B5CC9, FLAG_0x0D4, 0xffff },
+ { gText_Steven_Pokenav_2B5DB4, FLAG_0x070, 0xffff },
+ { gText_Steven_Pokenav_2B5E26, FLAG_0x4F6, 0xffff },
+ { gText_Steven_Pokenav_2B5EA2, FLAG_0x081, 0xffff },
+ { gText_Steven_Pokenav_2B5ED9, FLAG_SYS_GAME_CLEAR, 0xffff },
+ { NULL, 0xffff, 0xffff },
+};
+
+MATCHCALLDEF(sStevenMatchCallHeader, 0, 0xd5, FLAG_0x131, gStevenMatchCallDesc, gStevenMatchCallName, sStevenTextScripts);
+
+static const match_call_text_data_t sMayTextScripts[] = {
+ { gText_May_Pokenav_2B3AB3, 0xFFFF, 0xFFFF },
+ { gText_May_Pokenav_2B3B3F, FLAG_0x4F1, 0xFFFF },
+ { gText_May_Pokenav_2B3C13, FLAG_0x095, 0xFFFF },
+ { gText_May_Pokenav_2B3CF3, FLAG_0x324, 0xFFFF },
+ { gText_May_Pokenav_2B3D4B, FLAG_0x06A, 0xFFFF },
+ { gText_May_Pokenav_2B3DD1, FLAG_0x4F3, 0xFFFF },
+ { gText_May_Pokenav_2B3E69, FLAG_0x4F4, 0xFFFF },
+ { gText_May_Pokenav_2B3ECD, FLAG_0x097, 0xFFFF },
+ { gText_May_Pokenav_2B3F2B, FLAG_0x0D4, 0xFFFF },
+ { gText_May_Pokenav_2B3FFB, FLAG_0x06F, 0xFFFF },
+ { gText_May_Pokenav_2B402B, FLAG_0x061, 0xFFFF },
+ { gText_May_Pokenav_2B414B, FLAG_0x070, 0xFFFF },
+ { gText_May_Pokenav_2B4228, FLAG_0x081, 0xFFFF },
+ { gText_May_Pokenav_2B42E0, FLAG_0x4F7, 0xFFFF },
+ { gText_May_Pokenav_2B4350, FLAG_SYS_GAME_CLEAR, 0xFFFF },
+ { NULL, 0xFFFF, 0xFFFF }
+};
+
+MATCHCALLDEF(sMayMatchCallHeader, 4, MALE, FLAG_0x0FD, gMayBrendanMatchCallDesc, gExpandedPlaceholder_May, sMayTextScripts);
+
+static const match_call_text_data_t sBrendanTextScripts[] = {
+ { gText_Brendan_Pokenav_2B43EF, 0xFFFF, 0xFFFF },
+ { gText_Brendan_Pokenav_2B4486, FLAG_0x4F1, 0xFFFF },
+ { gText_Brendan_Pokenav_2B4560, FLAG_0x095, 0xFFFF },
+ { gText_Brendan_Pokenav_2B463F, FLAG_0x324, 0xFFFF },
+ { gText_Brendan_Pokenav_2B46B7, FLAG_0x06A, 0xFFFF },
+ { gText_Brendan_Pokenav_2B4761, FLAG_0x4F3, 0xFFFF },
+ { gText_Brendan_Pokenav_2B47F4, FLAG_0x4F4, 0xFFFF },
+ { gText_Brendan_Pokenav_2B4882, FLAG_0x097, 0xFFFF },
+ { gText_Brendan_Pokenav_2B4909, FLAG_0x0D4, 0xFFFF },
+ { gText_Brendan_Pokenav_2B49C4, FLAG_0x06F, 0xFFFF },
+ { gText_Brendan_Pokenav_2B4A44, FLAG_0x061, 0xFFFF },
+ { gText_Brendan_Pokenav_2B4B28, FLAG_0x070, 0xFFFF },
+ { gText_Brendan_Pokenav_2B4C15, FLAG_0x081, 0xFFFF },
+ { gText_Brendan_Pokenav_2B4CD8, FLAG_0x4F7, 0xFFFF },
+ { gText_Brendan_Pokenav_2B4D46, FLAG_SYS_GAME_CLEAR, 0xFFFF },
+ { NULL, 0xFFFF, 0xFFFF }
+};
+
+MATCHCALLDEF(sBrendanMatchCallHeader, 4, FEMALE, FLAG_0x0FD, gMayBrendanMatchCallDesc, gExpandedPlaceholder_Brendan, sBrendanTextScripts);
+
+static const match_call_text_data_t sWallyTextScripts[] = {
+ { gText_Wally_Pokenav_2B4DE2, 0xFFFF, 0xFFFF },
+ { gText_Wally_Pokenav_2B4E57, FLAG_0x0C7, 0xFFFF },
+ { gText_Wally_Pokenav_2B4EA5, FLAG_0x4F3, 0xFFFF },
+ { gText_Wally_Pokenav_2B4F41, FLAG_0x097, 0xFFFF },
+ { gText_Wally_Pokenav_2B4FF3, FLAG_0x06F, 0xFFFF },
+ { gText_Wally_Pokenav_2B50B1, FLAG_0x081, 0xFFFF },
+ { gText_Wally_Pokenav_2B5100, FLAG_0x07E, 0xFFFF },
+ { NULL, 0xFFFF, 0xFFFF }
+};
+
+const struct MatchCallSubstruct2 sWallyAdditionalData[] = {
+ { FLAG_0x324, 0x05 },
+ { FLAG_0x06F, 0xD5 },
+ { FLAG_0x35A, 0x46 },
+ { 0xFFFF, 0xD5 }
+};
+
+MATCHCALLDEF(sWallyMatchCallHeader, 2, 0, FLAG_0x0D6, REMATCH_WALLY_3, gWallyMatchCallDesc, sWallyTextScripts, sWallyAdditionalData);
+
+static const match_call_text_data_t sScottTextScripts[] = {
+ { gText_Scott_Pokenav_2B5184, 0xFFFF, 0xFFFF },
+ { gText_Scott_Pokenav_2B5275, FLAG_0x08B, 0xFFFF },
+ { gText_Scott_Pokenav_2B5323, FLAG_0x097, 0xFFFF },
+ { gText_Scott_Pokenav_2B53DB, FLAG_0x0D4, 0xFFFF },
+ { gText_Scott_Pokenav_2B54A5, FLAG_0x070, 0xFFFF },
+ { gText_Scott_Pokenav_2B5541, FLAG_0x4F7, 0xFFFF },
+ { gText_Scott_Pokenav_2B56CA, FLAG_SYS_GAME_CLEAR, 0xFFFF },
+ { NULL, 0xFFFF, 0xFFFF }
+};
+
+
+MATCHCALLDEF(sScottMatchCallHeader, 0, 0xD5, FLAG_0x0D7, gScottMatchCallDesc, gScottMatchCallName, sScottTextScripts);
+
+static const match_call_text_data_t sRoxanneTextScripts[] = {
+ { gText_Roxanne_Pokenav_2B2456, 0xFFFE, 0xFFFF },
+ { gText_Roxanne_Pokenav_2B250E, 0xFFFF, 0xFFFF },
+ { gText_Roxanne_Pokenav_2B25C1, 0xFFFF, 0xFFFF },
+ { gText_Roxanne_Pokenav_2B2607, FLAG_SYS_GAME_CLEAR, 0xFFFF },
+ { NULL, 0xFFFF, 0xFFFF }
+};
+
+MATCHCALLDEF(sRoxanneMatchCallHeader, 5, 10, FLAG_0x1D3, 0x41, gRoxanneMatchCallDesc, NULL, sRoxanneTextScripts);
+
+static const match_call_text_data_t sBrawlyTextScripts[] = {
+ { gText_Brawly_Pokenav_2B2659, 0xFFFE, 0xFFFF },
+ { gText_Brawly_Pokenav_2B275D, 0xFFFF, 0xFFFF },
+ { gText_Brawly_Pokenav_2B286F, 0xFFFF, 0xFFFF },
+ { gText_Brawly_Pokenav_2B28D1, FLAG_SYS_GAME_CLEAR, 0xFFFF },
+ { NULL, 0xFFFF, 0xFFFF }
+};
+
+MATCHCALLDEF(sBrawlyMatchCallHeader, 5, 2, FLAG_0x1D4, 0x42, gBrawlyMatchCallDesc, NULL, sBrawlyTextScripts);
+
+static const match_call_text_data_t sWattsonTextScripts[] = {
+ { gText_Wattson_Pokenav_2B2912, 0xFFFE, 0xFFFF },
+ { gText_Wattson_Pokenav_2B29CA, 0xFFFF, 0xFFFF },
+ { gText_Wattson_Pokenav_2B2AB6, 0xFFFF, 0xFFFF },
+ { gText_Wattson_Pokenav_2B2B01, FLAG_SYS_GAME_CLEAR, 0xFFFF },
+ { NULL, 0xFFFF, 0xFFFF }
+};
+
+MATCHCALLDEF(sWattsonMatchCallHeader, 5, 9, FLAG_0x1D5, 0x43, gWattsonMatchCallDesc, NULL, sWattsonTextScripts);
+
+static const match_call_text_data_t sFlanneryTextScripts[] = {
+ { gText_Flannery_Pokenav_2B2B4D, 0xFFFE, 0xFFFF },
+ { gText_Flannery_Pokenav_2B2C0E, 0xFFFF, 0xFFFF },
+ { gText_Flannery_Pokenav_2B2CF1, 0xFFFF, 0xFFFF },
+ { gText_Flannery_Pokenav_2B2D54, FLAG_SYS_GAME_CLEAR, 0xFFFF },
+ { NULL, 0xFFFF, 0xFFFF }
+};
+
+MATCHCALLDEF(sFlanneryMatchCallHeader, 5, 3, FLAG_0x1D6, 0x44, gFlanneryMatchCallDesc, NULL, sFlanneryTextScripts);
+
+static const match_call_text_data_t sWinonaTextScripts[] = {
+ { gText_Winona_Pokenav_2B2DA4, 0xFFFE, 0xFFFF },
+ { gText_Winona_Pokenav_2B2E2B, 0xFFFF, 0xFFFF },
+ { gText_Winona_Pokenav_2B2EC2, 0xFFFF, 0xFFFF },
+ { gText_Winona_Pokenav_2B2F16, FLAG_SYS_GAME_CLEAR, 0xFFFF },
+ { NULL, 0xFFFF, 0xFFFF }
+};
+
+MATCHCALLDEF(sWinonaMatchCallHeader, 5, 11, FLAG_0x1D7, 0x46, gWinonaMatchCallDesc, NULL, sWinonaTextScripts);
+
+static const match_call_text_data_t sTateLizaTextScripts[] = {
+ { gText_TateLiza_Pokenav_2B2F97, 0xFFFE, 0xFFFF },
+ { gText_TateLiza_Pokenav_2B306E, 0xFFFF, 0xFFFF },
+ { gText_TateLiza_Pokenav_2B3158, 0xFFFF, 0xFFFF },
+ { gText_TateLiza_Pokenav_2B31CD, FLAG_SYS_GAME_CLEAR, 0xFFFF },
+ { NULL, 0xFFFF, 0xFFFF }
+};
+
+MATCHCALLDEF(sTateLizaMatchCallHeader, 5, 13, FLAG_0x1D8, 0x47, gTateLizaMatchCallDesc, NULL, sTateLizaTextScripts);
+
+static const match_call_text_data_t sJuanTextScripts[] = {
+ { gText_Juan_Pokenav_2B3249, 0xFFFE, 0xFFFF },
+ { gText_Juan_Pokenav_2B32EC, 0xFFFF, 0xFFFF },
+ { gText_Juan_Pokenav_2B33AA, 0xFFFF, 0xFFFF },
+ { gText_Juan_Pokenav_2B341E, FLAG_SYS_GAME_CLEAR, 0xFFFF },
+ { NULL, 0xFFFF, 0xFFFF }
+};
+
+MATCHCALLDEF(sJuanMatchCallHeader, 5, 14, FLAG_0x1D9, 0x48, gJuanMatchCallDesc, NULL, sJuanTextScripts);
+
+static const match_call_text_data_t sSidneyTextScripts[] = {
+ { gText_Sidney_Pokenav_2B34CC, 0xFFFF, 0xFFFF },
+ { NULL, 0xFFFF, 0xFFFF }
+};
+
+MATCHCALLDEF(sSidneyMatchCallHeader, 5, 15, FLAG_0x1A5, 0x49, gEliteFourMatchCallDesc, NULL, sSidneyTextScripts);
+
+static const match_call_text_data_t sPhoebeTextScripts[] = {
+ { gText_Phoebe_Pokenav_2B3561, 0xFFFF, 0xFFFF },
+ { NULL, 0xFFFF, 0xFFFF }
+};
+
+MATCHCALLDEF(sPhoebeMatchCallHeader, 5, 15, FLAG_0x1A6, 0x4A, gEliteFourMatchCallDesc, NULL, sPhoebeTextScripts);
+
+static const match_call_text_data_t sGlaciaTextScripts[] = {
+ { gText_Glacia_Pokenav_2B35E4, 0xFFFF, 0xFFFF },
+ { NULL, 0xFFFF, 0xFFFF }
+};
+
+MATCHCALLDEF(sGlaciaMatchCallHeader, 5, 15, FLAG_0x1A7, 0x4B, gEliteFourMatchCallDesc, NULL, sGlaciaTextScripts);
+
+static const match_call_text_data_t sDrakeTextScripts[] = {
+ { gText_Drake_Pokenav_2B368B, 0xFFFF, 0xFFFF },
+ { NULL, 0xFFFF, 0xFFFF }
+};
+
+MATCHCALLDEF(sDrakeMatchCallHeader, 5, 15, FLAG_0x1A8, 0x4C, gEliteFourMatchCallDesc, NULL, sDrakeTextScripts);
+
+static const match_call_text_data_t sWallaceTextScripts[] = {
+ { gText_Wallace_Pokenav_2B3790, 0xFFFF, 0xFFFF },
+ { NULL, 0xFFFF, 0xFFFF }
+};
+
+MATCHCALLDEF(sWallaceMatchCallHeader, 5, 15, FLAG_0x1A9, 0x4D, gChampionMatchCallDesc, NULL, sWallaceTextScripts);
+
+static const match_call_t sMatchCallHeaders[] = {
+ {.type0 = &sMrStoneMatchCallHeader},
+ {.type3 = &sProfBirchMatchCallHeader},
+ {.type4 = &sBrendanMatchCallHeader},
+ {.type4 = &sMayMatchCallHeader},
+ {.type2 = &sWallyMatchCallHeader},
+ {.type5 = &sNormanMatchCallHeader},
+ {.type0 = &sMomMatchCallHeader},
+ {.type0 = &sStevenMatchCallHeader},
+ {.type0 = &sScottMatchCallHeader},
+ {.type5 = &sRoxanneMatchCallHeader},
+ {.type5 = &sBrawlyMatchCallHeader},
+ {.type5 = &sWattsonMatchCallHeader},
+ {.type5 = &sFlanneryMatchCallHeader},
+ {.type5 = &sWinonaMatchCallHeader},
+ {.type5 = &sTateLizaMatchCallHeader},
+ {.type5 = &sJuanMatchCallHeader},
+ {.type5 = &sSidneyMatchCallHeader},
+ {.type5 = &sPhoebeMatchCallHeader},
+ {.type5 = &sGlaciaMatchCallHeader},
+ {.type5 = &sDrakeMatchCallHeader},
+ {.type5 = &sWallaceMatchCallHeader}
+};
+
+static bool32 (*const sMatchCallGetFlagFuncs[])(match_call_t) = {
+ MatchCallGetFlag_Type0,
+ MatchCallGetFlag_Type1,
+ MatchCallGetFlag_Type2,
+ MatchCallGetFlag_Type3,
+ MatchCallGetFlag_Type4
+};
+
+static u8 (*const gUnknown_08625310[])(match_call_t) = {
+ sub_81D1714,
+ sub_81D1718,
+ sub_81D171C,
+ sub_81D1750,
+ sub_81D1754
+};
+
+static bool32 (*const sMatchCall_IsRematchableFunctions[])(match_call_t) = {
+ MatchCall_IsRematchable_Type0,
+ MatchCall_IsRematchable_Type1,
+ MatchCall_IsRematchable_Type2,
+ MatchCall_IsRematchable_Type3,
+ MatchCall_IsRematchable_Type4
+};
+
+static bool32 (*const gUnknown_08625338[])(match_call_t) = {
+ sub_81D1840,
+ sub_81D1844,
+ sub_81D1848,
+ sub_81D184C,
+ sub_81D1850
+};
+
+static u32 (*const sMatchCall_GetRematchTableIdxFunctions[])(match_call_t) = {
+ MatchCall_GetRematchTableIdx_Type0,
+ MatchCall_GetRematchTableIdx_Type1,
+ MatchCall_GetRematchTableIdx_Type2,
+ MatchCall_GetRematchTableIdx_Type3,
+ MatchCall_GetRematchTableIdx_Type4
+};
+
+static void (*const sMatchCall_GetMessageFunctions[])(match_call_t, u8 *) = {
+ MatchCall_GetMessage_Type0,
+ MatchCall_GetMessage_Type1,
+ MatchCall_GetMessage_Type2,
+ MatchCall_GetMessage_Type3,
+ MatchCall_GetMessage_Type4
+};
+
+static void (*const sMatchCall_GetNameAndDescFunctions[])(match_call_t, const u8 **, const u8 **) = {
+ MatchCall_GetNameAndDesc_Type0,
+ MatchCall_GetNameAndDesc_Type1,
+ MatchCall_GetNameAndDesc_Type2,
+ MatchCall_GetNameAndDesc_Type3,
+ MatchCall_GetNameAndDesc_Type4
+};
+
+static const struct UnkStruct_08625388 sMatchCallCheckPageOverrides[] = {
+ { 7, 0x4B, 0xffff, { gMatchCallStevenStrategyText, gMatchCall_StevenTrainersPokemonText, gMatchCall_StevenSelfIntroductionText_Line1_BeforeMeteorFallsBattle, gMatchCall_StevenSelfIntroductionText_Line2_BeforeMeteorFallsBattle } }, // STEVEN
+ { 7, 0x4B, FLAG_0x4F6, { gMatchCallStevenStrategyText, gMatchCall_StevenTrainersPokemonText, gMatchCall_StevenSelfIntroductionText_Line1_AfterMeteorFallsBattle, gMatchCall_StevenSelfIntroductionText_Line2_AfterMeteorFallsBattle } }, // STEVEN
+ { 2, 0x3c, 0xffff, { gMatchCall_BrendanStrategyText, gMatchCall_BrendanTrainersPokemonText, gMatchCall_BrendanSelfIntroductionText_Line1, gMatchCall_BrendanSelfIntroductionText_Line2 } }, // Brendan
+ { 3, 0x3f, 0xffff, { gMatchCall_MayStrategyText, gMatchCall_MayTrainersPokemonText, gMatchCall_MaySelfIntroductionText_Line1, gMatchCall_MaySelfIntroductionText_Line2 } } // May
+};
+
+// .text
+
+static u32 MatchCallGetFunctionIndex(match_call_t matchCall)
+{
+ switch (matchCall.common->type)
+ {
+ case 0:
+ default:
+ return 0;
+ case 1:
+ case 5:
+ return 1;
+ case 2:
+ return 2;
+ case 4:
+ return 3;
+ case 3:
+ return 4;
+ }
+}
+
+u32 GetTrainerIdxByRematchIdx(u32 rematchIdx)
+{
+ return gRematchTable[rematchIdx].trainerIds[0];
+}
+
+s32 GetRematchIdxByTrainerIdx(s32 trainerIdx)
+{
+ s32 rematchIdx;
+
+ for (rematchIdx = 0; rematchIdx < REMATCH_TABLE_ENTRIES; rematchIdx++)
+ {
+ if (gRematchTable[rematchIdx].trainerIds[0] == trainerIdx)
+ return rematchIdx;
+ }
+ return -1;
+}
+
+bool32 MatchCallFlagGetByIndex(u32 idx)
+{
+ match_call_t matchCall;
+ u32 i;
+
+ if (idx > 20)
+ return FALSE;
+ matchCall = sMatchCallHeaders[idx];
+ i = MatchCallGetFunctionIndex(matchCall);
+ return sMatchCallGetFlagFuncs[i](matchCall);
+}
+
+static bool32 MatchCallGetFlag_Type0(match_call_t matchCall)
+{
+ if (matchCall.type0->flag == 0xffff)
+ return TRUE;
+ return FlagGet(matchCall.type0->flag);
+}
+
+static bool32 MatchCallGetFlag_Type1(match_call_t matchCall)
+{
+ if (matchCall.type1->flag == 0xffff)
+ return TRUE;
+ return FlagGet(matchCall.type1->flag);
+}
+
+static bool32 MatchCallGetFlag_Type2(match_call_t matchCall)
+{
+ if (matchCall.type2->flag == 0xffff)
+ return TRUE;
+ return FlagGet(matchCall.type2->flag);
+}
+
+static bool32 MatchCallGetFlag_Type3(match_call_t matchCall)
+{
+ if (matchCall.type4->gender != gSaveBlock2Ptr->playerGender)
+ return FALSE;
+ if (matchCall.type4->flag == 0xffff)
+ return TRUE;
+ return FlagGet(matchCall.type4->flag);
+}
+
+static bool32 MatchCallGetFlag_Type4(match_call_t matchCall)
+{
+ return FlagGet(matchCall.type3->flag);
+}
+
+u8 sub_81D16DC(u32 idx)
+{
+ match_call_t matchCall;
+ u32 i;
+
+ if (idx > 20)
+ return 0;
+ matchCall = sMatchCallHeaders[idx];
+ i = MatchCallGetFunctionIndex(matchCall);
+ return gUnknown_08625310[i](matchCall);
+}
+
+static u8 sub_81D1714(match_call_t matchCall)
+{
+ return matchCall.type0->v1;
+}
+
+static u8 sub_81D1718(match_call_t matchCall)
+{
+ return matchCall.type1->v1;
+}
+
+static u8 sub_81D171C(match_call_t matchCall)
+{
+ s32 i;
+
+ for (i = 0; matchCall.type2->v10[i].flag != 0xffff; i++)
+ {
+ if (!FlagGet(matchCall.type2->v10[i].flag))
+ break;
+ }
+ return matchCall.type2->v10[i].v2;
+}
+
+static u8 sub_81D1750(match_call_t matchCall)
+{
+ return 0xd5;
+}
+
+static u8 sub_81D1754(match_call_t matchCall)
+{
+ return 0xd5;
+}
+
+bool32 MatchCall_IsRematchable(u32 idx)
+{
+ match_call_t matchCall;
+ u32 i;
+
+ if (idx > 20)
+ return 0;
+ matchCall = sMatchCallHeaders[idx];
+ i = MatchCallGetFunctionIndex(matchCall);
+ return sMatchCall_IsRematchableFunctions[i](matchCall);
+}
+
+static bool32 MatchCall_IsRematchable_Type0(match_call_t matchCall)
+{
+ return FALSE;
+}
+
+static bool32 MatchCall_IsRematchable_Type1(match_call_t matchCall)
+{
+ if (matchCall.type1->rematchTableIdx >= REMATCH_ELITE_FOUR_ENTRIES)
+ return FALSE;
+ return gSaveBlock1Ptr->trainerRematches[matchCall.type1->rematchTableIdx] ? TRUE : FALSE;
+}
+
+static bool32 MatchCall_IsRematchable_Type2(match_call_t matchCall)
+{
+ return gSaveBlock1Ptr->trainerRematches[matchCall.type2->rematchTableIdx] ? TRUE : FALSE;
+}
+
+static bool32 MatchCall_IsRematchable_Type3(match_call_t matchCall)
+{
+ return FALSE;
+}
+
+static bool32 MatchCall_IsRematchable_Type4(match_call_t matchCall)
+{
+ return FALSE;
+}
+
+bool32 sub_81D17E8(u32 idx)
+{
+ match_call_t matchCall;
+ u32 i;
+
+ if (idx > 20)
+ return FALSE;
+ matchCall = sMatchCallHeaders[idx];
+ i = MatchCallGetFunctionIndex(matchCall);
+ if (gUnknown_08625338[i](matchCall))
+ return TRUE;
+ for (i = 0; i < 4; i++)
+ {
+ if (sMatchCallCheckPageOverrides[i].idx == idx)
+ return TRUE;
+ }
+ return FALSE;
+}
+
+static bool32 sub_81D1840(match_call_t matchCall)
+{
+ return FALSE;
+}
+
+static bool32 sub_81D1844(match_call_t matchCall)
+{
+ return TRUE;
+}
+
+static bool32 sub_81D1848(match_call_t matchCall)
+{
+ return TRUE;
+}
+
+static bool32 sub_81D184C(match_call_t matchCall)
+{
+ return FALSE;
+}
+
+static bool32 sub_81D1850(match_call_t matchCall)
+{
+ return FALSE;
+}
+
+u32 MatchCall_GetRematchTableIdx(u32 idx)
+{
+ match_call_t matchCall;
+ u32 i;
+
+ if (idx > 20)
+ return REMATCH_TABLE_ENTRIES;
+ matchCall = sMatchCallHeaders[idx];
+ i = MatchCallGetFunctionIndex(matchCall);
+ return sMatchCall_GetRematchTableIdxFunctions[i](matchCall);
+}
+
+static u32 MatchCall_GetRematchTableIdx_Type0(match_call_t matchCall)
+{
+ return REMATCH_TABLE_ENTRIES;
+}
+
+static u32 MatchCall_GetRematchTableIdx_Type1(match_call_t matchCall)
+{
+ return matchCall.type1->rematchTableIdx;
+}
+
+static u32 MatchCall_GetRematchTableIdx_Type2(match_call_t matchCall)
+{
+ return matchCall.type2->rematchTableIdx;
+}
+
+static u32 MatchCall_GetRematchTableIdx_Type3(match_call_t matchCall)
+{
+ return REMATCH_TABLE_ENTRIES;
+}
+
+static u32 MatchCall_GetRematchTableIdx_Type4(match_call_t matchCall)
+{
+ return REMATCH_TABLE_ENTRIES;
+}
+
+void MatchCall_GetMessage(u32 idx, u8 *dest)
+{
+ match_call_t matchCall;
+ u32 i;
+
+ if (idx > 20)
+ return;
+ matchCall = sMatchCallHeaders[idx];
+ i = MatchCallGetFunctionIndex(matchCall);
+ sMatchCall_GetMessageFunctions[i](matchCall, dest);
+}
+
+static void MatchCall_GetMessage_Type0(match_call_t matchCall, u8 *dest)
+{
+ sub_81D1920(matchCall.type0->textData, dest);
+}
+
+static void MatchCall_GetMessage_Type1(match_call_t matchCall, u8 *dest)
+{
+ if (matchCall.common->type != 5)
+ sub_81D1920(matchCall.type5->textData, dest);
+ else
+ sub_81D199C(matchCall.type1->textData, matchCall.type1->rematchTableIdx, dest);
+}
+
+static void MatchCall_GetMessage_Type2(match_call_t matchCall, u8 *dest)
+{
+ sub_81D1920(matchCall.type2->textData, dest);
+}
+
+static void MatchCall_GetMessage_Type3(match_call_t matchCall, u8 *dest)
+{
+ sub_81D1920(matchCall.type4->textData, dest);
+}
+
+static void MatchCall_GetMessage_Type4(match_call_t matchCall, u8 *dest)
+{
+ sub_8197080(dest);
+}
+
+void sub_81D1920(const match_call_text_data_t *sub0, u8 *dest)
+{
+ u32 i;
+ for (i = 0; sub0[i].text != NULL; i++)
+ ;
+ if (i)
+ i--;
+ while (i)
+ {
+ if (sub0[i].flag != 0xffff && FlagGet(sub0[i].flag) == TRUE)
+ break;
+ i--;
+ }
+ if (sub0[i].flag2 != 0xffff)
+ FlagSet(sub0[i].flag2);
+ StringExpandPlaceholders(dest, sub0[i].text);
+}
+
+#ifdef NONMATCHING
+// There's some weird upmerge going on that I cannot replicate at this time.
+static void sub_81D199C(const match_call_text_data_t *sub0, u16 idx, u8 *dest)
+{
+ u32 i;
+ for (i = 0; sub0[i].text != NULL; i++)
+ {
+ if (sub0[i].flag == 0xfffe)
+ break;
+ if (sub0[i].flag == 0xffff && !FlagGet(sub0[i].flag))
+ break;
+ }
+ if (sub0[i].flag != 0xfffe)
+ {
+ if (i)
+ i--;
+ if (sub0[i].flag2 != 0xffff)
+ FlagSet(sub0[i].flag2);
+ StringExpandPlaceholders(dest, sub0[i].text);
+ }
+ else
+ {
+ if (!FlagGet(FLAG_SYS_GAME_CLEAR))
+ ;
+ else if (gSaveBlock1Ptr->trainerRematches[idx])
+ i += 2;
+ else if (CountBattledRematchTeams(idx) >= 2)
+ i += 3;
+ else
+ i++;
+ StringExpandPlaceholders(dest, sub0[i].text);
+ }
+}
+#else
+static ASM_DIRECT void sub_81D199C(const match_call_text_data_t *sub0, u16 idx, u8 *dest)
+{
+ asm_unified("\tpush {r4-r7,lr}\n"
+ "\tmov r7, r10\n"
+ "\tmov r6, r9\n"
+ "\tmov r5, r8\n"
+ "\tpush {r5-r7}\n"
+ "\tadds r6, r0, 0\n"
+ "\tmov r10, r2\n"
+ "\tlsls r1, 16\n"
+ "\tlsrs r7, r1, 16\n"
+ "\tmovs r5, 0\n"
+ "\tldr r0, [r6]\n"
+ "\tcmp r0, 0\n"
+ "\tbeq _081D19E6\n"
+ "\tldrh r0, [r6, 0x4]\n"
+ "\tldr r1, =0x0000fffe\n"
+ "\tcmp r0, r1\n"
+ "\tbeq _081D1A24\n"
+ "\tldr r0, =0x0000ffff\n"
+ "\tmov r9, r0\n"
+ "\tmov r8, r1\n"
+ "\tadds r4, r6, 0\n"
+ "_081D19C6:\n"
+ "\tldrh r0, [r4, 0x4]\n"
+ "\tcmp r0, r9\n"
+ "\tbeq _081D19D6\n"
+ "\tbl FlagGet\n"
+ "\tlsls r0, 24\n"
+ "\tcmp r0, 0\n"
+ "\tbeq _081D19E6\n"
+ "_081D19D6:\n"
+ "\tadds r4, 0x8\n"
+ "\tadds r5, 0x1\n"
+ "\tldr r0, [r4]\n"
+ "\tcmp r0, 0\n"
+ "\tbeq _081D19E6\n"
+ "\tldrh r0, [r4, 0x4]\n"
+ "\tcmp r0, r8\n"
+ "\tbne _081D19C6\n"
+ "_081D19E6:\n"
+ "\tlsls r0, r5, 3\n"
+ "\tadds r0, r6\n"
+ "\tldrh r1, [r0, 0x4]\n"
+ "\tldr r0, =0x0000fffe\n"
+ "\tcmp r1, r0\n"
+ "\tbeq _081D1A24\n"
+ "\tcmp r5, 0\n"
+ "\tbeq _081D19F8\n"
+ "\tsubs r5, 0x1\n"
+ "_081D19F8:\n"
+ "\tlsls r0, r5, 3\n"
+ "\tadds r4, r0, r6\n"
+ "\tldrh r1, [r4, 0x6]\n"
+ "\tldr r0, =0x0000ffff\n"
+ "\tcmp r1, r0\n"
+ "\tbeq _081D1A0A\n"
+ "\tadds r0, r1, 0\n"
+ "\tbl FlagSet\n"
+ "_081D1A0A:\n"
+ "\tldr r1, [r4]\n"
+ "\tmov r0, r10\n"
+ "\tbl StringExpandPlaceholders\n"
+ "\tb _081D1A5C\n"
+ "\t.pool\n"
+ "_081D1A1C:\n"
+ "\tadds r5, 0x2\n"
+ "\tb _081D1A50\n"
+ "_081D1A20:\n"
+ "\tadds r5, 0x3\n"
+ "\tb _081D1A50\n"
+ "_081D1A24:\n"
+ "\tldr r0, =0x00000864\n"
+ "\tbl FlagGet\n"
+ "\tlsls r0, 24\n"
+ "\tcmp r0, 0\n"
+ "\tbeq _081D1A50\n"
+ "\tldr r0, =gSaveBlock1Ptr\n"
+ "\tldr r0, [r0]\n"
+ "\tldr r1, =0x000009ca\n"
+ "\tadds r0, r1\n"
+ "\tadds r0, r7\n"
+ "\tldrb r0, [r0]\n"
+ "\tcmp r0, 0\n"
+ "\tbne _081D1A1C\n"
+ "\tadds r0, r7, 0\n"
+ "\tbl CountBattledRematchTeams\n"
+ "\tlsls r0, 16\n"
+ "\tlsrs r0, 16\n"
+ "\tcmp r0, 0x1\n"
+ "\tbhi _081D1A20\n"
+ "\tadds r5, 0x1\n"
+ "_081D1A50:\n"
+ "\tlsls r0, r5, 3\n"
+ "\tadds r0, r6\n"
+ "\tldr r1, [r0]\n"
+ "\tmov r0, r10\n"
+ "\tbl StringExpandPlaceholders\n"
+ "_081D1A5C:\n"
+ "\tpop {r3-r5}\n"
+ "\tmov r8, r3\n"
+ "\tmov r9, r4\n"
+ "\tmov r10, r5\n"
+ "\tpop {r4-r7}\n"
+ "\tpop {r0}\n"
+ "\tbx r0\n"
+ "\t.pool");
+}
+#endif
+
+void sub_81D1A78(u32 idx, const u8 **desc, const u8 **name)
+{
+ match_call_t matchCall;
+ u32 i;
+
+ if (idx > 20)
+ return;
+ matchCall = sMatchCallHeaders[idx];
+ i = MatchCallGetFunctionIndex(matchCall);
+ sMatchCall_GetNameAndDescFunctions[i](matchCall, desc, name);
+}
+
+static void MatchCall_GetNameAndDesc_Type0(match_call_t matchCall, const u8 **desc, const u8 **name)
+{
+ *desc = matchCall.type0->desc;
+ *name = matchCall.type0->name;
+}
+
+static void MatchCall_GetNameAndDesc_Type1(match_call_t matchCall, const u8 **desc, const u8 **name)
+{
+ match_call_t _matchCall = matchCall;
+ if (_matchCall.type1->name == NULL)
+ MatchCall_GetNameAndDescByRematchIdx(_matchCall.type1->rematchTableIdx, desc, name);
+ else
+ *name = _matchCall.type1->name;
+ *desc = _matchCall.type1->desc;
+}
+
+static void MatchCall_GetNameAndDesc_Type2(match_call_t matchCall, const u8 **desc, const u8 **name)
+{
+ MatchCall_GetNameAndDescByRematchIdx(matchCall.type2->rematchTableIdx, desc, name);
+ *desc = matchCall.type2->desc;
+}
+
+static void MatchCall_GetNameAndDesc_Type3(match_call_t matchCall, const u8 **desc, const u8 **name)
+{
+ *desc = matchCall.type4->desc;
+ *name = matchCall.type4->name;
+}
+
+static void MatchCall_GetNameAndDesc_Type4(match_call_t matchCall, const u8 **desc, const u8 **name)
+{
+ *desc = matchCall.type3->desc;
+ *name = matchCall.type3->name;
+}
+
+static void MatchCall_GetNameAndDescByRematchIdx(u32 idx, const u8 **desc, const u8 **name)
+{
+ const struct Trainer *trainer = gTrainers + GetTrainerIdxByRematchIdx(idx);
+ *desc = gTrainerClassNames[trainer->trainerClass];
+ *name = trainer->trainerName;
+}
+
+#ifdef NONMATCHING
+const u8 *sub_81D1B40(u32 idx, u32 offset)
+{
+ u32 i;
+
+ for (i = 0; i < 4; i++)
+ {
+ if (sMatchCallCheckPageOverrides[i].idx == idx)
+ {
+ for (; i + 1 < 4 && sMatchCallCheckPageOverrides[i + 1].idx == idx; i++)
+ {
+ if (!FlagGet(sMatchCallCheckPageOverrides[i + 1].v4))
+ break;
+ }
+ return sMatchCallCheckPageOverrides[i].v8[offset];
+ }
+ }
+ return NULL;
+}
+#else
+ASM_DIRECT const u8 *sub_81D1B40(u32 idx, u32 offset)
+{
+ asm_unified("\tpush {r4-r7,lr}\n"
+ "\tmov r7, r9\n"
+ "\tmov r6, r8\n"
+ "\tpush {r6,r7}\n"
+ "\tadds r6, r0, 0\n"
+ "\tmovs r5, 0\n"
+ "\tldr r2, =sMatchCallCheckPageOverrides\n"
+ "\tmovs r0, 0x8\n"
+ "\tadds r0, r2\n"
+ "\tmov r9, r0\n"
+ "_081D1B54:\n"
+ "\tlsls r0, r5, 1\n"
+ "\tadds r0, r5\n"
+ "\tlsls r0, 3\n"
+ "\tadds r0, r2\n"
+ "\tldrh r0, [r0]\n"
+ "\tcmp r0, r6\n"
+ "\tbne _081D1BBC\n"
+ "\tadds r4, r5, 0x1\n"
+ "\tlsls r1, 2\n"
+ "\tmov r8, r1\n"
+ "\tcmp r4, 0x3\n"
+ "\tbhi _081D1BA8\n"
+ "\tlsls r0, r4, 1\n"
+ "\tadds r0, r4\n"
+ "\tlsls r0, 3\n"
+ "\tadds r0, r2\n"
+ "\tldrh r0, [r0]\n"
+ "\tcmp r0, r6\n"
+ "\tbne _081D1BA8\n"
+ "\tldr r7, =sMatchCallCheckPageOverrides\n"
+ "_081D1B7C:\n"
+ "\tlsls r0, r4, 1\n"
+ "\tadds r0, r4\n"
+ "\tlsls r0, 3\n"
+ "\tadds r1, r7, 0x4\n"
+ "\tadds r0, r1\n"
+ "\tldrh r0, [r0]\n"
+ "\tbl FlagGet\n"
+ "\tlsls r0, 24\n"
+ "\tcmp r0, 0\n"
+ "\tbeq _081D1BA8\n"
+ "\tadds r5, r4, 0\n"
+ "\tadds r4, r5, 0x1\n"
+ "\tcmp r4, 0x3\n"
+ "\tbhi _081D1BA8\n"
+ "\tlsls r0, r4, 1\n"
+ "\tadds r0, r4\n"
+ "\tlsls r0, 3\n"
+ "\tadds r0, r7\n"
+ "\tldrh r0, [r0]\n"
+ "\tcmp r0, r6\n"
+ "\tbeq _081D1B7C\n"
+ "_081D1BA8:\n"
+ "\tlsls r0, r5, 1\n"
+ "\tadds r0, r5\n"
+ "\tlsls r0, 3\n"
+ "\tadd r0, r8\n"
+ "\tadd r0, r9\n"
+ "\tldr r0, [r0]\n"
+ "\tb _081D1BC4\n"
+ "\t.pool\n"
+ "_081D1BBC:\n"
+ "\tadds r5, 0x1\n"
+ "\tcmp r5, 0x3\n"
+ "\tbls _081D1B54\n"
+ "\tmovs r0, 0\n"
+ "_081D1BC4:\n"
+ "\tpop {r3,r4}\n"
+ "\tmov r8, r3\n"
+ "\tmov r9, r4\n"
+ "\tpop {r4-r7}\n"
+ "\tpop {r1}\n"
+ "\tbx r1");
+}
+#endif
+
+s32 sub_81D1BD0(u32 idx)
+{
+ u32 i;
+
+ for (i = 0; i < 4; i++)
+ {
+ if (sMatchCallCheckPageOverrides[i].idx == idx)
+ return sMatchCallCheckPageOverrides[i].v2;
+ }
+ return -1;
+}
+
+bool32 sub_81D1BF8(u32 idx)
+{
+ s32 i;
+
+ for (i = 0; i < 21; i++)
+ {
+ u32 r0 = MatchCall_GetRematchTableIdx(i);
+ if (r0 != REMATCH_TABLE_ENTRIES && r0 == idx)
+ return TRUE;
+ }
+ return FALSE;
+}
+
+void SetMatchCallRegisteredFlag(void)
+{
+ s32 r0 = GetRematchIdxByTrainerIdx(gSpecialVar_0x8004);
+ if (r0 >= 0)
+ FlagSet(FLAG_MATCH_CALL_REGISTERED + r0);
+}