summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--asm/vs_seeker.s973
-rw-r--r--data/data_84827AC.s20
-rw-r--r--include/battle_setup.h1
-rw-r--r--include/event_scripts.h5
-rw-r--r--include/field_effect.h4
-rw-r--r--include/field_map_obj.h1
-rw-r--r--include/field_specials.h1
-rw-r--r--include/item_menu.h8
-rw-r--r--include/item_use.h9
-rw-r--r--include/map_obj_lock.h1
-rw-r--r--include/new_menu_helpers.h4
-rw-r--r--include/vs_seeker.h30
-rw-r--r--ld_script.txt3
-rw-r--r--src/vs_seeker.c828
14 files changed, 893 insertions, 995 deletions
diff --git a/asm/vs_seeker.s b/asm/vs_seeker.s
index 00f880d86..108e75c37 100644
--- a/asm/vs_seeker.s
+++ b/asm/vs_seeker.s
@@ -5,979 +5,6 @@
.text
- thumb_func_start sub_810C670
-sub_810C670: @ 810C670
- push {r4-r7,lr}
- lsls r0, 24
- lsrs r4, r0, 24
- movs r2, 0
- ldr r7, _0810C6C0 @ =gUnknown_203ADB8
- lsls r1, r4, 2
- adds r0, r1, r4
- lsls r3, r0, 3
- ldr r5, _0810C6C4 @ =gTasks+0x8
- adds r6, r1, 0
- movs r1, 0
-_0810C686:
- lsls r0, r2, 1
- adds r0, r3
- adds r0, r5
- strh r1, [r0]
- adds r0, r2, 0x1
- lsls r0, 24
- lsrs r2, r0, 24
- cmp r2, 0xF
- bls _0810C686
- adds r5, r7, 0
- ldr r0, _0810C6C8 @ =0x00000434
- bl AllocZeroed
- str r0, [r5]
- bl sub_810C808
- bl sub_810C96C
- lsls r0, 24
- lsrs r0, 24
- adds r1, r0, 0
- cmp r0, 0
- bne _0810C6D0
- ldr r0, [r5]
- bl Free
- ldr r2, _0810C6CC @ =gUnknown_81C137C
- b _0810C6DC
- .align 2, 0
-_0810C6C0: .4byte gUnknown_203ADB8
-_0810C6C4: .4byte gTasks+0x8
-_0810C6C8: .4byte 0x00000434
-_0810C6CC: .4byte gUnknown_81C137C
-_0810C6D0:
- cmp r0, 0x1
- bne _0810C6F0
- ldr r0, [r7]
- bl Free
- ldr r2, _0810C6E8 @ =gUnknown_81C13D6
-_0810C6DC:
- ldr r3, _0810C6EC @ =sub_80A1E0C
- adds r0, r4, 0
- movs r1, 0x2
- bl DisplayItemMessageOnField
- b _0810C718
- .align 2, 0
-_0810C6E8: .4byte gUnknown_81C13D6
-_0810C6EC: .4byte sub_80A1E0C
-_0810C6F0:
- cmp r1, 0x2
- bne _0810C718
- ldr r0, _0810C720 @ =gUnknown_203AD30
- ldrh r2, [r0]
- ldr r3, _0810C724 @ =0x0000ffff
- movs r0, 0x4
- movs r1, 0
- bl sub_80A2294
- movs r0, 0x41
- bl FieldEffectStart
- ldr r1, _0810C728 @ =gTasks
- adds r0, r6, r4
- lsls r0, 3
- adds r0, r1
- ldr r1, _0810C72C @ =sub_810C730
- str r1, [r0]
- movs r1, 0xF
- strh r1, [r0, 0x8]
-_0810C718:
- pop {r4-r7}
- pop {r0}
- bx r0
- .align 2, 0
-_0810C720: .4byte gUnknown_203AD30
-_0810C724: .4byte 0x0000ffff
-_0810C728: .4byte gTasks
-_0810C72C: .4byte sub_810C730
- thumb_func_end sub_810C670
-
- thumb_func_start sub_810C730
-sub_810C730: @ 810C730
- push {lr}
- lsls r0, 24
- lsrs r0, 24
- ldr r2, _0810C758 @ =gTasks
- lsls r1, r0, 2
- adds r1, r0
- lsls r1, 3
- adds r1, r2
- ldrh r0, [r1, 0x8]
- subs r0, 0x1
- strh r0, [r1, 0x8]
- lsls r0, 16
- cmp r0, 0
- bne _0810C754
- ldr r0, _0810C75C @ =sub_810C760
- str r0, [r1]
- movs r0, 0x10
- strh r0, [r1, 0xA]
-_0810C754:
- pop {r0}
- bx r0
- .align 2, 0
-_0810C758: .4byte gTasks
-_0810C75C: .4byte sub_810C760
- thumb_func_end sub_810C730
-
- thumb_func_start sub_810C760
-sub_810C760: @ 810C760
- push {r4,r5,lr}
- lsls r0, 24
- lsrs r5, r0, 24
- lsls r0, r5, 2
- adds r0, r5
- lsls r0, 3
- ldr r1, _0810C7E8 @ =gTasks+0x8
- adds r4, r0, r1
- movs r1, 0x4
- ldrsh r0, [r4, r1]
- cmp r0, 0x2
- beq _0810C794
- ldrh r0, [r4, 0x2]
- subs r0, 0x1
- strh r0, [r4, 0x2]
- lsls r0, 16
- cmp r0, 0
- bne _0810C794
- movs r0, 0x5E
- bl PlaySE
- movs r0, 0xB
- strh r0, [r4, 0x2]
- ldrh r0, [r4, 0x4]
- adds r0, 0x1
- strh r0, [r4, 0x4]
-_0810C794:
- movs r0, 0x41
- bl FieldEffectActiveListContains
- lsls r0, 24
- lsrs r0, 24
- cmp r0, 0
- bne _0810C7E2
- strh r0, [r4, 0x2]
- strh r0, [r4, 0x4]
- bl sub_810C604
- ldr r0, _0810C7EC @ =gUnknown_845318C
- bl sub_810C9A8
- ldr r1, _0810C7F0 @ =gUnknown_203ADB8
- ldr r2, [r1]
- ldr r1, _0810C7F4 @ =0x00000431
- adds r2, r1
- lsls r0, 3
- ldrb r3, [r2]
- movs r1, 0x7
- ands r1, r3
- orrs r1, r0
- strb r1, [r2]
- ldr r0, _0810C7F8 @ =gSaveBlock1Ptr
- ldr r0, [r0]
- ldrb r1, [r0, 0x5]
- ldrb r2, [r0, 0x4]
- ldr r3, _0810C7FC @ =gUnknown_8453F5C
- movs r0, 0xFF
- bl ScriptMovement_StartObjectMovementScript
- ldr r1, _0810C800 @ =gTasks
- lsls r0, r5, 2
- adds r0, r5
- lsls r0, 3
- adds r0, r1
- ldr r1, _0810C804 @ =sub_810C8EC
- str r1, [r0]
-_0810C7E2:
- pop {r4,r5}
- pop {r0}
- bx r0
- .align 2, 0
-_0810C7E8: .4byte gTasks+0x8
-_0810C7EC: .4byte gUnknown_845318C
-_0810C7F0: .4byte gUnknown_203ADB8
-_0810C7F4: .4byte 0x00000431
-_0810C7F8: .4byte gSaveBlock1Ptr
-_0810C7FC: .4byte gUnknown_8453F5C
-_0810C800: .4byte gTasks
-_0810C804: .4byte sub_810C8EC
- thumb_func_end sub_810C760
-
- thumb_func_start sub_810C808
-sub_810C808: @ 810C808
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- sub sp, 0x4
- ldr r0, _0810C8DC @ =gSaveBlock1Ptr
- ldr r0, [r0]
- movs r1, 0x8E
- lsls r1, 4
- adds r2, r0, r1
- movs r1, 0
- mov r0, sp
- strb r1, [r0]
- mov r8, r1
- mov r9, r1
- ldr r0, _0810C8E0 @ =gMapHeader
- ldr r0, [r0, 0x4]
- ldrb r0, [r0]
- cmp r8, r0
- bge _0810C8BC
- ldr r7, _0810C8E4 @ =gUnknown_203ADB8
- mov r6, sp
- ldr r0, _0810C8E8 @ =gUnknown_2036E38
- mov r10, r0
- adds r5, r2, 0
-_0810C83C:
- ldrh r0, [r5, 0xC]
- cmp r0, 0x1
- beq _0810C846
- cmp r0, 0x3
- bne _0810C8AC
-_0810C846:
- ldr r1, [r7]
- mov r2, r8
- lsls r4, r2, 4
- adds r1, r4
- ldr r0, [r5, 0x10]
- str r0, [r1]
- ldr r0, [r5, 0x10]
- bl sub_810D074
- ldr r1, [r7]
- adds r1, r4
- strh r0, [r1, 0x4]
- ldrb r0, [r5]
- strb r0, [r1, 0x6]
- ldrb r0, [r5]
- ldr r1, _0810C8DC @ =gSaveBlock1Ptr
- ldr r2, [r1]
- ldrb r1, [r2, 0x5]
- ldrb r2, [r2, 0x4]
- mov r3, sp
- bl TryGetFieldObjectIdByLocalIdAndMap
- ldr r0, [r7]
- adds r0, r4
- ldrb r1, [r6]
- strb r1, [r0, 0x7]
- ldr r2, [r7]
- adds r2, r4
- ldrb r1, [r6]
- lsls r0, r1, 3
- adds r0, r1
- lsls r0, 2
- add r0, r10
- ldrh r0, [r0, 0x10]
- subs r0, 0x7
- strh r0, [r2, 0x8]
- ldrb r1, [r6]
- lsls r0, r1, 3
- adds r0, r1
- lsls r0, 2
- add r0, r10
- ldrh r0, [r0, 0x12]
- subs r0, 0x7
- strh r0, [r2, 0xA]
- ldrb r0, [r5, 0x1]
- strb r0, [r2, 0xC]
- mov r0, r8
- adds r0, 0x1
- lsls r0, 24
- lsrs r0, 24
- mov r8, r0
-_0810C8AC:
- adds r5, 0x18
- movs r0, 0x1
- add r9, r0
- ldr r0, _0810C8E0 @ =gMapHeader
- ldr r0, [r0, 0x4]
- ldrb r0, [r0]
- cmp r9, r0
- blt _0810C83C
-_0810C8BC:
- ldr r0, _0810C8E4 @ =gUnknown_203ADB8
- ldr r0, [r0]
- mov r2, r8
- lsls r1, r2, 4
- adds r0, r1
- movs r1, 0xFF
- strb r1, [r0, 0x6]
- add sp, 0x4
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r0}
- bx r0
- .align 2, 0
-_0810C8DC: .4byte gSaveBlock1Ptr
-_0810C8E0: .4byte gMapHeader
-_0810C8E4: .4byte gUnknown_203ADB8
-_0810C8E8: .4byte gUnknown_2036E38
- thumb_func_end sub_810C808
-
- thumb_func_start sub_810C8EC
-sub_810C8EC: @ 810C8EC
- push {r4,r5,lr}
- lsls r0, 24
- lsrs r4, r0, 24
- adds r5, r4, 0
- ldr r0, _0810C928 @ =gSaveBlock1Ptr
- ldr r0, [r0]
- ldrb r1, [r0, 0x5]
- ldrb r2, [r0, 0x4]
- movs r0, 0xFF
- bl ScriptMovement_IsObjectMovementFinished
- lsls r0, 24
- cmp r0, 0
- beq _0810C962
- ldr r0, _0810C92C @ =gUnknown_203ADB8
- ldr r0, [r0]
- ldr r1, _0810C930 @ =0x00000431
- adds r0, r1
- ldrb r0, [r0]
- movs r1, 0xF8
- ands r1, r0
- cmp r1, 0
- bne _0810C93C
- ldr r2, _0810C934 @ =gUnknown_81C1429
- ldr r3, _0810C938 @ =sub_80A1E0C
- adds r0, r4, 0
- movs r1, 0x2
- bl DisplayItemMessageOnField
- b _0810C95A
- .align 2, 0
-_0810C928: .4byte gSaveBlock1Ptr
-_0810C92C: .4byte gUnknown_203ADB8
-_0810C930: .4byte 0x00000431
-_0810C934: .4byte gUnknown_81C1429
-_0810C938: .4byte sub_80A1E0C
-_0810C93C:
- cmp r1, 0x10
- bne _0810C944
- bl sub_810D304
-_0810C944:
- movs r0, 0
- movs r1, 0x1
- bl sub_80F6F54
- bl sub_80696C0
- bl ScriptContext2_Disable
- adds r0, r5, 0
- bl DestroyTask
-_0810C95A:
- ldr r0, _0810C968 @ =gUnknown_203ADB8
- ldr r0, [r0]
- bl Free
-_0810C962:
- pop {r4,r5}
- pop {r0}
- bx r0
- .align 2, 0
-_0810C968: .4byte gUnknown_203ADB8
- thumb_func_end sub_810C8EC
-
- thumb_func_start sub_810C96C
-sub_810C96C: @ 810C96C
- push {lr}
- ldr r0, _0810C990 @ =gSaveBlock1Ptr
- ldr r0, [r0]
- movs r1, 0xC7
- lsls r1, 3
- adds r0, r1
- ldrb r0, [r0]
- cmp r0, 0x64
- bne _0810C998
- bl sub_810D1CC
- lsls r0, 24
- lsrs r0, 24
- cmp r0, 0xFF
- bne _0810C994
- movs r0, 0x1
- b _0810C9A4
- .align 2, 0
-_0810C990: .4byte gSaveBlock1Ptr
-_0810C994:
- movs r0, 0x2
- b _0810C9A4
-_0810C998:
- movs r1, 0x64
- subs r1, r0
- movs r0, 0
- bl TV_PrintIntToStringVar
- movs r0, 0
-_0810C9A4:
- pop {r1}
- bx r1
- thumb_func_end sub_810C96C
-
- thumb_func_start sub_810C9A8
-sub_810C9A8: @ 810C9A8
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- sub sp, 0x8
- str r0, [sp, 0x4]
- movs r0, 0
- mov r8, r0
- mov r0, sp
- mov r1, r8
- strb r1, [r0]
- movs r2, 0
- mov r9, r2
- ldr r4, _0810CA14 @ =gUnknown_203ADB8
- ldr r0, [r4]
- ldrb r0, [r0, 0x6]
- cmp r0, 0xFF
- bne _0810C9D0
- b _0810CB2C
-_0810C9D0:
- adds r6, r4, 0
- movs r3, 0x86
- lsls r3, 3
- mov r10, r3
- movs r5, 0
-_0810C9DA:
- ldr r0, [r6]
- adds r0, r5
- bl sub_810D0FC
- lsls r0, 24
- lsrs r0, 24
- cmp r0, 0x1
- beq _0810C9EC
- b _0810CB18
-_0810C9EC:
- ldr r0, [r4]
- adds r0, r5
- ldrh r0, [r0, 0x4]
- mov r8, r0
- bl HasTrainerAlreadyBeenFought
- lsls r0, 24
- cmp r0, 0
- bne _0810CA20
- ldr r0, [r6]
- adds r0, r5
- ldr r1, _0810CA18 @ =gUnknown_8453F60
- bl sub_810D24C
- ldr r2, [r6]
- ldr r0, _0810CA1C @ =0x00000431
- adds r2, r0
- ldrb r0, [r2]
- movs r1, 0x1
- b _0810CB14
- .align 2, 0
-_0810CA14: .4byte gUnknown_203ADB8
-_0810CA18: .4byte gUnknown_8453F60
-_0810CA1C: .4byte 0x00000431
-_0810CA20:
- ldr r0, [sp, 0x4]
- mov r1, r8
- mov r2, sp
- bl sub_810D164
- lsls r0, 24
- lsrs r7, r0, 24
- cmp r7, 0
- bne _0810CA50
- ldr r0, [r6]
- adds r0, r5
- ldr r1, _0810CA48 @ =gUnknown_8453F62
- bl sub_810D24C
- ldr r2, [r6]
- ldr r3, _0810CA4C @ =0x00000431
- adds r2, r3
- ldrb r0, [r2]
- movs r1, 0x2
- b _0810CB14
- .align 2, 0
-_0810CA48: .4byte gUnknown_8453F62
-_0810CA4C: .4byte 0x00000431
-_0810CA50:
- bl Random
- lsls r0, 16
- lsrs r0, 16
- movs r1, 0x64
- bl __umodsi3
- lsls r0, 16
- lsrs r4, r0, 16
- mov r0, r9
- mov r1, r8
- bl sub_810D280
- lsls r0, 24
- lsrs r0, 24
- cmp r0, 0x2
- bne _0810CA76
- movs r4, 0x64
- b _0810CA7C
-_0810CA76:
- cmp r0, 0x1
- bne _0810CA7C
- movs r4, 0
-_0810CA7C:
- cmp r4, 0x1D
- bhi _0810CAA0
- ldr r0, [r6]
- adds r0, r5
- ldr r1, _0810CA98 @ =gUnknown_8453F62
- bl sub_810D24C
- ldr r2, [r6]
- ldr r0, _0810CA9C @ =0x00000431
- adds r2, r0
- ldrb r0, [r2]
- movs r1, 0x2
- b _0810CB14
- .align 2, 0
-_0810CA98: .4byte gUnknown_8453F62
-_0810CA9C: .4byte 0x00000431
-_0810CAA0:
- ldr r0, _0810CB54 @ =gSaveBlock1Ptr
- ldr r1, [r0]
- ldr r0, [r6]
- adds r0, r5
- ldr r2, _0810CB58 @ =0x0000063a
- adds r1, r2
- ldrb r0, [r0, 0x6]
- adds r1, r0
- strb r7, [r1]
- ldr r0, [r6]
- adds r0, r5
- ldrb r1, [r0, 0x7]
- lsls r0, r1, 3
- adds r0, r1
- lsls r0, 2
- ldr r1, _0810CB5C @ =gUnknown_2036E38
- adds r0, r1
- bl npc_coords_shift_still
- ldr r0, [r6]
- adds r0, r5
- ldr r1, _0810CB60 @ =gUnknown_8453F64
- bl sub_810D24C
- ldr r2, [r6]
- mov r3, r10
- adds r0, r2, r3
- ldrb r1, [r0]
- lsls r1, 1
- movs r3, 0x80
- lsls r3, 3
- adds r0, r2, r3
- adds r0, r1
- mov r1, r8
- strh r1, [r0]
- adds r2, r5
- ldrb r0, [r2, 0xC]
- bl sub_810CF90
- ldr r1, [r6]
- mov r3, r10
- adds r2, r1, r3
- movs r3, 0x84
- lsls r3, 3
- adds r1, r3
- ldrb r2, [r2]
- adds r1, r2
- strb r0, [r1]
- ldr r1, [r6]
- add r1, r10
- ldrb r0, [r1]
- adds r0, 0x1
- strb r0, [r1]
- ldr r2, [r6]
- ldr r0, _0810CB64 @ =0x00000431
- adds r2, r0
- ldrb r0, [r2]
- movs r1, 0x4
-_0810CB14:
- orrs r0, r1
- strb r0, [r2]
-_0810CB18:
- adds r5, 0x10
- movs r1, 0x1
- add r9, r1
- ldr r4, _0810CB68 @ =gUnknown_203ADB8
- ldr r0, [r4]
- adds r0, r5
- ldrb r0, [r0, 0x6]
- cmp r0, 0xFF
- beq _0810CB2C
- b _0810C9DA
-_0810CB2C:
- ldr r2, _0810CB68 @ =gUnknown_203ADB8
- ldr r0, [r2]
- ldr r3, _0810CB64 @ =0x00000431
- adds r0, r3
- ldrb r1, [r0]
- movs r0, 0x4
- ands r0, r1
- cmp r0, 0
- beq _0810CB70
- movs r0, 0x15
- bl PlaySE
- ldr r0, _0810CB6C @ =0x00000801
- bl FlagSet
- bl sub_810C640
- movs r0, 0x2
- b _0810CB7E
- .align 2, 0
-_0810CB54: .4byte gSaveBlock1Ptr
-_0810CB58: .4byte 0x0000063a
-_0810CB5C: .4byte gUnknown_2036E38
-_0810CB60: .4byte gUnknown_8453F64
-_0810CB64: .4byte 0x00000431
-_0810CB68: .4byte gUnknown_203ADB8
-_0810CB6C: .4byte 0x00000801
-_0810CB70:
- movs r0, 0x1
- ands r0, r1
- cmp r0, 0
- bne _0810CB7C
- movs r0, 0
- b _0810CB7E
-_0810CB7C:
- movs r0, 0x1
-_0810CB7E:
- add sp, 0x8
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r1}
- bx r1
- thumb_func_end sub_810C9A8
-
- thumb_func_start sub_810CB90
-sub_810CB90: @ 810CB90
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- sub sp, 0x4
- movs r1, 0
- mov r0, sp
- strb r1, [r0]
- ldr r5, _0810CC54 @ =gSaveBlock1Ptr
- ldr r0, [r5]
- movs r1, 0x8E
- lsls r1, 4
- adds r4, r0, r1
- ldr r0, _0810CC58 @ =gUnknown_845318C
- ldr r1, _0810CC5C @ =gTrainerBattleOpponent_A
- ldrh r1, [r1]
- bl sub_810CE10
- mov r9, r0
- movs r0, 0x1
- negs r0, r0
- cmp r9, r0
- beq _0810CC8A
- movs r0, 0
- mov r8, r0
- ldr r0, _0810CC60 @ =gMapHeader
- ldr r0, [r0, 0x4]
- ldrb r0, [r0]
- cmp r8, r0
- bge _0810CC8A
- mov r10, r5
- adds r6, r4, 0
- adds r5, r6, 0
-_0810CBD4:
- ldrh r0, [r5, 0xC]
- cmp r0, 0x1
- beq _0810CBDE
- cmp r0, 0x3
- bne _0810CC78
-_0810CBDE:
- ldr r0, [r5, 0x10]
- bl sub_810D074
- adds r1, r0, 0
- lsls r1, 16
- lsrs r1, 16
- ldr r0, _0810CC58 @ =gUnknown_845318C
- bl sub_810CE10
- cmp r9, r0
- bne _0810CC78
- ldrb r0, [r5]
- mov r1, r10
- ldr r2, [r1]
- ldrb r1, [r2, 0x5]
- ldrb r2, [r2, 0x4]
- mov r3, sp
- bl TryGetFieldObjectIdByLocalIdAndMap
- mov r0, sp
- ldrb r1, [r0]
- lsls r0, r1, 3
- adds r0, r1
- lsls r0, 2
- ldr r1, _0810CC64 @ =gUnknown_2036E38
- adds r4, r0, r1
- adds r0, r6, 0
- bl sub_810CF54
- ldr r7, _0810CC68 @ =gUnknown_8453F67
- ldrb r0, [r4, 0x18]
- lsls r0, 28
- lsrs r0, 28
- adds r0, r7
- ldrb r1, [r0]
- adds r0, r4, 0
- bl sub_805FE7C
- mov r1, r10
- ldr r0, [r1]
- ldr r1, _0810CC6C @ =0x0000063a
- adds r0, r1
- ldrb r1, [r5]
- adds r0, r1
- movs r1, 0
- strb r1, [r0]
- ldr r0, _0810CC70 @ =gUnknown_3005074
- mov r1, sp
- ldrb r0, [r0]
- ldrb r1, [r1]
- cmp r0, r1
- bne _0810CC74
- ldrb r0, [r4, 0x18]
- lsls r0, 28
- lsrs r0, 28
- adds r0, r7
- ldrb r0, [r0]
- b _0810CC76
- .align 2, 0
-_0810CC54: .4byte gSaveBlock1Ptr
-_0810CC58: .4byte gUnknown_845318C
-_0810CC5C: .4byte gTrainerBattleOpponent_A
-_0810CC60: .4byte gMapHeader
-_0810CC64: .4byte gUnknown_2036E38
-_0810CC68: .4byte gUnknown_8453F67
-_0810CC6C: .4byte 0x0000063a
-_0810CC70: .4byte gUnknown_3005074
-_0810CC74:
- movs r0, 0x8
-_0810CC76:
- strb r0, [r4, 0x6]
-_0810CC78:
- adds r5, 0x18
- adds r6, 0x18
- movs r0, 0x1
- add r8, r0
- ldr r0, _0810CC9C @ =gMapHeader
- ldr r0, [r0, 0x4]
- ldrb r0, [r0]
- cmp r8, r0
- blt _0810CBD4
-_0810CC8A:
- add sp, 0x4
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r0}
- bx r0
- .align 2, 0
-_0810CC9C: .4byte gMapHeader
- thumb_func_end sub_810CB90
-
- thumb_func_start sub_810CCA0
-sub_810CCA0: @ 810CCA0
- push {r4,r5,lr}
- adds r5, r0, 0
- adds r4, r1, 0
- ldrb r0, [r4]
- cmp r0, 0x5
- bhi _0810CD0A
- lsls r0, 2
- ldr r1, _0810CCB8 @ =_0810CCBC
- adds r0, r1
- ldr r0, [r0]
- mov pc, r0
- .align 2, 0
-_0810CCB8: .4byte _0810CCBC
- .align 2, 0
-_0810CCBC:
- .4byte _0810CD0A
- .4byte _0810CCD4
- .4byte _0810CCDC
- .4byte _0810CCE4
- .4byte _0810CCEC
- .4byte _0810CCF4
-_0810CCD4:
- ldr r0, _0810CCD8 @ =0x00000292
- b _0810CCF6
- .align 2, 0
-_0810CCD8: .4byte 0x00000292
-_0810CCDC:
- ldr r0, _0810CCE0 @ =0x00000896
- b _0810CCF6
- .align 2, 0
-_0810CCE0: .4byte 0x00000896
-_0810CCE4:
- ldr r0, _0810CCE8 @ =0x00000897
- b _0810CCF6
- .align 2, 0
-_0810CCE8: .4byte 0x00000897
-_0810CCEC:
- ldr r0, _0810CCF0 @ =0x0000082c
- b _0810CCF6
- .align 2, 0
-_0810CCF0: .4byte 0x0000082c
-_0810CCF4:
- ldr r0, _0810CD10 @ =0x00000844
-_0810CCF6:
- bl FlagGet
- lsls r0, 24
- cmp r0, 0
- bne _0810CD0A
- ldrb r1, [r4]
- adds r0, r5, 0
- bl sub_810CD14
- strb r0, [r4]
-_0810CD0A:
- pop {r4,r5}
- pop {r0}
- bx r0
- .align 2, 0
-_0810CD10: .4byte 0x00000844
- thumb_func_end sub_810CCA0
-
- thumb_func_start sub_810CD14
-sub_810CD14: @ 810CD14
- push {lr}
- adds r2, r0, 0
- lsls r1, 24
- movs r0, 0xFF
- lsls r0, 24
- adds r1, r0
- lsrs r1, 24
- cmp r1, 0
- beq _0810CD46
- ldr r3, _0810CD38 @ =0x0000ffff
-_0810CD28:
- lsls r0, r1, 1
- adds r0, r2, r0
- ldrh r0, [r0]
- cmp r0, r3
- beq _0810CD3C
- adds r0, r1, 0
- b _0810CD48
- .align 2, 0
-_0810CD38: .4byte 0x0000ffff
-_0810CD3C:
- subs r0, r1, 0x1
- lsls r0, 24
- lsrs r1, r0, 24
- cmp r1, 0
- bne _0810CD28
-_0810CD46:
- movs r0, 0
-_0810CD48:
- pop {r1}
- bx r1
- thumb_func_end sub_810CD14
-
- thumb_func_start sub_810CD4C
-sub_810CD4C: @ 810CD4C
- push {r4,r5,lr}
- ldr r5, _0810CD70 @ =gUnknown_845318C
- ldr r4, _0810CD74 @ =gTrainerBattleOpponent_A
- ldrh r1, [r4]
- adds r0, r5, 0
- bl sub_810CD80
- lsls r0, 24
- cmp r0, 0
- bne _0810CD78
- ldrh r1, [r4]
- adds r0, r5, 0
- bl sub_810CDB4
- lsls r0, 24
- lsrs r0, 24
- b _0810CD7A
- .align 2, 0
-_0810CD70: .4byte gUnknown_845318C
-_0810CD74: .4byte gTrainerBattleOpponent_A
-_0810CD78:
- movs r0, 0x1
-_0810CD7A:
- pop {r4,r5}
- pop {r1}
- bx r1
- thumb_func_end sub_810CD4C
-
- thumb_func_start sub_810CD80
-sub_810CD80: @ 810CD80
- push {lr}
- lsls r1, 16
- lsrs r1, 16
- bl sub_810D084
- adds r1, r0, 0
- movs r0, 0x1
- negs r0, r0
- cmp r1, r0
- beq _0810CDAC
- cmp r1, 0xDC
- bhi _0810CDAC
- ldr r0, _0810CDA8 @ =gUnknown_20370D2
- ldrh r0, [r0]
- bl sub_810D0A8
- cmp r0, 0
- beq _0810CDAC
- movs r0, 0x1
- b _0810CDAE
- .align 2, 0
-_0810CDA8: .4byte gUnknown_20370D2
-_0810CDAC:
- movs r0, 0
-_0810CDAE:
- pop {r1}
- bx r1
- thumb_func_end sub_810CD80
-
- thumb_func_start sub_810CDB4
-sub_810CDB4: @ 810CDB4
- push {r4,lr}
- adds r4, r0, 0
- lsls r1, 16
- lsrs r1, 16
- bl sub_810D084
- adds r1, r0, 0
- movs r0, 0x1
- negs r0, r0
- cmp r1, r0
- beq _0810CDDE
- lsls r0, r1, 4
- adds r0, r4
- ldrh r0, [r0]
- bl HasTrainerAlreadyBeenFought
- lsls r0, 24
- cmp r0, 0
- beq _0810CDDE
- movs r0, 0x1
- b _0810CDE0
-_0810CDDE:
- movs r0, 0
-_0810CDE0:
- pop {r4}
- pop {r1}
- bx r1
- thumb_func_end sub_810CDB4
-
- thumb_func_start sub_810CDE8
-sub_810CDE8: @ 810CDE8
- push {lr}
- ldr r0, _0810CE04 @ =gSaveBlock1Ptr
- ldr r0, [r0]
- ldr r1, _0810CE08 @ =gUnknown_20370D2
- ldr r2, _0810CE0C @ =0x0000063a
- adds r0, r2
- ldrh r1, [r1]
- adds r0, r1
- movs r1, 0
- strb r1, [r0]
- bl sub_80803FC
- pop {r0}
- bx r0
- .align 2, 0
-_0810CE04: .4byte gSaveBlock1Ptr
-_0810CE08: .4byte gUnknown_20370D2
-_0810CE0C: .4byte 0x0000063a
- thumb_func_end sub_810CDE8
-
thumb_func_start sub_810CE10
sub_810CE10: @ 810CE10
push {r4-r7,lr}
diff --git a/data/data_84827AC.s b/data/data_84827AC.s
index 565a6adf2..4f794c658 100644
--- a/data/data_84827AC.s
+++ b/data/data_84827AC.s
@@ -3341,24 +3341,9 @@ gUnknown_8453178:: @ 8453178
gUnknown_8453184:: @ 8453184
.incbin "baserom.gba", 0x453184, 0x8
-gUnknown_845318C:: @ 845318C
- .incbin "baserom.gba", 0x45318C, 0xDD0
-
-gUnknown_8453F5C:: @ 8453F5C
- .incbin "baserom.gba", 0x453F5C, 0x4
-
-gUnknown_8453F60:: @ 8453F60
- .incbin "baserom.gba", 0x453F60, 0x2
-
-gUnknown_8453F62:: @ 8453F62
- .incbin "baserom.gba", 0x453F62, 0x2
-
-gUnknown_8453F64:: @ 8453F64
- .incbin "baserom.gba", 0x453F64, 0x3
-
-gUnknown_8453F67:: @ 8453F67
- .incbin "baserom.gba", 0x453F67, 0x5
+ .section .rodata.8453F6C
+// item_pc.o
gUnknown_8453F6C:: @ 8453F6C
.incbin "baserom.gba", 0x453F6C, 0x8
@@ -5016,6 +5001,7 @@ gUnknown_8468BCC:: @ 8468BCC
.section .rodata.8468C98
+// seagallop.o
.align 2
gUnknown_8468C98:: @ 8468C98
.incbin "baserom.gba", 0x468C98, 0x520
diff --git a/include/battle_setup.h b/include/battle_setup.h
index 0168022cc..9b9ad2e15 100644
--- a/include/battle_setup.h
+++ b/include/battle_setup.h
@@ -14,5 +14,6 @@ void trainer_flag_clear(u16);
void BattleSetup_StartTrainerBattle(void);
u8 *BattleSetup_GetScriptAddrAfterBattle(void);
u8 *BattleSetup_GetTrainerPostBattleScript(void);
+void sub_80803FC(void);
#endif // GUARD_BATTLE_SETUP_H
diff --git a/include/event_scripts.h b/include/event_scripts.h
index 844f1052a..03329ba34 100644
--- a/include/event_scripts.h
+++ b/include/event_scripts.h
@@ -372,4 +372,9 @@ extern const u8 SecretBase_RedCave1_Text_274E75[];
extern const u8 SecretBase_RedCave1_Text_2751E1[];
extern const u8 SecretBase_RedCave1_Text_2754F6[];
extern const u8 SecretBase_RedCave1_Text_2758CC[];
+
+// vs_seeker
+extern const u8 gUnknown_81C137C[];
+extern const u8 gUnknown_81C13D6[];
+extern const u8 gUnknown_81C1429[];
#endif //GUARD_EVENT_SCRIPTS_H
diff --git a/include/field_effect.h b/include/field_effect.h
index 629ae07c7..9404e3959 100644
--- a/include/field_effect.h
+++ b/include/field_effect.h
@@ -66,7 +66,9 @@ enum FieldEffectScriptIdx
FLDEFF_USE_FLY_ANCIENT_TOMB,
FLDEFF_PCTURN_ON,
FLDEFF_HALL_OF_FAME_RECORD,
- FLDEFF_USE_TELEPORT
+ FLDEFF_USE_TELEPORT,
+ FLDEFF_UNK_40,
+ FLDEFF_UNK_41 // TODO: related to vs_seeker
};
extern u32 gFieldEffectArguments[8];
diff --git a/include/field_map_obj.h b/include/field_map_obj.h
index 0107fa10f..803ed275b 100644
--- a/include/field_map_obj.h
+++ b/include/field_map_obj.h
@@ -76,6 +76,7 @@ void MoveCoords(u8, s16 *, s16 *);
bool8 FieldObjectIsSpecialAnimActive(struct MapObject *);
u8 FieldObjectClearAnimIfSpecialAnimFinished(struct MapObject *);
u8 GetFieldObjectIdByXYZ(u16 x, u16 y, u8 z);
+void npc_coords_shift_still(struct MapObject *);
// Exported data declarations
diff --git a/include/field_specials.h b/include/field_specials.h
index 1f8fbf147..8c0e69c2c 100644
--- a/include/field_specials.h
+++ b/include/field_specials.h
@@ -2,5 +2,6 @@
#define GUARD_FIELD_SPECIALS_H
u8 GetLeadMonIndex(void);
+void TV_PrintIntToStringVar(u8, int);
#endif // GUARD_FIELD_SPECIALS_H
diff --git a/include/item_menu.h b/include/item_menu.h
index 85655e9d5..0e1f20588 100644
--- a/include/item_menu.h
+++ b/include/item_menu.h
@@ -1,12 +1,14 @@
-#ifndef GUARD_item_menu_H
-#define GUARD_item_menu_H
+#ifndef GUARD_ITEM_MENU_H
+#define GUARD_ITEM_MENU_H
// Exported type declarations
// Exported RAM declarations
+extern u16 gUnknown_203AD30;
+
// Exported ROM declarations
void sub_81AAC50(void);
void sub_81AAC70(void);
-#endif //GUARD_item_menu_H
+#endif //GUARD_ITEM_MENU_H
diff --git a/include/item_use.h b/include/item_use.h
new file mode 100644
index 000000000..5ec5f2b33
--- /dev/null
+++ b/include/item_use.h
@@ -0,0 +1,9 @@
+#ifndef GUARD_ITEM_USE_H
+#define GUARD_ITEM_USE_H
+
+#include "global.h"
+
+void sub_80A1E0C(u8);
+void sub_80A2294(u8, u8, u16, u16);
+
+#endif //GUARD_ITEM_USE_H
diff --git a/include/map_obj_lock.h b/include/map_obj_lock.h
index a10648f2f..cf1f714d7 100644
--- a/include/map_obj_lock.h
+++ b/include/map_obj_lock.h
@@ -7,5 +7,6 @@ bool8 sub_809847C(void);
void LockSelectedMapObject(void);
void sub_8098630(void);
bool8 sub_8098734(void);
+void sub_80696C0(void);
#endif // GUARD_MAP_OBJ_LOCK_H
diff --git a/include/new_menu_helpers.h b/include/new_menu_helpers.h
index c52184972..639395941 100644
--- a/include/new_menu_helpers.h
+++ b/include/new_menu_helpers.h
@@ -1,6 +1,7 @@
#ifndef GUARD_NEW_MENU_HELPERS_H
#define GUARD_NEW_MENU_HELPERS_H
+#include "global.h"
#include "text.h"
#include "task.h"
@@ -9,10 +10,11 @@ void sub_81973C4(u8, u8);
void sub_819746C(u8 windowId, bool8 copyToVram);
void sub_81973FC(u8, u8);
u16 AddTextPrinterParametrized(u8 windowId, u8 fontId, const u8 *str, u8 speed, void ( *callback)(u16, struct TextPrinter *), u8 fgColor, u8 bgColor, u8 shadowColor);
-void DisplayItemMessageOnField(u8 taskId, const u8 *src, TaskFunc callback);
+void DisplayItemMessageOnField(u8 taskId, u8 bgId, const u8 *src, TaskFunc callback);
void sub_8197434(u8 a0, u8 a1);
void SetStandardWindowBorderStyle(u8 a0, u8 a1);
void sub_8197930(void);
u8 GetPlayerTextSpeed(void);
+void sub_80F6F54(u8, u8);
#endif // GUARD_NEW_MENU_HELPERS_H
diff --git a/include/vs_seeker.h b/include/vs_seeker.h
new file mode 100644
index 000000000..d79035576
--- /dev/null
+++ b/include/vs_seeker.h
@@ -0,0 +1,30 @@
+#ifndef GUARD_VS_SEEKER_H
+#define GUARD_VS_SEEKER_H
+
+#include "global.h"
+
+struct VsSeekerSubstruct
+{
+ const u8 *unk_0;
+ u16 unk_4;
+ u8 unk_6;
+ u8 unk_7;
+ u16 unk_8;
+ u16 unk_a;
+ u8 unk_c;
+};
+
+struct VsSeekerStruct
+{
+ /*0x000*/ struct VsSeekerSubstruct unk_000[MAP_OBJECTS_COUNT];
+ /*0x100*/ u8 filler_100[0x300];
+ /*0x400*/ u16 unk_400[0x10];
+ /*0x420*/ u8 unk_420[0x10];
+ /*0x430*/ u8 unk_430;
+ /*0x431*/ u8 unk_431_0:1;
+ /*0x431*/ u8 unk_431_1:1;
+ /*0x431*/ u8 unk_431_2:1;
+ u8 unk_431_3:5;
+};
+
+#endif //GUARD_VS_SEEKER_H
diff --git a/ld_script.txt b/ld_script.txt
index 70084ef0e..e1afe8856 100644
--- a/ld_script.txt
+++ b/ld_script.txt
@@ -218,6 +218,7 @@ SECTIONS {
asm/bag.o(.text);
asm/battle_dome_cards.o(.text);
asm/unk_810C3A4.o(.text);
+ src/vs_seeker.o(.text);
asm/vs_seeker.o(.text);
asm/item_pc.o(.text);
asm/mailbox_pc.o(.text);
@@ -369,6 +370,8 @@ SECTIONS {
data/data.o(.rodata);
src/battle_ai_script_commands.o(.rodata);
data/data_84827AC.o(.rodata);
+ src/vs_seeker.o(.rodata);
+ data/data_84827AC.o(.rodata.8453F6C);
src/menews_jisan.o(.rodata);
data/data_84827AC.o(.rodata.8468C98);
src/m4a_tables.o(.rodata);
diff --git a/src/vs_seeker.c b/src/vs_seeker.c
new file mode 100644
index 000000000..f8dd673fe
--- /dev/null
+++ b/src/vs_seeker.c
@@ -0,0 +1,828 @@
+#include "global.h"
+#include "songs.h"
+#include "sound.h"
+#include "task.h"
+#include "malloc.h"
+#include "field_map_obj.h"
+#include "new_menu_helpers.h"
+#include "item_use.h"
+#include "event_scripts.h"
+#include "event_data.h"
+#include "script.h"
+#include "map_obj_lock.h"
+#include "field_specials.h"
+#include "item_menu.h"
+#include "field_effect.h"
+#include "script_movement.h"
+#include "battle.h"
+#include "battle_setup.h"
+#include "random.h"
+#include "field_map_obj.h"
+#include "vs_seeker.h"
+
+// static types
+struct UnkStruct_845318C
+{
+ u16 unk_0[6];
+ u8 filler_c[4];
+};
+
+extern u16 gUnknown_20370D2;
+extern struct MapObject gUnknown_2036E38[MAP_OBJECTS_COUNT];
+extern u8 gUnknown_3005074;
+
+// static declarations
+EWRAM_DATA struct VsSeekerStruct *gUnknown_203ADB8;
+void sub_810C730(u8 taskId);
+void sub_810C760(u8 taskId);
+void sub_810C808(void);
+void sub_810C8EC(u8 taskId);
+bool8 sub_810C96C(void);
+u8 sub_810C9A8(const struct UnkStruct_845318C *);
+u8 sub_810CD14(const u16 *, u8);
+u8 sub_810CD80(const struct UnkStruct_845318C *, u16);
+bool32 sub_810D0A8(u16);
+u8 sub_810CDB4(const struct UnkStruct_845318C *, u16);
+int sub_810D084(const struct UnkStruct_845318C *, u16);
+void sub_810D304(void);
+void sub_810C604(void);
+bool8 sub_810D0FC(struct VsSeekerSubstruct *);
+u16 sub_810D074(const u8 *);
+u8 sub_810D1CC(void);
+void sub_810D24C(struct VsSeekerSubstruct *, const u8 *);
+int sub_810CE10(const struct UnkStruct_845318C *, u16);
+bool8 sub_810D164(const void *, u16, u8 *);
+u8 sub_810D280(int, u16);
+u8 sub_810CF90(u8);
+void sub_810C640(void);
+void sub_810CF54(struct MapObjectTemplate *);
+void sub_805FE7C(struct MapObject *, u8);
+
+// rodata
+const struct UnkStruct_845318C gUnknown_845318C[] = {
+ { {0x0059, 0x0065, 0xffff, 0x01f2, 0x01f3, 0x0000}, {0x03, 0x00, 0x15, 0x00} },
+ { {0x005a, 0x005a, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x15, 0x00} },
+ { {0x0069, 0x02d9, 0xffff, 0x02da, 0xffff, 0x02db}, {0x03, 0x00, 0x15, 0x00} },
+ { {0x006a, 0x006a, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x15, 0x00} },
+ { {0x006b, 0x006b, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x15, 0x00} },
+ { {0x0074, 0x01fb, 0xffff, 0x01fc, 0x0000, 0x0000}, {0x03, 0x00, 0x15, 0x00} },
+ { {0x0075, 0x0075, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x15, 0x00} },
+ { {0x0076, 0x0076, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x15, 0x00} },
+ { {0x0077, 0x0077, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x16, 0x00} },
+ { {0x005c, 0x01f7, 0xffff, 0x01f8, 0xffff, 0x01f9}, {0x03, 0x00, 0x2b, 0x00} },
+ { {0x006e, 0x006e, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x2b, 0x00} },
+ { {0x007a, 0x01f5, 0xffff, 0x01f6, 0x0000, 0x0000}, {0x03, 0x00, 0x2b, 0x00} },
+ { {0x007b, 0x007b, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x2b, 0x00} },
+ { {0x008f, 0x008f, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x2b, 0x00} },
+ { {0x0090, 0x0090, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x2b, 0x00} },
+ { {0x005d, 0x005d, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x2c, 0x00} },
+ { {0x005e, 0x005e, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x2c, 0x00} },
+ { {0x005f, 0x01f4, 0xffff, 0x01fa, 0x01fd, 0x0000}, {0x03, 0x00, 0x2c, 0x00} },
+ { {0x0099, 0x026d, 0xffff, 0x026e, 0x026f, 0x0000}, {0x03, 0x00, 0x2c, 0x00} },
+ { {0x007d, 0x007d, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x2c, 0x00} },
+ { {0x00b6, 0xffff, 0x01fe, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x2c, 0x00} },
+ { {0x00b7, 0x00b7, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x2c, 0x00} },
+ { {0x00b8, 0x00b8, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x2c, 0x00} },
+ { {0x01d7, 0x01d7, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x2c, 0x00} },
+ { {0x006f, 0x006f, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x18, 0x00} },
+ { {0x0070, 0x0070, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x18, 0x00} },
+ { {0x0091, 0x0270, 0xffff, 0x0271, 0xffff, 0x0272}, {0x03, 0x00, 0x18, 0x00} },
+ { {0x0092, 0x0273, 0xffff, 0x0274, 0xffff, 0x0275}, {0x03, 0x00, 0x18, 0x00} },
+ { {0x0097, 0x0097, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x18, 0x00} },
+ { {0x0098, 0x0276, 0xffff, 0x0277, 0x0278, 0x0000}, {0x03, 0x00, 0x18, 0x00} },
+ { {0x0061, 0x0061, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x1d, 0x00} },
+ { {0x0062, 0x0062, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x1d, 0x00} },
+ { {0x0063, 0xffff, 0x0279, 0xffff, 0x027a, 0x0000}, {0x03, 0x00, 0x1d, 0x00} },
+ { {0x0064, 0x0064, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x1d, 0x00} },
+ { {0x00dd, 0x00dd, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x1d, 0x00} },
+ { {0x00de, 0xffff, 0xffff, 0x027b, 0x0000, 0x0000}, {0x03, 0x00, 0x1d, 0x00} },
+ { {0x0102, 0x0102, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x1d, 0x00} },
+ { {0x0103, 0x0103, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x1d, 0x00} },
+ { {0x0104, 0x0104, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x1d, 0x00} },
+ { {0x0105, 0xffff, 0xffff, 0x027c, 0x0000, 0x0000}, {0x03, 0x00, 0x1d, 0x00} },
+ { {0x0072, 0x0072, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x1b, 0x00} },
+ { {0x0073, 0x0073, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x1b, 0x00} },
+ { {0x0094, 0xffff, 0x027d, 0x027e, 0xffff, 0x027f}, {0x03, 0x00, 0x1b, 0x00} },
+ { {0x0095, 0x0095, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x1b, 0x00} },
+ { {0x009a, 0xffff, 0x0280, 0x0281, 0xffff, 0x0282}, {0x03, 0x00, 0x1b, 0x00} },
+ { {0x009b, 0x009b, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x1b, 0x00} },
+ { {0x00b9, 0x00b9, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x1b, 0x00} },
+ { {0x00ba, 0x00ba, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x1b, 0x00} },
+ { {0x01d1, 0xffff, 0xffff, 0x0283, 0x0000, 0x0000}, {0x03, 0x00, 0x1b, 0x00} },
+ { {0x009c, 0x009c, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x1c, 0x00} },
+ { {0x009d, 0x009d, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x1c, 0x00} },
+ { {0x00a2, 0xffff, 0xffff, 0x0252, 0xffff, 0x0284}, {0x03, 0x00, 0x1c, 0x00} },
+ { {0x00a3, 0xffff, 0xffff, 0x0285, 0xffff, 0x0286}, {0x03, 0x00, 0x1c, 0x00} },
+ { {0x00bb, 0x00bb, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x1c, 0x00} },
+ { {0x00bc, 0xffff, 0xffff, 0x0287, 0x0000, 0x0000}, {0x03, 0x00, 0x1c, 0x00} },
+ { {0x0080, 0x0080, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x1a, 0x00} },
+ { {0x0081, 0x0081, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x1a, 0x00} },
+ { {0x0082, 0xffff, 0x0288, 0xffff, 0x0289, 0x0000}, {0x03, 0x00, 0x1a, 0x00} },
+ { {0x0083, 0x0083, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x1a, 0x00} },
+ { {0x00ab, 0x00ab, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x1a, 0x00} },
+ { {0x00ac, 0xffff, 0xffff, 0x028a, 0x0000, 0x0000}, {0x03, 0x00, 0x1a, 0x00} },
+ { {0x00ad, 0x00ad, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x1a, 0x00} },
+ { {0x0106, 0x0106, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x1a, 0x00} },
+ { {0x0108, 0xffff, 0xffff, 0x028b, 0x0000, 0x0000}, {0x03, 0x00, 0x1a, 0x00} },
+ { {0x01e4, 0xffff, 0xffff, 0x0215, 0x0000, 0x0000}, {0x03, 0x00, 0x1a, 0x00} },
+ { {0x0217, 0x0217, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x1a, 0x00} },
+ { {0x0218, 0xffff, 0xffff, 0x028c, 0x0000, 0x0000}, {0x03, 0x00, 0x1a, 0x00} },
+ { {0x00e1, 0x00e1, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x1e, 0x00} },
+ { {0x00e2, 0x00e2, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x1e, 0x00} },
+ { {0x00e3, 0x00e3, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x1e, 0x00} },
+ { {0x00e4, 0xffff, 0xffff, 0x028d, 0x0000, 0x0000}, {0x03, 0x00, 0x1e, 0x00} },
+ { {0x00e9, 0x00e9, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x1e, 0x00} },
+ { {0x011d, 0xffff, 0xffff, 0x028e, 0x0000, 0x0000}, {0x03, 0x00, 0x1e, 0x00} },
+ { {0x01dd, 0x01dd, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x1e, 0x00} },
+ { {0x01e6, 0xffff, 0xffff, 0x02c2, 0xffff, 0x02c3}, {0x03, 0x00, 0x1e, 0x00} },
+ { {0x00c3, 0x00c3, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x1f, 0x00} },
+ { {0x010c, 0x010c, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x1f, 0x00} },
+ { {0x010d, 0xffff, 0xffff, 0xffff, 0x028f, 0x0000}, {0x03, 0x00, 0x1f, 0x00} },
+ { {0x012c, 0x012c, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x1f, 0x00} },
+ { {0x012d, 0x012d, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x1f, 0x00} },
+ { {0x012e, 0xffff, 0xffff, 0x0290, 0x0291, 0x0000}, {0x03, 0x00, 0x1f, 0x00} },
+ { {0x01d2, 0x01d2, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x1f, 0x00} },
+ { {0x01d3, 0xffff, 0xffff, 0x0292, 0x0293, 0x0294}, {0x03, 0x00, 0x1f, 0x00} },
+ { {0x01d4, 0x01d4, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x1f, 0x00} },
+ { {0x01d5, 0x01d5, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x1f, 0x00} },
+ { {0x00c4, 0x00c4, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x20, 0x00} },
+ { {0x00cf, 0xffff, 0xffff, 0xffff, 0x0295, 0x0000}, {0x03, 0x00, 0x20, 0x00} },
+ { {0x00d0, 0x00d0, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x20, 0x00} },
+ { {0x00d1, 0x00d1, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x20, 0x00} },
+ { {0x012f, 0x012f, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x20, 0x00} },
+ { {0x0130, 0xffff, 0xffff, 0x0296, 0x0297, 0x0000}, {0x03, 0x00, 0x20, 0x00} },
+ { {0x0139, 0x0139, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x20, 0x00} },
+ { {0x013a, 0x013a, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x20, 0x00} },
+ { {0x013b, 0x013b, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x20, 0x00} },
+ { {0x013c, 0xffff, 0xffff, 0x0298, 0x0299, 0x0000}, {0x03, 0x00, 0x20, 0x00} },
+ { {0x01e7, 0x01e7, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x20, 0x00} },
+ { {0x00c5, 0x00c5, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x21, 0x00} },
+ { {0x00c6, 0x00c6, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x21, 0x00} },
+ { {0x0111, 0xffff, 0xffff, 0xffff, 0x029a, 0x0000}, {0x03, 0x00, 0x21, 0x00} },
+ { {0x0112, 0x0112, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x21, 0x00} },
+ { {0x0131, 0x0131, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x21, 0x00} },
+ { {0x0132, 0xffff, 0xffff, 0x029b, 0x029c, 0x0000}, {0x03, 0x00, 0x21, 0x00} },
+ { {0x01de, 0x01de, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x21, 0x00} },
+ { {0x01df, 0x01df, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x21, 0x00} },
+ { {0x01e0, 0xffff, 0xffff, 0x029d, 0x029e, 0x029f}, {0x03, 0x00, 0x21, 0x00} },
+ { {0x01e1, 0x01e1, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x21, 0x00} },
+ { {0x01e8, 0xffff, 0xffff, 0x02a0, 0x02a1, 0x02a2}, {0x03, 0x00, 0x21, 0x00} },
+ { {0x00c7, 0x00c7, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x22, 0x00} },
+ { {0x00c9, 0x00c9, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x22, 0x00} },
+ { {0x00ca, 0xffff, 0xffff, 0xffff, 0x02a3, 0x0000}, {0x03, 0x00, 0x22, 0x00} },
+ { {0x00f9, 0x00f9, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x22, 0x00} },
+ { {0x00fa, 0x00fa, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x22, 0x00} },
+ { {0x00fb, 0xffff, 0xffff, 0xffff, 0x02a4, 0x0000}, {0x03, 0x00, 0x22, 0x00} },
+ { {0x01e9, 0x01e9, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x22, 0x00} },
+ { {0x00cb, 0x00cb, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x23, 0x00} },
+ { {0x00cc, 0x00cc, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x23, 0x00} },
+ { {0x00cd, 0xffff, 0xffff, 0xffff, 0x02a5, 0x0000}, {0x03, 0x00, 0x23, 0x00} },
+ { {0x00ce, 0x00ce, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x23, 0x00} },
+ { {0x00fc, 0x00fc, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x23, 0x00} },
+ { {0x00fd, 0xffff, 0xffff, 0xffff, 0x02a6, 0x0000}, {0x03, 0x00, 0x23, 0x00} },
+ { {0x00fe, 0x00fe, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x23, 0x00} },
+ { {0x00ff, 0x00ff, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x23, 0x00} },
+ { {0x0100, 0xffff, 0xffff, 0xffff, 0x02a7, 0x0000}, {0x03, 0x00, 0x23, 0x00} },
+ { {0x01d6, 0x01d6, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x23, 0x00} },
+ { {0x0133, 0x0133, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x24, 0x00} },
+ { {0x0134, 0x0134, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x24, 0x00} },
+ { {0x0135, 0xffff, 0xffff, 0x02a8, 0x02a9, 0x0000}, {0x03, 0x00, 0x24, 0x00} },
+ { {0x00eb, 0x00eb, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x25, 0x00} },
+ { {0x00ec, 0x00ec, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x25, 0x00} },
+ { {0x00ed, 0xffff, 0xffff, 0xffff, 0x02dc, 0x0000}, {0x03, 0x00, 0x25, 0x00} },
+ { {0x00ee, 0x00ee, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x25, 0x00} },
+ { {0x00ef, 0x00ef, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x25, 0x00} },
+ { {0x00f0, 0xffff, 0xffff, 0xffff, 0x02dd, 0x0000}, {0x03, 0x00, 0x25, 0x00} },
+ { {0x00f1, 0x00f1, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x25, 0x00} },
+ { {0x0114, 0x0114, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x25, 0x00} },
+ { {0x0115, 0xffff, 0xffff, 0xffff, 0x02aa, 0x0000}, {0x03, 0x00, 0x25, 0x00} },
+ { {0x0116, 0x0116, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x25, 0x00} },
+ { {0x01ea, 0x01ea, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x25, 0x00} },
+ { {0x00f2, 0x00f2, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x26, 0x00} },
+ { {0x00f3, 0x00f3, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x26, 0x00} },
+ { {0x00f4, 0xffff, 0xffff, 0xffff, 0xffff, 0x02ab}, {0x03, 0x00, 0x26, 0x00} },
+ { {0x010e, 0x010e, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x26, 0x00} },
+ { {0x010f, 0x010f, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x26, 0x00} },
+ { {0x0110, 0xffff, 0xffff, 0xffff, 0x02de, 0x0000}, {0x03, 0x00, 0x26, 0x00} },
+ { {0x0117, 0x0117, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x26, 0x00} },
+ { {0x0136, 0x0136, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x26, 0x00} },
+ { {0x01d8, 0xffff, 0xffff, 0xffff, 0x02ac, 0x02ad}, {0x03, 0x00, 0x26, 0x00} },
+ { {0x01d9, 0x01d9, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x26, 0x00} },
+ { {0x00e5, 0x00e5, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x27, 0x00} },
+ { {0x00e6, 0x00e6, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x27, 0x00} },
+ { {0x00e7, 0xffff, 0xffff, 0xffff, 0x02ae, 0x0000}, {0x03, 0x00, 0x27, 0x00} },
+ { {0x00e8, 0x00e8, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x27, 0x00} },
+ { {0x00f5, 0x00f5, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x27, 0x00} },
+ { {0x00f6, 0xffff, 0xffff, 0xffff, 0x02af, 0x0000}, {0x03, 0x00, 0x27, 0x00} },
+ { {0x00f7, 0x00f7, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x27, 0x00} },
+ { {0x00f8, 0x00f8, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x27, 0x00} },
+ { {0x01eb, 0xffff, 0xffff, 0xffff, 0x02b0, 0x02b1}, {0x03, 0x00, 0x27, 0x00} },
+ { {0x0223, 0x0223, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x2d, 0x00} },
+ { {0x0224, 0x0224, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x2d, 0x00} },
+ { {0x0225, 0xffff, 0xffff, 0xffff, 0x02b2, 0x0000}, {0x03, 0x00, 0x2d, 0x00} },
+ { {0x0226, 0x0226, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x2d, 0x00} },
+ { {0x0227, 0x0227, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x2d, 0x00} },
+ { {0x0206, 0xffff, 0xffff, 0xffff, 0x02b3, 0x02b4}, {0x03, 0x00, 0x2d, 0x00} },
+ { {0x0228, 0xffff, 0xffff, 0xffff, 0x02b5, 0x02b6}, {0x03, 0x00, 0x2d, 0x00} },
+ { {0x0229, 0xffff, 0xffff, 0xffff, 0x02b7, 0x02b8}, {0x03, 0x00, 0x2d, 0x00} },
+ { {0x022a, 0xffff, 0xffff, 0xffff, 0x02b9, 0x02ba}, {0x03, 0x00, 0x2d, 0x00} },
+ { {0x022b, 0x022b, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x2d, 0x00} },
+ { {0x022c, 0x022c, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x2d, 0x00} },
+ { {0x022d, 0xffff, 0xffff, 0xffff, 0x02bb, 0x02bc}, {0x03, 0x00, 0x2d, 0x00} },
+ { {0x0222, 0x0222, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x2e, 0x00} },
+ { {0x020b, 0x020b, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x30, 0x00} },
+ { {0x022e, 0x022e, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x30, 0x00} },
+ { {0x0207, 0xffff, 0xffff, 0xffff, 0x02bd, 0x0000}, {0x03, 0x00, 0x30, 0x00} },
+ { {0x022f, 0x022f, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x30, 0x00} },
+ { {0x0231, 0x0231, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x30, 0x00} },
+ { {0x0230, 0xffff, 0xffff, 0xffff, 0x02be, 0x0000}, {0x03, 0x00, 0x30, 0x00} },
+ { {0x020e, 0x020e, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x36, 0x00} },
+ { {0x0232, 0x0232, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x36, 0x00} },
+ { {0x0233, 0xffff, 0xffff, 0xffff, 0xffff, 0x02bf}, {0x03, 0x00, 0x36, 0x00} },
+ { {0x020d, 0x020d, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x36, 0x00} },
+ { {0x0234, 0x0234, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x36, 0x00} },
+ { {0x0235, 0xffff, 0xffff, 0xffff, 0xffff, 0x02c0}, {0x03, 0x00, 0x36, 0x00} },
+ { {0x0236, 0x0236, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x36, 0x00} },
+ { {0x0208, 0xffff, 0xffff, 0xffff, 0xffff, 0x02c1}, {0x03, 0x00, 0x37, 0x00} },
+ { {0x023a, 0xffff, 0xffff, 0xffff, 0xffff, 0x02c4}, {0x03, 0x00, 0x39, 0x00} },
+ { {0x023b, 0xffff, 0xffff, 0xffff, 0xffff, 0x02c5}, {0x03, 0x00, 0x39, 0x00} },
+ { {0x023c, 0xffff, 0xffff, 0xffff, 0xffff, 0x02c6}, {0x03, 0x00, 0x39, 0x00} },
+ { {0x023d, 0x023d, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x3a, 0x00} },
+ { {0x023e, 0x023e, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x3a, 0x00} },
+ { {0x023f, 0xffff, 0xffff, 0xffff, 0xffff, 0x02c7}, {0x03, 0x00, 0x3a, 0x00} },
+ { {0x0240, 0x0240, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x3a, 0x00} },
+ { {0x0205, 0xffff, 0xffff, 0xffff, 0xffff, 0x02c8}, {0x03, 0x00, 0x3b, 0x00} },
+ { {0x0241, 0x0241, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x3c, 0x00} },
+ { {0x0123, 0x0123, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x3c, 0x00} },
+ { {0x0242, 0xffff, 0xffff, 0xffff, 0xffff, 0x02c9}, {0x03, 0x00, 0x3c, 0x00} },
+ { {0x0243, 0x0243, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x3c, 0x00} },
+ { {0x0244, 0x0244, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x3c, 0x00} },
+ { {0x0245, 0xffff, 0xffff, 0xffff, 0xffff, 0x02ca}, {0x03, 0x00, 0x3c, 0x00} },
+ { {0x020c, 0x020c, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x3d, 0x00} },
+ { {0x0246, 0x0246, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x3d, 0x00} },
+ { {0x0247, 0xffff, 0xffff, 0xffff, 0xffff, 0x02cb}, {0x03, 0x00, 0x3d, 0x00} },
+ { {0x0248, 0x0248, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x3d, 0x00} },
+ { {0x0249, 0xffff, 0xffff, 0xffff, 0xffff, 0x02cc}, {0x03, 0x00, 0x3d, 0x00} },
+ { {0x024a, 0xffff, 0xffff, 0xffff, 0xffff, 0x02cd}, {0x03, 0x00, 0x3e, 0x00} },
+ { {0x024b, 0xffff, 0xffff, 0xffff, 0xffff, 0x02ce}, {0x03, 0x00, 0x3e, 0x00} },
+ { {0x024c, 0x024c, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x3f, 0x00} },
+ { {0x024d, 0x024d, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x3f, 0x00} },
+ { {0x024e, 0xffff, 0xffff, 0xffff, 0xffff, 0x02cf}, {0x03, 0x00, 0x3f, 0x00} },
+ { {0x0209, 0xffff, 0xffff, 0xffff, 0xffff, 0x02d0}, {0x03, 0x00, 0x3f, 0x00} },
+ { {0x020a, 0xffff, 0xffff, 0xffff, 0xffff, 0x02d1}, {0x03, 0x00, 0x3f, 0x00} },
+ { {0x024f, 0xffff, 0xffff, 0xffff, 0xffff, 0x02d2}, {0x03, 0x00, 0x40, 0x00} },
+ { {0x0251, 0xffff, 0xffff, 0xffff, 0xffff, 0x02d3}, {0x03, 0x00, 0x40, 0x00} },
+ { {0x0254, 0xffff, 0xffff, 0xffff, 0xffff, 0x02d4}, {0x03, 0x00, 0x40, 0x00} },
+ { {0x0256, 0xffff, 0xffff, 0xffff, 0xffff, 0x02d5}, {0x03, 0x00, 0x40, 0x00} },
+ { {0x0257, 0xffff, 0xffff, 0xffff, 0xffff, 0x02d6}, {0x03, 0x00, 0x40, 0x00} },
+ { {0x0258, 0xffff, 0xffff, 0xffff, 0xffff, 0x02d7}, {0x03, 0x00, 0x40, 0x00} },
+ { {0x0259, 0xffff, 0xffff, 0xffff, 0xffff, 0x02d8}, {0x03, 0x00, 0x40, 0x00} },
+ { {0x025a, 0x025a, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x41, 0x00} },
+ { {0x025b, 0x025b, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x41, 0x00} },
+ { {0x025c, 0x025c, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x41, 0x00} },
+ { {0x025d, 0x025d, 0x0000, 0x0000, 0x0000, 0x0000}, {0x03, 0x00, 0x41, 0x00} }
+};
+
+const u8 gUnknown_8453F5C[] = { 0x1c, 0x1c, 0x1c, 0xfe };
+const u8 gUnknown_8453F60[] = { 0x62, 0xfe };
+const u8 gUnknown_8453F62[] = { 0x64, 0xfe };
+const u8 gUnknown_8453F64[] = { 0x2d, 0x65, 0xfe };
+const u8 gUnknown_8453F67[] = { 0x08, 0x08, 0x07, 0x09, 0x0a };
+
+
+// text
+void sub_810C670(u8 taskId)
+{
+ u8 i;
+ u8 respval;
+
+ for (i = 0; i < 16; i++)
+ gTasks[taskId].data[i] = 0;
+
+ gUnknown_203ADB8 = AllocZeroed(sizeof(struct VsSeekerStruct));
+ sub_810C808();
+ respval = sub_810C96C();
+ if (respval == 0)
+ {
+ Free(gUnknown_203ADB8);
+ DisplayItemMessageOnField(taskId, 2, gUnknown_81C137C, sub_80A1E0C);
+ }
+ else if (respval == 1)
+ {
+ Free(gUnknown_203ADB8);
+ DisplayItemMessageOnField(taskId, 2, gUnknown_81C13D6, sub_80A1E0C);
+ }
+ else if (respval == 2)
+ {
+ sub_80A2294(4, 0, gUnknown_203AD30, 0xffff);
+ FieldEffectStart(FLDEFF_UNK_41); // TODO: name this enum
+ gTasks[taskId].func = sub_810C730;
+ gTasks[taskId].data[0] = 15;
+ }
+}
+
+void sub_810C730(u8 taskId)
+{
+ if (--gTasks[taskId].data[0] == 0)
+ {
+ gTasks[taskId].func = sub_810C760;
+ gTasks[taskId].data[1] = 16;
+ }
+}
+
+void sub_810C760(u8 taskId)
+{
+ s16 * data = gTasks[taskId].data;
+
+ if (data[2] != 2 && --data[1] == 0)
+ {
+ PlaySE(SE_BASABASA);
+ data[1] = 11;
+ data[2]++;
+ }
+
+ if (!FieldEffectActiveListContains(FLDEFF_UNK_41))
+ {
+ data[1] = 0;
+ data[2] = 0;
+ sub_810C604();
+ gUnknown_203ADB8->unk_431_3 = sub_810C9A8(gUnknown_845318C);
+ ScriptMovement_StartObjectMovementScript(0xFF, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, gUnknown_8453F5C);
+ gTasks[taskId].func = sub_810C8EC;
+ }
+}
+
+void sub_810C808(void)
+{
+ struct MapObjectTemplate *templates = gSaveBlock1Ptr->mapObjectTemplates;
+ u8 fieldObjectId = 0;
+ u8 vsSeekerObjectIdx = 0;
+ s32 mapObjectIdx;
+
+ for (mapObjectIdx = 0; mapObjectIdx < gMapHeader.events->mapObjectCount; mapObjectIdx++)
+ {
+ if (templates[mapObjectIdx].unkC == 1 || templates[mapObjectIdx].unkC == 3)
+ {
+ gUnknown_203ADB8->unk_000[vsSeekerObjectIdx].unk_0 = templates[mapObjectIdx].script;
+ gUnknown_203ADB8->unk_000[vsSeekerObjectIdx].unk_4 = sub_810D074(templates[mapObjectIdx].script);
+ gUnknown_203ADB8->unk_000[vsSeekerObjectIdx].unk_6 = templates[mapObjectIdx].localId;
+ TryGetFieldObjectIdByLocalIdAndMap(templates[mapObjectIdx].localId, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, &fieldObjectId);
+ gUnknown_203ADB8->unk_000[vsSeekerObjectIdx].unk_7 = fieldObjectId;
+ gUnknown_203ADB8->unk_000[vsSeekerObjectIdx].unk_8 = gUnknown_2036E38[fieldObjectId].coords2.x - 7;
+ gUnknown_203ADB8->unk_000[vsSeekerObjectIdx].unk_a = gUnknown_2036E38[fieldObjectId].coords2.y - 7;
+ gUnknown_203ADB8->unk_000[vsSeekerObjectIdx].unk_c = templates[mapObjectIdx].graphicsId;
+ vsSeekerObjectIdx++;
+ }
+ }
+ gUnknown_203ADB8->unk_000[vsSeekerObjectIdx].unk_6 = 0xFF;
+}
+
+void sub_810C8EC(u8 taskId)
+{
+ if (ScriptMovement_IsObjectMovementFinished(0xFF, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup))
+ {
+ if (gUnknown_203ADB8->unk_431_3 == 0)
+ {
+ DisplayItemMessageOnField(taskId, 2, gUnknown_81C1429, sub_80A1E0C);
+ }
+ else
+ {
+ if (gUnknown_203ADB8->unk_431_3 == 2)
+ sub_810D304();
+ sub_80F6F54(0, 1);
+ sub_80696C0();
+ ScriptContext2_Disable();
+ DestroyTask(taskId);
+ }
+ Free(gUnknown_203ADB8);
+ }
+}
+
+u8 sub_810C96C(void)
+{
+ u8 vsSeekerChargeSteps = gSaveBlock1Ptr->trainerRematchStepCounter;
+ if (vsSeekerChargeSteps == 100)
+ {
+ if (sub_810D1CC() == 0xFF)
+ return 1;
+ else
+ return 2;
+ }
+ else
+ {
+ TV_PrintIntToStringVar(0, 100 - vsSeekerChargeSteps);
+ return 0;
+ }
+}
+
+// Nonmatching due to register roulette
+#ifdef NONMATCHING
+u8 sub_810C9A8(const struct UnkStruct_845318C * a0)
+{
+ u16 r8 = 0;
+ u8 sp0 = 0;
+ int vsSeekerIdx;
+
+ for (vsSeekerIdx = 0; gUnknown_203ADB8->unk_000[vsSeekerIdx].unk_6 != 0xFF; vsSeekerIdx++)
+ {
+ if (sub_810D0FC(&gUnknown_203ADB8->unk_000[vsSeekerIdx]) == 1)
+ {
+ r8 = gUnknown_203ADB8->unk_000[vsSeekerIdx].unk_4;
+ if (!HasTrainerAlreadyBeenFought(r8))
+ {
+ sub_810D24C(&gUnknown_203ADB8->unk_000[vsSeekerIdx], gUnknown_8453F60);
+ gUnknown_203ADB8->unk_431_0 = 1;
+ }
+ else
+ {
+ u8 r7 = sub_810D164(a0, r8, &sp0);
+ if (r7 == 0)
+ {
+ sub_810D24C(&gUnknown_203ADB8->unk_000[vsSeekerIdx], gUnknown_8453F62);
+ gUnknown_203ADB8->unk_431_1 = 1;
+ }
+ else
+ {
+ u16 rval = Random() % 100;
+ u8 r0 = sub_810D280(vsSeekerIdx, r8);
+ if (r0 == 2)
+ rval = 100;
+ else if (r0 == 1)
+ rval = 0;
+ if (rval < 30)
+ {
+ sub_810D24C(&gUnknown_203ADB8->unk_000[vsSeekerIdx], gUnknown_8453F62);
+ gUnknown_203ADB8->unk_431_1 = 1;
+ }
+ else
+ {
+ gSaveBlock1Ptr->trainerRematches[gUnknown_203ADB8->unk_000[vsSeekerIdx].unk_6] = r7;
+ npc_coords_shift_still(&gUnknown_2036E38[gUnknown_203ADB8->unk_000[vsSeekerIdx].unk_7]);
+ sub_810D24C(&gUnknown_203ADB8->unk_000[vsSeekerIdx], gUnknown_8453F64);
+ gUnknown_203ADB8->unk_400[gUnknown_203ADB8->unk_430] = r8;
+ gUnknown_203ADB8->unk_420[gUnknown_203ADB8->unk_430] = sub_810CF90(gUnknown_203ADB8->unk_000[vsSeekerIdx].unk_c);
+ gUnknown_203ADB8->unk_430++;
+ gUnknown_203ADB8->unk_431_2 = 1;
+ }
+ }
+ }
+ }
+ }
+
+ if (gUnknown_203ADB8->unk_431_2)
+ {
+ PlaySE(SE_PIN);
+ FlagSet(0x801); // TODO: make this an enum
+ sub_810C640();
+ return 2;
+ }
+ if (gUnknown_203ADB8->unk_431_0)
+ return 1;
+ return 0;
+}
+#else
+NAKED
+u8 sub_810C9A8(const struct UnkStruct_845318C * a0)
+{
+ asm_unified("\tpush {r4-r7,lr}\n"
+ "\tmov r7, r10\n"
+ "\tmov r6, r9\n"
+ "\tmov r5, r8\n"
+ "\tpush {r5-r7}\n"
+ "\tsub sp, 0x8\n"
+ "\tstr r0, [sp, 0x4]\n"
+ "\tmovs r0, 0\n"
+ "\tmov r8, r0\n"
+ "\tmov r0, sp\n"
+ "\tmov r1, r8\n"
+ "\tstrb r1, [r0]\n"
+ "\tmovs r2, 0\n"
+ "\tmov r9, r2\n"
+ "\tldr r4, _0810CA14 @ =gUnknown_203ADB8\n"
+ "\tldr r0, [r4]\n"
+ "\tldrb r0, [r0, 0x6]\n"
+ "\tcmp r0, 0xFF\n"
+ "\tbne _0810C9D0\n"
+ "\tb _0810CB2C\n"
+ "_0810C9D0:\n"
+ "\tadds r6, r4, 0\n"
+ "\tmovs r3, 0x86\n"
+ "\tlsls r3, 3\n"
+ "\tmov r10, r3\n"
+ "\tmovs r5, 0\n"
+ "_0810C9DA:\n"
+ "\tldr r0, [r6]\n"
+ "\tadds r0, r5\n"
+ "\tbl sub_810D0FC\n"
+ "\tlsls r0, 24\n"
+ "\tlsrs r0, 24\n"
+ "\tcmp r0, 0x1\n"
+ "\tbeq _0810C9EC\n"
+ "\tb _0810CB18\n"
+ "_0810C9EC:\n"
+ "\tldr r0, [r4]\n"
+ "\tadds r0, r5\n"
+ "\tldrh r0, [r0, 0x4]\n"
+ "\tmov r8, r0\n"
+ "\tbl HasTrainerAlreadyBeenFought\n"
+ "\tlsls r0, 24\n"
+ "\tcmp r0, 0\n"
+ "\tbne _0810CA20\n"
+ "\tldr r0, [r6]\n"
+ "\tadds r0, r5\n"
+ "\tldr r1, _0810CA18 @ =gUnknown_8453F60\n"
+ "\tbl sub_810D24C\n"
+ "\tldr r2, [r6]\n"
+ "\tldr r0, _0810CA1C @ =0x00000431\n"
+ "\tadds r2, r0\n"
+ "\tldrb r0, [r2]\n"
+ "\tmovs r1, 0x1\n"
+ "\tb _0810CB14\n"
+ "\t.align 2, 0\n"
+ "_0810CA14: .4byte gUnknown_203ADB8\n"
+ "_0810CA18: .4byte gUnknown_8453F60\n"
+ "_0810CA1C: .4byte 0x00000431\n"
+ "_0810CA20:\n"
+ "\tldr r0, [sp, 0x4]\n"
+ "\tmov r1, r8\n"
+ "\tmov r2, sp\n"
+ "\tbl sub_810D164\n"
+ "\tlsls r0, 24\n"
+ "\tlsrs r7, r0, 24\n"
+ "\tcmp r7, 0\n"
+ "\tbne _0810CA50\n"
+ "\tldr r0, [r6]\n"
+ "\tadds r0, r5\n"
+ "\tldr r1, _0810CA48 @ =gUnknown_8453F62\n"
+ "\tbl sub_810D24C\n"
+ "\tldr r2, [r6]\n"
+ "\tldr r3, _0810CA4C @ =0x00000431\n"
+ "\tadds r2, r3\n"
+ "\tldrb r0, [r2]\n"
+ "\tmovs r1, 0x2\n"
+ "\tb _0810CB14\n"
+ "\t.align 2, 0\n"
+ "_0810CA48: .4byte gUnknown_8453F62\n"
+ "_0810CA4C: .4byte 0x00000431\n"
+ "_0810CA50:\n"
+ "\tbl Random\n"
+ "\tlsls r0, 16\n"
+ "\tlsrs r0, 16\n"
+ "\tmovs r1, 0x64\n"
+ "\tbl __umodsi3\n"
+ "\tlsls r0, 16\n"
+ "\tlsrs r4, r0, 16\n"
+ "\tmov r0, r9\n"
+ "\tmov r1, r8\n"
+ "\tbl sub_810D280\n"
+ "\tlsls r0, 24\n"
+ "\tlsrs r0, 24\n"
+ "\tcmp r0, 0x2\n"
+ "\tbne _0810CA76\n"
+ "\tmovs r4, 0x64\n"
+ "\tb _0810CA7C\n"
+ "_0810CA76:\n"
+ "\tcmp r0, 0x1\n"
+ "\tbne _0810CA7C\n"
+ "\tmovs r4, 0\n"
+ "_0810CA7C:\n"
+ "\tcmp r4, 0x1D\n"
+ "\tbhi _0810CAA0\n"
+ "\tldr r0, [r6]\n"
+ "\tadds r0, r5\n"
+ "\tldr r1, _0810CA98 @ =gUnknown_8453F62\n"
+ "\tbl sub_810D24C\n"
+ "\tldr r2, [r6]\n"
+ "\tldr r0, _0810CA9C @ =0x00000431\n"
+ "\tadds r2, r0\n"
+ "\tldrb r0, [r2]\n"
+ "\tmovs r1, 0x2\n"
+ "\tb _0810CB14\n"
+ "\t.align 2, 0\n"
+ "_0810CA98: .4byte gUnknown_8453F62\n"
+ "_0810CA9C: .4byte 0x00000431\n"
+ "_0810CAA0:\n"
+ "\tldr r0, _0810CB54 @ =gSaveBlock1Ptr\n"
+ "\tldr r1, [r0]\n"
+ "\tldr r0, [r6]\n"
+ "\tadds r0, r5\n"
+ "\tldr r2, _0810CB58 @ =0x0000063a\n"
+ "\tadds r1, r2\n"
+ "\tldrb r0, [r0, 0x6]\n"
+ "\tadds r1, r0\n"
+ "\tstrb r7, [r1]\n"
+ "\tldr r0, [r6]\n"
+ "\tadds r0, r5\n"
+ "\tldrb r1, [r0, 0x7]\n"
+ "\tlsls r0, r1, 3\n"
+ "\tadds r0, r1\n"
+ "\tlsls r0, 2\n"
+ "\tldr r1, _0810CB5C @ =gUnknown_2036E38\n"
+ "\tadds r0, r1\n"
+ "\tbl npc_coords_shift_still\n"
+ "\tldr r0, [r6]\n"
+ "\tadds r0, r5\n"
+ "\tldr r1, _0810CB60 @ =gUnknown_8453F64\n"
+ "\tbl sub_810D24C\n"
+ "\tldr r2, [r6]\n"
+ "\tmov r3, r10\n"
+ "\tadds r0, r2, r3\n"
+ "\tldrb r1, [r0]\n"
+ "\tlsls r1, 1\n"
+ "\tmovs r3, 0x80\n"
+ "\tlsls r3, 3\n"
+ "\tadds r0, r2, r3\n"
+ "\tadds r0, r1\n"
+ "\tmov r1, r8\n"
+ "\tstrh r1, [r0]\n"
+ "\tadds r2, r5\n"
+ "\tldrb r0, [r2, 0xC]\n"
+ "\tbl sub_810CF90\n"
+ "\tldr r1, [r6]\n"
+ "\tmov r3, r10\n"
+ "\tadds r2, r1, r3\n"
+ "\tmovs r3, 0x84\n"
+ "\tlsls r3, 3\n"
+ "\tadds r1, r3\n"
+ "\tldrb r2, [r2]\n"
+ "\tadds r1, r2\n"
+ "\tstrb r0, [r1]\n"
+ "\tldr r1, [r6]\n"
+ "\tadd r1, r10\n"
+ "\tldrb r0, [r1]\n"
+ "\tadds r0, 0x1\n"
+ "\tstrb r0, [r1]\n"
+ "\tldr r2, [r6]\n"
+ "\tldr r0, _0810CB64 @ =0x00000431\n"
+ "\tadds r2, r0\n"
+ "\tldrb r0, [r2]\n"
+ "\tmovs r1, 0x4\n"
+ "_0810CB14:\n"
+ "\torrs r0, r1\n"
+ "\tstrb r0, [r2]\n"
+ "_0810CB18:\n"
+ "\tadds r5, 0x10\n"
+ "\tmovs r1, 0x1\n"
+ "\tadd r9, r1\n"
+ "\tldr r4, _0810CB68 @ =gUnknown_203ADB8\n"
+ "\tldr r0, [r4]\n"
+ "\tadds r0, r5\n"
+ "\tldrb r0, [r0, 0x6]\n"
+ "\tcmp r0, 0xFF\n"
+ "\tbeq _0810CB2C\n"
+ "\tb _0810C9DA\n"
+ "_0810CB2C:\n"
+ "\tldr r2, _0810CB68 @ =gUnknown_203ADB8\n"
+ "\tldr r0, [r2]\n"
+ "\tldr r3, _0810CB64 @ =0x00000431\n"
+ "\tadds r0, r3\n"
+ "\tldrb r1, [r0]\n"
+ "\tmovs r0, 0x4\n"
+ "\tands r0, r1\n"
+ "\tcmp r0, 0\n"
+ "\tbeq _0810CB70\n"
+ "\tmovs r0, 0x15\n"
+ "\tbl PlaySE\n"
+ "\tldr r0, _0810CB6C @ =0x00000801\n"
+ "\tbl FlagSet\n"
+ "\tbl sub_810C640\n"
+ "\tmovs r0, 0x2\n"
+ "\tb _0810CB7E\n"
+ "\t.align 2, 0\n"
+ "_0810CB54: .4byte gSaveBlock1Ptr\n"
+ "_0810CB58: .4byte 0x0000063a\n"
+ "_0810CB5C: .4byte gUnknown_2036E38\n"
+ "_0810CB60: .4byte gUnknown_8453F64\n"
+ "_0810CB64: .4byte 0x00000431\n"
+ "_0810CB68: .4byte gUnknown_203ADB8\n"
+ "_0810CB6C: .4byte 0x00000801\n"
+ "_0810CB70:\n"
+ "\tmovs r0, 0x1\n"
+ "\tands r0, r1\n"
+ "\tcmp r0, 0\n"
+ "\tbne _0810CB7C\n"
+ "\tmovs r0, 0\n"
+ "\tb _0810CB7E\n"
+ "_0810CB7C:\n"
+ "\tmovs r0, 0x1\n"
+ "_0810CB7E:\n"
+ "\tadd sp, 0x8\n"
+ "\tpop {r3-r5}\n"
+ "\tmov r8, r3\n"
+ "\tmov r9, r4\n"
+ "\tmov r10, r5\n"
+ "\tpop {r4-r7}\n"
+ "\tpop {r1}\n"
+ "\tbx r1");
+}
+#endif
+
+void sub_810CB90(void)
+{
+ u8 sp0 = 0;
+ struct MapObjectTemplate *r4 = gSaveBlock1Ptr->mapObjectTemplates;
+ int r9 = sub_810CE10(gUnknown_845318C, gTrainerBattleOpponent_A);
+
+ if (r9 != -1)
+ {
+ int r8;
+
+ for (r8 = 0; r8 < gMapHeader.events->mapObjectCount; r8++)
+ {
+ if ((r4[r8].unkC == 1 || r4[r8].unkC == 3) && r9 == sub_810CE10(gUnknown_845318C, sub_810D074(r4[r8].script)))
+ {
+ struct MapObject *r4_2;
+
+ TryGetFieldObjectIdByLocalIdAndMap(r4[r8].localId, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, &sp0);
+ r4_2 = &gUnknown_2036E38[sp0];
+ sub_810CF54(&r4[r8]);
+ sub_805FE7C(r4_2, gUnknown_8453F67[r4_2->mapobj_unk_18]);
+ gSaveBlock1Ptr->trainerRematches[r4[r8].localId] = 0;
+ if (gUnknown_3005074 == sp0)
+ r4_2->animPattern = gUnknown_8453F67[r4_2->mapobj_unk_18];
+ else
+ r4_2->animPattern = 0x08;
+ }
+ }
+ }
+}
+
+void sub_810CCA0(const u16 * a0, u8 * a1)
+{
+ switch (*a1)
+ {
+ case 0:
+ break;
+ case 1:
+ if (!FlagGet(0x292))
+ *a1 = sub_810CD14(a0, *a1);
+ break;
+ case 2:
+ if (!FlagGet(0x896))
+ *a1 = sub_810CD14(a0, *a1);
+ break;
+ case 3:
+ if (!FlagGet(0x897))
+ *a1 = sub_810CD14(a0, *a1);
+ break;
+ case 4:
+ if (!FlagGet(0x82c))
+ *a1 = sub_810CD14(a0, *a1);
+ break;
+ case 5:
+ if (!FlagGet(0x844))
+ *a1 = sub_810CD14(a0, *a1);
+ break;
+ }
+}
+
+u8 sub_810CD14(const u16 * a0, u8 a1)
+{
+ while (--a1 != 0)
+ {
+ const u16 *r0 = a0 + a1;
+ if (*r0 != 0xFFFF)
+ return a1;
+ }
+ return 0;
+}
+
+u8 sub_810CD4C(void)
+{
+ if (sub_810CD80(gUnknown_845318C, gTrainerBattleOpponent_A))
+ {
+ return 1;
+ }
+ return sub_810CDB4(gUnknown_845318C, gTrainerBattleOpponent_A);
+}
+
+bool8 sub_810CD80(const struct UnkStruct_845318C *a0, u16 a1)
+{
+ int r1 = sub_810D084(a0, a1);
+
+ if (r1 == -1)
+ return FALSE;
+ if (r1 >= 0 && r1 < 0xdd)
+ {
+ if (sub_810D0A8(gUnknown_20370D2))
+ return TRUE;
+ }
+ return FALSE;
+}
+
+bool8 sub_810CDB4(const struct UnkStruct_845318C *a0, u16 a1)
+{
+ int r1 = sub_810D084(a0, a1);
+
+ if (r1 == -1)
+ return FALSE;
+ if (!HasTrainerAlreadyBeenFought(a0[r1].unk_0[0]))
+ return FALSE;
+ return TRUE;
+}
+
+void sub_810CDE8(void)
+{
+ gSaveBlock1Ptr->trainerRematches[gUnknown_20370D2] = 0;
+ sub_80803FC();
+}