From bcff8d1b45d6cfdc0c2e5e94137aa0e578009f7c Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Wed, 1 Feb 2017 22:15:38 -0600 Subject: [PATCH] start decompiling battle_ai --- .gitignore | 4 + asm/battle_814AEAC.s | 14 +- asm/battle_ai.s | 1430 ++++----------------------------- asm/battle_anim_80FE840.s | 12 +- asm/battle_anim_8170478.s | 2 +- asm/battle_message.s | 60 +- asm/battle_setup.s | 34 +- asm/cable_club.s | 20 +- asm/calculate_base_damage.s | 12 +- asm/contest.s | 2 +- asm/contest_ai.s | 324 ++++---- asm/item_use.s | 2 +- asm/link.s | 8 +- asm/main.s | 2 +- asm/pokemon_1.s | 12 +- asm/pokemon_2.s | 16 +- asm/pokemon_3.s | 52 +- asm/rom3.s | 40 +- asm/rom5.s | 10 +- asm/rom6.s | 4 +- asm/rom_8034C54.s | 1486 +++++++++++++++++------------------ asm/rom_8072304.s | 22 +- asm/rom_80A5C6C.s | 8 +- asm/rom_80C6FA0.s | 6 +- asm/rom_8158B30.s | 60 +- asm/rom_817C95C.s | 26 +- asm/rom_8184DA4.s | 126 +-- asm/rom_81BAD84.s | 26 +- asm/secret_base.s | 2 +- asm/sound.s | 2 +- asm/text.s | 2 +- asm/tv.s | 2 +- data/data2.s | 2 +- ld_script.txt | 1 + src/battle_ai.c | 789 +++++++++++++++++++ sym_ewram.txt | 6 +- 36 files changed, 2148 insertions(+), 2478 deletions(-) create mode 100644 src/battle_ai.c diff --git a/.gitignore b/.gitignore index 827e6a00f..3d4a6443a 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,7 @@ tools/* *.map *.ld *.bat +*.dump +*.sav +Thumbs.db +.DS_Store diff --git a/asm/battle_814AEAC.s b/asm/battle_814AEAC.s index f0b4c9467..325fee209 100644 --- a/asm/battle_814AEAC.s +++ b/asm/battle_814AEAC.s @@ -27,7 +27,7 @@ sub_814AEB0: @ 814AEB0 bx_exec_buffer_A_ch0_tbl4: @ 814AECC push {lr} ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r0, =gUnknown_02024064 ldrb r3, [r0] lsls r0, r3, 2 @@ -176,7 +176,7 @@ sub_814B004: @ 814B004 lsls r0, 24 cmp r0, 0 beq _0814B05C - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -352,7 +352,7 @@ _0814B136: lsls r0, 24 cmp r0, 0 beq _0814B1F0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -979,7 +979,7 @@ dp01_tbl4_exec_completed: @ 814B740 adds r0, r1 ldr r1, =bx_exec_buffer_A_ch0_tbl4 str r1, [r0] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -1002,7 +1002,7 @@ dp01_tbl4_exec_completed: @ 814B740 .pool _0814B794: ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r0, [r4] lsls r0, 2 adds r0, r1 @@ -3598,7 +3598,7 @@ sub_814CF30: @ 814CF30 push {r4-r7,lr} mov r7, r8 push {r7} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -5221,7 +5221,7 @@ _0814DCF8: lsls r0, 24 cmp r0, 0 beq _0814DD18 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 diff --git a/asm/battle_ai.s b/asm/battle_ai.s index 9a4acde3d..8543f865b 100644 --- a/asm/battle_ai.s +++ b/asm/battle_ai.s @@ -5,1130 +5,6 @@ .text - thumb_func_start sub_81308C8 -sub_81308C8: @ 81308C8 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =gUnknown_020244A8 - ldr r0, [r1] - ldr r3, [r0, 0x18] - movs r4, 0 - mov r12, r1 - ldr r2, =gUnknown_02022FEC - movs r1, 0 -_081308DC: - adds r0, r3, r4 - strb r1, [r0] - adds r4, 0x1 - cmp r4, 0x53 - bls _081308DC - ldr r0, [r2] - ldr r1, =0x0a7f098a - ands r0, r1 - cmp r0, 0x8 - bne _0813092E - movs r4, 0 - ldr r6, =gUnknown_02038BCA - ldr r5, =gTrainers + 0x10 @ items offset -_081308F6: - lsls r2, r4, 1 - ldrh r1, [r6] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r2, r0 - adds r2, r5 - ldrh r3, [r2] - cmp r3, 0 - beq _08130928 - mov r0, r12 - ldr r2, [r0] - ldr r1, [r2, 0x18] - adds r0, r1, 0 - adds r0, 0x50 - ldrb r0, [r0] - lsls r0, 1 - adds r1, 0x48 - adds r1, r0 - strh r3, [r1] - ldr r1, [r2, 0x18] - adds r1, 0x50 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_08130928: - adds r4, 0x1 - cmp r4, 0x3 - ble _081308F6 -_0813092E: - adds r0, r7, 0 - bl sub_8130950 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81308C8 - - thumb_func_start sub_8130950 -sub_8130950: @ 8130950 - push {r4-r7,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r1, [r0, 0x14] - movs r4, 0 - ldr r6, =gUnknown_02024064 - movs r3, 0 -_08130962: - adds r0, r1, r4 - strb r3, [r0] - adds r4, 0x1 - cmp r4, 0x1B - bls _08130962 - movs r4, 0 - ldr r3, =gUnknown_020244A8 - movs r5, 0x1 -_08130972: - adds r1, r2, 0 - ands r1, r5 - cmp r1, 0 - beq _08130990 - ldr r0, [r3] - ldr r0, [r0, 0x14] - adds r0, 0x4 - adds r0, r4 - movs r1, 0x64 - b _08130998 - .pool -_08130990: - ldr r0, [r3] - ldr r0, [r0, 0x14] - adds r0, 0x4 - adds r0, r4 -_08130998: - strb r1, [r0] - lsrs r2, 1 - adds r4, 0x1 - cmp r4, 0x3 - ble _08130972 - ldrb r0, [r6] - movs r1, 0 - movs r2, 0xFF - bl sub_803FECC - lsls r0, 24 - lsrs r6, r0, 24 - movs r4, 0 - ldr r5, =gUnknown_020244A8 -_081309B4: - ldr r7, =gUnknown_0832A328 - lsls r0, r4, 2 - adds r0, r7 - ldr r0, [r0] - ands r0, r6 - cmp r0, 0 - beq _081309CE - ldr r0, [r5] - ldr r0, [r0, 0x14] - adds r0, 0x4 - adds r0, r4 - movs r1, 0 - strb r1, [r0] -_081309CE: - bl Random - ldr r1, [r5] - ldr r2, [r1, 0x14] - adds r2, 0x18 - adds r2, r4 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xF - ands r0, r1 - movs r1, 0x64 - subs r1, r0 - strb r1, [r2] - adds r4, 0x1 - cmp r4, 0x3 - ble _081309B4 - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r0, [r0, 0x1C] - adds r0, 0x20 - movs r1, 0 - strb r1, [r0] - ldr r0, =gUnknown_0203AB3C - ldr r6, =gUnknown_02024064 - ldrb r2, [r6] - strb r2, [r0] - ldr r0, =gUnknown_02022FEC - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08130A60 - ldr r5, =gUnknown_0202420C - bl Random - adds r4, r0, 0 - ldrb r0, [r6] - bl battle_side_get_owner - movs r3, 0x2 - adds r1, r3, 0 - ands r1, r4 - movs r2, 0x1 - eors r0, r2 - adds r1, r0 - strb r1, [r5] - ldr r0, =gUnknown_02024210 - ldrb r1, [r0] - ldrb r2, [r5] - lsls r0, r2, 2 - adds r0, r7 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _08130A68 - eors r2, r3 - strb r2, [r5] - b _08130A68 - .pool -_08130A60: - ldr r0, =gUnknown_0202420C - movs r1, 0x1 - eors r1, r2 - strb r1, [r0] -_08130A68: - ldr r0, =gUnknown_02022FEC - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 17 - ands r0, r1 - cmp r0, 0 - beq _08130A84 - bl sub_8186438 - b _08130AE6 - .pool -_08130A84: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08130AA0 - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r1, [r0, 0x14] - movs r0, 0x80 - lsls r0, 23 - str r0, [r1, 0xC] - b _08130B72 - .pool -_08130AA0: - movs r0, 0x80 - lsls r0, 3 - ands r0, r1 - cmp r0, 0 - beq _08130ABC - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r1, [r0, 0x14] - movs r0, 0x80 - lsls r0, 22 - str r0, [r1, 0xC] - b _08130B72 - .pool -_08130ABC: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08130AD8 - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r1, [r0, 0x14] - movs r0, 0x80 - lsls r0, 24 - str r0, [r1, 0xC] - b _08130B72 - .pool -_08130AD8: - movs r0, 0x80 - lsls r0, 12 - ands r0, r1 - cmp r0, 0 - beq _08130AF4 - bl sub_81A6FB4 -_08130AE6: - ldr r1, =gUnknown_020244A8 - ldr r1, [r1] - ldr r1, [r1, 0x14] - str r0, [r1, 0xC] - b _08130B72 - .pool -_08130AF4: - ldr r0, =0x0c3f0900 - ands r0, r1 - cmp r0, 0 - beq _08130B10 - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r1, [r0, 0x14] - movs r0, 0x7 - str r0, [r1, 0xC] - b _08130B72 - .pool -_08130B10: - movs r0, 0x80 - lsls r0, 8 - ands r1, r0 - cmp r1, 0 - beq _08130B58 - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r4, [r0, 0x14] - ldr r3, =gTrainers - ldr r0, =gUnknown_02038BCA - ldrh r0, [r0] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r3, 0x1C - adds r1, r3 - ldr r0, =gUnknown_02038BCC - ldrh r2, [r0] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r3 - ldr r1, [r1] - ldr r0, [r0] - orrs r1, r0 - str r1, [r4, 0xC] - b _08130B72 - .pool -_08130B58: - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r3, [r0, 0x14] - ldr r2, =gTrainers - ldr r0, =gUnknown_02038BCA - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r2, 0x1C - adds r0, r2 - ldr r0, [r0] - str r0, [r3, 0xC] -_08130B72: - ldr r0, =gUnknown_02022FEC - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08130B8C - ldr r0, =gUnknown_020244A8 - ldr r0, [r0] - ldr r2, [r0, 0x14] - ldr r0, [r2, 0xC] - movs r1, 0x80 - orrs r0, r1 - str r0, [r2, 0xC] -_08130B8C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8130950 - - thumb_func_start sub_8130BA4 -sub_8130BA4: @ 8130BA4 - push {r4,lr} - ldr r0, =gUnknown_020241EA - ldrh r4, [r0] - ldr r0, =gUnknown_02022FEC - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08130BC4 - bl sub_8130BDC - b _08130BC8 - .pool -_08130BC4: - bl sub_8130CF4 -_08130BC8: - lsls r0, 24 - lsrs r1, r0, 24 - ldr r0, =gUnknown_020241EA - strh r4, [r0] - adds r0, r1, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8130BA4 - - thumb_func_start sub_8130BDC -sub_8130BDC: @ 8130BDC - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - bl sub_8131074 - ldr r1, =gUnknown_020244A8 - ldr r0, [r1] - ldr r0, [r0, 0x14] - ldr r0, [r0, 0xC] - cmp r0, 0 - beq _08130C2C - adds r4, r1, 0 - movs r5, 0 -_08130BF8: - ldr r0, [r4] - ldr r2, [r0, 0x14] - ldr r0, [r2, 0xC] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08130C0C - strb r5, [r2] - bl tai_run_script -_08130C0C: - ldr r0, [r4] - ldr r1, [r0, 0x14] - ldr r0, [r1, 0xC] - lsrs r0, 1 - str r0, [r1, 0xC] - ldrb r0, [r1, 0x11] - adds r0, 0x1 - strb r0, [r1, 0x11] - ldr r0, [r4] - ldr r0, [r0, 0x14] - strb r5, [r0, 0x1] - ldr r0, [r4] - ldr r0, [r0, 0x14] - ldr r0, [r0, 0xC] - cmp r0, 0 - bne _08130BF8 -_08130C2C: - ldr r1, =gUnknown_020244A8 - ldr r0, [r1] - ldr r3, [r0, 0x14] - ldrb r2, [r3, 0x10] - movs r0, 0x2 - ands r0, r2 - mov r12, r1 - cmp r0, 0 - beq _08130C48 - movs r0, 0x4 - b _08130CE0 - .pool -_08130C48: - movs r0, 0x4 - ands r0, r2 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - beq _08130C58 - movs r0, 0x5 - b _08130CE0 -_08130C58: - movs r6, 0x1 - mov r1, sp - ldrb r0, [r3, 0x4] - strb r0, [r1] - add r0, sp, 0x4 - strb r2, [r0] - movs r3, 0x1 - mov r8, r0 - ldr r1, =gUnknown_02024084 - ldr r0, =gUnknown_0203AB3C - ldrb r2, [r0] - mov r5, sp - mov r7, r8 - movs r0, 0x58 - muls r0, r2 - adds r1, r0 - adds r4, r1, 0 - adds r4, 0xE -_08130C7C: - ldrh r0, [r4] - cmp r0, 0 - beq _08130CC6 - ldrb r1, [r5] - mov r2, r12 - ldr r0, [r2] - ldr r0, [r0, 0x14] - adds r0, 0x4 - adds r2, r0, r3 - movs r0, 0 - ldrsb r0, [r2, r0] - cmp r1, r0 - bne _08130CAA - mov r0, sp - adds r1, r0, r6 - ldrb r0, [r2] - strb r0, [r1] - adds r1, r6, 0 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - adds r1, r7, r1 - strb r3, [r1] -_08130CAA: - ldrb r1, [r5] - mov r2, r12 - ldr r0, [r2] - ldr r0, [r0, 0x14] - adds r0, 0x4 - adds r2, r0, r3 - movs r0, 0 - ldrsb r0, [r2, r0] - cmp r1, r0 - bge _08130CC6 - movs r6, 0x1 - ldrb r0, [r2] - strb r0, [r5] - strb r3, [r7] -_08130CC6: - adds r4, 0x2 - adds r3, 0x1 - cmp r3, 0x3 - ble _08130C7C - bl Random - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - bl __modsi3 - add r0, r8 - ldrb r0, [r0] -_08130CE0: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8130BDC - - thumb_func_start sub_8130CF4 -sub_8130CF4: @ 8130CF4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - movs r0, 0 - mov r8, r0 - mov r1, sp - adds r1, 0xC - str r1, [sp, 0x1C] - mov r2, sp - adds r2, 0x8 - str r2, [sp, 0x18] - str r1, [sp, 0x20] - mov r10, sp -_08130D14: - ldr r0, =gUnknown_0203AB3C - ldrb r0, [r0] - cmp r8, r0 - beq _08130D2E - movs r0, 0x58 - mov r7, r8 - muls r7, r0 - adds r0, r7, 0 - ldr r1, =gUnknown_02024084 - adds r0, r1 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _08130D48 -_08130D2E: - movs r0, 0xFF - ldr r2, [sp, 0x20] - strb r0, [r2] - ldr r0, =0x0000ffff - mov r7, r10 - strh r0, [r7] - b _08130EAE - .pool -_08130D48: - ldr r0, =gUnknown_02022FEC - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 10 - ands r0, r1 - cmp r0, 0 - beq _08130D70 - ldr r0, =gUnknown_0202449C - ldr r0, [r0] - adds r0, 0x92 - ldrb r0, [r0] - lsrs r0, 4 - bl sub_8130950 - b _08130D76 - .pool -_08130D70: - movs r0, 0xF - bl sub_8130950 -_08130D76: - ldr r0, =gUnknown_0202420C - mov r1, r8 - strb r1, [r0] - movs r1, 0x1 - mov r2, r8 - ands r2, r1 - ldr r0, =gUnknown_0203AB3C - ldrb r0, [r0] - ands r1, r0 - cmp r2, r1 - beq _08130D90 - bl sub_8131074 -_08130D90: - ldr r2, =gUnknown_020244A8 - ldr r0, [r2] - ldr r0, [r0, 0x14] - movs r1, 0 - strb r1, [r0, 0x11] - ldr r0, [r2] - ldr r0, [r0, 0x14] - strb r1, [r0, 0x1] - ldr r0, [r2] - ldr r0, [r0, 0x14] - ldr r4, [r0, 0xC] - mov r9, r2 - cmp r4, 0 - beq _08130DD8 - mov r5, r9 - movs r6, 0 -_08130DB0: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _08130DC2 - ldr r0, [r5] - ldr r0, [r0, 0x14] - strb r6, [r0] - bl tai_run_script -_08130DC2: - asrs r4, 1 - ldr r0, [r5] - ldr r1, [r0, 0x14] - ldrb r0, [r1, 0x11] - adds r0, 0x1 - strb r0, [r1, 0x11] - ldr r0, [r5] - ldr r0, [r0, 0x14] - strb r6, [r0, 0x1] - cmp r4, 0 - bne _08130DB0 -_08130DD8: - mov r2, r9 - ldr r0, [r2] - ldr r3, [r0, 0x14] - ldrb r1, [r3, 0x10] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08130DFC - movs r0, 0x4 - ldr r7, [sp, 0x20] - strb r0, [r7] - b _08130EAE - .pool -_08130DFC: - movs r0, 0x4 - ands r0, r1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - beq _08130E10 - movs r0, 0x5 - ldr r1, [sp, 0x20] - strb r0, [r1] - b _08130EAE -_08130E10: - add r1, sp, 0x10 - ldrb r0, [r3, 0x4] - strb r0, [r1] - add r0, sp, 0x14 - strb r2, [r0] - movs r5, 0x1 - movs r3, 0x1 - adds r6, r1, 0 - ldr r0, =gUnknown_0203AB3C - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - ldr r2, =gUnknown_02024090 - adds r0, r2 - adds r4, r0, 0x2 - add r7, sp, 0x14 -_08130E30: - ldrh r0, [r4] - cmp r0, 0 - beq _08130E72 - ldrb r1, [r6] - mov r2, r9 - ldr r0, [r2] - ldr r0, [r0, 0x14] - adds r0, 0x4 - adds r2, r0, r3 - movs r0, 0 - ldrsb r0, [r2, r0] - cmp r1, r0 - bne _08130E56 - adds r0, r6, r5 - ldrb r1, [r2] - strb r1, [r0] - adds r0, r7, r5 - strb r3, [r0] - adds r5, 0x1 -_08130E56: - ldrb r1, [r6] - mov r2, r9 - ldr r0, [r2] - ldr r0, [r0, 0x14] - adds r0, 0x4 - adds r2, r0, r3 - movs r0, 0 - ldrsb r0, [r2, r0] - cmp r1, r0 - bge _08130E72 - ldrb r0, [r2] - strb r0, [r6] - strb r3, [r7] - movs r5, 0x1 -_08130E72: - adds r4, 0x2 - adds r3, 0x1 - cmp r3, 0x3 - ble _08130E30 - bl Random - lsls r0, 16 - lsrs r0, 16 - adds r1, r5, 0 - bl __modsi3 - add r0, sp - adds r0, 0x14 - ldrb r0, [r0] - ldr r7, [sp, 0x20] - strb r0, [r7] - ldrb r2, [r6] - mov r0, r10 - strh r2, [r0] - ldr r0, =gUnknown_0203AB3C - ldrb r1, [r0] - movs r0, 0x2 - eors r0, r1 - cmp r8, r0 - bne _08130EAE - cmp r2, 0x63 - bgt _08130EAE - ldr r0, =0x0000ffff - mov r1, r10 - strh r0, [r1] -_08130EAE: - ldr r2, [sp, 0x20] - adds r2, 0x1 - str r2, [sp, 0x20] - movs r7, 0x2 - add r10, r7 - movs r0, 0x1 - add r8, r0 - mov r1, r8 - cmp r1, 0x3 - bgt _08130EC4 - b _08130D14 -_08130EC4: - mov r0, sp - ldrh r5, [r0] - movs r0, 0 - ldr r2, [sp, 0x18] - strb r0, [r2] - movs r4, 0x1 - mov r8, r4 - ldr r6, =gUnknown_0202420C - ldr r3, [sp, 0x18] - mov r1, sp - adds r1, 0x2 -_08130EDA: - lsls r0, r5, 16 - asrs r2, r0, 16 - movs r7, 0 - ldrsh r0, [r1, r7] - cmp r2, r0 - bne _08130EEE - adds r0, r3, r4 - mov r7, r8 - strb r7, [r0] - adds r4, 0x1 -_08130EEE: - movs r7, 0 - ldrsh r0, [r1, r7] - cmp r2, r0 - bge _08130EFE - ldrh r5, [r1] - mov r0, r8 - strb r0, [r3] - movs r4, 0x1 -_08130EFE: - adds r1, 0x2 - movs r2, 0x1 - add r8, r2 - mov r7, r8 - cmp r7, 0x3 - ble _08130EDA - bl Random - lsls r0, 16 - lsrs r0, 16 - adds r1, r4, 0 - bl __modsi3 - ldr r1, [sp, 0x18] - adds r0, r1, r0 - ldrb r0, [r0] - strb r0, [r6] - ldrb r0, [r6] - ldr r2, [sp, 0x1C] - adds r0, r2, r0 - ldrb r0, [r0] - add sp, 0x24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8130CF4 - - thumb_func_start tai_run_script -tai_run_script: @ 8130F48 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r7, =gUnknown_020244A8 - ldr r0, [r7] - ldr r0, [r0, 0x14] - ldrb r0, [r0] - adds r6, r7, 0 - cmp r0, 0x2 - bne _08130F60 - b _08131066 -_08130F60: - mov r9, r7 - ldr r0, =gUnknown_0203AB38 - mov r8, r0 -_08130F66: - mov r1, r9 - ldr r0, [r1] - ldr r2, [r0, 0x14] - ldrb r0, [r2] - cmp r0, 0x1 - beq _08130FD4 - cmp r0, 0x1 - bgt _0813105A - cmp r0, 0 - bne _0813105A - ldr r1, =gUnknown_082DBEF8 - ldrb r0, [r2, 0x11] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - mov r1, r8 - str r0, [r1] - ldr r5, =gUnknown_02024084 - ldrb r4, [r2, 0x1] - ldr r0, =gUnknown_0203AB3C - ldrb r1, [r0] - movs r0, 0x58 - adds r3, r1, 0 - muls r3, r0 - adds r0, r4, r3 - adds r1, r5, 0 - adds r1, 0x24 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _08130FB0 - lsls r0, r4, 1 - adds r0, r3 - adds r1, r5, 0 - adds r1, 0xC - adds r0, r1 - ldrh r0, [r0] -_08130FB0: - strh r0, [r2, 0x2] - ldr r0, [r6] - ldr r1, [r0, 0x14] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0813105A - .pool -_08130FD4: - ldrh r1, [r2, 0x2] - cmp r1, 0 - beq _08130FF4 - ldr r1, =gUnknown_085B083C - mov r2, r8 - ldr r0, [r2] - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - b _0813100A - .pool -_08130FF4: - adds r0, r2, 0x4 - ldrb r2, [r2, 0x1] - adds r0, r2 - strb r1, [r0] - mov r1, r9 - ldr r0, [r1] - ldr r2, [r0, 0x14] - ldrb r1, [r2, 0x10] - movs r0, 0x1 - orrs r0, r1 - strb r0, [r2, 0x10] -_0813100A: - ldr r2, =gUnknown_020244A8 - ldr r0, [r2] - ldr r3, [r0, 0x14] - ldrb r1, [r3, 0x10] - movs r0, 0x1 - ands r0, r1 - adds r6, r2, 0 - cmp r0, 0 - beq _0813105A - ldrb r0, [r3, 0x1] - adds r0, 0x1 - strb r0, [r3, 0x1] - ldr r0, [r6] - ldr r2, [r0, 0x14] - ldrb r0, [r2, 0x1] - cmp r0, 0x3 - bhi _08131044 - ldrb r1, [r2, 0x10] - movs r0, 0x8 - ands r0, r1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08131044 - strb r0, [r2] - b _0813104E - .pool -_08131044: - ldr r0, [r6] - ldr r1, [r0, 0x14] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_0813104E: - ldr r0, [r6] - ldr r2, [r0, 0x14] - ldrb r1, [r2, 0x10] - movs r0, 0xFE - ands r0, r1 - strb r0, [r2, 0x10] -_0813105A: - ldr r0, [r7] - ldr r0, [r0, 0x14] - ldrb r0, [r0] - cmp r0, 0x2 - beq _08131066 - b _08130F66 -_08131066: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end tai_run_script - - thumb_func_start sub_8131074 -sub_8131074: @ 8131074 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r7, 0 - ldr r4, =gUnknown_020244A8 - ldr r0, [r4] - ldr r2, [r0, 0x18] - ldr r3, =gUnknown_0202420C - ldrb r1, [r3] - lsls r0, r1, 4 - adds r2, r0 - ldr r5, =gUnknown_02024248 - lsls r1, 1 - adds r1, r5 - ldrh r0, [r2] - mov r8, r4 - mov r12, r3 - ldrh r1, [r1] - cmp r0, r1 - beq _081310E4 - adds r6, r5, 0 - movs r5, 0 -_081310A0: - mov r1, r8 - ldr r0, [r1] - ldr r4, [r0, 0x18] - mov r0, r12 - ldrb r1, [r0] - lsls r3, r1, 4 - adds r0, r5, r3 - adds r2, r4, r0 - ldrh r0, [r2] - cmp r0, 0 - bne _081310CC - lsls r0, r1, 1 - adds r0, r6 - ldrh r0, [r0] - strh r0, [r2] - b _081310E4 - .pool -_081310CC: - adds r5, 0x2 - adds r7, 0x1 - cmp r7, 0x3 - bgt _081310E4 - adds r0, r5, r3 - adds r0, r4, r0 - lsls r1, 1 - adds r1, r6 - ldrh r0, [r0] - ldrh r1, [r1] - cmp r0, r1 - bne _081310A0 -_081310E4: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8131074 - - thumb_func_start sub_81310F0 -sub_81310F0: @ 81310F0 - push {r4,lr} - lsls r0, 24 - ldr r4, =gUnknown_020244A8 - movs r3, 0 - lsrs r1, r0, 20 - movs r2, 0x3 -_081310FC: - ldr r0, [r4] - ldr r0, [r0, 0x18] - adds r0, r1 - strh r3, [r0] - adds r1, 0x2 - subs r2, 0x1 - cmp r2, 0 - bge _081310FC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81310F0 - - thumb_func_start b_history__record_ability_usage_of_player -b_history__record_ability_usage_of_player: @ 8131118 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gUnknown_020244A8 - ldr r2, [r2] - ldr r2, [r2, 0x18] - adds r2, 0x40 - adds r2, r0 - strb r1, [r2] - bx lr - .pool - thumb_func_end b_history__record_ability_usage_of_player - - thumb_func_start sub_8131130 -sub_8131130: @ 8131130 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_020244A8 - ldr r1, [r1] - ldr r1, [r1, 0x18] - adds r1, 0x40 - adds r1, r0 - movs r0, 0 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_8131130 - - thumb_func_start b_history__record_item_x12_of_player -b_history__record_item_x12_of_player: @ 8131148 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gUnknown_020244A8 - ldr r2, [r2] - ldr r2, [r2, 0x18] - adds r2, 0x44 - adds r2, r0 - strb r1, [r2] - bx lr - .pool - thumb_func_end b_history__record_item_x12_of_player - - thumb_func_start sub_8131160 -sub_8131160: @ 8131160 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_020244A8 - ldr r1, [r1] - ldr r1, [r1, 0x18] - adds r1, 0x44 - adds r1, r0 - movs r0, 0 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_8131160 - - thumb_func_start tai00_unk -tai00_unk: @ 8131178 - push {lr} - bl Random - lsls r0, 16 - movs r1, 0xFF - lsls r1, 16 - ldr r3, =gUnknown_0203AB38 - ldr r2, [r3] - ands r1, r0 - lsrs r1, 16 - ldrb r0, [r2, 0x1] - cmp r1, r0 - bcs _081311B0 - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _081311B4 - .pool -_081311B0: - adds r0, r2, 0x6 - str r0, [r3] -_081311B4: - pop {r0} - bx r0 - thumb_func_end tai00_unk - thumb_func_start tai01_unk tai01_unk: @ 81311B8 push {lr} @@ -1136,7 +12,7 @@ tai01_unk: @ 81311B8 lsls r0, 16 movs r1, 0xFF lsls r1, 16 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ands r1, r0 lsrs r1, 16 @@ -1171,7 +47,7 @@ tai02_unk: @ 81311F8 lsls r0, 16 movs r1, 0xFF lsls r1, 16 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ands r1, r0 lsrs r1, 16 @@ -1206,7 +82,7 @@ tai03_unk: @ 8131238 lsls r0, 16 movs r1, 0xFF lsls r1, 16 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ands r1, r0 lsrs r1, 16 @@ -1243,7 +119,7 @@ tai04_unk: @ 8131278 adds r1, r0, 0x4 ldrb r0, [r0, 0x1] adds r1, r0 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r0, [r3] ldrb r0, [r0, 0x1] ldrb r4, [r1] @@ -1273,7 +149,7 @@ _081312A8: thumb_func_start tai05_unk tai05_unk: @ 81312BC push {r4,lr} - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr ldr r1, [r0] ldrb r1, [r1, 0x1] adds r4, r0, 0 @@ -1286,7 +162,7 @@ _081312D8: ldr r0, =gUnknown_0202420C _081312DA: ldrb r1, [r0] - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons movs r0, 0x58 muls r1, r0 adds r1, r2 @@ -1324,7 +200,7 @@ _0813131C: thumb_func_start tai06_unk tai06_unk: @ 8131324 push {r4,lr} - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr ldr r1, [r0] ldrb r1, [r1, 0x1] adds r4, r0, 0 @@ -1337,7 +213,7 @@ _08131340: ldr r0, =gUnknown_0202420C _08131342: ldrb r1, [r0] - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons movs r0, 0x58 muls r1, r0 adds r1, r2 @@ -1375,7 +251,7 @@ _08131384: thumb_func_start tai07_unk tai07_unk: @ 813138C push {r4,lr} - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr ldr r1, [r0] ldrb r1, [r1, 0x1] adds r4, r0, 0 @@ -1388,7 +264,7 @@ _081313A8: ldr r0, =gUnknown_0202420C _081313AA: ldrb r1, [r0] - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons movs r0, 0x58 muls r1, r0 adds r1, r2 @@ -1426,7 +302,7 @@ _081313EC: thumb_func_start tai08_unk tai08_unk: @ 81313F4 push {r4,lr} - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr ldr r1, [r0] ldrb r1, [r1, 0x1] adds r4, r0, 0 @@ -1439,7 +315,7 @@ _08131410: ldr r0, =gUnknown_0202420C _08131412: ldrb r1, [r0] - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons movs r0, 0x58 muls r1, r0 adds r1, r2 @@ -1477,7 +353,7 @@ _08131454: thumb_func_start tai09_unk tai09_unk: @ 813145C push {r4,r5,lr} - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr ldr r1, [r0] ldrb r1, [r1, 0x1] adds r5, r0, 0 @@ -1501,7 +377,7 @@ _0813147A: ldrb r0, [r3, 0x5] lsls r0, 24 orrs r2, r0 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r4 adds r1, 0x4C @@ -1536,7 +412,7 @@ _081314CA: thumb_func_start tai0A_unk tai0A_unk: @ 81314D0 push {r4,r5,lr} - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr ldr r1, [r0] ldrb r1, [r1, 0x1] adds r5, r0, 0 @@ -1560,7 +436,7 @@ _081314EE: ldrb r0, [r3, 0x5] lsls r0, 24 orrs r2, r0 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r4 adds r1, 0x4C @@ -1595,7 +471,7 @@ _0813153E: thumb_func_start tai0B_unk tai0B_unk: @ 8131544 push {r4,r5,lr} - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr ldr r1, [r0] ldrb r1, [r1, 0x1] adds r5, r0, 0 @@ -1619,7 +495,7 @@ _08131562: ldrb r0, [r3, 0x5] lsls r0, 24 orrs r2, r0 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r4 adds r1, 0x50 @@ -1654,7 +530,7 @@ _081315B2: thumb_func_start tai0C_unk tai0C_unk: @ 81315B8 push {r4,r5,lr} - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr ldr r1, [r0] ldrb r1, [r1, 0x1] adds r5, r0, 0 @@ -1678,7 +554,7 @@ _081315D6: ldrb r0, [r3, 0x5] lsls r0, 24 orrs r2, r0 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r4 adds r1, 0x50 @@ -1713,7 +589,7 @@ _08131626: thumb_func_start tai0D_unk tai0D_unk: @ 813162C push {r4,r5,lr} - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr ldr r1, [r0] ldrb r1, [r1, 0x1] adds r5, r0, 0 @@ -1770,7 +646,7 @@ _08131696: thumb_func_start tai0E_unk tai0E_unk: @ 813169C push {r4,r5,lr} - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr ldr r1, [r0] ldrb r1, [r1, 0x1] adds r5, r0, 0 @@ -1827,7 +703,7 @@ _08131706: thumb_func_start tai0F_unk tai0F_unk: @ 813170C push {r4,lr} - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr ldr r0, [r0] ldrb r0, [r0, 0x1] cmp r0, 0x1 @@ -1842,7 +718,7 @@ _08131726: bl battle_get_per_side_status movs r2, 0x1 ands r2, r0 - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r1, [r3, 0x2] ldrb r0, [r3, 0x3] @@ -1887,7 +763,7 @@ _08131782: thumb_func_start tai10_unk tai10_unk: @ 8131788 push {r4,lr} - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr ldr r0, [r0] ldrb r0, [r0, 0x1] cmp r0, 0x1 @@ -1902,7 +778,7 @@ _081317A2: bl battle_get_per_side_status movs r2, 0x1 ands r2, r0 - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r1, [r3, 0x2] ldrb r0, [r3, 0x3] @@ -1950,7 +826,7 @@ tai11_unk: @ 8131804 ldr r0, =gUnknown_020244A8 ldr r0, [r0] ldr r0, [r0, 0x14] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldr r0, [r0, 0x8] ldrb r1, [r2, 0x1] @@ -1983,7 +859,7 @@ tai12_unk: @ 8131840 ldr r0, =gUnknown_020244A8 ldr r0, [r0] ldr r0, [r0, 0x14] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldr r0, [r0, 0x8] ldrb r1, [r2, 0x1] @@ -2016,7 +892,7 @@ tai13_unk: @ 813187C ldr r0, =gUnknown_020244A8 ldr r0, [r0] ldr r0, [r0, 0x14] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldr r0, [r0, 0x8] ldrb r1, [r2, 0x1] @@ -2049,7 +925,7 @@ tai14_unk: @ 81318B8 ldr r0, =gUnknown_020244A8 ldr r0, [r0] ldr r0, [r0, 0x14] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldr r0, [r0, 0x8] ldrb r1, [r2, 0x1] @@ -2079,7 +955,7 @@ _081318F0: thumb_func_start tai15_unk tai15_unk: @ 81318F4 push {lr} - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] @@ -2123,7 +999,7 @@ _08131942: thumb_func_start tai16_unk tai16_unk: @ 8131948 push {lr} - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] @@ -2167,7 +1043,7 @@ _08131996: thumb_func_start tai17_unk tai17_unk: @ 813199C push {lr} - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] @@ -2211,7 +1087,7 @@ _081319EA: thumb_func_start tai18_unk tai18_unk: @ 81319F0 push {lr} - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] @@ -2255,7 +1131,7 @@ _08131A3E: thumb_func_start tai19_unk tai19_unk: @ 8131A44 push {lr} - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] @@ -2291,7 +1167,7 @@ _08131A84: thumb_func_start tai1A_unk tai1A_unk: @ 8131A88 push {lr} - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] @@ -2327,7 +1203,7 @@ _08131AC8: thumb_func_start tai1B_unk tai1B_unk: @ 8131ACC push {r4,lr} - ldr r2, =gUnknown_0203AB38 + ldr r2, =gAIScriptPtr ldr r1, [r2] ldrb r3, [r1, 0x1] ldrb r0, [r1, 0x2] @@ -2383,7 +1259,7 @@ _08131B2E: thumb_func_start tai1C_unk tai1C_unk: @ 8131B34 push {r4,lr} - ldr r2, =gUnknown_0203AB38 + ldr r2, =gAIScriptPtr ldr r1, [r2] ldrb r3, [r1, 0x1] ldrb r0, [r1, 0x2] @@ -2440,7 +1316,7 @@ _08131B98: thumb_func_start tai1D_unk tai1D_unk: @ 8131BA0 push {r4,r5,lr} - ldr r2, =gUnknown_0203AB38 + ldr r2, =gAIScriptPtr ldr r1, [r2] ldrb r3, [r1, 0x1] ldrb r0, [r1, 0x2] @@ -2497,7 +1373,7 @@ _08131C06: thumb_func_start tai1E_unk tai1E_unk: @ 8131C0C push {r4,r5,lr} - ldr r2, =gUnknown_0203AB38 + ldr r2, =gAIScriptPtr ldr r1, [r2] ldrb r3, [r1, 0x1] ldrb r0, [r1, 0x2] @@ -2556,8 +1432,8 @@ _08131C74: tai1F_unk: @ 8131C7C push {r4,r5,lr} movs r3, 0 - ldr r4, =gUnknown_0203AB38 - ldr r1, =gUnknown_02024084 + ldr r4, =gAIScriptPtr + ldr r1, =gBattleMons ldr r0, =gUnknown_0203AB3C ldrb r2, [r0] ldr r5, =gBattleMoves @@ -2612,8 +1488,8 @@ _08131CE4: tai20_unk: @ 8131CEC push {r4,r5,lr} movs r3, 0 - ldr r4, =gUnknown_0203AB38 - ldr r1, =gUnknown_02024084 + ldr r4, =gAIScriptPtr + ldr r1, =gBattleMons ldr r0, =gUnknown_0203AB3C ldrb r2, [r0] ldr r5, =gBattleMoves @@ -2672,7 +1548,7 @@ tai21_unk: @ 8131D5C ldr r0, =gUnknown_03005D10 ldrb r0, [r0, 0x13] str r0, [r1, 0x8] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -2683,7 +1559,7 @@ tai21_unk: @ 8131D5C thumb_func_start dp15_get_some_type dp15_get_some_type: @ 8131D80 push {r4,lr} - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] ldrb r0, [r0, 0x1] adds r4, r1, 0 @@ -2706,7 +1582,7 @@ _08131DB4: ldr r0, =gUnknown_020244A8 ldr r0, [r0] ldr r3, [r0, 0x14] - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0203AB3C ldrb r1, [r0] movs r0, 0x58 @@ -2720,7 +1596,7 @@ _08131DD8: ldr r0, =gUnknown_020244A8 ldr r0, [r0] ldr r3, [r0, 0x14] - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420C ldrb r1, [r0] movs r0, 0x58 @@ -2734,7 +1610,7 @@ _08131DFC: ldr r0, =gUnknown_020244A8 ldr r0, [r0] ldr r3, [r0, 0x14] - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0203AB3C ldrb r1, [r0] movs r0, 0x58 @@ -2748,7 +1624,7 @@ _08131E20: ldr r0, =gUnknown_020244A8 ldr r0, [r0] ldr r3, [r0, 0x14] - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420C ldrb r1, [r0] movs r0, 0x58 @@ -2823,13 +1699,13 @@ _08131EAC: thumb_func_start tai5F_unk tai5F_unk: @ 8131EB4 push {r4,lr} - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r0, [r4] ldrb r0, [r0, 0x1] bl sub_8131E70 lsls r0, 24 lsrs r0, 24 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons movs r1, 0x58 muls r0, r1 adds r3, r0, r2 @@ -2859,7 +1735,7 @@ _08131EFC: movs r0, 0 _08131F04: str r0, [r1, 0x8] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x3 str r0, [r1] @@ -2882,7 +1758,7 @@ dp15_move_get_power__2_8: @ 8131F1C adds r0, r2 ldrb r0, [r0, 0x1] str r0, [r3, 0x8] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -2966,7 +1842,7 @@ _08131FAC: str r2, [sp, 0x10] _08131FD0: movs r3, 0 - ldr r5, =gUnknown_02024084 + ldr r5, =gBattleMons lsls r4, r6, 1 ldr r7, =gUnknown_0203AB3C lsls r0, r6, 2 @@ -3076,7 +1952,7 @@ _081320D0: add r0, sp ldr r1, [sp] ldr r0, [r0] - ldr r5, =gUnknown_0203AB38 + ldr r5, =gAIScriptPtr cmp r1, r0 bgt _08132106 adds r4, r2, 0 @@ -3115,7 +1991,7 @@ _08132126: ldr r1, [r0, 0x14] movs r0, 0 str r0, [r1, 0x8] - ldr r5, =gUnknown_0203AB38 + ldr r5, =gAIScriptPtr _08132130: ldr r0, [r5] adds r0, 0x1 @@ -3134,7 +2010,7 @@ _08132130: thumb_func_start dp15_get_move_to_execute_B dp15_get_move_to_execute_B: @ 813214C push {lr} - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr ldr r1, [r0] ldrb r1, [r1, 0x1] adds r3, r0, 0 @@ -3170,7 +2046,7 @@ _08132182: thumb_func_start tai26_unk tai26_unk: @ 81321A4 push {lr} - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2, 0x1] ldr r0, =gUnknown_020244A8 @@ -3203,7 +2079,7 @@ _081321DC: thumb_func_start tai27_unk tai27_unk: @ 81321E0 push {lr} - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2, 0x1] ldr r0, =gUnknown_020244A8 @@ -3242,7 +2118,7 @@ tai28_unk: @ 813221C ldrb r1, [r1] movs r2, 0x1 bl b_first_side - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] lsls r0, 24 lsrs r0, 24 @@ -3279,7 +2155,7 @@ tai29_unk: @ 8132268 ldrb r1, [r1] movs r2, 0x1 bl b_first_side - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] lsls r0, 24 lsrs r0, 24 @@ -3327,7 +2203,7 @@ tai2C_unk: @ 81322BC ldr r1, [r0, 0x14] movs r0, 0 str r0, [r1, 0x8] - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr ldr r0, [r0] ldrb r0, [r0, 0x1] cmp r0, 0x1 @@ -3349,7 +2225,7 @@ _081322EA: ldr r0, =gUnknown_020244EC mov r8, r0 _08132300: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -3416,7 +2292,7 @@ _08132394: adds r5, 0x1 cmp r5, 0x5 ble _08132350 - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x2 str r0, [r1] @@ -3435,7 +2311,7 @@ dp15_get_move_id__8: @ 81323B8 ldr r1, [r0, 0x14] ldrh r0, [r1, 0x2] str r0, [r1, 0x8] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -3456,7 +2332,7 @@ dp15_move_get_move_script_id: @ 81323D4 adds r0, r2 ldrb r0, [r0] str r0, [r3, 0x8] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -3467,7 +2343,7 @@ dp15_move_get_move_script_id: @ 81323D4 thumb_func_start tai2F_unk tai2F_unk: @ 8132400 push {r4-r7,lr} - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr ldr r1, [r0] ldrb r1, [r1, 0x1] mov r12, r0 @@ -3498,7 +2374,7 @@ _0813241E: b _08132504 .pool _0813244C: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r3 adds r4, r0, r1 @@ -3550,7 +2426,7 @@ _08132480: adds r0, r6 ldrb r0, [r0, 0x16] str r0, [r2, 0x8] - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr mov r12, r0 b _08132504 .pool @@ -3564,7 +2440,7 @@ _081324C4: adds r0, r6 ldrb r0, [r0, 0x17] str r0, [r2, 0x8] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr mov r12, r1 b _08132504 .pool @@ -3582,7 +2458,7 @@ _081324F0: ldr r0, =gUnknown_020244A8 ldr r0, [r0] ldr r2, [r0, 0x14] - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r3 adds r0, r1 @@ -3603,7 +2479,7 @@ _08132504: thumb_func_start tai60_unk tai60_unk: @ 813251C push {r4-r6,lr} - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r0, [r4] ldrb r0, [r0, 0x1] bl sub_8131E70 @@ -3632,7 +2508,7 @@ _0813253A: b _081325CA .pool _0813255C: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r5 adds r4, r0, r1 @@ -3681,7 +2557,7 @@ _081325B8: ldrb r3, [r1, 0x17] b _081325CA _081325BC: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r5 adds r0, r1 @@ -3696,11 +2572,11 @@ _081325CE: ldr r1, [r0, 0x14] movs r0, 0x2 str r0, [r1, 0x8] - ldr r2, =gUnknown_0203AB38 + ldr r2, =gAIScriptPtr b _08132608 .pool _081325E8: - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr ldr r1, [r0] adds r2, r0, 0 ldrb r1, [r1, 0x2] @@ -3819,7 +2695,7 @@ _081326B8: adds r5, 0x1 cmp r5, 0x3 ble _0813264A - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -3895,7 +2771,7 @@ _08132764: str r0, [r4] _08132772: ldrb r0, [r4] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2, 0x1] cmp r0, r1 @@ -3939,7 +2815,7 @@ tai34_unk: @ 81327D8 mov r6, r9 mov r5, r8 push {r5-r7} - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr ldr r0, [r0] ldrb r0, [r0, 0x1] cmp r0, 0x1 @@ -3948,7 +2824,7 @@ tai34_unk: @ 81327D8 b _0813281A .pool _081327F8: - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2, 0x6] ldrb r0, [r2, 0x7] @@ -3976,7 +2852,7 @@ _0813281A: ldr r0, =gUnknown_020244EC mov r9, r0 _0813282E: - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr ldr r1, [r0] ldrb r7, [r1, 0x2] ldrb r0, [r1, 0x3] @@ -4025,7 +2901,7 @@ _08132888: mov r0, r8 cmp r0, 0x5 ble _08132850 - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0xA str r0, [r1] @@ -4047,7 +2923,7 @@ tai35_unk: @ 81328B8 mov r6, r9 mov r5, r8 push {r5-r7} - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr ldr r0, [r0] ldrb r0, [r0, 0x1] cmp r0, 0x1 @@ -4068,7 +2944,7 @@ _081328DA: ldr r0, =gUnknown_020244EC mov r10, r0 _081328EE: - ldr r2, =gUnknown_0203AB38 + ldr r2, =gAIScriptPtr ldr r1, [r2] ldrb r7, [r1, 0x2] ldrb r0, [r1, 0x3] @@ -4121,7 +2997,7 @@ _08132950: mov r1, r8 cmp r1, 0x5 ble _0813290C - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2, 0x6] ldrb r0, [r2, 0x7] @@ -4192,7 +3068,7 @@ _081329D4: movs r0, 0x3 str r0, [r1, 0x8] _081329E8: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -4213,7 +3089,7 @@ tai37_unk: @ 8132A00 adds r0, r1 lsls r0, 2 adds r0, r2 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r0, [r0] ldrb r1, [r2, 0x1] @@ -4252,7 +3128,7 @@ tai38_unk: @ 8132A4C adds r0, r1 lsls r0, 2 adds r0, r2 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r0, [r0] ldrb r1, [r2, 0x1] @@ -4282,7 +3158,7 @@ _08132A94: thumb_func_start tai39_unk tai39_unk: @ 8132A98 push {r4,lr} - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr ldr r1, [r0] ldrb r1, [r1, 0x1] adds r4, r0, 0 @@ -4295,7 +3171,7 @@ _08132AB4: ldr r0, =gUnknown_0202420C _08132AB6: ldrb r3, [r0] - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r2, [r4] movs r0, 0x58 muls r0, r3 @@ -4335,7 +3211,7 @@ _08132AFA: thumb_func_start tai3A_unk tai3A_unk: @ 8132B00 push {r4,lr} - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr ldr r1, [r0] ldrb r1, [r1, 0x1] adds r4, r0, 0 @@ -4348,7 +3224,7 @@ _08132B1C: ldr r0, =gUnknown_0202420C _08132B1E: ldrb r3, [r0] - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r2, [r4] movs r0, 0x58 muls r0, r3 @@ -4388,7 +3264,7 @@ _08132B62: thumb_func_start tai3B_unk tai3B_unk: @ 8132B68 push {r4,lr} - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr ldr r1, [r0] ldrb r1, [r1, 0x1] adds r4, r0, 0 @@ -4401,7 +3277,7 @@ _08132B84: ldr r0, =gUnknown_0202420C _08132B86: ldrb r3, [r0] - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r2, [r4] movs r0, 0x58 muls r0, r3 @@ -4441,7 +3317,7 @@ _08132BCA: thumb_func_start tai3C_unk tai3C_unk: @ 8132BD0 push {r4,lr} - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr ldr r1, [r0] ldrb r1, [r1, 0x1] adds r4, r0, 0 @@ -4454,7 +3330,7 @@ _08132BEC: ldr r0, =gUnknown_0202420C _08132BEE: ldrb r3, [r0] - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r2, [r4] movs r0, 0x58 muls r0, r3 @@ -4555,7 +3431,7 @@ tai3D_unk: @ 8132C38 bne _08132CB8 str r7, [r4] _08132CB8: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldrb r1, [r6] movs r0, 0x58 muls r0, r1 @@ -4564,7 +3440,7 @@ _08132CB8: ldr r0, [r4] cmp r1, r0 bgt _08132D1C - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] @@ -4580,7 +3456,7 @@ _08132CB8: b _08132D24 .pool _08132D1C: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x5 str r0, [r1] @@ -4648,7 +3524,7 @@ dp15_determine_move_damage_jump_if_not_fatal: @ 8132D34 movs r1, 0x64 bl __divsi3 str r0, [r4] - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldrb r2, [r5] movs r1, 0x58 muls r1, r2 @@ -4656,7 +3532,7 @@ dp15_determine_move_damage_jump_if_not_fatal: @ 8132D34 ldrh r1, [r1, 0x28] cmp r1, r0 ble _08132E04 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] @@ -4672,7 +3548,7 @@ dp15_determine_move_damage_jump_if_not_fatal: @ 8132D34 b _08132E0C .pool _08132E04: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x5 str r0, [r1] @@ -4686,7 +3562,7 @@ _08132E0C: thumb_func_start tai3F_unk tai3F_unk: @ 8132E18 push {r4-r7,lr} - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr ldr r5, [r0] adds r7, r5, 0x2 ldrb r1, [r5, 0x1] @@ -4707,7 +3583,7 @@ _08132E38: b _08132F40 _08132E42: movs r4, 0 - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldr r2, =gUnknown_0203AB3C ldrb r1, [r2] movs r0, 0x58 @@ -4738,7 +3614,7 @@ _08132E74: b _08132F28 .pool _08132E84: - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldr r2, =gUnknown_0203AB3C ldrb r1, [r2] movs r0, 0x2 @@ -4842,7 +3718,7 @@ _08132F40: thumb_func_start tai40_unk tai40_unk: @ 8132F48 push {r4-r7,lr} - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r6, r0, 0x2 ldrb r0, [r0, 0x1] @@ -4862,7 +3738,7 @@ _08132F68: bne _08133018 _08132F70: movs r3, 0 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r4, =gUnknown_0203AB3C ldrb r1, [r4] movs r0, 0x58 @@ -4955,7 +3831,7 @@ _08133018: thumb_func_start tai41_unk tai41_unk: @ 8133020 push {r4-r7,lr} - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] ldrb r0, [r0, 0x1] adds r5, r1, 0 @@ -4974,7 +3850,7 @@ _0813303C: bne _08133110 _08133044: movs r3, 0 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0203AB3C ldrb r2, [r0] ldr r6, =gBattleMoves @@ -4982,7 +3858,7 @@ _08133044: muls r0, r2 adds r1, 0xC adds r2, r0, r1 - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr _08133058: ldrh r0, [r2] cmp r0, 0 @@ -5009,7 +3885,7 @@ _0813307A: .pool _08133090: movs r3, 0 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0203AB3C ldrb r2, [r0] ldr r0, =gBattleMoves @@ -5077,7 +3953,7 @@ _08133110: thumb_func_start tai42_unk tai42_unk: @ 8133118 push {r4-r6,lr} - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] ldrb r0, [r0, 0x1] adds r4, r1, 0 @@ -5096,7 +3972,7 @@ _08133134: bne _081331F4 _0813313C: movs r3, 0 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0203AB3C ldrb r2, [r0] ldr r6, =gBattleMoves @@ -5104,7 +3980,7 @@ _0813313C: muls r0, r2 adds r1, 0xC adds r2, r0, r1 - ldr r5, =gUnknown_0203AB38 + ldr r5, =gAIScriptPtr _08133150: ldrh r0, [r2] cmp r0, 0 @@ -5139,7 +4015,7 @@ _08133188: ldr r6, =gBattleMoves lsls r0, 4 adds r2, r0, r1 - ldr r5, =gUnknown_0203AB38 + ldr r5, =gAIScriptPtr _0813319C: ldrh r0, [r2] cmp r0, 0 @@ -5190,7 +4066,7 @@ _081331F4: thumb_func_start tai43_unk tai43_unk: @ 81331FC push {r4,r5,lr} - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr ldr r1, [r0] ldrb r1, [r1, 0x1] adds r5, r0, 0 @@ -5260,7 +4136,7 @@ _0813327C: thumb_func_start tai44_unk tai44_unk: @ 8133284 push {r4,lr} - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r0, [r3, 0x1] cmp r0, 0 @@ -5357,7 +4233,7 @@ tai46_unk: @ 8133328 lsrs r0, 24 cmp r0, r4 bcs _08133374 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] @@ -5373,7 +4249,7 @@ tai46_unk: @ 8133328 b _0813337C .pool _08133374: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x5 str r0, [r1] @@ -5400,7 +4276,7 @@ dp15_end_with_move_5: @ 8133388 thumb_func_start dp15_get_held_item_x12__8 dp15_get_held_item_x12__8: @ 813339C push {r4,lr} - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr ldr r0, [r0] ldrb r0, [r0, 0x1] cmp r0, 0x1 @@ -5427,7 +4303,7 @@ _081333B6: b _081333F2 .pool _081333E0: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r2 adds r0, r1 @@ -5440,7 +4316,7 @@ _081333F2: lsls r0, 24 lsrs r0, 24 str r0, [r1, 0x8] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x2 str r0, [r1] @@ -5453,7 +4329,7 @@ _081333F2: thumb_func_start tai62_unk tai62_unk: @ 8133414 push {r4,lr} - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr ldr r0, [r0] ldrb r0, [r0, 0x1] bl sub_8131E70 @@ -5467,7 +4343,7 @@ tai62_unk: @ 8133414 ands r0, r2 cmp r1, r0 bne _0813344C - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r3 adds r0, r1 @@ -5482,7 +4358,7 @@ _0813344C: adds r0, r3 ldrb r3, [r0] _08133458: - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r2, [r4] ldrb r1, [r2, 0x2] ldrb r0, [r2, 0x3] @@ -5515,7 +4391,7 @@ _0813348E: thumb_func_start tai49_unk tai49_unk: @ 8133494 push {lr} - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr ldr r0, [r0] ldrb r0, [r0, 0x1] cmp r0, 0x1 @@ -5527,7 +4403,7 @@ _081334AC: ldr r0, =gUnknown_0202420C _081334AE: ldrb r1, [r0] - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons movs r0, 0x58 muls r1, r0 adds r0, r1, r2 @@ -5542,7 +4418,7 @@ _081334AE: lsls r0, 24 lsrs r0, 24 str r0, [r1, 0x8] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x2 str r0, [r1] @@ -5554,7 +4430,7 @@ _081334AE: thumb_func_start dp15_enter_battle_countdown_get_state dp15_enter_battle_countdown_get_state: @ 81334EC push {r4,lr} - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr ldr r1, [r0] ldrb r1, [r1, 0x1] adds r4, r0, 0 @@ -5589,7 +4465,7 @@ _0813350A: thumb_func_start dp15_stockpile_get_num_uses dp15_stockpile_get_num_uses: @ 8133538 push {r4,lr} - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr ldr r1, [r0] ldrb r1, [r1, 0x1] adds r4, r0, 0 @@ -5626,12 +4502,12 @@ dp15_is_double_battle: @ 8133584 ldr r0, =gUnknown_020244A8 ldr r0, [r0] ldr r2, [r0, 0x14] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 str r0, [r2, 0x8] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -5642,7 +4518,7 @@ dp15_is_double_battle: @ 8133584 thumb_func_start dp15_get_dp08_item__8 dp15_get_dp08_item__8: @ 81335AC push {r4,lr} - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr ldr r1, [r0] ldrb r1, [r1, 0x1] adds r4, r0, 0 @@ -5687,7 +4563,7 @@ dp15_move_get_type__8: @ 81335F8 adds r0, r2 ldrb r0, [r0, 0x2] str r0, [r3, 0x8] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -5708,7 +4584,7 @@ dp15_move_get_power__8_8: @ 8133624 adds r0, r2 ldrb r0, [r0, 0x1] str r0, [r3, 0x8] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -5729,7 +4605,7 @@ dp15_move_get_move_script_id__8: @ 8133650 adds r0, r2 ldrb r0, [r0] str r0, [r3, 0x8] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -5740,7 +4616,7 @@ dp15_move_get_move_script_id__8: @ 8133650 thumb_func_start dp15_get_protect_endure_activity dp15_get_protect_endure_activity: @ 813367C push {r4,lr} - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr ldr r1, [r0] ldrb r1, [r1, 0x1] adds r4, r0, 0 @@ -5805,7 +4681,7 @@ nullsub_111: @ 81336DC thumb_func_start tai58_unk tai58_unk: @ 81336E0 push {r4,lr} - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r0, [r4] adds r0, 0x5 bl b_mc_stack_push @@ -5829,7 +4705,7 @@ tai58_unk: @ 81336E0 thumb_func_start dp15_jump dp15_jump: @ 8133710 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] @@ -5869,7 +4745,7 @@ _0813374A: thumb_func_start dp15_compare_attacker_defender_levels dp15_compare_attacker_defender_levels: @ 8133754 push {r4,r5,lr} - ldr r5, =gUnknown_0203AB38 + ldr r5, =gAIScriptPtr ldr r4, [r5] ldrb r0, [r4, 0x1] cmp r0, 0x1 @@ -5885,7 +4761,7 @@ _08133770: beq _081337D8 b _08133824 _08133776: - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldr r0, =gUnknown_0203AB3C ldrb r0, [r0] movs r2, 0x58 @@ -5905,7 +4781,7 @@ _08133776: b _08133820 .pool _081337A8: - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldr r0, =gUnknown_0203AB3C ldrb r0, [r0] movs r2, 0x58 @@ -5925,7 +4801,7 @@ _081337A8: b _08133820 .pool _081337D8: - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldr r0, =gUnknown_0203AB3C ldrb r0, [r0] movs r2, 0x58 @@ -5979,7 +4855,7 @@ tai5C_unk: @ 813382C lsls r0, 28 cmp r0, 0 beq _0813386C - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] @@ -5995,7 +4871,7 @@ tai5C_unk: @ 813382C b _08133874 .pool _0813386C: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x5 str r0, [r1] @@ -6019,7 +4895,7 @@ tai5D_unk: @ 813387C lsls r0, 28 cmp r0, 0 bne _081338BC - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] @@ -6035,7 +4911,7 @@ tai5D_unk: @ 813387C b _081338C4 .pool _081338BC: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x5 str r0, [r1] @@ -6058,7 +4934,7 @@ tai5E_unk: @ 81338CC ands r0, r2 cmp r1, r0 bne _0813390C - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] @@ -6074,7 +4950,7 @@ tai5E_unk: @ 81338CC b _08133914 .pool _0813390C: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x5 str r0, [r1] @@ -6087,7 +4963,7 @@ _08133914: thumb_func_start tai61_unk tai61_unk: @ 813391C push {r4,lr} - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r0, [r4] ldrb r0, [r0, 0x1] bl sub_8131E70 @@ -6160,7 +5036,7 @@ b_mc_stack_push_cursor: @ 8133990 lsls r0, 24 lsrs r0, 22 adds r2, r0 - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr ldr r0, [r0] str r0, [r2] bx lr @@ -6184,7 +5060,7 @@ b_mc_stack_pop_cursor: @ 81339B8 _081339D4: subs r0, 0x1 strb r0, [r1] - ldr r2, =gUnknown_0203AB38 + ldr r2, =gAIScriptPtr ldr r0, [r3] ldr r1, [r0, 0x1C] adds r0, r1, 0 diff --git a/asm/battle_anim_80FE840.s b/asm/battle_anim_80FE840.s index 8f7dfc009..9e6820215 100644 --- a/asm/battle_anim_80FE840.s +++ b/asm/battle_anim_80FE840.s @@ -10736,7 +10736,7 @@ _08103DB6: lsrs r0, 24 strh r0, [r4, 0x1C] mov r9, r0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -16986,7 +16986,7 @@ _081070A6: sub_81070AC: @ 81070AC push {r4,r5,lr} adds r5, r0, 0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -50436,7 +50436,7 @@ battle_intro_launch: @ 81181D4 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r2, =gUnknown_02022FEC + ldr r2, =gBattleTypeFlags ldr r0, [r2] movs r1, 0x80 lsls r1, 15 @@ -50587,7 +50587,7 @@ _08118330: .4byte _081183E4 .4byte _08118524 _08118344: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -50937,7 +50937,7 @@ _0811861C: adds r2, r0, r1 movs r3, 0x10 strh r3, [r2, 0x10] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -51236,7 +51236,7 @@ _08118898: lsls r0, 3 adds r2, r0, r1 strh r4, [r2, 0x10] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x02000002 ands r0, r1 diff --git a/asm/battle_anim_8170478.s b/asm/battle_anim_8170478.s index 84f9e7c85..e5e958051 100644 --- a/asm/battle_anim_8170478.s +++ b/asm/battle_anim_8170478.s @@ -1261,7 +1261,7 @@ sub_8170F2C: @ 8170F2C push {r6,r7} lsls r0, 24 lsrs r7, r0, 24 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 2 diff --git a/asm/battle_message.s b/asm/battle_message.s index 201cc6ee0..40930505d 100644 --- a/asm/battle_message.s +++ b/asm/battle_message.s @@ -114,7 +114,7 @@ _0814E1B4: .4byte _0814E4F8 .4byte _0814E55C _0814E1CC: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r2, [r0] movs r0, 0x8 ands r0, r2 @@ -219,7 +219,7 @@ _0814E2AC: lsls r0, 24 cmp r0, 0 bne _0814E310 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x1 ands r0, r1 @@ -258,7 +258,7 @@ _0814E308: b _0814E6D8 .pool _0814E310: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x1 ands r0, r1 @@ -333,7 +333,7 @@ _0814E394: _0814E3BC: cmp r2, 0x1 beq _0814E3CC - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -357,7 +357,7 @@ _0814E3EC: ldrh r1, [r0] movs r0, 0x80 lsls r0, 4 - ldr r2, =gUnknown_02022FEC + ldr r2, =gBattleTypeFlags cmp r1, r0 beq _0814E406 ldr r0, [r2] @@ -395,7 +395,7 @@ _0814E430: ldrb r2, [r0] cmp r2, 0 beq _0814E456 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -421,7 +421,7 @@ _0814E47C: b _0814E6D8 .pool _0814E488: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] ldr r0, =0x02000002 ands r0, r1 @@ -543,7 +543,7 @@ _0814E58A: b _0814E6D8 .pool _0814E5A4: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -570,7 +570,7 @@ _0814E5C4: eors r0, r1 strb r0, [r4] _0814E5E0: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x40 ands r0, r1 @@ -774,7 +774,7 @@ get_battle_strings: @ 814E764 mov r8, r1 movs r6, 0 movs r4, 0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 18 @@ -1100,7 +1100,7 @@ _0814EAF8: adds r2, r4, 0 cmp r0, 0 beq _0814EB74 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x8 ands r1, r0 @@ -1225,7 +1225,7 @@ _0814EC38: lsls r0, 24 cmp r0, 0 beq _0814ECA8 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x8 ands r1, r0 @@ -1290,7 +1290,7 @@ _0814ECD4: lsls r0, 24 cmp r0, 0 beq _0814ED44 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x8 ands r1, r0 @@ -1355,7 +1355,7 @@ _0814ED70: lsls r0, 24 cmp r0, 0 beq _0814EDE0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x8 ands r1, r0 @@ -1420,7 +1420,7 @@ _0814EE0C: lsls r0, 24 cmp r0, 0 beq _0814EE7C - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x8 ands r1, r0 @@ -1485,7 +1485,7 @@ _0814EEA8: lsls r0, 24 cmp r0, 0 beq _0814EF18 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x8 ands r1, r0 @@ -1583,7 +1583,7 @@ _0814EF8A: b _0814F5C0 .pool _0814EF98: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] ldr r0, =0x02000002 ands r0, r1 @@ -1709,7 +1709,7 @@ _0814F0C0: b _0814F5C0 .pool _0814F0D8: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x80 lsls r0, 20 @@ -1775,7 +1775,7 @@ _0814F14E: b _0814F5A2 .pool _0814F164: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x80 lsls r0, 20 @@ -1922,7 +1922,7 @@ _0814F284: b _0814F5C0 .pool _0814F298: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -1938,7 +1938,7 @@ _0814F2B4: b _0814F5C0 .pool _0814F2C0: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] ldr r0, =0x003f0100 ands r0, r1 @@ -1965,7 +1965,7 @@ _0814F2F8: adds r4, r0, 0 b _0814F5C0 _0814F300: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] ldr r0, =0x003f0100 ands r0, r1 @@ -1992,7 +1992,7 @@ _0814F330: lsls r0, 24 cmp r0, 0 beq _0814F39C - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x8 ands r1, r0 @@ -2114,7 +2114,7 @@ _0814F456: b _0814F5C0 .pool _0814F468: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] ldr r0, =0x003f0100 ands r0, r1 @@ -2147,7 +2147,7 @@ _0814F49C: b _0814F5A2 .pool _0814F4B8: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] ldr r0, =0x003f0100 ands r0, r1 @@ -2179,7 +2179,7 @@ _0814F4F0: b _0814F5C0 .pool _0814F508: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] ldr r0, =0x003f0100 ands r0, r1 @@ -2206,7 +2206,7 @@ _0814F540: adds r4, r0, 0 b _0814F5C0 _0814F548: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] ldr r0, =0x003f0100 ands r0, r1 @@ -2479,7 +2479,7 @@ _0814F744: b _0814F7A4 .pool _0814F768: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x8 ands r0, r1 @@ -2590,7 +2590,7 @@ _0814F858: ldrb r0, [r0, 0x2] lsls r0, 8 orrs r2, r0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x02000002 ands r0, r1 @@ -2898,7 +2898,7 @@ _0814FAE0: _0814FAE8: strb r1, [r0] adds r3, r0, 0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] ldr r2, =0x01000002 ands r1, r2 diff --git a/asm/battle_setup.s b/asm/battle_setup.s index 32b042cad..4307a77d5 100644 --- a/asm/battle_setup.s +++ b/asm/battle_setup.s @@ -114,7 +114,7 @@ sub_80B06BC: @ 80B06BC ldr r1, =gUnknown_030022C0 ldr r0, =sub_80B0AF8 str r0, [r1, 0x8] - ldr r4, =gUnknown_02022FEC + ldr r4, =gBattleTypeFlags movs r0, 0 str r0, [r4] bl InBattlePyramid @@ -156,7 +156,7 @@ sub_80B072C: @ 80B072C ldr r1, =gUnknown_030022C0 ldr r0, =sub_80B0AF8 str r0, [r1, 0x8] - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0x80 lsls r0, 3 str r0, [r1] @@ -185,7 +185,7 @@ sub_80B077C: @ 80B077C ldr r1, =gUnknown_030022C0 ldr r0, =sub_80FC190 str r0, [r1, 0x8] - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0x80 str r0, [r1] bl sub_80B0EC8 @@ -207,7 +207,7 @@ sub_80B07B4: @ 80B07B4 ldr r1, =gUnknown_030022C0 ldr r0, =sub_80B0AF8 str r0, [r1, 0x8] - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0x80 lsls r0, 13 str r0, [r1] @@ -287,7 +287,7 @@ sub_80B086C: @ 80B086C ldr r1, =gUnknown_030022C0 ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music str r0, [r1, 0x8] - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0x80 lsls r0, 2 str r0, [r1] @@ -306,7 +306,7 @@ sub_80B08A8: @ 80B08A8 ldr r1, =gUnknown_030022C0 ldr r0, =sub_80B0B6C str r0, [r1, 0x8] - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0 str r0, [r1] bl sub_80B0EC8 @@ -332,7 +332,7 @@ sub_80B08EC: @ 80B08EC ldr r1, =gUnknown_030022C0 ldr r0, =sub_80B0B6C str r0, [r1, 0x8] - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0x80 lsls r0, 6 str r0, [r1] @@ -359,7 +359,7 @@ sub_80B0934: @ 80B0934 ldr r1, =gUnknown_030022C0 ldr r0, =sub_80B0B6C str r0, [r1, 0x8] - ldr r4, =gUnknown_02022FEC + ldr r4, =gBattleTypeFlags movs r0, 0x80 lsls r0, 6 str r0, [r4] @@ -396,7 +396,7 @@ _080B0988: cmp r1, r0 beq _080B09E4 _080B099A: - ldr r2, =gUnknown_02022FEC + ldr r2, =gBattleTypeFlags ldr r0, [r2] movs r1, 0x80 lsls r1, 21 @@ -461,7 +461,7 @@ sub_80B0A18: @ 80B0A18 ldr r1, =gUnknown_030022C0 ldr r0, =sub_80B0B6C str r0, [r1, 0x8] - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0xC0 lsls r0, 6 str r0, [r1] @@ -498,7 +498,7 @@ sub_80B0A74: @ 80B0A74 ldr r1, =gUnknown_030022C0 ldr r0, =sub_80B0B6C str r0, [r1, 0x8] - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0xC0 lsls r0, 7 str r0, [r1] @@ -1380,7 +1380,7 @@ sub_80B11A8: @ 80B11A8 lsrs r0, 24 cmp r0, 0x1 bne _080B11F0 - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0x10 str r0, [r1] ldr r1, =gUnknown_030022C0 @@ -2104,12 +2104,12 @@ sub_80B17E0: @ 80B17E0 ldrb r0, [r0] cmp r0, 0x2 bne _080B17FC - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r0, =0x00008009 b _080B1800 .pool _080B17FC: - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0x8 _080B1800: str r0, [r1] @@ -2120,7 +2120,7 @@ _080B1800: ldr r0, =0x0000400e movs r1, 0 bl VarSet - ldr r2, =gUnknown_02022FEC + ldr r2, =gBattleTypeFlags ldr r0, [r2] movs r1, 0x80 lsls r1, 14 @@ -2166,7 +2166,7 @@ _080B1884: lsls r0, 24 cmp r0, 0 beq _080B18B8 - ldr r2, =gUnknown_02022FEC + ldr r2, =gBattleTypeFlags ldr r0, [r2] movs r1, 0x80 lsls r1, 19 @@ -2308,7 +2308,7 @@ _080B19E2: thumb_func_start sub_80B19EC sub_80B19EC: @ 80B19EC push {lr} - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0x8 str r0, [r1] ldr r1, =gUnknown_030022C0 diff --git a/asm/cable_club.s b/asm/cable_club.s index 56e6bb140..a1e99e9ea 100644 --- a/asm/cable_club.s +++ b/asm/cable_club.s @@ -1270,7 +1270,7 @@ sub_80B2E4C: @ 80B2E4C ldr r2, =0x00001133 adds r0, r2, 0 strh r0, [r1] - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0 str r0, [r1] movs r0, 0x2 @@ -1291,7 +1291,7 @@ sub_80B2E74: @ 80B2E74 ldr r2, =0x00003311 adds r0, r2, 0 strh r0, [r1] - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0 str r0, [r1] movs r0, 0x2 @@ -1458,7 +1458,7 @@ sub_80B2FD8: @ 80B2FD8 ldr r2, =0x00004411 adds r0, r2, 0 strh r0, [r1] - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0 str r0, [r1] movs r0, 0x2 @@ -1476,7 +1476,7 @@ sub_80B3000: @ 80B3000 ldr r2, =0x00006601 adds r0, r2, 0 strh r0, [r1] - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0 str r0, [r1] movs r0, 0x4 @@ -1494,7 +1494,7 @@ sub_80B3028: @ 80B3028 ldr r2, =0x00006602 adds r0, r2, 0 strh r0, [r1] - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0 str r0, [r1] movs r0, 0x2 @@ -1751,23 +1751,23 @@ _080B3270: beq _080B32A0 b _080B32A6 _080B327A: - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0xA b _080B32A4 .pool _080B3284: - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0xB b _080B32A4 .pool _080B3290: bl sub_80F94E8 - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0x4B b _080B32A4 .pool _080B32A0: - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r0, =0x0000014b _080B32A4: str r0, [r1] @@ -2150,7 +2150,7 @@ _080B35FE: thumb_func_start sub_80B360C sub_80B360C: @ 80B360C push {r4,r5,lr} - ldr r2, =gUnknown_02022FEC + ldr r2, =gBattleTypeFlags ldr r0, [r2] movs r1, 0x21 negs r1, r1 diff --git a/asm/calculate_base_damage.s b/asm/calculate_base_damage.s index f6c2497a7..47813bbd0 100644 --- a/asm/calculate_base_damage.s +++ b/asm/calculate_base_damage.s @@ -261,7 +261,7 @@ _08069790: mov r0, r9 cmp r0, 0x22 bne _080697C6 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x003f0100 ands r0, r1 @@ -288,7 +288,7 @@ _080697C6: ldr r0, [sp, 0x20] cmp r0, 0x22 bne _080697FC - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x003f0100 ands r0, r1 @@ -728,7 +728,7 @@ _08069B48: ldrb r1, [r4] cmp r1, 0x1 bne _08069B8A - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ands r0, r1 cmp r0, 0 @@ -750,7 +750,7 @@ _08069B84: adds r0, r5, r0 asrs r5, r0, 1 _08069B8A: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -880,7 +880,7 @@ _08069C76: ldrb r1, [r4] cmp r1, 0x1 bne _08069CCA - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ands r0, r1 cmp r0, 0 @@ -902,7 +902,7 @@ _08069CC4: adds r0, r5, r0 asrs r5, r0, 1 _08069CCA: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 diff --git a/asm/contest.s b/asm/contest.s index 9c00bdc64..66da30fc3 100644 --- a/asm/contest.s +++ b/asm/contest.s @@ -1056,7 +1056,7 @@ _080D8004: strb r3, [r1, 0x2] movs r2, 0x2 strb r2, [r1, 0x3] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags str r4, [r0] ldr r4, =gUnknown_0202420B strb r2, [r4] diff --git a/asm/contest_ai.s b/asm/contest_ai.s index d680894ac..f28492886 100644 --- a/asm/contest_ai.s +++ b/asm/contest_ai.s @@ -143,7 +143,7 @@ sub_81563B0: @ 81563B0 cmp r0, 0x2 beq _081564A0 adds r7, r5, 0 - ldr r6, =gUnknown_0203AB38 + ldr r6, =gAIScriptPtr ldr r0, =gUnknown_02039E1E mov r8, r0 _081563CC: @@ -295,7 +295,7 @@ sub_81564DC: @ 81564DC adds r1, r0, 0x5 ldrb r0, [r0, 0x4] adds r1, r0 - ldr r2, =gUnknown_0203AB38 + ldr r2, =gAIScriptPtr ldr r0, [r2] ldrb r0, [r0, 0x1] lsls r0, 24 @@ -337,7 +337,7 @@ sub_8156530: @ 8156530 ldr r0, [r0] ldrb r0, [r0, 0x1] strh r0, [r1, 0x18] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -354,7 +354,7 @@ sub_8156550: @ 8156550 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -389,7 +389,7 @@ sub_8156594: @ 8156594 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -424,7 +424,7 @@ sub_81565D8: @ 81565D8 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -459,7 +459,7 @@ sub_815661C: @ 815661C ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -495,7 +495,7 @@ sub_8156660: @ 8156660 lsls r0, 24 asrs r0, 24 strh r0, [r1, 0x18] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -512,7 +512,7 @@ sub_8156684: @ 8156684 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -547,7 +547,7 @@ sub_81566C8: @ 81566C8 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -582,7 +582,7 @@ sub_815670C: @ 815670C ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -617,7 +617,7 @@ sub_8156750: @ 8156750 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -655,7 +655,7 @@ sub_8156794: @ 8156794 adds r0, r1 ldrb r0, [r0] strh r0, [r2, 0x18] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -672,7 +672,7 @@ sub_81567BC: @ 81567BC ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -707,7 +707,7 @@ sub_8156800: @ 8156800 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -742,7 +742,7 @@ sub_8156844: @ 8156844 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -777,7 +777,7 @@ sub_8156888: @ 8156888 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -825,7 +825,7 @@ sub_81568CC: @ 81568CC lsls r0, 24 asrs r0, 24 strh r0, [r4, 0x18] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -844,7 +844,7 @@ sub_815690C: @ 815690C ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -879,7 +879,7 @@ sub_8156950: @ 8156950 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -914,7 +914,7 @@ sub_8156994: @ 8156994 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -949,7 +949,7 @@ sub_81569D8: @ 81569D8 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -990,7 +990,7 @@ sub_8156A1C: @ 8156A1C adds r0, r2 ldrh r0, [r0, 0x4] strh r0, [r3, 0x18] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -1005,7 +1005,7 @@ sub_8156A48: @ 8156A48 ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r2, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r1, [r3] ldrb r0, [r3, 0x1] @@ -1046,7 +1046,7 @@ sub_8156A98: @ 8156A98 ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r2, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r1, [r3] ldrb r0, [r3, 0x1] @@ -1087,7 +1087,7 @@ sub_8156AE8: @ 8156AE8 ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r2, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r1, [r3] ldrb r0, [r3, 0x1] @@ -1128,7 +1128,7 @@ sub_8156B38: @ 8156B38 ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r2, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r1, [r3] ldrb r0, [r3, 0x1] @@ -1175,7 +1175,7 @@ sub_8156B88: @ 8156B88 adds r0, r1 ldrh r0, [r0] strh r0, [r2, 0x18] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -1190,7 +1190,7 @@ sub_8156BB4: @ 8156BB4 ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r2, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r1, [r3] ldrb r0, [r3, 0x1] @@ -1231,7 +1231,7 @@ sub_8156C04: @ 8156C04 ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r2, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r1, [r3] ldrb r0, [r3, 0x1] @@ -1272,7 +1272,7 @@ sub_8156C54: @ 8156C54 ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r2, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r1, [r3] ldrb r0, [r3, 0x1] @@ -1313,7 +1313,7 @@ sub_8156CA4: @ 8156CA4 ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r2, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r1, [r3] ldrb r0, [r3, 0x1] @@ -1355,7 +1355,7 @@ sub_8156CF4: @ 8156CF4 ldr r0, =gUnknown_02039F2C ldrh r0, [r0] strh r0, [r1, 0x18] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -1372,7 +1372,7 @@ sub_8156D18: @ 8156D18 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -1407,7 +1407,7 @@ sub_8156D5C: @ 8156D5C ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -1455,7 +1455,7 @@ sub_8156DA0: @ 8156DA0 lsls r0, 24 asrs r0, 24 strh r0, [r1, 0x18] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -1472,7 +1472,7 @@ sub_8156DE4: @ 8156DE4 ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r0, [r0, 0xC] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] movs r4, 0x18 ldrsh r1, [r0, r4] @@ -1509,7 +1509,7 @@ sub_8156E2C: @ 8156E2C ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r0, [r0, 0xC] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] movs r4, 0x18 ldrsh r1, [r0, r4] @@ -1546,7 +1546,7 @@ sub_8156E74: @ 8156E74 ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r0, [r0, 0xC] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] movs r4, 0x18 ldrsh r1, [r0, r4] @@ -1583,7 +1583,7 @@ sub_8156EBC: @ 8156EBC ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r0, [r0, 0xC] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] movs r4, 0x18 ldrsh r1, [r0, r4] @@ -1634,7 +1634,7 @@ sub_8156F04: @ 8156F04 adds r0, r1 ldrb r0, [r0] strh r0, [r3, 0x18] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -1651,7 +1651,7 @@ sub_8156F44: @ 8156F44 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -1686,7 +1686,7 @@ sub_8156F88: @ 8156F88 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -1737,7 +1737,7 @@ sub_8156FCC: @ 8156FCC adds r0, r2 ldrb r0, [r0] strh r0, [r3, 0x18] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -1754,7 +1754,7 @@ sub_8157018: @ 8157018 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -1789,7 +1789,7 @@ sub_815705C: @ 815705C ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -1840,7 +1840,7 @@ sub_81570A0: @ 81570A0 adds r0, r3 ldrb r7, [r0, 0x1] movs r6, 0 - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr mov r12, r0 adds r1, r2 _081570D4: @@ -1894,7 +1894,7 @@ sub_815712C: @ 815712C ldrsh r0, [r0, r1] cmp r0, 0 beq _08157164 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -1910,7 +1910,7 @@ sub_815712C: @ 815712C b _0815716C .pool _08157164: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -1945,7 +1945,7 @@ sub_8157174: @ 8157174 adds r0, r3 ldrb r7, [r0, 0x2] movs r6, 0 - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr mov r12, r0 adds r1, r2 _081571A8: @@ -1999,7 +1999,7 @@ sub_8157200: @ 8157200 ldrsh r0, [r0, r1] cmp r0, 0 beq _08157238 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] @@ -2015,7 +2015,7 @@ sub_8157200: @ 8157200 b _08157240 .pool _08157238: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x5 str r0, [r1] @@ -2055,7 +2055,7 @@ sub_8157248: @ 8157248 lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x18] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -2074,7 +2074,7 @@ sub_81572A4: @ 81572A4 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -2109,7 +2109,7 @@ sub_81572E8: @ 81572E8 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -2144,7 +2144,7 @@ sub_815732C: @ 815732C ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -2179,7 +2179,7 @@ sub_8157370: @ 8157370 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -2235,7 +2235,7 @@ sub_81573B4: @ 81573B4 lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x18] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -2254,7 +2254,7 @@ sub_8157410: @ 8157410 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -2289,7 +2289,7 @@ sub_8157454: @ 8157454 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -2324,7 +2324,7 @@ sub_8157498: @ 8157498 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -2359,7 +2359,7 @@ sub_81574DC: @ 81574DC ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -2421,7 +2421,7 @@ _08157560: ldr r0, [r5] ldr r0, [r0, 0xC] strh r1, [r0, 0x18] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -2440,7 +2440,7 @@ sub_8157578: @ 8157578 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -2475,7 +2475,7 @@ sub_81575BC: @ 81575BC ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -2510,7 +2510,7 @@ sub_8157600: @ 8157600 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -2545,7 +2545,7 @@ sub_8157644: @ 8157644 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -2623,7 +2623,7 @@ _081576DE: ldr r0, [r0] ldr r0, [r0, 0xC] strh r3, [r0, 0x18] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -2644,7 +2644,7 @@ sub_8157700: @ 8157700 ldrsh r0, [r0, r1] cmp r0, 0 beq _08157738 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -2660,7 +2660,7 @@ sub_8157700: @ 8157700 b _08157740 .pool _08157738: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -2681,7 +2681,7 @@ sub_8157748: @ 8157748 ldrsh r0, [r0, r1] cmp r0, 0 bne _08157780 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -2697,7 +2697,7 @@ sub_8157748: @ 8157748 b _08157788 .pool _08157780: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -2758,7 +2758,7 @@ _081577E4: ldr r0, [r0] ldr r0, [r0, 0xC] strh r3, [r0, 0x18] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -2779,7 +2779,7 @@ sub_8157808: @ 8157808 ldrsh r0, [r0, r1] cmp r0, 0 beq _08157840 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -2795,7 +2795,7 @@ sub_8157808: @ 8157808 b _08157848 .pool _08157840: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -2816,7 +2816,7 @@ sub_8157850: @ 8157850 ldrsh r0, [r0, r1] cmp r0, 0 bne _08157888 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -2832,7 +2832,7 @@ sub_8157850: @ 8157850 b _08157890 .pool _08157888: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -2879,7 +2879,7 @@ _081578D6: ldr r0, [r6] ldr r0, [r0, 0xC] strh r5, [r0, 0x18] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -2900,7 +2900,7 @@ sub_81578F8: @ 81578F8 ldrsh r0, [r0, r1] cmp r0, 0 beq _08157930 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -2916,7 +2916,7 @@ sub_81578F8: @ 81578F8 b _08157938 .pool _08157930: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -2937,7 +2937,7 @@ sub_8157940: @ 8157940 ldrsh r0, [r0, r1] cmp r0, 0 bne _08157978 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -2953,7 +2953,7 @@ sub_8157940: @ 8157940 b _08157980 .pool _08157978: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -2966,7 +2966,7 @@ _08157980: thumb_func_start sub_8157988 sub_8157988: @ 8157988 push {r4,r5,lr} - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r0, [r4] ldrb r0, [r0, 0x1] bl sub_81564AC @@ -3005,7 +3005,7 @@ sub_81579CC: @ 81579CC ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -3040,7 +3040,7 @@ sub_8157A10: @ 8157A10 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -3075,7 +3075,7 @@ sub_8157A54: @ 8157A54 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -3110,7 +3110,7 @@ sub_8157A98: @ 8157A98 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -3140,7 +3140,7 @@ _08157AD8: sub_8157ADC: @ 8157ADC push {r4-r6,lr} movs r6, 0 - ldr r5, =gUnknown_0203AB38 + ldr r5, =gAIScriptPtr ldr r0, [r5] ldrb r0, [r0, 0x1] bl sub_81564AC @@ -3189,7 +3189,7 @@ sub_8157B38: @ 8157B38 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -3224,7 +3224,7 @@ sub_8157B7C: @ 8157B7C ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -3259,7 +3259,7 @@ sub_8157BC0: @ 8157BC0 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -3294,7 +3294,7 @@ sub_8157C04: @ 8157C04 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -3323,7 +3323,7 @@ _08157C44: thumb_func_start sub_8157C48 sub_8157C48: @ 8157C48 push {lr} - ldr r0, =gUnknown_0203AB38 + ldr r0, =gAIScriptPtr ldr r0, [r0] ldrb r0, [r0, 0x1] bl sub_81564AC @@ -3346,7 +3346,7 @@ _08157C74: movs r0, 0x1 _08157C7C: strh r0, [r1, 0x18] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x2 str r0, [r1] @@ -3366,7 +3366,7 @@ sub_8157C94: @ 8157C94 ldrsh r0, [r0, r1] cmp r0, 0 beq _08157CCC - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -3382,7 +3382,7 @@ sub_8157C94: @ 8157C94 b _08157CD4 .pool _08157CCC: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -3403,7 +3403,7 @@ sub_8157CDC: @ 8157CDC ldrsh r0, [r0, r1] cmp r0, 0 bne _08157D14 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -3419,7 +3419,7 @@ sub_8157CDC: @ 8157CDC b _08157D1C .pool _08157D14: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -3432,7 +3432,7 @@ _08157D1C: thumb_func_start sub_8157D24 sub_8157D24: @ 8157D24 push {r4,lr} - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r0, [r4] ldrb r0, [r0, 0x1] bl sub_81564AC @@ -3470,7 +3470,7 @@ sub_8157D60: @ 8157D60 ldrsh r0, [r0, r1] cmp r0, 0 beq _08157D98 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -3486,7 +3486,7 @@ sub_8157D60: @ 8157D60 b _08157DA0 .pool _08157D98: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -3507,7 +3507,7 @@ sub_8157DA8: @ 8157DA8 ldrsh r0, [r0, r1] cmp r0, 0 bne _08157DE0 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -3523,7 +3523,7 @@ sub_8157DA8: @ 8157DA8 b _08157DE8 .pool _08157DE0: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -3536,7 +3536,7 @@ _08157DE8: thumb_func_start sub_8157DF0 sub_8157DF0: @ 8157DF0 push {r4,r5,lr} - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r0, [r4] ldrb r0, [r0, 0x1] bl sub_81564AC @@ -3581,7 +3581,7 @@ sub_8157E3C: @ 8157E3C ldrsh r0, [r0, r1] cmp r0, 0 bge _08157E74 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -3597,7 +3597,7 @@ sub_8157E3C: @ 8157E3C b _08157E7C .pool _08157E74: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -3618,7 +3618,7 @@ sub_8157E84: @ 8157E84 ldrsh r0, [r0, r1] cmp r0, 0 ble _08157EBC - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -3634,7 +3634,7 @@ sub_8157E84: @ 8157E84 b _08157EC4 .pool _08157EBC: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -3655,7 +3655,7 @@ sub_8157ECC: @ 8157ECC ldrsh r0, [r0, r1] cmp r0, 0 bne _08157F04 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -3671,7 +3671,7 @@ sub_8157ECC: @ 8157ECC b _08157F0C .pool _08157F04: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -3692,7 +3692,7 @@ sub_8157F14: @ 8157F14 ldrsh r0, [r0, r1] cmp r0, 0 beq _08157F4C - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -3708,7 +3708,7 @@ sub_8157F14: @ 8157F14 b _08157F54 .pool _08157F4C: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -3721,7 +3721,7 @@ _08157F54: thumb_func_start sub_8157F5C sub_8157F5C: @ 8157F5C push {r4,lr} - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r0, [r4] ldrb r0, [r0, 0x1] bl sub_81564AC @@ -3761,7 +3761,7 @@ sub_8157FA0: @ 8157FA0 ldrsh r0, [r0, r1] cmp r0, 0 bge _08157FD8 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -3777,7 +3777,7 @@ sub_8157FA0: @ 8157FA0 b _08157FE0 .pool _08157FD8: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -3798,7 +3798,7 @@ sub_8157FE8: @ 8157FE8 ldrsh r0, [r0, r1] cmp r0, 0 ble _08158020 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -3814,7 +3814,7 @@ sub_8157FE8: @ 8157FE8 b _08158028 .pool _08158020: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -3835,7 +3835,7 @@ sub_8158030: @ 8158030 ldrsh r0, [r0, r1] cmp r0, 0 bne _08158068 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -3851,7 +3851,7 @@ sub_8158030: @ 8158030 b _08158070 .pool _08158068: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -3872,7 +3872,7 @@ sub_8158078: @ 8158078 ldrsh r0, [r0, r1] cmp r0, 0 beq _081580B0 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -3888,7 +3888,7 @@ sub_8158078: @ 8158078 b _081580B8 .pool _081580B0: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -3901,7 +3901,7 @@ _081580B8: thumb_func_start sub_81580C0 sub_81580C0: @ 81580C0 push {r4,r5,lr} - ldr r5, =gUnknown_0203AB38 + ldr r5, =gAIScriptPtr ldr r0, [r5] ldrb r0, [r0, 0x1] bl sub_81564AC @@ -3940,7 +3940,7 @@ sub_8158108: @ 8158108 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -3975,7 +3975,7 @@ sub_815814C: @ 815814C ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -4010,7 +4010,7 @@ sub_8158190: @ 8158190 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -4045,7 +4045,7 @@ sub_81581D4: @ 81581D4 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -4074,7 +4074,7 @@ _08158214: thumb_func_start sub_8158218 sub_8158218: @ 8158218 push {r4,r5,lr} - ldr r5, =gUnknown_0203AB38 + ldr r5, =gAIScriptPtr ldr r0, [r5] ldrb r0, [r0, 0x1] bl sub_81564AC @@ -4110,7 +4110,7 @@ sub_8158254: @ 8158254 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -4145,7 +4145,7 @@ sub_8158298: @ 8158298 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -4180,7 +4180,7 @@ sub_81582DC: @ 81582DC ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -4215,7 +4215,7 @@ sub_8158320: @ 8158320 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -4244,7 +4244,7 @@ _08158360: thumb_func_start sub_8158364 sub_8158364: @ 8158364 push {r4,r5,lr} - ldr r5, =gUnknown_0203AB38 + ldr r5, =gAIScriptPtr ldr r0, [r5] ldrb r0, [r0, 0x1] bl sub_81564AC @@ -4287,7 +4287,7 @@ sub_81583B8: @ 81583B8 ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -4322,7 +4322,7 @@ sub_81583FC: @ 81583FC ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] cmp r0, r1 @@ -4354,7 +4354,7 @@ sub_8158440: @ 8158440 ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r3, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r2, [r4] ldrb r0, [r2, 0x1] lsls r0, 1 @@ -4377,7 +4377,7 @@ sub_815846C: @ 815846C ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r3, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r2, [r4] ldrb r0, [r2, 0x1] lsls r0, 1 @@ -4402,7 +4402,7 @@ sub_815849C: @ 815849C ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r2, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r0, [r3, 0x1] lsls r0, 1 @@ -4430,7 +4430,7 @@ sub_81584D4: @ 81584D4 ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r2, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r1, [r3, 0x1] lsls r1, 1 @@ -4457,7 +4457,7 @@ sub_8158508: @ 8158508 ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r2, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r1, [r3, 0x1] lsls r1, 1 @@ -4484,7 +4484,7 @@ sub_815853C: @ 815853C ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r1, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r0, [r3, 0x1] lsls r0, 1 @@ -4527,7 +4527,7 @@ sub_815858C: @ 815858C ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r1, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r0, [r3, 0x1] lsls r0, 1 @@ -4570,7 +4570,7 @@ sub_81585DC: @ 81585DC ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r1, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r0, [r3, 0x1] lsls r0, 1 @@ -4613,7 +4613,7 @@ sub_815862C: @ 815862C ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r1, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r0, [r3, 0x1] lsls r0, 1 @@ -4656,7 +4656,7 @@ sub_815867C: @ 815867C ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r2, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r1, [r3, 0x1] lsls r1, 1 @@ -4699,7 +4699,7 @@ sub_81586D0: @ 81586D0 ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r2, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r1, [r3, 0x1] lsls r1, 1 @@ -4742,7 +4742,7 @@ sub_8158724: @ 8158724 ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r2, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r1, [r3, 0x1] lsls r1, 1 @@ -4785,7 +4785,7 @@ sub_8158778: @ 8158778 ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r2, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r1, [r3, 0x1] lsls r1, 1 @@ -4831,7 +4831,7 @@ sub_81587CC: @ 81587CC ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r1, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r0, [r3, 0x1] lsls r0, 1 @@ -4872,7 +4872,7 @@ sub_815881C: @ 815881C ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r1, [r0, 0xC] - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r3, [r4] ldrb r0, [r3, 0x1] lsls r0, 1 @@ -4906,7 +4906,7 @@ _08158864: thumb_func_start sub_815886C sub_815886C: @ 815886C - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] @@ -4926,7 +4926,7 @@ sub_815886C: @ 815886C thumb_func_start dp15_call dp15_call: @ 815888C push {r4,lr} - ldr r4, =gUnknown_0203AB38 + ldr r4, =gAIScriptPtr ldr r0, [r4] adds r0, 0x5 bl sub_81588E0 @@ -5007,7 +5007,7 @@ sub_8158908: @ 8158908 _08158924: subs r0, 0x1 strb r0, [r1] - ldr r2, =gUnknown_0203AB38 + ldr r2, =gAIScriptPtr ldr r0, [r3] ldr r1, [r0, 0xC] adds r0, r1, 0 @@ -5061,7 +5061,7 @@ _08158986: ldr r0, [r0] ldr r0, [r0, 0xC] strh r5, [r0, 0x18] - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x1 str r0, [r1] @@ -5082,7 +5082,7 @@ sub_81589A4: @ 81589A4 ldrsh r0, [r0, r1] cmp r0, 0 beq _081589DC - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -5098,7 +5098,7 @@ sub_81589A4: @ 81589A4 b _081589E4 .pool _081589DC: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -5119,7 +5119,7 @@ sub_81589EC: @ 81589EC ldrsh r0, [r0, r1] cmp r0, 0 bne _08158A24 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -5135,7 +5135,7 @@ sub_81589EC: @ 81589EC b _08158A2C .pool _08158A24: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -5149,7 +5149,7 @@ _08158A2C: sub_8158A34: @ 8158A34 push {r4-r6,lr} movs r6, 0 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r0, [r3] ldrb r5, [r0, 0x1] ldrb r0, [r0, 0x2] @@ -5212,7 +5212,7 @@ sub_8158AA0: @ 8158AA0 ldrsh r0, [r0, r1] cmp r0, 0 beq _08158AD8 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -5228,7 +5228,7 @@ sub_8158AA0: @ 8158AA0 b _08158AE0 .pool _08158AD8: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] @@ -5249,7 +5249,7 @@ sub_8158AE8: @ 8158AE8 ldrsh r0, [r0, r1] cmp r0, 0 bne _08158B20 - ldr r3, =gUnknown_0203AB38 + ldr r3, =gAIScriptPtr ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] @@ -5265,7 +5265,7 @@ sub_8158AE8: @ 8158AE8 b _08158B28 .pool _08158B20: - ldr r1, =gUnknown_0203AB38 + ldr r1, =gAIScriptPtr ldr r0, [r1] adds r0, 0x4 str r0, [r1] diff --git a/asm/item_use.s b/asm/item_use.s index d3f7e3565..e612f1cbb 100644 --- a/asm/item_use.s +++ b/asm/item_use.s @@ -2618,7 +2618,7 @@ ItemUseInBattle_Escape: @ 80FE5E4 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x8 ands r0, r1 diff --git a/asm/link.s b/asm/link.s index 66aad0f34..d96bc6377 100644 --- a/asm/link.s +++ b/asm/link.s @@ -3065,7 +3065,7 @@ _0800ACCA: _0800ACD0: cmp r3, r2 bne _0800ACF4 - ldr r2, =gUnknown_02022FEC + ldr r2, =gBattleTypeFlags ldr r0, [r2] movs r1, 0x21 negs r1, r1 @@ -3169,7 +3169,7 @@ _0800ADAE: _0800ADB6: cmp r1, r3 bne _0800ADDA - ldr r2, =gUnknown_02022FEC + ldr r2, =gBattleTypeFlags ldr r0, [r2] movs r1, 0x21 negs r1, r1 @@ -13509,7 +13509,7 @@ _080101E6: ble _080101DC cmp r2, r5 bne _08010220 - ldr r2, =gUnknown_02022FEC + ldr r2, =gBattleTypeFlags ldr r0, [r2] movs r1, 0x21 negs r1, r1 @@ -21074,7 +21074,7 @@ sub_8014210: @ 8014210 ldr r1, =gUnknown_030022C0 ldr r0, =sub_80B360C str r0, [r1, 0x8] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags str r6, [r0] bl sub_806E64C pop {r4-r6} diff --git a/asm/main.s b/asm/main.s index 6c07103d1..e7be46910 100644 --- a/asm/main.s +++ b/asm/main.s @@ -489,7 +489,7 @@ _08000782: ands r0, r1 cmp r0, 0 beq _080007BA - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x013f0102 ands r0, r1 diff --git a/asm/pokemon_1.s b/asm/pokemon_1.s index fb16b623e..762762b88 100644 --- a/asm/pokemon_1.s +++ b/asm/pokemon_1.s @@ -1785,7 +1785,7 @@ _08068914: .4byte _08068A00 .4byte _08068990 _0806892C: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -1802,7 +1802,7 @@ _0806892C: b _080689B6 .pool _08068958: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -1825,7 +1825,7 @@ _08068958: b _080689CE .pool _08068990: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r2, [r0] movs r3, 0x2 adds r0, r2, 0 @@ -1889,7 +1889,7 @@ get_pokemon_data_3: @ 8068A10 push {r4-r6,lr} adds r5, r0, 0 adds r6, r1, 0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x20 ands r0, r1 @@ -2036,7 +2036,7 @@ _08068B34: thumb_func_start sub_8068B48 sub_8068B48: @ 8068B48 push {lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 18 @@ -2084,7 +2084,7 @@ _08068B78: thumb_func_start sub_8068BB0 sub_8068BB0: @ 8068BB0 push {lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 18 diff --git a/asm/pokemon_2.s b/asm/pokemon_2.s index 74560a1e2..8ceb1ee6b 100644 --- a/asm/pokemon_2.s +++ b/asm/pokemon_2.s @@ -28,7 +28,7 @@ _08069E0A: ldr r0, =gUnknown_02024064 ldrb r3, [r0] ldr r4, =gUnknown_02024210 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable _08069E14: cmp r5, r3 beq _08069E28 @@ -63,7 +63,7 @@ _08069E42: bne _08069E74 ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, r5, 2 adds r0, r2 ldr r0, [r0] @@ -95,7 +95,7 @@ _08069E8A: bne _08069EBC ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, r5, 2 adds r0, r2 ldr r0, [r0] @@ -124,7 +124,7 @@ sub_8069ED8: @ 8069ED8 lsrs r5, r0, 16 lsls r1, 24 lsrs r2, r1, 24 - ldr r4, =gUnknown_02022FEC + ldr r4, =gBattleTypeFlags ldr r0, [r4] ldr r1, =0x023f0902 ands r0, r1 @@ -176,7 +176,7 @@ sub_8069F34: @ 8069F34 ands r4, r0 eors r4, r1 adds r5, r4, 0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ands r0, r6 cmp r0, 0 @@ -205,7 +205,7 @@ _08069F7C: _08069F80: ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, r4, 2 adds r0, r2 ldr r0, [r0] @@ -1748,7 +1748,7 @@ _0806AB34: ldrh r5, [r2] adds r7, r1, 0 adds r2, r6, 0 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable _0806AB3E: ldrh r3, [r2] cmp r5, r3 @@ -3664,7 +3664,7 @@ battle_data_fill: @ 806B9FC movs r1, 0xB movs r2, 0 bl pokemon_getattr - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons mov r8, r1 movs r1, 0x58 ldr r2, [sp, 0x14] diff --git a/asm/pokemon_3.s b/asm/pokemon_3.s index 1ba5d25d5..e000d3427 100644 --- a/asm/pokemon_3.s +++ b/asm/pokemon_3.s @@ -272,7 +272,7 @@ _0806BF2C: ldr r0, [sp, 0x38] cmp r0, 0x4 beq _0806BF76 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 ldr r2, [sp, 0x38] muls r0, r2 @@ -295,7 +295,7 @@ _0806BF76: ands r0, r1 cmp r0, 0 beq _0806BFA4 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_02024064 ldrb r2, [r0] movs r0, 0x58 @@ -321,7 +321,7 @@ _0806BFA4: bne _0806BFB2 bl _0806CD4C _0806BFB2: - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons ldr r5, =gUnknown_02024064 ldrb r0, [r5] movs r4, 0x58 @@ -360,7 +360,7 @@ _0806BFFC: adds r6, r2, 0 cmp r3, 0 beq _0806C042 - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons ldr r5, =gUnknown_02024064 ldrb r0, [r5] movs r4, 0x58 @@ -394,7 +394,7 @@ _0806C042: bne _0806C050 bl _0806CD4C _0806C050: - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons ldr r5, =gUnknown_02024064 ldrb r0, [r5] movs r4, 0x58 @@ -431,7 +431,7 @@ _0806C08C: adds r6, r2, 0 cmp r3, 0 beq _0806C0D2 - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons ldr r5, =gUnknown_02024064 ldrb r0, [r5] movs r4, 0x58 @@ -465,7 +465,7 @@ _0806C0D2: bne _0806C0E0 bl _0806CD4C _0806C0E0: - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons ldr r5, =gUnknown_02024064 ldrb r0, [r5] movs r4, 0x58 @@ -591,7 +591,7 @@ _0806C1CA: ldr r1, [sp, 0x38] cmp r1, 0x4 beq _0806C202 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 ldr r3, [sp, 0x38] adds r2, r3, 0 @@ -692,7 +692,7 @@ _0806C2A8: bne _0806C2B2 bl _0806CD4C _0806C2B2: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 ldr r2, [sp, 0x38] muls r0, r2 @@ -965,7 +965,7 @@ _0806C4FC: cmp r3, 0x4 beq _0806C55C ldr r2, =gUnknown_02024210 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable lsls r0, r3, 2 adds r0, r1 ldr r1, [r0] @@ -988,7 +988,7 @@ _0806C4FC: .pool _0806C55C: ldr r3, =gUnknown_02024210 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r2, =gUnknown_02024064 ldrb r0, [r2] eors r0, r4 @@ -1123,7 +1123,7 @@ _0806C65E: ldr r2, [sp, 0x38] cmp r2, 0x4 beq _0806C6EC - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r2 adds r0, r1 @@ -1286,7 +1286,7 @@ _0806C7CC: ldr r2, [sp, 0x38] cmp r2, 0x4 beq _0806C82E - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons movs r0, 0x58 adds r3, r2, 0 muls r3, r0 @@ -1306,7 +1306,7 @@ _0806C7CC: adds r0, r1 ldrb r1, [r0, 0x18] lsrs r1, 4 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, r5, 2 adds r0, r2 ldr r0, [r0] @@ -1437,7 +1437,7 @@ _0806C914: ldr r2, [sp, 0x38] cmp r2, 0x4 beq _0806C978 - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons movs r0, 0x58 adds r3, r2, 0 muls r3, r0 @@ -1457,7 +1457,7 @@ _0806C914: adds r0, r1 ldrb r1, [r0, 0x18] lsrs r1, 4 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable ldr r5, [sp, 0x14] lsls r0, r5, 2 adds r0, r2 @@ -1996,7 +1996,7 @@ HealStatusConditions: @ 806CD6C beq _0806CDBE cmp r6, 0x4 beq _0806CDBE - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons movs r1, 0x58 muls r1, r6 adds r0, 0x4C @@ -3607,7 +3607,7 @@ _0806D9E0: _0806D9F0: cmp r5, 0x3 bne _0806DA20 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x8 ands r0, r1 @@ -3999,7 +3999,7 @@ _0806DCDA: bl pokemon_getattr cmp r0, 0 bne _0806DCDA - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable lsls r0, r5, 2 adds r0, r1 ldrb r1, [r0] @@ -4956,7 +4956,7 @@ _0806E41C: thumb_func_start song_id_for_battle song_id_for_battle: @ 806E42C push {lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x80 lsls r0, 5 @@ -5110,7 +5110,7 @@ _0806E5E0: lsls r0, 1 b _0806E646 _0806E5E6: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x003f0100 ands r0, r1 @@ -5692,7 +5692,7 @@ sub_806EA68: @ 806EA68 push {r4-r7,lr} mov r7, r8 push {r7} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x00302008 ands r0, r1 @@ -5871,7 +5871,7 @@ _0806EBEA: thumb_func_start sub_806EBF8 sub_806EBF8: @ 806EBF8 push {r4,lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 15 @@ -6000,7 +6000,7 @@ sub_806ECEC: @ 806ECEC ands r0, r1 cmp r0, 0 beq _0806ED30 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x02000002 ands r0, r1 @@ -6209,7 +6209,7 @@ sub_806EEB4: @ 806EEB4 ands r0, r1 cmp r0, 0 beq _0806EEE8 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x02000002 ands r0, r1 @@ -6527,7 +6527,7 @@ sub_806F104: @ 806F104 ands r0, r1 cmp r0, 0 beq _0806F122 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x003f0100 ands r0, r1 diff --git a/asm/rom3.s b/asm/rom3.s index 0e3a24a7c..240c5c546 100644 --- a/asm/rom3.s +++ b/asm/rom3.s @@ -8,7 +8,7 @@ thumb_func_start battle_wireless_setup_if_required_maybe battle_wireless_setup_if_required_maybe: @ 8032654 push {lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -78,8 +78,8 @@ _080326B8: bl sub_80A3934 bl sub_806E414 movs r0, 0xF - bl sub_81308C8 - ldr r0, =gUnknown_02022FEC + bl BattleAI_HandleItemUseBeforeAISetup + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x10 ands r0, r1 @@ -117,7 +117,7 @@ _08032728: thumb_func_start sub_8032768 sub_8032768: @ 8032768 push {r4,r5,lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -132,7 +132,7 @@ _08032784: movs r0, 0x2 bl sub_8184DA4 _0803278A: - ldr r4, =gUnknown_02022FEC + ldr r4, =gBattleTypeFlags ldr r0, [r4] movs r1, 0x80 lsls r1, 17 @@ -153,7 +153,7 @@ _080327B0: bl b_setup_bx _080327B4: bl sub_8033050 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -214,7 +214,7 @@ b_setup_bx: @ 8032824 mov r6, r9 mov r5, r8 push {r5-r7} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r3, [r0] movs r5, 0x80 lsls r5, 15 @@ -327,7 +327,7 @@ _08032934: ldr r2, =gUnknown_0202406C movs r7, 0x2 strb r7, [r2] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r3, [r0] movs r0, 0x80 lsls r0, 17 @@ -739,7 +739,7 @@ b_setup_bx_link: @ 8032CC0 mov r6, r9 mov r5, r8 push {r5-r7} - ldr r4, =gUnknown_02022FEC + ldr r4, =gBattleTypeFlags ldr r1, [r4] movs r5, 0x1 adds r3, r1, 0 @@ -1127,7 +1127,7 @@ sub_8033050: @ 8033050 mov r6, r9 mov r5, r8 push {r5-r7} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -1264,7 +1264,7 @@ _0803317A: bge _08033184 b _08033074 _08033184: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 8 @@ -1296,7 +1296,7 @@ dp01_prepare_buffer: @ 80331B8 adds r5, r3, 0 lsls r2, 16 lsrs r2, 16 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -1690,7 +1690,7 @@ _080334F6: b _08033640 .pool _08033504: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x80 lsls r0, 1 @@ -1861,7 +1861,7 @@ sub_8033648: @ 8033648 ldrb r0, [r0] cmp r0, 0 beq _08033738 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x20 ands r0, r1 @@ -1877,7 +1877,7 @@ _08033680: bl sub_800A550 lsls r0, 24 lsrs r0, 24 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r1, r4, 2 adds r1, r2 ldr r1, [r1] @@ -2041,7 +2041,7 @@ _080337CC: b _0803388A _080337D2: ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable lsls r0, r4, 2 adds r0, r1 ldr r1, [r2] @@ -2058,7 +2058,7 @@ _080337D2: bl memcpy adds r0, r4, 0 bl sub_803F850 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x4 ands r0, r1 @@ -2105,7 +2105,7 @@ _0803385C: _08033874: ldrb r2, [r3, 0x8] ldr r3, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable lsls r0, r4, 2 adds r0, r1 lsls r2, 2 @@ -2636,7 +2636,7 @@ dp01_build_cmdbuf_x10_TODO: @ 8033BE4 ldr r0, =gUnknown_02022F78 mov r8, r0 adds r2, 0x10 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons adds r4, r0, 0 adds r4, 0x20 _08033C6A: @@ -2735,7 +2735,7 @@ dp01_build_cmdbuf_x11_TODO: @ 8033CFC mov r8, r7 mov r4, r9 adds r4, 0x10 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons adds r2, r0, 0 adds r2, 0x20 _08033D5E: diff --git a/asm/rom5.s b/asm/rom5.s index 345cfe573..4d5788e28 100644 --- a/asm/rom5.s +++ b/asm/rom5.s @@ -376,7 +376,7 @@ _080A966C: bl sub_805E7DC b _080A96F4 _080A9676: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r2, 0x80 ands r1, r2 @@ -599,7 +599,7 @@ _080A9786: b _080A9A50 .pool _080A986C: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r2, 0x80 ands r1, r2 @@ -878,7 +878,7 @@ sub_80A9ADC: @ 80A9ADC bcc _080A9AEC b _080A9C5E _080A9AEC: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r2, 0x80 ands r1, r2 @@ -931,7 +931,7 @@ _080A9B24: b _080A9BB8 .pool _080A9B6C: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 ands r0, r1 @@ -1011,7 +1011,7 @@ _080A9BFC: b _080A9C5E .pool _080A9C34: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 ands r0, r1 diff --git a/asm/rom6.s b/asm/rom6.s index 042887b18..938c1d618 100644 --- a/asm/rom6.s +++ b/asm/rom6.s @@ -11559,7 +11559,7 @@ _0813B52E: sub_813B534: @ 813B534 push {lr} ldr r2, =gUnknown_0203AB70 - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r0, [r1] str r0, [r2] movs r0, 0 @@ -11829,7 +11829,7 @@ _0813B7A8: bne _0813B7B4 bl sub_800AC34 _0813B7B4: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, =gUnknown_0203AB70 ldr r1, [r1] str r1, [r0] diff --git a/asm/rom_8034C54.s b/asm/rom_8034C54.s index 71b69787b..3e4ceeaf8 100644 --- a/asm/rom_8034C54.s +++ b/asm/rom_8034C54.s @@ -1318,7 +1318,7 @@ trs_config: @ 8035658 movs r0, 0 movs r2, 0x4 bl InitBgsFromTemplates - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x80 lsls r0, 11 @@ -1398,7 +1398,7 @@ sub_803570C: @ 803570C movs r1, 0x50 movs r2, 0x20 bl decompress_palette - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 11 @@ -1427,7 +1427,7 @@ _0803575A: thumb_func_start load_battle_oval_graphics load_battle_oval_graphics: @ 8035770 push {r4,r5,lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] ldr r0, =0x023f0902 ands r0, r1 @@ -1715,7 +1715,7 @@ sub_8035AE4: @ 8035AE4 lsrs r4, 24 mov r9, r4 movs r4, 0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -1892,7 +1892,7 @@ sub_8035C4C: @ 8035C4C b _08035D68 .pool _08035C68: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -2037,7 +2037,7 @@ _08035DA4: _08035DAA: b _08036138 _08035DAC: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -2460,7 +2460,7 @@ _08036138: thumb_func_start sub_8036154 sub_8036154: @ 8036154 push {r4,r5,lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x2 ands r0, r1 @@ -2720,7 +2720,7 @@ _08036424: b _08036758 .pool _08036434: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] ldr r0, =0x023f0902 ands r0, r1 @@ -2820,7 +2820,7 @@ _0803651A: b _08036758 .pool _0803652C: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] ldr r0, =0x023f0902 ands r0, r1 @@ -2931,7 +2931,7 @@ _08036626: b _08036758 .pool _08036638: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] ldr r0, =0x023f0902 ands r0, r1 @@ -3070,7 +3070,7 @@ sub_8036760: @ 8036760 bl dp11_init bl init_uns_table_pokemon_copy bl sub_8185F84 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x40 ands r0, r1 @@ -3144,7 +3144,7 @@ sub_80367D4: @ 80367D4 ldr r0, =gUnknown_02022E24 movs r2, 0xF0 strh r2, [r0] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 15 @@ -3228,7 +3228,7 @@ _080368BE: bl sub_80B0BD0 ldr r2, =gUnknown_02022FF0 strb r0, [r2] - ldr r4, =gUnknown_02022FEC + ldr r4, =gBattleTypeFlags ldr r0, [r4] movs r1, 0x80 lsls r1, 17 @@ -3280,7 +3280,7 @@ _080369A8: ldr r0, =sub_8036FAC bl SetMainCallback2 _080369AE: - ldr r5, =gUnknown_02022FEC + ldr r5, =gBattleTypeFlags ldr r0, [r5] ldr r1, =0x01000002 ands r0, r1 @@ -3561,7 +3561,7 @@ berry_801017C: @ 8036C08 mov r6, r9 mov r5, r8 push {r5-r7} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x2 ands r0, r1 @@ -3912,13 +3912,13 @@ sub_8036EB8: @ 8036EB8 bne _08036EFC cmp r3, 0 bne _08036EEC - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r2, 0xC b _08036EF2 .pool _08036EEC: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r2, 0x8 _08036EF2: @@ -3952,13 +3952,13 @@ _08036F20: bne _08036F48 cmp r3, 0 bne _08036F38 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r2, 0xC b _08036F3E .pool _08036F38: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r2, 0x8 _08036F3E: @@ -3971,7 +3971,7 @@ _08036F48: cmp r6, 0 bne _08036FA0 movs r2, 0 - ldr r5, =gUnknown_02022FEC + ldr r5, =gBattleTypeFlags cmp r2, r4 bge _08036F8A mov r0, r12 @@ -4101,7 +4101,7 @@ _08037072: b _0803744C .pool _08037080: - ldr r2, =gUnknown_02022FEC + ldr r2, =gBattleTypeFlags ldr r1, [r2] movs r6, 0x2 adds r0, r1, 0 @@ -4366,7 +4366,7 @@ _08037318: movs r0, 0 strb r0, [r2, 0x1] strb r0, [r2, 0x2] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -4426,7 +4426,7 @@ _080373A0: cmp r1, 0x3 bne _0803744C bl sub_800A5B4 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x4 ands r0, r1 @@ -4457,7 +4457,7 @@ _080373E0: str r0, [r1] ldr r0, =sub_8038420 bl SetMainCallback2 - ldr r2, =gUnknown_02022FEC + ldr r2, =gBattleTypeFlags ldr r1, [r2] movs r0, 0x2 ands r0, r1 @@ -4565,7 +4565,7 @@ _0803750C: beq _08037518 bl sub_800E0E8 _08037518: - ldr r2, =gUnknown_02022FEC + ldr r2, =gBattleTypeFlags ldr r1, [r2] movs r3, 0x2 adds r0, r1, 0 @@ -4987,7 +4987,7 @@ _08037908: movs r0, 0 strb r0, [r2, 0x1] strb r0, [r2, 0x2] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -5021,7 +5021,7 @@ _0803795C: cmp r1, 0x3 bne _080379D6 bl sub_800A5B4 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x4 ands r0, r1 @@ -5057,7 +5057,7 @@ _080379A0: str r0, [r1] ldr r0, =sub_8038420 bl SetMainCallback2 - ldr r2, =gUnknown_02022FEC + ldr r2, =gBattleTypeFlags ldr r1, [r2] movs r0, 0x2 ands r0, r1 @@ -5186,7 +5186,7 @@ sub_8037ADC: @ 8037ADC movs r0, 0x4 mov r9, r0 movs r4, 0xF - ldr r6, =gUnknown_02022FEC + ldr r6, =gBattleTypeFlags ldr r0, [r6] movs r1, 0x80 lsls r1, 1 @@ -5342,7 +5342,7 @@ _08037C2E: ldr r0, [r1, 0x8] ldr r2, [sp] str r0, [r2] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] mov r2, r10 str r0, [r2] @@ -5467,7 +5467,7 @@ _08037D64: ldr r0, [r1, 0x8] mov r2, r8 str r0, [r2] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] str r0, [r7] ldr r0, =intro_end @@ -5486,7 +5486,7 @@ _08037DA4: bne _08037DD6 movs r0, 0x2 strb r0, [r5] - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r0, [r7] str r0, [r1] ldr r1, =gUnknown_030022C0 @@ -5576,7 +5576,7 @@ _08037E9A: b _080383F8 .pool _08037EA8: - ldr r2, =gUnknown_02022FEC + ldr r2, =gBattleTypeFlags ldr r1, [r2] movs r0, 0x2 ands r0, r1 @@ -6074,7 +6074,7 @@ _080382CC: movs r0, 0 strb r0, [r3, 0x1] strb r0, [r3, 0x2] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -6123,7 +6123,7 @@ _0803832C: movs r0, 0xC0 lsls r0, 1 adds r4, r0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] str r0, [r4] ldr r0, =gUnknown_0203BD2C @@ -6188,7 +6188,7 @@ _080383BC: str r0, [r1] ldr r0, =sub_8038420 bl SetMainCallback2 - ldr r3, =gUnknown_02022FEC + ldr r3, =gBattleTypeFlags ldr r2, [r3] movs r0, 0x2 ands r0, r2 @@ -6227,7 +6227,7 @@ sub_8038420: @ 8038420 ands r0, r1 cmp r0, 0 beq _08038482 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -6439,7 +6439,7 @@ LoadTrainerParty: @ 80385E8 movs r0, 0 b _080389E2 _08038610: - ldr r4, =gUnknown_02022FEC + ldr r4, =gBattleTypeFlags ldr r0, [r4] ldr r1, =0x043f0908 ands r0, r1 @@ -6910,7 +6910,7 @@ _080389B4: bge _080389BC b _08038688 _080389BC: - ldr r2, =gUnknown_02022FEC + ldr r2, =gBattleTypeFlags ldr r1, =gTrainers ldr r3, [sp, 0x20] ldr r4, [sp, 0x14] @@ -6965,7 +6965,7 @@ _08038A1E: thumb_func_start vblank_cb_08078BB4 vblank_cb_08078BB4: @ 8038A28 push {lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x013f0102 ands r0, r1 @@ -7127,7 +7127,7 @@ sub_8038B94: @ 8038B94 ldr r0, =gUnknown_02024474 adds r0, 0x25 ldrb r2, [r0] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -7345,7 +7345,7 @@ sub_8038D64: @ 8038D64 bl SetHBlankCallback movs r0, 0 bl SetVBlankCallback - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r2, 0x21 negs r2, r2 @@ -7581,7 +7581,7 @@ _08038FD0: ands r0, r3 orrs r0, r1 strb r0, [r2] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -8893,7 +8893,7 @@ sub_8039B58: @ 8039B58 ands r0, r1 cmp r0, 0 beq _08039B80 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x02000002 ands r0, r1 @@ -9502,7 +9502,7 @@ _0803A004: ldr r2, =gUnknown_02024280 movs r0, 0 str r0, [r2] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x80 lsls r0, 17 @@ -9773,7 +9773,7 @@ sub_803A284: @ 803A284 movs r5, 0 mov r6, r9 movs r4, 0x58 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons adds r2, 0x18 movs r1, 0x6 _0803A2D4: @@ -9855,7 +9855,7 @@ _0803A35C: movs r0, 0x58 adds r2, r1, 0 muls r2, r0 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons adds r0, 0x50 adds r2, r0 ldr r0, [r2] @@ -9925,7 +9925,7 @@ _0803A414: ldrb r1, [r0] movs r0, 0x58 muls r0, r1 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons adds r1, 0x50 adds r0, r1 movs r1, 0 @@ -9946,7 +9946,7 @@ _0803A430: cmp r5, r7 bge _0803A490 ldr r3, =gUnknown_020240D4 - ldr r7, =gUnknown_0832A328 + ldr r7, =gBitTable ldr r6, =gUnknown_02024064 _0803A448: movs r0, 0x58 @@ -10203,7 +10203,7 @@ _0803A540: adds r1, 0x92 ldrb r0, [r7] lsls r0, 2 - ldr r6, =gUnknown_0832A328 + ldr r6, =gBitTable adds r0, r6 ldr r2, [r0] ldrb r0, [r1] @@ -10321,7 +10321,7 @@ sub_803A75C: @ 803A75C push {r5-r7} sub sp, 0x4 movs r5, 0 - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons ldr r0, =gUnknown_020242AC mov r8, r0 ldr r1, =gUnknown_0202449C @@ -10366,7 +10366,7 @@ _0803A788: bge _0803A830 adds r3, r2, 0 movs r4, 0 - ldr r0, =gUnknown_0832A328 + ldr r0, =gBitTable mov r8, r0 _0803A7C6: ldr r1, [r3] @@ -10727,7 +10727,7 @@ _0803A852: adds r1, 0x92 ldrb r0, [r6] lsls r0, 2 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable adds r0, r2 ldr r2, [r0] ldrb r0, [r1] @@ -10798,7 +10798,7 @@ _0803AB02: adds r1, r0 movs r0, 0 str r0, [r1] - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons ldrb r0, [r2] movs r3, 0x58 adds r2, r0, 0 @@ -10949,14 +10949,14 @@ _0803AC98: b _0803AF48 _0803ACA6: movs r7, 0x58 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons mov r8, r0 mov r9, r2 movs r1, 0x48 add r1, r8 mov r10, r1 _0803ACB4: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 ands r0, r1 @@ -11098,7 +11098,7 @@ _0803ADCA: ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution _0803ADE4: - ldr r5, =gUnknown_02022FEC + ldr r5, =gBattleTypeFlags ldr r0, [r5] movs r1, 0x8 ands r0, r1 @@ -11186,7 +11186,7 @@ _0803AE96: ldr r1, =gUnknown_03005D10 strh r0, [r1, 0x20] _0803AEC0: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -11211,7 +11211,7 @@ _0803AEEA: ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution _0803AEF6: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 8 @@ -11230,7 +11230,7 @@ _0803AEF6: ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution _0803AF20: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 11 @@ -11277,7 +11277,7 @@ bc_801333C: @ 803AF80 beq _0803AF92 b _0803B10C _0803AF92: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x8 ands r0, r1 @@ -11501,7 +11501,7 @@ sub_803B180: @ 803B180 ldr r0, [r0] cmp r0, 0 bne _0803B1D0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r2, [r0] movs r0, 0x80 lsls r0, 17 @@ -11542,7 +11542,7 @@ _0803B1D0: thumb_func_start sub_803B1DC sub_803B1DC: @ 803B1DC push {r4,r5,lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x80 lsls r0, 17 @@ -11602,7 +11602,7 @@ _0803B23A: thumb_func_start sub_803B25C sub_803B25C: @ 803B25C push {r4-r6,lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r2, [r0] movs r0, 0x80 lsls r0, 17 @@ -11653,7 +11653,7 @@ _0803B2B2: bl dp01_build_cmdbuf_x2F_2F_2F_2F ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x00008040 ands r0, r1 @@ -11696,7 +11696,7 @@ bc_801362C: @ 803B314 cmp r1, r0 bcs _0803B37E adds r4, r2, 0 - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons movs r5, 0x58 adds r7, r6, 0 adds r7, 0x48 @@ -11707,7 +11707,7 @@ _0803B334: lsrs r0, 24 cmp r0, 0x1 bne _0803B36C - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x063f0902 ands r0, r1 @@ -11770,7 +11770,7 @@ sub_803B3CC: @ 803B3CC ldr r0, [r0] cmp r0, 0 bne _0803B418 - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r2, [r1] movs r0, 0x80 lsls r0, 17 @@ -11813,7 +11813,7 @@ _0803B418: thumb_func_start sub_803B42C sub_803B42C: @ 803B42C push {r4,r5,lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x80 lsls r0, 17 @@ -11886,7 +11886,7 @@ _0803B48A: thumb_func_start sub_803B4C8 sub_803B4C8: @ 803B4C8 push {r4-r6,lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x80 lsls r0, 17 @@ -11934,7 +11934,7 @@ _0803B51A: bl dp01_build_cmdbuf_x2F_2F_2F_2F ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -12314,7 +12314,7 @@ _0803B834: ldrb r0, [r3] cmp r5, r0 bge _0803B866 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons movs r4, 0x9 negs r4, r4 adds r1, r0, 0 @@ -12354,7 +12354,7 @@ _0803B866: bl Random ldr r1, =gUnknown_02024330 strh r0, [r1] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 11 @@ -12399,7 +12399,7 @@ _0803B91C: ldrb r3, [r3] cmp r4, r3 bge _0803B96E - ldr r5, =gUnknown_02024084 + ldr r5, =gBattleMons adds r6, r5, 0 adds r6, 0x4C _0803B932: @@ -12609,7 +12609,7 @@ _0803BAE6: bl Random ldr r1, =gUnknown_02024330 strh r0, [r1] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x80 lsls r0, 10 @@ -12648,7 +12648,7 @@ _0803BB78: sub_803BB88: @ 803BB88 push {r4-r7,lr} sub sp, 0x4 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_02024064 ldrb r2, [r0] movs r0, 0x58 @@ -12679,7 +12679,7 @@ _0803BBC2: bne _0803BBD0 b _0803BD4C _0803BBD0: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -12687,7 +12687,7 @@ _0803BBD0: beq _0803BBDE b _0803BD4C _0803BBDE: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r2, [r3] movs r0, 0x58 muls r0, r2 @@ -12716,7 +12716,7 @@ _0803BC08: lsrs r0, 24 cmp r6, r0 beq _0803BC2C - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r5 adds r0, r1 @@ -12733,7 +12733,7 @@ _0803BC2C: lsrs r0, 24 cmp r6, r0 beq _0803BC76 - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldr r0, =gUnknown_02024064 ldrb r0, [r0] movs r2, 0x58 @@ -12785,7 +12785,7 @@ _0803BC86: lsrs r5, r0, 24 cmp r5, 0 beq _0803BCF8 - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons ldrb r0, [r4] movs r3, 0x58 muls r0, r3 @@ -12816,7 +12816,7 @@ _0803BCBE: b _0803BD90 .pool _0803BCF8: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_02024064 ldrb r2, [r0] movs r0, 0x58 @@ -12845,7 +12845,7 @@ _0803BD22: b _0803BD92 .pool _0803BD40: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x10 ands r0, r1 @@ -12934,7 +12934,7 @@ _0803BDBC: lsrs r1, 24 adds r0, r4, 0 bl sub_81B8FB0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -13056,7 +13056,7 @@ _0803BF0C: adds r1, 0x5C movs r0, 0x6 strb r0, [r1] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -13073,7 +13073,7 @@ _0803BF0C: ldr r1, [r4] adds r1, 0x91 ldrb r1, [r1] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, 24 lsrs r0, 22 adds r0, r2 @@ -13096,7 +13096,7 @@ _0803BF68: ldr r0, [r0] adds r0, 0x91 ldrb r3, [r0] - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r4, =gUnknown_02024064 ldrb r2, [r4] lsls r0, r2, 2 @@ -13109,7 +13109,7 @@ _0803BF68: adds r0, r2, r0 movs r1, 0xD strb r1, [r0] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -13131,7 +13131,7 @@ _0803BFBC: bl _0803CD04 .pool _0803BFD0: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r2 adds r1, 0x50 @@ -13169,7 +13169,7 @@ _0803C00C: .pool _0803C02C: ldr r3, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r6, =gUnknown_02024064 ldrb r5, [r6] lsls r0, r5, 2 @@ -13303,7 +13303,7 @@ _0803C134: .pool _0803C188: add r2, sp, 0x4 - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons movs r1, 0x58 adds r0, r4, 0 muls r0, r1 @@ -13372,7 +13372,7 @@ _0803C1CA: adds r4, 0x1 cmp r4, 0x3 ble _0803C1CA - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x1 ands r1, r0 @@ -13383,7 +13383,7 @@ _0803C1CA: b _0803C42E .pool _0803C230: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x021f0902 ands r0, r1 @@ -13414,7 +13414,7 @@ _0803C268: adds r0, r2 ldrh r0, [r0] strb r0, [r1] - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons ldrb r2, [r5] movs r6, 0x58 adds r0, r2, 0 @@ -13427,7 +13427,7 @@ _0803C268: ands r1, r0 cmp r1, 0 bne _0803C2B8 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 11 @@ -13509,7 +13509,7 @@ _0803C33C: lsrs r4, r0, 24 cmp r4, 0 beq _0803C3B0 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldrb r1, [r5] movs r0, 0x58 muls r0, r1 @@ -13682,7 +13682,7 @@ _0803C4B4: lsls r0, 24 lsrs r0, 24 bl battle_get_side_with_given_state - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons lsls r0, 24 lsrs r0, 24 movs r7, 0x58 @@ -13812,7 +13812,7 @@ _0803C616: b _0803C668 .pool _0803C628: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 10 @@ -13873,7 +13873,7 @@ _0803C6AE: b _0803CD70 .pool _0803C6C4: - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r2, [r1] movs r5, 0x8 adds r0, r2, 0 @@ -13979,7 +13979,7 @@ _0803C7C4: .pool _0803C7D8: ldr r4, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r3, =gUnknown_02024064 ldrb r5, [r3] lsls r0, r5, 2 @@ -14112,7 +14112,7 @@ _0803C8D0: b _0803CD70 .pool _0803C91C: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 10 @@ -14143,7 +14143,7 @@ _0803C942: ldrb r2, [r6] lsls r5, r2, 1 adds r5, r0 - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldr r4, [r4] adds r0, r2, r4 adds r0, 0x80 @@ -14287,7 +14287,7 @@ _0803CABC: .pool _0803CAD0: ldr r3, =gUnknown_02024068 - ldr r6, =gUnknown_0832A328 + ldr r6, =gBitTable ldr r0, =gUnknown_02024064 ldrb r0, [r0] lsls r0, 2 @@ -14314,7 +14314,7 @@ _0803CAFA: negs r1, r0 orrs r1, r0 lsrs r4, r1, 31 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x41 ands r0, r1 @@ -14369,7 +14369,7 @@ _0803CB74: .pool _0803CB84: ldr r3, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r0, =gUnknown_02024064 ldrb r0, [r0] lsls r0, 2 @@ -14416,7 +14416,7 @@ _0803CBC8: .pool _0803CBF4: ldr r3, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r0, =gUnknown_02024064 ldrb r4, [r0] lsls r0, r4, 2 @@ -14504,7 +14504,7 @@ _0803CCB4: ldr r4, [r0] str r4, [r7] ldr r3, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r0, [r5] lsls r0, 2 adds r0, r1 @@ -14559,7 +14559,7 @@ _0803CD1E: ldr r1, =gUnknown_03005D04 ldr r0, =sub_803D2E8 str r0, [r1] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 15 @@ -14659,7 +14659,7 @@ sub_803CDF8: @ 803CDF8 adds r1, r2 ldrb r1, [r1] bl sub_8184FBC - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x42 ands r0, r1 @@ -14815,7 +14815,7 @@ b_first_side: @ 803CF10 lsls r0, 24 cmp r0, 0 bne _0803CFD8 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 mov r2, r9 muls r2, r0 @@ -14851,7 +14851,7 @@ _0803CF9A: mov r1, r10 muls r1, r0 adds r0, r1, 0 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons adds r0, r2 adds r0, 0x20 ldrb r2, [r0] @@ -14881,7 +14881,7 @@ _0803CFD8: _0803CFDA: movs r7, 0x1 _0803CFDC: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 mov r2, r9 muls r2, r0 @@ -14924,7 +14924,7 @@ _0803D02C: lsls r0, 24 lsrs r5, r0, 24 _0803D040: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x023f0102 ands r0, r1 @@ -14954,7 +14954,7 @@ _0803D074: lsrs r2, 1 mov r8, r2 _0803D07E: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 mov r3, r9 muls r3, r0 @@ -14984,7 +14984,7 @@ _0803D09C: negs r1, r1 mov r8, r1 _0803D0B8: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 mov r2, r10 muls r2, r0 @@ -15028,7 +15028,7 @@ _0803D118: lsls r0, 24 lsrs r5, r0, 24 _0803D12C: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x023f0102 ands r0, r1 @@ -15054,7 +15054,7 @@ _0803D15C: bne _0803D162 lsrs r7, 1 _0803D162: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons movs r0, 0x58 mov r1, r10 muls r1, r0 @@ -15118,7 +15118,7 @@ _0803D1E0: muls r3, r1 adds r1, r3, 0 adds r0, r1 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons adds r1, 0xC adds r0, r1 ldrh r3, [r0] @@ -15154,7 +15154,7 @@ _0803D22C: muls r2, r1 adds r1, r2, 0 adds r0, r1 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons adds r1, 0xC adds r0, r1 ldrh r2, [r0] @@ -15249,7 +15249,7 @@ sub_803D2E8: @ 803D2E8 mov r5, r8 push {r5-r7} movs r3, 0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x80 ands r0, r1 @@ -15767,7 +15767,7 @@ _0803D71C: ldrh r0, [r0] cmp r0, r7 bne _0803D7A0 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r3 adds r1, 0x4C @@ -15912,7 +15912,7 @@ sub_803D8C0: @ 803D8C0 ldr r1, =gUnknown_02024083 movs r0, 0 strb r0, [r1] - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r2, [r1] ldr r0, =0x02000002 ands r0, r2 @@ -16084,7 +16084,7 @@ sub_803DAC0: @ 803DAC0 ldr r1, =gUnknown_02024083 movs r0, 0 strb r0, [r1] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] ldr r0, =0x02000002 ands r0, r1 @@ -16163,7 +16163,7 @@ sub_803DBA0: @ 803DBA0 ldr r1, =gUnknown_02024083 movs r0, 0 strb r0, [r1] - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r2, [r1] ldr r0, =0x003f0100 ands r0, r2 @@ -16285,7 +16285,7 @@ sub_803DCD8: @ 803DCD8 bls _0803DCEE b _0803DE10 _0803DCEE: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] ldr r0, =0x023f0b92 ands r1, r0 @@ -16368,7 +16368,7 @@ _0803DDA0: _0803DDB2: bl sub_80EC728 _0803DDB6: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x023f0b9a ands r0, r1 @@ -16447,7 +16447,7 @@ _0803DE80: str r0, [r1] _0803DE86: bl FreeAllWindowBuffers - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -16474,7 +16474,7 @@ _0803DEC0: movs r6, 0 _0803DEC2: ldrb r2, [r3] - ldr r0, =gUnknown_0832A328 + ldr r0, =gBitTable lsls r1, r6, 2 adds r1, r0 ldr r1, [r1] @@ -16547,7 +16547,7 @@ _0803DF5A: thumb_func_start c4_overworld c4_overworld: @ 803DF70 push {r4-r6,lr} - ldr r6, =gUnknown_02022FEC + ldr r6, =gBattleTypeFlags ldr r0, [r6] movs r5, 0x2 ands r0, r5 @@ -16708,7 +16708,7 @@ sub_803E0B8: @ 803E0B8 adds r0, r3, 0 adds r0, 0x91 ldrb r2, [r0] - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r0, [r6] lsls r0, 2 adds r0, r1 @@ -16781,7 +16781,7 @@ _0803E110: b _0803E316 .pool _0803E1BC: - ldr r5, =gUnknown_02024084 + ldr r5, =gBattleMons mov r10, r5 movs r0, 0x58 adds r5, r4, 0 @@ -16906,7 +16906,7 @@ _0803E268: b _0803E316 .pool _0803E2DC: - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons mov r5, r8 ldrb r0, [r5] lsls r0, 1 @@ -16945,7 +16945,7 @@ _0803E334: strh r3, [r0] strh r3, [r1] _0803E33C: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r1, =gUnknown_0202420B ldrb r3, [r1] movs r0, 0x58 @@ -17007,7 +17007,7 @@ _0803E384: lsls r0, 24 cmp r4, r0 beq _0803E400 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r2, [r5, 0x9] movs r0, 0x58 muls r0, r2 @@ -17020,7 +17020,7 @@ _0803E384: b _0803E76A .pool _0803E400: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -17055,7 +17055,7 @@ _0803E424: bne _0803E440 b _0803E630 _0803E440: - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldr r2, =gUnknown_0202420B ldrb r6, [r2] ldr r0, =gUnknown_0202449C @@ -17104,7 +17104,7 @@ _0803E480: ldrb r1, [r4] cmp r0, r1 beq _0803E4CE - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r2, [r4] movs r0, 0x58 muls r0, r2 @@ -17197,7 +17197,7 @@ _0803E568: _0803E578: ldr r7, =gUnknown_02024210 ldrb r0, [r7] - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable mov r8, r1 ldr r5, =gUnknown_0202420C ldrb r1, [r5] @@ -17244,7 +17244,7 @@ _0803E5E2: ldrb r0, [r0] strb r0, [r4] ldrb r0, [r4] - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons movs r1, 0x58 muls r1, r0 adds r1, r2 @@ -17267,7 +17267,7 @@ _0803E5E2: b _0803E76A .pool _0803E630: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r4, 0x1 ands r0, r4 @@ -17318,7 +17318,7 @@ _0803E696: strb r0, [r1] ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable ldr r5, =gUnknown_0202420C ldrb r0, [r5] lsls r0, 2 @@ -17351,7 +17351,7 @@ _0803E6E0: strb r0, [r5] ldr r6, =gUnknown_02024210 ldrb r1, [r6] - ldr r7, =gUnknown_0832A328 + ldr r7, =gBitTable ldrb r0, [r5] lsls r0, 2 adds r0, r7 @@ -17400,7 +17400,7 @@ _0803E758: bl battle_get_side_with_given_state strb r0, [r5] _0803E76A: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r2, 0x80 lsls r2, 10 @@ -17417,7 +17417,7 @@ _0803E76A: lsls r0, 27 cmp r0, 0 bge _0803E808 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r2 adds r0, r1 @@ -17830,7 +17830,7 @@ _0803EB8C: b _0803EBDE .pool _0803EBB0: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x1 ands r1, r0 @@ -17889,7 +17889,7 @@ sub_803EC20: @ 803EC20 lsls r0, 24 lsrs r5, r0, 24 movs r7, 0 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r5 adds r1, r0, r1 @@ -17915,7 +17915,7 @@ _0803EC5E: cmp r1, 0x25 bne _0803EC9C ldr r2, =gUnknown_02024208 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r5 adds r0, r1 @@ -17934,7 +17934,7 @@ _0803EC5E: b _0803ED70 .pool _0803EC9C: - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons mov r10, r0 movs r2, 0x58 mov r9, r2 @@ -18017,7 +18017,7 @@ _0803ED38: b _0803ED70 .pool _0803ED5C: - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r2, [r1] ldr r0, =0x043f0100 ands r0, r2 @@ -18046,7 +18046,7 @@ _0803ED80: bl sub_81A9E28 lsls r0, 24 lsrs r1, r0, 24 - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons movs r3, 0x58 adds r0, r5, 0 muls r0, r3 @@ -18061,7 +18061,7 @@ _0803ED80: b _0803EDDA .pool _0803EDBC: - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons movs r2, 0x58 adds r0, r5, 0 muls r0, r2 @@ -18137,7 +18137,7 @@ sub_803EE48: @ 803EE48 adds r0, r1 ldrb r0, [r0] strb r0, [r4] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x02000002 ands r0, r1 @@ -18230,7 +18230,7 @@ _0803EF0C: b _0803EF96 .pool _0803EF4C: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r2, [r4] movs r0, 0x58 muls r0, r2 @@ -18764,7 +18764,7 @@ sub_803F480: @ 803F480 lsrs r5, r1, 24 lsls r2, 16 lsrs r2, 16 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r4, 0x58 muls r0, r4 adds r0, r1 @@ -18821,7 +18821,7 @@ _0803F4DE: adds r0, r1 ldrb r1, [r0, 0x18] lsrs r1, 4 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, r3, 2 adds r0, r2 ldr r0, [r0] @@ -18875,7 +18875,7 @@ sub_803F548: @ 803F548 ldrb r0, [r0] cmp r4, r0 bge _0803F5F0 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 adds r7, r5, 0 muls r7, r0 @@ -18890,7 +18890,7 @@ _0803F57E: adds r6, r4, 0x1 cmp r9, r0 beq _0803F5E6 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons movs r3, 0x58 adds r1, r4, 0 muls r1, r3 @@ -18945,7 +18945,7 @@ _0803F5F0: mov r1, r8 cmp r1, 0x4 beq _0803F658 - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons movs r3, 0x58 adds r0, r5, 0 muls r0, r3 @@ -18965,7 +18965,7 @@ _0803F5F0: adds r0, r1 ldrb r1, [r0, 0x18] lsrs r1, 4 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable mov r4, r8 lsls r0, r4, 2 adds r0, r2 @@ -19021,7 +19021,7 @@ sub_803F67C: @ 803F67C ldrb r0, [r0] cmp r1, r0 bge _0803F6FE - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons movs r2, 0x58 mov r12, r2 mov r5, r12 @@ -19078,7 +19078,7 @@ _0803F6F4: _0803F6FE: cmp r6, 0x4 beq _0803F762 - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons movs r5, 0x58 adds r0, r3, 0 muls r0, r5 @@ -19098,7 +19098,7 @@ _0803F6FE: adds r0, r1 ldrb r1, [r0, 0x18] lsrs r1, 4 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, r6, 2 adds r0, r2 ldr r0, [r0] @@ -19139,7 +19139,7 @@ _0803F762: thumb_func_start sub_803F790 sub_803F790: @ 803F790 push {r4,r5,lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -19151,7 +19151,7 @@ sub_803F790: @ 803F790 cmp r2, r0 bge _0803F7EE ldr r3, =gUnknown_02024068 - ldr r5, =gUnknown_0832A328 + ldr r5, =gBitTable _0803F7AC: ldm r5!, {r1} lsls r1, 28 @@ -19171,7 +19171,7 @@ _0803F7D0: cmp r2, r0 bge _0803F7EE ldr r3, =gUnknown_02024068 - ldr r5, =gUnknown_0832A328 + ldr r5, =gBitTable _0803F7DE: ldr r0, [r3] ldm r5!, {r1} @@ -19193,14 +19193,14 @@ dp01_battle_side_mark_buffer_for_execution: @ 803F800 push {lr} lsls r0, 24 lsrs r3, r0, 24 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 cmp r0, 0 beq _0803F834 ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable lsls r0, r3, 2 adds r0, r1 ldr r1, [r0] @@ -19212,7 +19212,7 @@ dp01_battle_side_mark_buffer_for_execution: @ 803F800 .pool _0803F834: ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable lsls r0, r3, 2 adds r0, r1 ldr r1, [r2] @@ -19232,7 +19232,7 @@ sub_803F850: @ 803F850 lsrs r7, r0, 24 movs r4, 0 ldr r5, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable lsls r0, r7, 2 adds r6, r0, r1 b _0803F87A @@ -19268,7 +19268,7 @@ _0803F87A: b_cancel_multi_turn_move_maybe: @ 803F8A0 lsls r0, 24 lsrs r0, 24 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r2, 0x58 adds r3, r0, 0 muls r3, r2 @@ -19388,7 +19388,7 @@ sub_803F988: @ 803F988 adds r6, r0, 0 cmp r1, r2 bge _0803F9B6 - ldr r5, =gUnknown_0832A328 + ldr r5, =gBitTable adds r4, r2, 0 ldr r2, =gUnknown_0202406E _0803F9A4: @@ -19456,7 +19456,7 @@ sub_803F9EC: @ 803F9EC bge _0803FA4A ldr r0, =gUnknown_02024210 ldrb r7, [r0] - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable adds r6, r2, 0 ldr r3, =gUnknown_0202406E adds r2, r1, 0 @@ -19512,7 +19512,7 @@ _0803FA8C: ldr r0, =gUnknown_020243FE mov r12, r0 movs r7, 0x2 - ldr r6, =gUnknown_0832A328 + ldr r6, =gBitTable ldr r1, =gUnknown_0202406E lsls r0, r4, 1 adds r4, r0, r1 @@ -19606,7 +19606,7 @@ sub_803FB4C: @ 803FB4C mov r7, r8 push {r7} movs r6, 0 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r1, =gUnknown_02023864 ldr r3, =gUnknown_02024064 ldrb r4, [r3] @@ -19643,7 +19643,7 @@ sub_803FB4C: @ 803FB4C strb r4, [r0, 0x17] ldr r0, =gUnknown_020241EA strh r5, [r0] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 10 @@ -19684,7 +19684,7 @@ _0803FC06: bne _0803FC90 cmp r5, 0xA5 beq _0803FC90 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r2 adds r1, 0x50 @@ -19694,7 +19694,7 @@ _0803FC06: bge _0803FC90 adds r0, r2, 0 bl b_cancel_multi_turn_move_maybe - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 10 @@ -19749,7 +19749,7 @@ _0803FC90: bne _0803FD1A ldr r0, =gUnknown_020241EA strh r5, [r0] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 10 @@ -19792,7 +19792,7 @@ _0803FD1A: beq _0803FD8E ldr r0, =gUnknown_020241EA strh r5, [r0] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 10 @@ -19826,7 +19826,7 @@ _0803FD7C: lsls r0, 24 lsrs r6, r0, 24 _0803FD8E: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_02024064 ldrb r2, [r0] movs r0, 0x58 @@ -19853,7 +19853,7 @@ _0803FDCE: ldr r1, =gUnknown_02024064 ldrb r0, [r1] strb r0, [r2] - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons mov r12, r0 adds r7, r1, 0 cmp r4, 0x1D @@ -19877,7 +19877,7 @@ _0803FDCE: add r0, r12 ldrh r0, [r0, 0x2E] strh r0, [r2] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x80 lsls r0, 10 @@ -19919,7 +19919,7 @@ _0803FE58: ldrb r0, [r0] cmp r0, 0 bne _0803FEB8 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 10 @@ -19974,7 +19974,7 @@ sub_803FECC: @ 803FECC ldr r1, [r1] adds r1, r0 str r1, [sp, 0x4] - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r7 adds r1, r0, r1 @@ -20008,7 +20008,7 @@ _0803FF2E: str r2, [sp, 0xC] ldr r5, =gUnknown_020242BC mov r12, r5 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons movs r2, 0x58 adds r6, r7, 0 muls r6, r2 @@ -20021,7 +20021,7 @@ _0803FF2E: subs r0, r1, r7 lsls r0, 2 mov r8, r0 - ldr r6, =gUnknown_0832A328 + ldr r6, =gBitTable _0803FF5A: ldrh r0, [r5] cmp r0, 0 @@ -20355,7 +20355,7 @@ sub_80401D0: @ 80401D0 bcs _08040224 ldr r2, =gUnknown_02024210 ldrb r1, [r2] - ldr r5, =gUnknown_0832A328 + ldr r5, =gBitTable ldr r0, [r5] ands r1, r0 cmp r1, 0 @@ -20386,7 +20386,7 @@ _08040224: beq _0804025E ldr r2, =gUnknown_02024210 ldrb r1, [r2] - ldr r5, =gUnknown_0832A328 + ldr r5, =gBitTable ldr r0, [r5] ands r1, r0 cmp r1, 0 @@ -20886,7 +20886,7 @@ _0804067C: lsls r0, 24 cmp r0, 0 bne _080406C4 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r2, [r4] movs r0, 0x58 muls r0, r2 @@ -21192,7 +21192,7 @@ _08040968: strb r0, [r3] ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable ldrb r0, [r3] lsls r0, 2 adds r0, r2 @@ -21253,7 +21253,7 @@ _08040A18: bne _08040A30 bl _080412DE _08040A30: - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons movs r1, 0x58 muls r1, r3 adds r0, r1, r0 @@ -21330,7 +21330,7 @@ _08040AC6: bne _08040ADC bl _080412DE _08040ADC: - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons movs r5, 0x3 ands r5, r1 movs r1, 0x58 @@ -21372,7 +21372,7 @@ _08040B1E: b _080412D0 .pool _08040B44: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldrb r1, [r6] movs r0, 0x58 adds r3, r1, 0 @@ -21406,7 +21406,7 @@ _08040B7A: b _080412D0 .pool _08040B8C: - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons ldrb r0, [r6] movs r7, 0x58 mov r8, r7 @@ -21469,7 +21469,7 @@ _08040BE4: b _080412D0 .pool _08040C0C: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldrb r1, [r6] movs r0, 0x58 adds r3, r1, 0 @@ -21503,7 +21503,7 @@ _08040C42: b _080412D0 .pool _08040C54: - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons ldrb r1, [r6] movs r0, 0x58 muls r1, r0 @@ -21551,7 +21551,7 @@ _08040CAC: b _080412DE .pool _08040CB8: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldrb r1, [r6] movs r0, 0x58 adds r3, r1, 0 @@ -21586,7 +21586,7 @@ _08040CF0: b _080412D0 .pool _08040D00: - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons mov r8, r3 ldrb r0, [r6] movs r3, 0x58 @@ -21734,7 +21734,7 @@ _08040E00: b _08040EC8 .pool _08040E60: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldrb r1, [r6] movs r0, 0x58 muls r0, r1 @@ -21803,7 +21803,7 @@ _08040EE8: ldr r5, =gUnknown_02024064 ldrb r0, [r5] strb r0, [r2] - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldrb r0, [r5] movs r7, 0x58 adds r1, r0, 0 @@ -21866,7 +21866,7 @@ _08040F72: b _080412DE .pool _08040F7C: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r0, [r6] movs r7, 0x58 muls r0, r7 @@ -21959,7 +21959,7 @@ _08041024: b _080412DE _0804103C: movs r4, 0 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons movs r0, 0x58 adds r1, r3, 0 muls r1, r0 @@ -22056,7 +22056,7 @@ _080410E8: bne _080410FE b _080412DE _080410FE: - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons mov r8, r7 ldrb r0, [r2, 0xC] lsls r0, 1 @@ -22229,7 +22229,7 @@ _08041238: ands r0, r3 cmp r0, 0 bne _080412DE - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons movs r5, 0x58 adds r1, r2, 0 muls r1, r5 @@ -22405,7 +22405,7 @@ _080413CA: strb r0, [r4] ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable ldrb r0, [r4] lsls r0, 2 adds r0, r2 @@ -22437,7 +22437,7 @@ _08041422: lsrs r3, r0, 24 cmp r3, 0 bne _08041520 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r2, [r4] movs r0, 0x58 muls r0, r2 @@ -22589,7 +22589,7 @@ _0804156A: strb r0, [r5] ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable ldrb r0, [r5] lsls r0, 2 adds r0, r2 @@ -22650,7 +22650,7 @@ _080415BC: ands r0, r1 str r0, [r2] ldr r3, =gUnknown_020241F0 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldrb r1, [r5] movs r0, 0x58 muls r0, r1 @@ -22706,7 +22706,7 @@ _08041684: movs r0, 0 strb r0, [r1] _0804169A: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 11 @@ -22718,7 +22718,7 @@ _0804169A: ldrb r0, [r0] cmp r0, 0x2 bne _08041708 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrh r0, [r1, 0x28] cmp r0, 0 beq _08041708 @@ -22773,7 +22773,7 @@ sub_8041728: @ 8041728 mov r7, r8 push {r7} sub sp, 0x4 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 ands r0, r1 @@ -22848,7 +22848,7 @@ _080417B4: ldr r6, =gUnknown_02024210 _080417D4: ldrb r0, [r6] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r1, r5, 2 adds r1, r2 ldr r4, [r1] @@ -22879,7 +22879,7 @@ _08041806: mov r12, r1 ldr r2, =gUnknown_0202420C mov r5, r8 - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons ldr r6, =gUnknown_0202406E _08041816: ldr r3, [r5] @@ -22899,7 +22899,7 @@ _08041816: adds r0, r3, 0 adds r0, 0xDF ldrb r1, [r0] - ldr r3, =gUnknown_0832A328 + ldr r3, =gBitTable lsls r0, r4, 1 adds r0, r6 ldrh r0, [r0] @@ -22981,8 +22981,8 @@ _080418F6: mov r12, r0 ldr r7, =gUnknown_0202420C ldr r5, =gUnknown_0202449C - ldr r2, =gUnknown_02024084 - ldr r6, =gUnknown_0832A328 + ldr r2, =gBattleMons + ldr r6, =gBitTable _08041902: ldr r0, [r5] adds r4, r0, 0 @@ -23214,7 +23214,7 @@ _08041AC0: .4byte _0804231C .4byte _08042376 _08041AFC: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r3, =gUnknown_0202420B ldrb r2, [r3] movs r0, 0x58 @@ -23240,7 +23240,7 @@ _08041AFC: bl _08042370 .pool _08041B48: - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons ldr r4, =gUnknown_0202420B ldrb r1, [r4] movs r5, 0x58 @@ -23320,7 +23320,7 @@ _08041BF4: subs r0, r1, r3 str r0, [r2] _08041BF8: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r1, [r0] movs r0, 0x58 @@ -23375,7 +23375,7 @@ _08041C6E: b _0804216A .pool _08041C90: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r7, =gUnknown_0202420B ldrb r0, [r7] movs r6, 0x58 @@ -23449,7 +23449,7 @@ _08041D30: b _08042370 .pool _08041D50: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r2, [r0] movs r0, 0x58 @@ -23494,7 +23494,7 @@ _08041D7A: b _0804215E .pool _08041DC4: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r3, =gUnknown_0202420B ldrb r2, [r3] movs r0, 0x58 @@ -23539,7 +23539,7 @@ _08041E10: b _0804216A .pool _08041E40: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r3, =gUnknown_0202420B ldrb r2, [r3] movs r0, 0x58 @@ -23715,7 +23715,7 @@ _08041FFE: b _0804216A .pool _08042028: - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons ldr r5, =gUnknown_0202420B ldrb r0, [r5] movs r6, 0x58 @@ -23810,7 +23810,7 @@ _080420FA: b _08042370 .pool _08042114: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r4, =gUnknown_0202420B ldrb r2, [r4] movs r0, 0x58 @@ -23862,7 +23862,7 @@ _0804216A: b _08042376 .pool _08042194: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r4, =gUnknown_0202420B ldrb r2, [r4] movs r0, 0x58 @@ -23922,7 +23922,7 @@ _0804220E: b _08042370 .pool _08042234: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r6, =gUnknown_0202420B ldrb r0, [r6] movs r5, 0x58 @@ -23976,7 +23976,7 @@ _08042280: strb r0, [r4] ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable ldrb r0, [r4] lsls r0, 2 adds r0, r2 @@ -24012,7 +24012,7 @@ _08042306: b _08042370 .pool _0804231C: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r2, [r0] movs r0, 0x58 @@ -24117,7 +24117,7 @@ sub_80423F4: @ 80423F4 lsls r2, 24 lsrs r2, 24 mov r9, r2 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x1 ands r0, r1 @@ -24453,7 +24453,7 @@ castform_switch: @ 80426BC lsls r0, 24 lsrs r6, r0, 24 movs r5, 0 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r6 adds r4, r0, r1 @@ -24535,7 +24535,7 @@ _08042764: adds r4, r1, 0 cmp r2, 0 bne _08042792 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r6 adds r1, r0, r1 @@ -24557,7 +24557,7 @@ _08042792: ands r0, r1 cmp r0, 0 beq _080427BE - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r6 adds r1, r0, r1 @@ -24580,7 +24580,7 @@ _080427BE: ands r0, r1 cmp r0, 0 beq _080427EA - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r6 adds r1, r0, r1 @@ -24603,7 +24603,7 @@ _080427EA: ands r0, r1 cmp r0, 0 beq _08042816 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r6 adds r1, r0, r1 @@ -24744,7 +24744,7 @@ _080428F8: movs r1, 0 bl pokemon_getattr str r0, [sp, 0x14] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 ands r0, r1 @@ -24762,7 +24762,7 @@ _0804293A: .pool _08042958: ldr r2, =gUnknown_0202420A - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 mov r5, r10 muls r5, r0 @@ -24894,7 +24894,7 @@ _08042A7E: beq _08042A86 bl _0804441E _08042A86: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -25139,7 +25139,7 @@ _08042CC4: bl _0804441E .pool _08042CDC: - ldr r5, =gUnknown_02024084 + ldr r5, =gBattleMons mov r8, r5 movs r0, 0x58 mov r6, r10 @@ -25405,7 +25405,7 @@ _08042F2C: bne _08042F3C bl _0804441E _08042F3C: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r2, [r0] movs r0, 0x58 @@ -25525,7 +25525,7 @@ _0804304C: _0804305C: cmp r3, 0xA bne _08043126 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 mov r3, r10 muls r3, r0 @@ -25610,7 +25610,7 @@ _08043126: beq _08043130 bl _0804441E _08043130: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 mov r3, r10 muls r3, r0 @@ -25761,7 +25761,7 @@ _080432B4: bne _080432DC bl _0804441E _080432DC: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 mov r2, r10 muls r2, r0 @@ -25811,7 +25811,7 @@ _08043350: beq _08043360 bl _0804441E _08043360: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r2, [r0] movs r0, 0x58 @@ -25887,7 +25887,7 @@ _08043410: beq _08043420 bl _0804441E _08043420: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r2, [r0] movs r0, 0x58 @@ -25988,7 +25988,7 @@ _08043508: beq _08043518 bl _0804441E _08043518: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r2, [r0] movs r0, 0x58 @@ -26074,7 +26074,7 @@ _080435E4: beq _080435F4 bl _0804441E _080435F4: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r2, [r0] movs r0, 0x58 @@ -26160,7 +26160,7 @@ _080436C0: beq _080436D0 bl _0804441E _080436D0: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r2, [r0] movs r0, 0x58 @@ -26246,7 +26246,7 @@ _0804379C: beq _080437AC bl _0804441E _080437AC: - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons ldr r3, =gUnknown_0202420B mov r8, r3 ldrb r1, [r3] @@ -26378,7 +26378,7 @@ _080438B6: adds r2, r0, 0 muls r2, r7 adds r2, r4 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r0, [r5] lsls r0, 2 adds r0, r1 @@ -26402,7 +26402,7 @@ _08043908: bcc _08043918 bl _0804441E _08043918: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 mov r2, r10 muls r2, r0 @@ -26653,7 +26653,7 @@ _08043BB4: beq _08043BE8 b _08043BFC _08043BBC: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 mov r2, r10 muls r2, r0 @@ -26663,7 +26663,7 @@ _08043BBC: b _08043BFA .pool _08043BD0: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 mov r2, r10 muls r2, r0 @@ -26675,7 +26675,7 @@ _08043BD0: b _08043BF8 .pool _08043BE8: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 mov r2, r10 muls r2, r0 @@ -26735,7 +26735,7 @@ _08043C6C: bcc _08043C7A b _0804441E _08043C7A: - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons _08043C7C: movs r0, 0x58 mov r3, r10 @@ -26885,7 +26885,7 @@ _08043DC4: blt _08043DD0 b _0804441E _08043DD0: - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons adds r5, r1, 0 ldr r2, =gUnknown_020242AC adds r3, r0, 0 @@ -26919,7 +26919,7 @@ _08043E08: _08043E14: ldr r5, =gUnknown_02024064 mov r8, r5 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons adds r0, 0x20 str r0, [sp, 0x1C] movs r1, 0 @@ -26958,7 +26958,7 @@ _08043E42: bl battle_get_side_with_given_state lsls r0, 24 lsrs r7, r0, 24 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r2, 0x1 ands r0, r2 @@ -26969,7 +26969,7 @@ _08043E74: movs r1, 0x58 adds r0, r6, 0 muls r0, r1 - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons adds r1, r0, r3 adds r0, r1, 0 adds r0, 0x20 @@ -27005,7 +27005,7 @@ _08043E74: ldrb r0, [r2] movs r3, 0x58 muls r0, r3 - ldr r5, =gUnknown_02024084 + ldr r5, =gBattleMons adds r0, r5 adds r0, 0x20 ldrb r0, [r0] @@ -27021,7 +27021,7 @@ _08043E74: b _08043FAC .pool _08043EFC: - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons movs r2, 0x58 adds r0, r6, 0 muls r0, r2 @@ -27054,7 +27054,7 @@ _08043EFC: b _08043FA8 .pool _08043F40: - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons movs r2, 0x58 adds r0, r7, 0 muls r0, r2 @@ -27092,7 +27092,7 @@ _08043F84: movs r3, 0x58 adds r0, r6, 0 muls r0, r3 - ldr r5, =gUnknown_02024084 + ldr r5, =gBattleMons adds r0, r5 adds r2, r0, 0 adds r2, 0x20 @@ -27143,7 +27143,7 @@ _08043FE4: blt _08043FF0 b _0804441E _08043FF0: - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons adds r5, r1, 0 ldr r2, =gUnknown_020242AC adds r3, r0, 0 @@ -27179,7 +27179,7 @@ _08044028: blt _0804403E b _0804441E _0804403E: - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons _08044040: lsls r0, r4, 24 lsrs r0, 24 @@ -27221,7 +27221,7 @@ _08044084: blt _0804409A b _0804441E _0804409A: - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons _0804409C: lsls r0, r4, 24 lsrs r0, 24 @@ -27265,7 +27265,7 @@ _080440E0: blt _080440F8 b _0804441E _080440F8: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons b _08044174 .pool _08044104: @@ -27353,7 +27353,7 @@ _08044196: blt _080441A2 b _0804441E _080441A2: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons mov r8, r2 adds r2, r0, 0 movs r5, 0x58 @@ -27389,7 +27389,7 @@ _080441DC: blt _080441E8 b _0804441E _080441E8: - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons adds r1, r0, 0 movs r5, 0x58 ldr r2, =gUnknown_0202420A @@ -27426,7 +27426,7 @@ _08044220: blt _08044236 b _0804441E _08044236: - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons _08044238: lsls r0, r4, 24 lsrs r0, 24 @@ -27469,7 +27469,7 @@ _0804427C: blt _08044292 b _0804441E _08044292: - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons _08044294: lsls r0, r4, 24 lsrs r0, 24 @@ -27607,7 +27607,7 @@ _080443EC: ldrb r1, [r0] cmp r4, r1 bge _0804441E - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons adds r2, r1, 0 adds r1, r0, 0 adds r1, 0x20 @@ -27735,7 +27735,7 @@ berry_effects_maybe: @ 80444DC add r0, sp, 0x4 strb r1, [r0] ldr r4, =gUnknown_02024208 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r7 adds r0, r1 @@ -27765,7 +27765,7 @@ _08044534: lsrs r0, 24 _08044548: mov r9, r0 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r2, [r0] movs r0, 0x58 @@ -27797,7 +27797,7 @@ _0804457C: lsrs r0, 24 _08044592: str r0, [sp, 0x10] - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420C ldrb r1, [r0] movs r0, 0x58 @@ -27851,7 +27851,7 @@ _08044604: bl _0804582A .pool _08044618: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons mov r8, r1 movs r0, 0x58 adds r1, r7, 0 @@ -27896,7 +27896,7 @@ _08044654: bl _0804582A .pool _08044688: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r7 adds r0, r1 @@ -28113,7 +28113,7 @@ _08044864: bl _080451DE .pool _080448B0: - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons movs r1, 0x58 muls r1, r7 adds r0, 0x18 @@ -29160,7 +29160,7 @@ _08045164: movs r0, 0x1 _08045168: strb r0, [r1, 0x5] - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons movs r0, 0x58 adds r3, r7, 0 muls r3, r0 @@ -29234,7 +29234,7 @@ _08045220: muls r0, r7 b _0804568C _08045226: - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons movs r0, 0x58 adds r3, r7, 0 muls r3, r0 @@ -29256,7 +29256,7 @@ _08045242: adds r0, r1 ldrb r1, [r0, 0x18] lsrs r1, 4 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable mov r5, r10 lsls r0, r5, 2 adds r0, r2 @@ -29284,7 +29284,7 @@ _08045280: b _0804582A _0804528C: ldr r4, =gUnknown_02024208 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r7 adds r0, r1 @@ -29351,7 +29351,7 @@ _080452E8: .4byte _08045674 .4byte _080454C8 _08045354: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r7 adds r1, 0x4C @@ -29376,7 +29376,7 @@ _0804536A: b _0804567A .pool _08045390: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r7 adds r1, 0x4C @@ -29400,7 +29400,7 @@ _080453A6: b _0804567A .pool _080453CC: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r7 adds r1, 0x4C @@ -29425,7 +29425,7 @@ _080453E2: b _0804567A .pool _08045408: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r7 adds r1, 0x4C @@ -29450,7 +29450,7 @@ _0804541E: b _0804567A .pool _08045444: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons movs r0, 0x58 adds r4, r7, 0 muls r4, r0 @@ -29480,7 +29480,7 @@ _0804545E: b _080455DC .pool _0804548C: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r7 adds r1, 0x50 @@ -29505,7 +29505,7 @@ _080454A2: b _0804567A .pool _080454C8: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r7 adds r1, 0x50 @@ -29536,7 +29536,7 @@ _080454E0: b _0804567A .pool _08045520: - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons movs r0, 0x58 adds r5, r7, 0 muls r5, r0 @@ -29637,7 +29637,7 @@ _080455DC: b _0804567A .pool _08045614: - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons mov r8, r0 movs r0, 0x58 adds r1, r7, 0 @@ -29781,7 +29781,7 @@ _08045720: ands r0, r1 cmp r0, 0 beq _0804582A - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldrb r1, [r4] movs r0, 0x58 muls r0, r1 @@ -29824,7 +29824,7 @@ _08045794: ldrb r3, [r0] cmp r3, r2 beq _0804582A - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldrb r1, [r0] movs r0, 0x58 muls r0, r1 @@ -29898,7 +29898,7 @@ sub_8045868: @ 8045868 adds r1, r2 movs r2, 0 strb r2, [r1, 0x10] - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r2, 0x58 adds r3, r0, 0 muls r3, r2 @@ -30058,7 +30058,7 @@ _08045A28: ldrb r0, [r2, 0x8] cmp r0, 0 beq _08045A5A - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r4, [r2, 0x9] movs r0, 0x58 muls r0, r4 @@ -30096,7 +30096,7 @@ _08045A6A: beq _08045A6A ldr r0, =gUnknown_02024210 ldrb r2, [r0] - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable lsls r0, r5, 2 adds r0, r1 ldr r0, [r0] @@ -30124,7 +30124,7 @@ _08045AB8: bne _08045ACE b _08045C20 _08045ACE: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons movs r1, 0x58 adds r0, r5, 0 muls r0, r1 @@ -30181,7 +30181,7 @@ _08045B40: ldrb r0, [r2, 0x8] cmp r0, 0 beq _08045B80 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r4, [r2, 0x9] movs r0, 0x58 muls r0, r4 @@ -30194,7 +30194,7 @@ _08045B70: b _08045C20 .pool _08045B80: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r4, 0x1 ands r0, r4 @@ -30237,7 +30237,7 @@ _08045BD2: lsrs r5, r0, 24 ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, r5, 2 adds r0, r2 ldr r0, [r0] @@ -30346,7 +30346,7 @@ sub_8045CBC: @ 8045CBC push {r6,r7} sub sp, 0x10 movs r6, 0 - ldr r5, =gUnknown_02022FEC + ldr r5, =gBattleTypeFlags ldr r0, [r5] ldr r1, =0x02000002 ands r0, r1 @@ -30376,7 +30376,7 @@ sub_8045CBC: @ 8045CBC cmp r0, 0x2 beq _08045DAC _08045D08: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] ldr r0, =0x003f0100 ands r0, r1 @@ -30387,7 +30387,7 @@ _08045D08: ands r1, r0 cmp r1, 0 bne _08045DAC - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r1, [r0] movs r0, 0x58 @@ -30429,7 +30429,7 @@ _08045D68: beq _08045D76 movs r6, 0x46 _08045D76: - ldr r5, =gUnknown_02024084 + ldr r5, =gBattleMons ldr r0, =gUnknown_0202420B mov r8, r0 ldrb r0, [r0] @@ -30498,7 +30498,7 @@ _08045E20: movs r5, 0xFF adds r1, r5, 0 ands r1, r0 - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons ldr r2, =gUnknown_0202420B mov r9, r2 ldrb r3, [r2] @@ -30514,7 +30514,7 @@ _08045E20: asrs r4, r0, 8 cmp r4, r6 bge _08045EE8 - ldr r6, =gUnknown_0832A328 + ldr r6, =gBitTable ldr r5, =gUnknown_020241E8 ldrb r0, [r5] lsls r0, 2 @@ -30546,7 +30546,7 @@ _08045E6E: cmp r0, 0 bne _08045E6E ldr r4, =gUnknown_020241EE - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldr r0, =gUnknown_020241E8 ldrb r0, [r0] lsls r0, 1 @@ -30654,7 +30654,7 @@ _08045F8C: ldrb r1, [r4] movs r0, 0x58 muls r1, r0 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons adds r1, r0 movs r0, 0x28 str r0, [sp] @@ -30712,7 +30712,7 @@ atk00_attackcanceler: @ 8045FFC b _08046398 .pool _08046020: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r1, [r0] movs r0, 0x58 @@ -30756,7 +30756,7 @@ _08046072: beq _0804608A b _08046398 _0804608A: - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons ldr r0, =gUnknown_020241E8 ldrb r1, [r0] ldr r3, =gUnknown_0202420B @@ -30979,7 +30979,7 @@ _08046296: beq _08046390 cmp r3, 0xAE bne _080462D4 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r1, [r0] movs r0, 0x58 @@ -31001,7 +31001,7 @@ _080462D4: lsls r0, 24 cmp r0, 0 beq _080462FA - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r2, [r0] movs r0, 0x58 @@ -31515,7 +31515,7 @@ _08046760: beq _0804676E b _080469D2 _0804676E: - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldr r0, =gUnknown_0202420C ldrb r0, [r0] movs r2, 0x58 @@ -31613,7 +31613,7 @@ _08046822: bl __divsi3 lsls r0, 16 lsrs r4, r0, 16 - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r0, [r0] movs r5, 0x58 @@ -31673,7 +31673,7 @@ _08046860: lsls r0, 16 lsrs r4, r0, 16 _080468B8: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r1, [r0] movs r0, 0x58 @@ -31758,7 +31758,7 @@ _08046960: movs r1, 0x1 orrs r0, r1 strb r0, [r2] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -31917,7 +31917,7 @@ _08046AD6: ldrb r7, [r1] cmp r0, r7 beq _08046AF6 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldrb r1, [r1] movs r0, 0x58 muls r0, r1 @@ -31935,7 +31935,7 @@ _08046AF6: ands r4, r0 cmp r4, 0 bne _08046BDC - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r3, =gUnknown_020241E8 ldr r1, =gUnknown_0202420B ldrb r5, [r1] @@ -32002,7 +32002,7 @@ _08046B72: adds r0, r1 ldrb r1, [r0, 0x18] lsrs r1, 4 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable ldrb r0, [r7] lsls r0, 2 adds r0, r2 @@ -32057,7 +32057,7 @@ _08046BEE: thumb_func_start atk04_critcalc atk04_critcalc: @ 8046C18 push {r4-r7,lr} - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r2, [r0] movs r0, 0x58 @@ -32083,7 +32083,7 @@ _08046C50: ldr r3, =gUnknown_0202420B ldrb r0, [r3] strb r0, [r1] - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons ldrb r1, [r3] movs r0, 0x58 adds r7, r1, 0 @@ -32189,7 +32189,7 @@ _08046D00: ands r0, r1 cmp r0, 0 bne _08046D70 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x84 lsls r1, 2 @@ -32243,7 +32243,7 @@ atk05_cmd5: @ 8046D8C ldrb r0, [r6] movs r4, 0x58 muls r0, r4 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons adds r0, r2 ldrb r1, [r5] muls r1, r4 @@ -32343,7 +32343,7 @@ sub_8046E7C: @ 8046E7C movs r1, 0x58 adds r0, r7, 0 muls r0, r1 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons adds r0, r2 muls r1, r5 adds r1, r2 @@ -32557,7 +32557,7 @@ _08047068: ldrb r0, [r0, 0x2] mov r8, r0 _08047078: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r1, [r0] movs r0, 0x58 @@ -32643,7 +32643,7 @@ _0804713C: bne _08047198 adds r1, r3, 0x1 adds r1, r5 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r7, =gUnknown_0202420C ldrb r0, [r7] movs r6, 0x58 @@ -32683,7 +32683,7 @@ _08047172: ldr r3, [sp, 0x4] _08047198: adds r3, 0x3 - ldr r5, =gUnknown_02024084 + ldr r5, =gBattleMons ldr r4, =gUnknown_0202420C ldr r2, =gUnknown_0831ACE8 _080471A0: @@ -32707,7 +32707,7 @@ _080471A4: cmp r0, 0 beq _08047138 _080471C4: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r5, =gUnknown_0202420C ldrb r1, [r5] movs r0, 0x58 @@ -32840,7 +32840,7 @@ _080472F4: ldrb r1, [r1, 0x2] mov r12, r1 _080472F8: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r3, =gUnknown_0202420C ldrb r1, [r3] movs r0, 0x58 @@ -33250,7 +33250,7 @@ _08047616: adds r0, r1 ldrb r0, [r0, 0x2] str r0, [sp, 0x8] - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 ldr r3, [sp, 0x4] muls r0, r3 @@ -33328,7 +33328,7 @@ _080476B6: bne _08047710 adds r1, 0x1 adds r1, r7 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons movs r0, 0x58 mov r3, r9 muls r3, r0 @@ -33366,7 +33366,7 @@ _080476F0: _08047710: movs r1, 0x3 add r8, r1 - ldr r5, =gUnknown_02024084 + ldr r5, =gBattleMons ldr r2, =gUnknown_0831ACE8 _08047718: mov r3, r8 @@ -33639,7 +33639,7 @@ atk07_cmd7: @ 80478F4 movs r0, 0x1 str r0, [r4] _08047926: - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons ldr r6, =gUnknown_0202420C ldrb r2, [r6] movs r5, 0x58 @@ -33700,7 +33700,7 @@ _08047976: orrs r1, r2 strb r1, [r0] _080479B4: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r3, =gUnknown_0202420C ldrb r4, [r3] movs r0, 0x58 @@ -33826,7 +33826,7 @@ atk08_cmd8: @ 8047AA4 movs r0, 0x1 str r0, [r4] _08047AD6: - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons ldr r6, =gUnknown_0202420C ldrb r2, [r6] movs r5, 0x58 @@ -33887,7 +33887,7 @@ _08047B26: orrs r1, r2 strb r1, [r0] _08047B64: - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons ldr r6, =gUnknown_0202420C ldrb r2, [r6] movs r7, 0x58 @@ -34046,7 +34046,7 @@ _08047CBA: ldr r3, =gUnknown_0202420B ldrb r0, [r3] strb r0, [r1] - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420C ldrb r1, [r0] movs r0, 0x58 @@ -34179,7 +34179,7 @@ atk0B_graphicalhpupdate: @ 8047DE8 bl get_battle_side_of_something ldr r2, =gUnknown_02024064 strb r0, [r2] - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r2, [r2] movs r0, 0x58 muls r0, r2 @@ -34298,7 +34298,7 @@ _08047F12: bl get_battle_side_of_something ldr r7, =gUnknown_02024064 strb r0, [r7] - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r2, [r7] movs r0, 0x58 muls r0, r2 @@ -34415,7 +34415,7 @@ _08048028: adds r7, r1, 0 cmp r5, 0 bge _0804807C - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons ldr r2, =gUnknown_02024064 ldrb r0, [r2] movs r3, 0x58 @@ -34481,7 +34481,7 @@ _080480DC: ldrb r1, [r1] strb r1, [r0] _080480E0: - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons ldrb r0, [r5] movs r3, 0x58 muls r0, r3 @@ -34911,7 +34911,7 @@ _08048474: b _0804856E _08048478: ldr r4, =gUnknown_02024208 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r3, =gUnknown_0202420C ldrb r1, [r3] movs r0, 0x58 @@ -34976,7 +34976,7 @@ _08048510: cmp r0, 0 beq _08048558 ldr r4, =gUnknown_02024208 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r3, =gUnknown_0202420C ldrb r1, [r3] movs r0, 0x58 @@ -35291,7 +35291,7 @@ _080487C4: ldrb r0, [r0] strb r0, [r1, 0x17] mov r9, r2 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons mov r4, r9 ldrb r1, [r4] movs r0, 0x58 @@ -35358,7 +35358,7 @@ _08048828: bl _080499B8 .pool _08048880: - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldr r2, =gUnknown_0202420E ldrb r1, [r2] movs r0, 0x58 @@ -35811,7 +35811,7 @@ _08048BEA: movs r2, 0 str r2, [sp, 0x4] _08048C26: - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons ldr r0, =gUnknown_0202420E ldrb r3, [r0] movs r0, 0x58 @@ -36048,7 +36048,7 @@ _08048DFC: cmp r3, 0x7 bne _08048E50 bl Random - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r1, =gUnknown_0202420E ldrb r3, [r1] movs r1, 0x58 @@ -36064,7 +36064,7 @@ _08048DFC: b _08048E64 .pool _08048E50: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420E ldrb r1, [r0] movs r0, 0x58 @@ -36412,7 +36412,7 @@ _080491D8: bne _08049210 ldr r4, =gUnknown_0202432E ldrh r3, [r4] - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldrb r1, [r5] movs r0, 0x58 muls r0, r1 @@ -36787,7 +36787,7 @@ _0804955A: b _08049994 .pool _08049564: - ldr r5, =gUnknown_02022FEC + ldr r5, =gBattleTypeFlags ldr r0, [r5] movs r1, 0x80 lsls r1, 19 @@ -36824,7 +36824,7 @@ _080495A8: adds r0, 0x29 adds r0, r4, r0 ldrb r1, [r0] - ldr r3, =gUnknown_0832A328 + ldr r3, =gBitTable ldr r2, =gUnknown_0202406E ldrb r0, [r6] lsls r0, 1 @@ -36838,7 +36838,7 @@ _080495A8: beq _080495D4 b _08049994 _080495D4: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r1, =gUnknown_0202420C ldrb r0, [r1] movs r5, 0x58 @@ -37192,7 +37192,7 @@ _08049900: ldr r2, =gUnknown_020243D0 adds r2, 0x29 adds r2, r4, r2 - ldr r3, =gUnknown_0832A328 + ldr r3, =gBitTable ldr r1, =gUnknown_0202406E mov r4, r9 ldrb r0, [r4] @@ -37262,7 +37262,7 @@ _080499B8: thumb_func_start atk15_seteffectwithchancetarget atk15_seteffectwithchancetarget: @ 80499D4 push {r4,lr} - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r1, [r0] movs r0, 0x58 @@ -37393,7 +37393,7 @@ sub_8049AE0: @ 8049AE0 ldrb r0, [r3, 0x3] cmp r0, 0x6 bhi _08049B14 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r2, [r2] movs r0, 0x58 muls r2, r0 @@ -37401,7 +37401,7 @@ sub_8049AE0: @ 8049AE0 b _08049B1E .pool _08049B14: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r2, [r2] movs r0, 0x58 muls r2, r0 @@ -37448,7 +37448,7 @@ atk19_faintpokemon: @ 8049B5C ldr r5, =gUnknown_02024064 strb r0, [r5] ldr r2, =gUnknown_02024280 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r0, [r5] lsls r0, 2 adds r0, r1 @@ -37512,7 +37512,7 @@ _08049C18: mov r8, r1 ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable mov r7, r8 ldrb r3, [r7] lsls r0, r3, 2 @@ -37523,7 +37523,7 @@ _08049C18: beq _08049C32 b _08049E2C _08049C32: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r3 adds r0, r1 @@ -37591,7 +37591,7 @@ _08049CCE: ands r0, r1 cmp r0, 0 beq _08049D0C - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r0, [r0] movs r5, 0x58 @@ -37649,7 +37649,7 @@ _08049D34: lsls r0, 24 cmp r4, r0 beq _08049E32 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons mov r9, r0 mov r2, r8 ldrb r1, [r2] @@ -37780,14 +37780,14 @@ sub_8049E7C: @ 8049E7C bl get_battle_side_of_something ldr r4, =gUnknown_02024064 strb r0, [r4] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 11 ands r0, r1 cmp r0, 0 beq _08049EB4 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldrb r1, [r4] movs r0, 0x58 muls r0, r1 @@ -37796,7 +37796,7 @@ sub_8049E7C: @ 8049E7C cmp r0, 0 bne _08049EDC _08049EB4: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r0, [r4] movs r2, 0x58 muls r0, r2 @@ -37858,7 +37858,7 @@ atk1C_jumpifstatus: @ 8049F04 ldrb r1, [r2, 0x9] lsls r1, 24 adds r3, r1 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons movs r1, 0x58 muls r1, r0 adds r0, r2, 0 @@ -37917,7 +37917,7 @@ atk1D_jumpifsecondarystatus: @ 8049F7C ldrb r1, [r2, 0x9] lsls r1, 24 adds r3, r1 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons movs r1, 0x58 muls r1, r0 adds r0, r2, 0 @@ -38019,7 +38019,7 @@ _0804A08C: bl get_battle_side_of_something lsls r0, 24 lsrs r4, r0, 24 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r4 adds r0, r1 @@ -38117,7 +38117,7 @@ sub_804A154: @ 804A154 bl get_battle_side_of_something lsls r0, 24 lsrs r0, 24 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r3, [r4] movs r1, 0x58 muls r0, r1 @@ -38312,7 +38312,7 @@ sub_804A2D0: @ 804A2D0 ldrb r1, [r3, 0x6] lsls r1, 24 adds r6, r2, r1 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons movs r1, 0x58 muls r0, r1 adds r1, r0, r2 @@ -38395,7 +38395,7 @@ _0804A3A8: beq _0804A3BC bl _0804AC7C _0804A3BC: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x063f0982 ands r0, r1 @@ -38410,7 +38410,7 @@ _0804A3CC: ldr r0, =gUnknown_0202449C ldr r2, [r0] adds r2, 0xDF - ldr r3, =gUnknown_0832A328 + ldr r3, =gBitTable ldr r1, =gUnknown_0202406E ldrb r0, [r4] lsls r0, 1 @@ -38443,7 +38443,7 @@ _0804A418: bl pokemon_getattr cmp r0, 0 beq _0804A486 - ldr r0, =gUnknown_0832A328 + ldr r0, =gBitTable lsls r1, r7, 2 adds r1, r0 ldr r0, [r1] @@ -38480,7 +38480,7 @@ _0804A486: cmp r7, 0x5 ble _0804A418 ldr r3, =gBaseStats - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420D ldrb r1, [r0] movs r0, 0x58 @@ -38626,13 +38626,13 @@ _0804A5D0: b _0804ACB2 .pool _0804A5E8: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x8 ands r0, r1 cmp r0, 0 bne _0804A616 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons ldrh r0, [r0, 0x28] cmp r0, 0 beq _0804A616 @@ -38699,7 +38699,7 @@ _0804A67A: bl __divsi3 str r0, [r4] _0804A68E: - ldr r5, =gUnknown_02022FEC + ldr r5, =gBattleTypeFlags ldr r0, [r5] movs r1, 0x8 ands r0, r1 @@ -38757,7 +38757,7 @@ _0804A714: ldr r1, =gUnknown_020241F0 mov r9, r1 _0804A71A: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x1 ands r1, r0 @@ -38768,7 +38768,7 @@ _0804A71A: ldr r4, [r1] ldrh r0, [r0, 0x4] adds r5, r1, 0 - ldr r3, =gUnknown_0832A328 + ldr r3, =gBitTable ldr r2, =gUnknown_02024210 ldrb r1, [r4, 0x10] cmp r0, r1 @@ -38871,7 +38871,7 @@ _0804A78E: muls r0, r1 ldr r1, =gUnknown_020244EC adds r0, r1 - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldr r1, =gUnknown_0202420D ldrb r2, [r1] movs r1, 0x58 @@ -39026,7 +39026,7 @@ _0804A97C: beq _0804A988 b _0804AC28 _0804A988: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x8 ands r0, r1 @@ -39085,7 +39085,7 @@ _0804A9B2: strb r0, [r4, 0x5] bl b_movescr_stack_push_cursor ldr r2, =gUnknown_03005D54 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable mov r4, r9 ldr r5, [r4] ldrb r0, [r5, 0x10] @@ -39125,7 +39125,7 @@ _0804A9B2: ldrh r0, [r1] cmp r0, r2 bne _0804AB1E - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons ldrh r0, [r4, 0x28] cmp r0, 0 beq _0804AB1E @@ -39227,14 +39227,14 @@ _0804AB1E: beq _0804AB2E b _0804AC2E _0804AB2E: - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons movs r4, 0xD8 adds r4, r6 mov r8, r4 ldrh r0, [r4] cmp r0, 0 beq _0804AC2E - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -39360,7 +39360,7 @@ _0804AC88: ldr r5, [r0] cmp r5, 0 bne _0804ACB2 - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons ldr r2, =gUnknown_0202420D ldrb r0, [r2] movs r1, 0x58 @@ -39399,7 +39399,7 @@ sub_804ACD0: @ 804ACD0 beq _0804ACE2 b _0804AF22 _0804ACE2: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 15 @@ -39458,7 +39458,7 @@ _0804AD4A: bl pokemon_getattr cmp r0, 0 bne _0804ADA2 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 11 @@ -39471,7 +39471,7 @@ _0804AD4A: lsls r1, 2 adds r0, r1 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, r5, 2 adds r0, r2 ldr r0, [r0] @@ -39516,7 +39516,7 @@ _0804ADBA: bl pokemon_getattr cmp r0, 0 bne _0804AE10 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 11 @@ -39528,7 +39528,7 @@ _0804ADBA: ldr r1, =0x000002a1 adds r0, r1 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, r5, 2 adds r0, r2 ldr r0, [r0] @@ -39557,7 +39557,7 @@ _0804AE24: ldrb r0, [r2] cmp r0, 0 bne _0804AF1A - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] ldr r2, =0x02000002 ands r1, r2 @@ -40651,7 +40651,7 @@ atk3C_return: @ 804B658 thumb_func_start sub_804B664 sub_804B664: @ 804B664 push {lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 11 @@ -40752,7 +40752,7 @@ atk42_jumpiftype2: @ 804B728 lsls r0, 24 lsrs r0, 24 ldr r3, [r4] - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons movs r1, 0x58 muls r0, r1 adds r0, r2 @@ -41163,7 +41163,7 @@ _0804BA58: ldr r3, [sp] cmp r0, 0 bne _0804BAB2 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons ldrb r2, [r6] movs r1, 0x58 muls r2, r1 @@ -41362,7 +41362,7 @@ _0804BBEE: str r4, [sp, 0x10] ldrb r0, [r0, 0x2] str r0, [sp, 0x14] - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r2, [r0] movs r0, 0x58 @@ -41507,7 +41507,7 @@ _0804BD38: .4byte _0804C4E4 .4byte _0804C570 _0804BD80: - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons ldr r5, =gUnknown_0202420C ldrb r3, [r5] movs r7, 0x58 @@ -41605,7 +41605,7 @@ _0804BE26: b _0804C0B8 .pool _0804BE5C: - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons ldr r6, =gUnknown_0202420C ldrb r2, [r6] movs r5, 0x58 @@ -41791,7 +41791,7 @@ _0804BFDE: strh r0, [r1] _0804BFE4: movs r4, 0 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r3, =gUnknown_0202420B ldrb r1, [r3] movs r0, 0x58 @@ -41844,7 +41844,7 @@ _0804C054: movs r6, 0 movs r3, 0xD0 adds r5, r0, 0 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons _0804C05E: ldr r0, [r7] adds r0, r3 @@ -42075,7 +42075,7 @@ _0804C246: _0804C262: ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable mov r3, r9 ldrb r4, [r3] lsls r0, r4, 2 @@ -42238,7 +42238,7 @@ _0804C3E8: _0804C3FC: ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r7, =gUnknown_0832A328 + ldr r7, =gBitTable ldr r2, =gUnknown_0202420B ldrb r3, [r2] lsls r0, r3, 2 @@ -42344,7 +42344,7 @@ _0804C4E4: ands r0, r2 cmp r0, 0 bne _0804C568 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -42387,7 +42387,7 @@ _0804C4E4: bl battle_get_side_with_given_state lsls r0, 24 lsrs r2, r0, 24 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r2 adds r0, r1 @@ -42475,7 +42475,7 @@ atk4A_damagecalc2: @ 804C5F4 adds r0, r2 ldrb r0, [r0, 0x2] mov r8, r0 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r3, =gUnknown_0202420C ldrb r1, [r3] movs r0, 0x58 @@ -42638,7 +42638,7 @@ _0804C74A: cmp r0, 0 beq _0804C744 _0804C76A: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420C mov r8, r0 ldrb r1, [r0] @@ -42736,7 +42736,7 @@ atk4B_cmd4b: @ 804C844 ldrb r0, [r0] strb r0, [r4] ldr r2, =gUnknown_02024280 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r0, [r4] lsls r0, 2 adds r0, r1 @@ -42785,7 +42785,7 @@ atk4C_switch1: @ 804C894 adds r0, 0x5C ldrb r0, [r0] strh r0, [r2] - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r0, [r4] lsls r0, 1 adds r0, r3 @@ -42824,7 +42824,7 @@ _0804C912: bl get_battle_side_of_something ldr r4, =gUnknown_02024064 strb r0, [r4] - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons ldrb r0, [r4] movs r5, 0x58 adds r1, r0, 0 @@ -42850,7 +42850,7 @@ _0804C93E: adds r2, 0x1 cmp r2, 0x57 bls _0804C93E - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons ldr r6, =gUnknown_02024064 ldrb r0, [r6] movs r7, 0x58 @@ -42899,7 +42899,7 @@ _0804C93E: adds r0, 0x29 adds r0, r2, r0 ldrb r1, [r0] - ldr r3, =gUnknown_0832A328 + ldr r3, =gBitTable ldr r2, =gUnknown_0202406E ldrb r5, [r6] lsls r0, r5, 1 @@ -42957,14 +42957,14 @@ _0804C9FE: str r1, [r0] _0804CA26: bl sub_803A284 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 10 ands r0, r1 cmp r0, 0 beq _0804CA78 - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons ldr r0, =gUnknown_02024064 ldrb r3, [r0] movs r0, 0x58 @@ -42989,7 +42989,7 @@ _0804CA26: ldr r0, =gUnknown_0202449C ldr r2, [r0] adds r2, 0x92 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable lsls r0, r3, 2 adds r0, r1 ldr r0, [r0] @@ -43046,13 +43046,13 @@ atk4E_switch3: @ 804CAE8 lsrs r0, 24 cmp r0, 0x1 bne _0804CB3E - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x063f0902 ands r0, r1 cmp r0, 0 bne _0804CB3E - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons ldrb r0, [r6] movs r5, 0x58 muls r0, r5 @@ -43070,7 +43070,7 @@ atk4E_switch3: @ 804CAE8 bl SetPokedexFlag _0804CB3E: ldr r2, =gUnknown_02024210 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r5, =gUnknown_02024064 ldrb r0, [r5] lsls r0, 2 @@ -43094,7 +43094,7 @@ _0804CB3E: ldr r0, [r4] adds r0, 0x3 str r0, [r4] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 11 @@ -43128,7 +43128,7 @@ atk4F_jumpifcannotswitch: @ 804CBB0 ands r0, r1 cmp r0, 0 bne _0804CC28 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r3, [r3] movs r0, 0x58 muls r0, r3 @@ -43163,7 +43163,7 @@ _0804CBFC: b _0804CF00 .pool _0804CC28: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x80 lsls r0, 15 @@ -43397,7 +43397,7 @@ _0804CE10: bl battle_get_side_with_given_state lsls r0, 24 lsrs r7, r0, 24 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ands r0, r4 cmp r0, 0 @@ -43420,7 +43420,7 @@ _0804CE54: bl battle_get_side_with_given_state lsls r0, 24 lsrs r7, r0, 24 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -43533,7 +43533,7 @@ sub_804CF10: @ 804CF10 strb r1, [r0] ldr r1, [r4] adds r1, 0x93 - ldr r3, =gUnknown_0832A328 + ldr r3, =gBitTable ldrb r0, [r5] lsls r0, 2 adds r0, r3 @@ -43591,7 +43591,7 @@ atk50_openpartyscreen: @ 804CF88 beq _0804CFBE b _0804D464 _0804CFBE: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x41 ands r1, r0 @@ -43606,7 +43606,7 @@ _0804CFBE: b _0804D450 _0804CFD8: ldr r7, =gUnknown_02024280 - ldr r6, =gUnknown_0832A328 + ldr r6, =gBitTable adds r4, r1, 0 ldr r2, =gUnknown_02024210 mov r8, r2 @@ -43704,7 +43704,7 @@ _0804D0B8: mov r8, r0 ldr r0, [r0] lsrs r5, r0, 28 - ldr r6, =gUnknown_0832A328 + ldr r6, =gBitTable ldr r0, [r6] ands r0, r5 cmp r0, 0 @@ -43778,7 +43778,7 @@ _0804D15C: movs r0, 0x1 mov r9, r0 _0804D170: - ldr r6, =gUnknown_0832A328 + ldr r6, =gBitTable ldr r0, [r6, 0x8] ands r0, r5 cmp r0, 0 @@ -43860,7 +43860,7 @@ _0804D214: ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution _0804D22E: - ldr r6, =gUnknown_0832A328 + ldr r6, =gBitTable ldr r0, [r6, 0x4] ands r0, r5 cmp r0, 0 @@ -43937,7 +43937,7 @@ _0804D2CC: orrs r2, r0 mov r9, r2 _0804D2E4: - ldr r6, =gUnknown_0832A328 + ldr r6, =gBitTable ldr r0, [r6, 0xC] ands r0, r5 cmp r0, 0 @@ -44034,7 +44034,7 @@ _0804D3A2: beq _0804D3FA ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r0, =gUnknown_0832A328 + ldr r0, =gBitTable ldr r0, [r0] ands r1, r0 cmp r1, 0 @@ -44071,7 +44071,7 @@ _0804D3FA: beq _0804D450 ldr r0, =gUnknown_02024210 ldrb r0, [r0] - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r1, [r1, 0x4] ands r0, r1 cmp r0, 0 @@ -44104,7 +44104,7 @@ _0804D464: beq _0804D46A b _0804D658 _0804D46A: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x40 ands r0, r1 @@ -44121,7 +44121,7 @@ _0804D482: ldr r7, =gUnknown_02024280 ldr r0, [r7] lsrs r5, r0, 28 - ldr r4, =gUnknown_0832A328 + ldr r4, =gBitTable ldr r0, [r4, 0x8] ands r0, r5 cmp r0, 0 @@ -44189,7 +44189,7 @@ _0804D4F8: orrs r1, r2 strb r1, [r0] _0804D52A: - ldr r4, =gUnknown_0832A328 + ldr r4, =gBitTable ldr r0, [r4, 0xC] ands r0, r5 cmp r0, 0 @@ -44277,7 +44277,7 @@ _0804D5F8: ldr r1, =gUnknown_0202420D movs r0, 0 strb r0, [r1] - ldr r4, =gUnknown_0832A328 + ldr r4, =gBitTable ldr r2, [r4] ands r2, r5 ldr r6, =gUnknown_0202406C @@ -44352,7 +44352,7 @@ _0804D690: ldr r2, =gUnknown_02024064 strb r7, [r2] ldr r3, =gUnknown_02024210 - ldr r4, =gUnknown_0832A328 + ldr r4, =gBitTable ldrb r0, [r2] lsls r0, 2 adds r0, r4 @@ -44394,7 +44394,7 @@ _0804D6E0: strb r1, [r0] ldr r1, [r3] adds r1, 0x93 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable ldrb r0, [r4] lsls r0, 2 adds r0, r2 @@ -44436,7 +44436,7 @@ _0804D6E0: adds r0, 0x1 strb r0, [r1, 0x2] _0804D760: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -44484,7 +44484,7 @@ _0804D7C4: strb r0, [r4] ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable ldrb r3, [r4] lsls r0, r3, 2 adds r0, r2 @@ -44566,7 +44566,7 @@ _0804D870: ldr r0, [r5] adds r0, 0x93 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, r6, 2 adds r0, r2 ldr r4, [r0] @@ -44594,7 +44594,7 @@ _0804D8AA: b _0804DA82 .pool _0804D8CC: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -44611,7 +44611,7 @@ _0804D8E8: ldr r0, [r4] adds r0, 0x93 ldrb r1, [r0] - ldr r6, =gUnknown_0832A328 + ldr r6, =gBitTable ldrb r2, [r5] lsls r0, r2, 2 adds r0, r6 @@ -44655,7 +44655,7 @@ _0804D922: adds r0, r2 ldrb r0, [r0] strb r0, [r1] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x42 ands r0, r1 @@ -44768,7 +44768,7 @@ _0804DA36: strb r5, [r1] movs r0, 0x6 strb r0, [r1, 0x1] - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons ldr r3, =gUnknown_0202420B ldrb r0, [r3] movs r2, 0x58 @@ -44832,7 +44832,7 @@ atk52_cmd52: @ 804DAAC bl sub_803FA70 ldr r1, =gUnknown_02024280 mov r8, r1 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r0, [r4] lsls r0, 2 adds r0, r1 @@ -44881,7 +44881,7 @@ _0804DB1C: bne _0804DB34 b _0804DC30 _0804DB34: - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons ldrb r2, [r4] movs r6, 0x58 adds r0, r2, 0 @@ -44981,7 +44981,7 @@ _0804DC24: b _0804DD8E .pool _0804DC30: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r1, =gUnknown_02024064 ldrb r3, [r1] movs r0, 0x58 @@ -45073,7 +45073,7 @@ _0804DCD8: cmp r4, r0 bge _0804DD0C ldr r6, =gUnknown_0202449C - ldr r5, =gUnknown_02024084 + ldr r5, =gBattleMons _0804DCE6: lsls r0, r4, 24 lsrs r0, 24 @@ -45107,7 +45107,7 @@ _0804DD0C: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable b _0804DD6E .pool _0804DD60: @@ -45377,7 +45377,7 @@ _0804DF88: ldrb r1, [r1, 0x10] cmp r0, r1 bne _0804DFC8 - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons movs r0, 0x58 adds r2, r3, 0 muls r2, r0 @@ -45394,7 +45394,7 @@ _0804DF88: adds r1, r5, 0 bl sub_80691B0 _0804DFC8: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -45414,7 +45414,7 @@ _0804DFC8: ldrb r1, [r1, 0x10] cmp r0, r1 bne _0804E014 - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons movs r0, 0x58 adds r2, r3, 0 muls r2, r0 @@ -45722,7 +45722,7 @@ _0804E274: ldrb r1, [r1, 0x10] cmp r0, r1 bne _0804E30A - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons ldr r0, [r4, 0x50] movs r1, 0x80 lsls r1, 14 @@ -45732,7 +45732,7 @@ _0804E274: ldr r0, =gUnknown_020242BC ldrb r1, [r0, 0x18] lsrs r1, 4 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, r5, 2 adds r0, r2 ldr r0, [r0] @@ -45747,7 +45747,7 @@ _0804E274: adds r2, r5, 0 bl sub_8069234 _0804E30A: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -45760,7 +45760,7 @@ _0804E30A: ldrb r1, [r1, 0x10] cmp r0, r1 bne _0804E3B8 - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons movs r1, 0x80 lsls r1, 1 adds r0, r4, r1 @@ -45774,7 +45774,7 @@ _0804E30A: adds r0, 0x50 ldrb r1, [r0] lsrs r1, 4 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, r5, 2 adds r0, r2 ldr r0, [r0] @@ -45991,7 +45991,7 @@ atk5C_cmd5c: @ 804E508 ands r0, r1 cmp r0, 0 beq _0804E55A - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r2, [r2] movs r0, 0x58 muls r0, r2 @@ -46130,7 +46130,7 @@ _0804E644: ldr r0, =gUnknown_0202449C mov r8, r0 mov r9, r1 - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags mov r10, r1 cmp r3, 0xFF beq _0804E67A @@ -46206,7 +46206,7 @@ sub_804E6D8: @ 804E6D8 ldrh r0, [r0] bl sub_804E598 adds r4, r0, 0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 8 @@ -46590,7 +46590,7 @@ atk64_statusanimation: @ 804E9F4 ands r0, r1 cmp r0, 0 bne _0804EA54 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r2 adds r1, 0x4C @@ -46660,7 +46660,7 @@ atk65_8025D90: @ 804EA84 ands r0, r1 cmp r0, 0 bne _0804EAFC - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r2 adds r1, 0x50 @@ -46883,7 +46883,7 @@ _0804ECC2: thumb_func_start atk69_8025FE0 atk69_8025FE0: @ 804ECDC push {r4-r7,lr} - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons ldr r6, =gUnknown_0202420C ldrb r2, [r6] movs r5, 0x58 @@ -46944,7 +46944,7 @@ _0804ED2A: orrs r1, r2 strb r1, [r0] _0804ED68: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r3, =gUnknown_0202420C ldrb r4, [r3] movs r0, 0x58 @@ -47060,7 +47060,7 @@ atk6A_stash_item_for_side: @ 804EE58 adds r0, 0xB8 ldr r1, [r1] adds r1, r0 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons movs r3, 0x58 adds r0, r4, 0 muls r0, r3 @@ -47766,7 +47766,7 @@ sub_804F498: @ 804F498 ldrb r2, [r0, 0x10] cmp r1, r2 beq _0804F4BA - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -47932,7 +47932,7 @@ _0804F5F0: thumb_func_start atk73_cmd73 atk73_cmd73: @ 804F5F8 push {r4-r6,lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r4, [r0] movs r6, 0x1 ands r4, r6 @@ -47948,7 +47948,7 @@ atk73_cmd73: @ 804F5F8 eors r0, r1 lsls r0, 24 lsrs r0, 24 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons movs r1, 0x58 muls r1, r0 adds r1, r2 @@ -48013,7 +48013,7 @@ atk74_hp_tresholds_2: @ 804F6A4 push {r4-r7,lr} mov r7, r8 push {r7} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r7, [r0] movs r0, 0x1 mov r8, r0 @@ -48040,7 +48040,7 @@ atk74_hp_tresholds_2: @ 804F6A4 adds r0, r6 adds r0, 0xA8 ldrb r5, [r0] - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r4 adds r0, r1 @@ -48204,7 +48204,7 @@ _0804F85C: ldrb r0, [r2, 0x8] cmp r0, 0 beq _0804F8A8 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r2, [r2, 0x9] movs r0, 0x58 muls r0, r2 @@ -48239,7 +48239,7 @@ _0804F8CC: .pool _0804F8E4: ldr r2, =gUnknown_02024280 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r0, =gUnknown_02024064 ldrb r0, [r0] lsls r0, 2 @@ -48318,7 +48318,7 @@ _0804F98C: ldr r1, [r6] adds r4, r1, r0 movs r3, 0 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r2 adds r1, 0xC @@ -48353,7 +48353,7 @@ _0804F9D2: b _0804FD70 .pool _0804F9E0: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0xB ands r0, r1 @@ -48361,7 +48361,7 @@ _0804F9E0: beq _0804F9EE b _0804FD70 _0804F9EE: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrh r0, [r1, 0x28] cmp r0, 0 bne _0804F9F8 @@ -48396,7 +48396,7 @@ _0804FA20: adds r7, r0, 0 adds r7, 0x92 ldrb r3, [r7] - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r2, [r6] lsls r0, r2, 2 adds r0, r1 @@ -48407,7 +48407,7 @@ _0804FA20: beq _0804FA50 b _0804FD70 _0804FA50: - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons movs r0, 0x58 mov r12, r0 mov r1, r12 @@ -48472,12 +48472,12 @@ _0804FADE: b _0804FD70 .pool _0804FAE8: - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons adds r0, 0x80 movs r1, 0 strh r1, [r0] ldr r2, =gUnknown_02024280 - ldr r3, =gUnknown_0832A328 + ldr r3, =gBitTable ldr r1, [r3, 0x4] lsls r1, 28 ldr r0, [r2] @@ -48502,11 +48502,11 @@ _0804FAE8: b _0804FBF4 .pool _0804FB3C: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0 strh r0, [r1, 0x28] ldr r2, =gUnknown_02024280 - ldr r3, =gUnknown_0832A328 + ldr r3, =gBitTable ldr r1, [r3] lsls r1, 28 ldr r0, [r2] @@ -48536,13 +48536,13 @@ _0804FB3C: b _0804FD70 .pool _0804FB94: - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons movs r1, 0 strh r1, [r0, 0x28] adds r0, 0x80 strh r1, [r0] ldr r2, =gUnknown_02024280 - ldr r3, =gUnknown_0832A328 + ldr r3, =gBitTable ldr r0, [r3] lsls r0, 28 ldr r1, [r2] @@ -48634,7 +48634,7 @@ _0804FC78: ldr r4, =gUnknown_02024064 movs r0, 0x1 strb r0, [r4] - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons adds r0, 0x58 b _0804FCA2 .pool @@ -48646,7 +48646,7 @@ _0804FC8C: ldr r4, =gUnknown_02024064 movs r0, 0x3 strb r0, [r4] - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons movs r2, 0x84 lsls r2, 1 adds r0, r2 @@ -48681,7 +48681,7 @@ _0804FCF0: ldr r2, [r0] ldr r0, =0x000002a2 adds r2, r0 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r0, =gUnknown_02024064 ldrb r0, [r0] lsls r0, 2 @@ -48895,7 +48895,7 @@ atk78_faintifabilitynotdamp: @ 804FEC8 ldrb r3, [r0] adds r5, r1, 0 mov r8, r0 - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons cmp r2, r3 bcs _0804FF14 adds r0, r6, 0 @@ -48955,7 +48955,7 @@ _0804FF14: beq _0804FFCC adds r3, r5, 0 ldrb r5, [r7] - ldr r7, =gUnknown_0832A328 + ldr r7, =gBitTable adds r4, r0, 0 ldr r6, =gUnknown_02024210 _0804FF60: @@ -49014,7 +49014,7 @@ atk79_setuserhptozero: @ 804FFE4 ldr r0, =gUnknown_0202420B ldrb r0, [r0] strb r0, [r4] - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r0, [r4] movs r2, 0x58 muls r0, r2 @@ -49059,7 +49059,7 @@ sub_8050044: @ 8050044 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r4, r0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -49075,7 +49075,7 @@ sub_8050044: @ 8050044 lsrs r1, 24 adds r3, r0, 0 ldr r6, =gUnknown_02024210 - ldr r5, =gUnknown_0832A328 + ldr r5, =gBitTable ldr r0, =gUnknown_0202406C mov r12, r0 ldrb r0, [r2] @@ -49145,7 +49145,7 @@ sub_80500E8: @ 80500E8 strb r0, [r3] _08050110: ldr r1, =gUnknown_020241F0 - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons ldrb r0, [r3] movs r5, 0x58 muls r0, r5 @@ -49433,7 +49433,7 @@ _0805035C: adds r0, r4 ldrb r1, [r6] strb r1, [r0, 0x1] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ands r0, r5 cmp r0, 0 @@ -49501,7 +49501,7 @@ _0805041A: b _08050488 .pool _08050438: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r4 adds r1, r0, r1 @@ -49589,7 +49589,7 @@ _080504D8: bne _080504EA str r2, [r3] _080504EA: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420C ldrb r1, [r0] movs r0, 0x58 @@ -49643,7 +49643,7 @@ atk81_setrest: @ 8050528 strb r0, [r2] strb r0, [r5] ldr r4, =gUnknown_020241F0 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r0, [r2] movs r3, 0x58 muls r0, r3 @@ -49774,7 +49774,7 @@ sub_8050650: @ 8050650 mov r8, r0 cmp r2, r1 bge _080506C4 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons mov r12, r0 movs r0, 0x58 muls r0, r3 @@ -49864,7 +49864,7 @@ sub_80506EC: @ 80506EC b _08050762 .pool _08050720: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r3, [r6] movs r0, 0x58 muls r0, r3 @@ -50004,7 +50004,7 @@ _08050828: ldrb r0, [r6] movs r4, 0x58 muls r0, r4 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons adds r0, r2 ldrb r1, [r5] muls r1, r4 @@ -50110,7 +50110,7 @@ atk87_stockpiletohprecovery: @ 8050904 b _080509D0 .pool _08050954: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r3 adds r1, r0, r1 @@ -50357,7 +50357,7 @@ _08050B68: b _08050E80 .pool _08050B78: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r1, =gUnknown_02024064 ldrb r3, [r1] movs r4, 0x58 @@ -50611,7 +50611,7 @@ _08050DA6: mov r2, r12 orrs r0, r2 strb r0, [r1] - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r4, =gUnknown_02024064 ldrb r3, [r4] movs r0, 0x58 @@ -50765,7 +50765,7 @@ atk8A_normalisebuffs: @ 8050EEC mov r12, r0 cmp r2, r1 bge _08050F24 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons movs r4, 0x6 adds r5, r1, 0 movs r7, 0x58 @@ -50801,7 +50801,7 @@ _08050F24: thumb_func_start atk8B_setbide atk8B_setbide: @ 8050F40 push {r4,r5,lr} - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons ldr r3, =gUnknown_0202420B ldrb r0, [r3] movs r5, 0x58 @@ -50849,7 +50849,7 @@ atk8B_setbide: @ 8050F40 thumb_func_start atk8C_confuseifrepeatingattackends atk8C_confuseifrepeatingattackends: @ 8050FB0 push {lr} - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r2, [r0] movs r0, 0x58 @@ -50935,7 +50935,7 @@ atk8E_cmd8e: @ 805103C thumb_func_start sub_8051064 sub_8051064: @ 8051064 push {r4-r7,lr} - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons ldr r7, =gUnknown_0202420B ldrb r0, [r7] movs r5, 0x58 @@ -51032,7 +51032,7 @@ sub_805112C: @ 805112C sub sp, 0xC movs r0, 0 str r0, [sp, 0x4] - ldr r5, =gUnknown_02022FEC + ldr r5, =gBattleTypeFlags ldr r0, [r5] movs r1, 0x8 ands r0, r1 @@ -51320,7 +51320,7 @@ _08051378: ldrb r0, [r4] bl sub_803BDA0 _08051396: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r2, [r0] movs r1, 0x81 lsls r1, 1 @@ -51356,7 +51356,7 @@ _080513C0: movs r2, 0x1 bl sub_81B8E80 _080513DE: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 15 @@ -51391,7 +51391,7 @@ sub_8051424: @ 8051424 mov r5, r8 push {r5-r7} movs r6, 0 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r3, =gUnknown_0202420B ldrb r1, [r3] movs r0, 0x58 @@ -51425,7 +51425,7 @@ _08051466: bcs _080514E8 ldr r0, =gBattleMoves mov r10, r0 - ldr r5, =gUnknown_02024084 + ldr r5, =gBattleMons mov r12, r5 ldr r7, =gUnknown_0202420B ldrb r0, [r7] @@ -51512,7 +51512,7 @@ _08051512: ands r3, r7 cmp r3, r6 bcs _08051512 - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons lsls r1, r3, 1 ldr r3, =gUnknown_0202420B ldrb r2, [r3] @@ -51597,7 +51597,7 @@ _080515B0: thumb_func_start atk91_givemoney atk91_givemoney: @ 80515C8 push {r4,lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x02000002 ands r0, r1 @@ -51716,7 +51716,7 @@ _080516A4: adds r0, r4 ldrb r1, [r5] strb r1, [r0, 0x3] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ands r0, r6 cmp r0, 0 @@ -51752,7 +51752,7 @@ atk93_ko_move: @ 8051730 mov r7, r9 mov r6, r8 push {r6,r7} - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons ldr r6, =gUnknown_0202420C ldrb r2, [r6] movs r5, 0x58 @@ -51813,7 +51813,7 @@ _08051782: orrs r1, r2 strb r1, [r0] _080517C0: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r2, =gUnknown_0202420C ldrb r3, [r2] movs r6, 0x58 @@ -51932,7 +51932,7 @@ _080518CA: adds r2, r0 lsls r2, 2 adds r2, r1 - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons ldrb r0, [r7] movs r5, 0x58 muls r0, r5 @@ -51979,7 +51979,7 @@ _080518CA: _08051934: movs r4, 0 _08051936: - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons mov r8, r3 ldr r0, =gUnknown_0202420C mov r9, r0 @@ -52065,7 +52065,7 @@ _08051A08: movs r1, 0x1 orrs r0, r1 strb r0, [r2] - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r0, [r0] movs r2, 0x58 @@ -52118,7 +52118,7 @@ _08051A70: atk94_gethalfcurrentenemyhp: @ 8051A84 push {lr} ldr r3, =gUnknown_020241F0 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420C ldrb r1, [r0] movs r0, 0x58 @@ -52216,7 +52216,7 @@ _08051B4C: ldr r5, =gUnknown_0202420B cmp r0, 0 beq _08051BDA - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons ldrb r2, [r5] movs r1, 0x58 muls r1, r2 @@ -52278,7 +52278,7 @@ _08051BDA: ands r0, r1 cmp r0, 0 beq _08051C50 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r3, [r5] movs r0, 0x58 muls r0, r3 @@ -52330,7 +52330,7 @@ _08051C48: _08051C50: ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable ldrb r0, [r5] lsls r0, 2 adds r0, r2 @@ -52438,7 +52438,7 @@ _08051D1C: ldrb r0, [r5] movs r6, 0x58 muls r0, r6 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons adds r0, r1 adds r0, 0x20 ldrb r2, [r0] @@ -52468,7 +52468,7 @@ _08051D94: beq _08051DE4 ldrb r0, [r5] muls r0, r6 - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons adds r4, 0x50 adds r0, r4 ldr r0, [r0] @@ -52512,7 +52512,7 @@ _08051E08: adds r2, r0, 0 muls r2, r6 adds r2, r4 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r0, =gUnknown_0202420B ldrb r0, [r0] lsls r0, 2 @@ -52552,7 +52552,7 @@ sub_8051E48: @ 8051E48 bl get_battle_side_of_something ldr r4, =gUnknown_02024064 strb r0, [r4] - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldrb r1, [r4] movs r0, 0x58 adds r2, r1, 0 @@ -52580,7 +52580,7 @@ _08051EA0: strb r0, [r4] ldr r6, =gUnknown_02024210 ldrb r1, [r6] - ldr r7, =gUnknown_0832A328 + ldr r7, =gBitTable ldrb r2, [r4] lsls r0, r2, 2 adds r0, r7 @@ -52588,7 +52588,7 @@ _08051EA0: ands r1, r0 cmp r1, 0 bne _08051EDC - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons movs r0, 0x58 muls r2, r0 adds r0, r3, 0 @@ -52603,7 +52603,7 @@ _08051EA0: ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution _08051EDC: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -52625,7 +52625,7 @@ _08051EDC: ands r1, r0 cmp r1, 0 bne _08051F2C - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons movs r0, 0x58 muls r2, r0 adds r0, r3, 0 @@ -52728,7 +52728,7 @@ _08051FE6: thumb_func_start atk9A_setincreasedcriticalchance atk9A_setincreasedcriticalchance: @ 8052000 push {lr} - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r2, [r0] movs r0, 0x58 @@ -52780,7 +52780,7 @@ atk9B_transformdataexecution: @ 805205C ldr r0, [r1] adds r0, 0x1 str r0, [r1] - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons ldr r0, =gUnknown_0202420C mov r12, r0 ldrb r1, [r0] @@ -52956,7 +52956,7 @@ _080521EC: thumb_func_start sub_80521FC sub_80521FC: @ 80521FC push {r4-r7,lr} - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons ldr r6, =gUnknown_0202420B ldrb r0, [r6] movs r5, 0x58 @@ -53094,7 +53094,7 @@ atk9D_copyattack: @ 8052300 lsls r0, 24 cmp r0, 0 bne _0805235A - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldr r2, =gUnknown_0202420B ldrb r1, [r2] movs r0, 0x58 @@ -53249,7 +53249,7 @@ _0805244C: adds r2, r1 ldrb r4, [r2, 0x18] lsrs r3, r4, 4 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r0, [r5] lsls r0, 2 adds r0, r1 @@ -53365,7 +53365,7 @@ _0805251C: thumb_func_start atk9F_nightshadedamageeffect atk9F_nightshadedamageeffect: @ 8052584 ldr r3, =gUnknown_020241F0 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r1, [r0] movs r0, 0x58 @@ -53396,7 +53396,7 @@ _080525B8: adds r0, r3 lsls r3, r0, 1 ldr r4, =gUnknown_020241F0 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r1, [r0] movs r0, 0x58 @@ -53445,7 +53445,7 @@ atkA1_counterdamagecalculator: @ 8052608 beq _080526BC cmp r6, r2 beq _080526BC - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons adds r0, r1, r5 ldrb r0, [r0, 0xC] movs r4, 0x58 @@ -53550,7 +53550,7 @@ atkA2_mirrorcoatdamagecalculator: @ 8052700 beq _080527B4 cmp r6, r2 beq _080527B4 - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons adds r0, r1, r5 ldrb r0, [r0, 0xD] movs r4, 0x58 @@ -53636,7 +53636,7 @@ atkA3_disablelastusedattack: @ 80527F8 mov r6, r8 push {r6,r7} movs r4, 0 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r3, =gUnknown_0202420C ldrb r1, [r3] movs r0, 0x58 @@ -53793,7 +53793,7 @@ atkA4_setencore: @ 805293C mov r5, r8 push {r5-r7} movs r5, 0 - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldr r4, =gUnknown_0202420C ldrb r1, [r4] movs r0, 0x58 @@ -53941,7 +53941,7 @@ _08052A5E: thumb_func_start sub_8052A70 sub_8052A70: @ 8052A70 push {r4-r7,lr} - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons ldr r0, =gUnknown_0202420C mov r12, r0 ldrb r0, [r0] @@ -54049,7 +54049,7 @@ atkA6_settypetorandomresistance: @ 8052B34 lsls r0, 24 cmp r0, 0 beq _08052C1C - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r2, =gUnknown_02024270 ldrb r0, [r4] adds r0, r2 @@ -54109,7 +54109,7 @@ _08052BE0: mov r4, r10 ldrb r0, [r4] muls r0, r6 - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons adds r0, r7 adds r0, 0x22 strb r2, [r0] @@ -54158,7 +54158,7 @@ _08052C24: ldrb r0, [r0] cmp r0, 0x5 bhi _08052C80 - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons movs r2, 0x58 adds r0, r5, 0 muls r0, r2 @@ -54215,7 +54215,7 @@ _08052CA6: movs r6, 0x58 adds r0, r2, 0 muls r0, r6 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons adds r2, r0, r1 adds r4, r2, 0 adds r4, 0x21 @@ -54313,7 +54313,7 @@ atkA8_copymovepermanently: @ 8052D8C ldr r1, =0x0000ffff adds r5, r1, 0 strh r5, [r0] - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldr r2, =gUnknown_0202420B ldrb r1, [r2] movs r0, 0x58 @@ -54680,7 +54680,7 @@ _08053036: cmp r0, 0 beq _08053084 _08053076: - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable lsls r0, r5, 2 adds r0, r1 ldr r0, [r0] @@ -54708,7 +54708,7 @@ _08053084: .pool _080530B8: movs r7, 0x3 - ldr r4, =gUnknown_0832A328 + ldr r4, =gBitTable _080530BC: bl Random adds r5, r7, 0 @@ -54720,7 +54720,7 @@ _080530BC: cmp r0, 0 bne _080530BC ldr r4, =gUnknown_020241EE - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons lsls r1, r5, 1 ldr r0, =gUnknown_0202420B ldrb r3, [r0] @@ -54769,7 +54769,7 @@ _0805311C: thumb_func_start atkAA_destinybondeffect atkAA_destinybondeffect: @ 8053150 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r2, [r0] movs r0, 0x58 @@ -54802,7 +54802,7 @@ b_feature_update_destiny_bond: @ 8053180 bl battle_side_get_owner lsls r0, 24 lsrs r3, r0, 24 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r2, [r4] movs r0, 0x58 muls r0, r2 @@ -54849,7 +54849,7 @@ atkAB_802A458: @ 80531E0 thumb_func_start atkAC_remaininghptopower atkAC_remaininghptopower: @ 80531F8 push {lr} - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r1, [r0] movs r0, 0x58 @@ -54918,7 +54918,7 @@ _08053280: b _08053408 _08053288: movs r7, 0 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons movs r1, 0x58 muls r1, r3 adds r3, r0, 0 @@ -54959,7 +54959,7 @@ _080532C6: muls r3, r0 adds r0, r3, 0 adds r0, r7, r0 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons adds r1, 0x24 mov r10, r1 add r0, r10 @@ -55038,7 +55038,7 @@ _08053304: adds r0, r1 ldrb r1, [r0, 0x18] lsrs r1, 4 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, r7, 2 adds r0, r2 ldr r0, [r0] @@ -55047,7 +55047,7 @@ _08053304: bne _080533B8 mov r2, r9 muls r2, r3 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons adds r0, 0x50 adds r0, r2, r0 ldr r0, [r0] @@ -55075,7 +55075,7 @@ _080533B8: ldr r0, [r1] adds r0, 0x5 str r0, [r1] - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0202420C ldrb r2, [r0] movs r0, 0x58 @@ -55147,7 +55147,7 @@ _08053454: ldr r2, =gUnknown_020244EC mov r10, r2 _08053470: - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons ldrb r3, [r5] movs r7, 0x58 adds r2, r3, 0 @@ -55198,7 +55198,7 @@ _080534D4: ldr r1, =gUnknown_02024474 strb r0, [r1, 0x17] strb r0, [r7] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -55206,7 +55206,7 @@ _080534D4: beq _0805357A ldr r0, =gUnknown_02024210 ldrb r2, [r0] - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r3, [r7] lsls r0, r3, 2 adds r0, r1 @@ -55214,7 +55214,7 @@ _080534D4: ands r2, r0 cmp r2, 0 bne _0805357A - ldr r5, =gUnknown_02024084 + ldr r5, =gBattleMons movs r6, 0x58 adds r4, r3, 0 muls r4, r6 @@ -55251,7 +55251,7 @@ _08053568: strb r0, [r1, 0x5] _0805357A: movs r6, 0 - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons _0805357E: movs r0, 0x64 adds r4, r6, 0 @@ -55286,7 +55286,7 @@ _0805357E: b _08053600 .pool _080535D0: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -55301,7 +55301,7 @@ _080535D0: bne _08053618 ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, r3, 2 adds r0, r2 ldr r0, [r0] @@ -55343,7 +55343,7 @@ _0805363E: strb r0, [r1, 0x5] movs r2, 0x3F mov r8, r2 - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldr r2, =gUnknown_0202420B ldrb r0, [r2] movs r5, 0x58 @@ -55372,7 +55372,7 @@ _0805363E: bl battle_get_side_with_given_state ldr r4, =gUnknown_02024064 strb r0, [r4] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -55380,7 +55380,7 @@ _0805363E: beq _080536BC ldr r0, =gUnknown_02024210 ldrb r2, [r0] - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r3, [r4] lsls r0, r3, 2 adds r0, r1 @@ -55434,7 +55434,7 @@ _080536DE: thumb_func_start atkAF_cursetarget atkAF_cursetarget: @ 805371C push {r4,r5,lr} - ldr r5, =gUnknown_02024084 + ldr r5, =gBattleMons ldr r0, =gUnknown_0202420C ldrb r0, [r0] movs r4, 0x58 @@ -55558,7 +55558,7 @@ _0805381E: thumb_func_start atkB1_setforesight atkB1_setforesight: @ 805382C - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0202420C ldrb r2, [r0] movs r0, 0x58 @@ -55594,7 +55594,7 @@ atkB2_setperishsong: @ 805385C cmp r6, r1 bge _080538C8 movs r5, 0x20 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons mov r12, r0 ldr r0, =gUnknown_020242BC adds r4, r0, 0 @@ -55688,7 +55688,7 @@ atkB3_rolloutdamagecalculation: @ 8053914 b _08053A60 .pool _08053948: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r1, =gUnknown_0202420B ldrb r3, [r1] movs r5, 0x58 @@ -55846,7 +55846,7 @@ _08053A60: thumb_func_start atkB4_jumpifconfusedandattackmaxed atkB4_jumpifconfusedandattackmaxed: @ 8053A90 push {r4,r5,lr} - ldr r5, =gUnknown_02024084 + ldr r5, =gBattleMons ldr r0, =gUnknown_0202420C ldrb r1, [r0] movs r0, 0x58 @@ -55987,7 +55987,7 @@ atkB6_happinesstodamagecalculation: @ 8053BAC cmp r0, 0x79 bne _08053BEC ldr r4, =gUnknown_02024400 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r1, [r0] movs r0, 0x58 @@ -55999,7 +55999,7 @@ atkB6_happinesstodamagecalculation: @ 8053BAC .pool _08053BEC: ldr r4, =gUnknown_02024400 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r1, [r0] movs r0, 0x58 @@ -56057,7 +56057,7 @@ _08053C5C: .pool _08053C6C: ldr r3, =gUnknown_020241F0 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420C ldrb r1, [r0] movs r0, 0x58 @@ -56082,7 +56082,7 @@ _08053C8E: b _08053CE6 .pool _08053CAC: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420C ldrb r1, [r0] movs r0, 0x58 @@ -56279,7 +56279,7 @@ _08053E3C: adds r4, r6, 0 ldr r0, =gUnknown_0202420B ldrb r5, [r0] - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable mov r12, r1 ldr r7, =gUnknown_02024210 _08053E72: @@ -56370,7 +56370,7 @@ _08053F2A: ldrb r1, [r1, 0xC] cmp r2, r1 bne _08054030 - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons movs r2, 0x58 adds r0, r3, 0 muls r0, r2 @@ -56530,7 +56530,7 @@ _0805409A: thumb_func_start atkBC_maxattackhalvehp atkBC_maxattackhalvehp: @ 80540B4 push {r4,r5,lr} - ldr r5, =gUnknown_02024084 + ldr r5, =gBattleMons ldr r4, =gUnknown_0202420B ldrb r0, [r4] movs r3, 0x58 @@ -56626,7 +56626,7 @@ _08054142: thumb_func_start atkBE_breakfree atkBE_breakfree: @ 805417C push {r4-r6,lr} - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r5, =gUnknown_0202420B ldrb r2, [r5] movs r6, 0x58 @@ -56758,7 +56758,7 @@ _080542BA: thumb_func_start atkBF_setcurled atkBF_setcurled: @ 80542C8 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r2, [r0] movs r0, 0x58 @@ -56786,7 +56786,7 @@ atkC0_recoverbasedonsunlight: @ 80542F8 ldr r5, =gUnknown_0202420B ldrb r0, [r5] strb r0, [r1] - ldr r7, =gUnknown_02024084 + ldr r7, =gBattleMons ldrb r0, [r5] movs r6, 0x58 muls r0, r6 @@ -56821,7 +56821,7 @@ atkC0_recoverbasedonsunlight: @ 80542F8 beq _08054378 _0805434A: ldr r3, =gUnknown_020241F0 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r1, [r0] movs r0, 0x58 @@ -56907,7 +56907,7 @@ sub_8054400: @ 8054400 mov r6, r9 mov r5, r8 push {r5-r7} - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r1, [r0] movs r0, 0x58 @@ -57058,7 +57058,7 @@ atkC2_selectnexttarget: @ 8054524 adds r3, r6, 0 ldr r0, =gUnknown_0202420B ldrb r5, [r0] - ldr r0, =gUnknown_0832A328 + ldr r0, =gBitTable mov r12, r0 adds r4, r1, 0 ldr r7, =gUnknown_02024210 @@ -57173,7 +57173,7 @@ _080545DC: ldrb r0, [r5] movs r4, 0x58 muls r0, r4 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons adds r0, r2 ldrb r1, [r6] muls r1, r4 @@ -57258,7 +57258,7 @@ atkC4_802B910: @ 80546E4 bne _080546FE ldr r7, =gUnknown_020244EC _080546FE: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420C ldrb r1, [r0] movs r0, 0x58 @@ -57392,7 +57392,7 @@ _080547A4: ldr r1, [r2] muls r0, r1 str r0, [r2] - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldr r1, =gUnknown_0202420C ldrb r2, [r1] movs r1, 0x58 @@ -57670,7 +57670,7 @@ _08054A86: thumb_func_start atkC9_jumpifattackandspecialattackcannotfall atkC9_jumpifattackandspecialattackcannotfall: @ 8054AA0 push {r4,lr} - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420C ldrb r1, [r0] movs r0, 0x58 @@ -57861,7 +57861,7 @@ atkCC_callterrainattack: @ 8054BEC atkCD_cureifburnedparalysedorpoisoned: @ 8054C60 push {r4-r6,lr} sub sp, 0x4 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r3, =gUnknown_0202420B ldrb r0, [r3] movs r6, 0x58 @@ -57921,7 +57921,7 @@ _08054CD6: thumb_func_start atkCE_settorment atkCE_settorment: @ 8054CE4 push {lr} - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0202420C ldrb r2, [r0] movs r0, 0x58 @@ -58077,7 +58077,7 @@ atkD1_sethelpinghand: @ 8054E0C bl battle_get_side_with_given_state ldr r3, =gUnknown_0202420C strb r0, [r3] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -58085,7 +58085,7 @@ atkD1_sethelpinghand: @ 8054E0C beq _08054E90 ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable ldrb r3, [r3] lsls r0, r3, 2 adds r0, r2 @@ -58145,7 +58145,7 @@ sub_8054EB4: @ 8054EB4 mov r5, r8 push {r5-r7} sub sp, 0x4 - ldr r4, =gUnknown_02022FEC + ldr r4, =gBattleTypeFlags ldr r0, [r4] movs r1, 0x80 lsls r1, 19 @@ -58175,7 +58175,7 @@ _08054EE8: bl battle_side_get_owner lsls r0, 24 lsrs r5, r0, 24 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x0a3f0902 ands r0, r1 @@ -58186,7 +58186,7 @@ _08054EE8: adds r2, 0x29 adds r0, r4, r2 ldrb r1, [r0] - ldr r4, =gUnknown_0832A328 + ldr r4, =gBitTable ldr r3, =gUnknown_0202406E ldrb r0, [r6] lsls r0, 1 @@ -58211,7 +58211,7 @@ _08054EE8: cmp r1, 0 bne _08054F9A _08054F46: - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons mov r8, r0 ldr r1, =gUnknown_0202420B ldrb r4, [r1] @@ -58436,7 +58436,7 @@ _08055132: thumb_func_start sub_8055148 sub_8055148: @ 8055148 push {r4,lr} - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldr r4, =gUnknown_0202420C ldrb r0, [r4] movs r2, 0x58 @@ -58543,7 +58543,7 @@ _08055210: movs r0, 0xFF strb r0, [r1, 0x4] ldr r1, =gUnknown_020241F0 - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons ldrb r0, [r4] movs r5, 0x58 muls r0, r5 @@ -58691,7 +58691,7 @@ sub_805534C: @ 805534C ands r0, r2 cmp r0, 0 bne _08055374 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r3 adds r1, 0x4C @@ -58734,7 +58734,7 @@ _080553B0: thumb_func_start atkD8_setdamagetohealthdifference atkD8_setdamagetohealthdifference: @ 80553BC push {lr} - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420C ldrb r0, [r0] movs r1, 0x58 @@ -58794,7 +58794,7 @@ atkD9_scaledamagebyhealthratio: @ 8055428 lsls r0, 2 adds r0, r2 ldrb r3, [r0, 0x1] - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r1, [r0] movs r0, 0x58 @@ -58824,7 +58824,7 @@ _08055464: thumb_func_start atkDA_abilityswap atkDA_abilityswap: @ 805548C push {r4-r6,lr} - ldr r5, =gUnknown_02024084 + ldr r5, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r0, [r0] movs r4, 0x58 @@ -58951,7 +58951,7 @@ _0805558A: movs r4, 0 ldr r7, =gUnknown_0202420B mov r9, r7 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons mov r12, r0 mov r1, r9 ldrb r0, [r1] @@ -59082,7 +59082,7 @@ atkDD_weightdamagecalculation: @ 8055684 cmp r0, r1 beq _080556FC adds r6, r2, 0 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons mov r8, r0 adds r7, r1, 0 adds r4, r6, 0 @@ -59443,7 +59443,7 @@ atkE1_802CBE4: @ 805599C strb r0, [r2] movs r0, 0x9 strb r0, [r2, 0x1] - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldrb r1, [r4, 0x17] movs r0, 0x58 muls r0, r1 @@ -59460,7 +59460,7 @@ atkE1_802CBE4: @ 805599C cmp r0, r1 bcs _08055A22 adds r4, r2, 0 - ldr r6, =gUnknown_0832A328 + ldr r6, =gBitTable _080559E2: ldrb r0, [r4] bl battle_side_get_owner @@ -59533,7 +59533,7 @@ atkE2_cmde2: @ 8055A78 bl get_battle_side_of_something ldr r4, =gUnknown_02024064 strb r0, [r4] - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldrb r0, [r4] movs r6, 0x58 adds r1, r0, 0 @@ -59547,7 +59547,7 @@ atkE2_cmde2: @ 8055A78 adds r1, r3 movs r0, 0 str r0, [r1] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable ldrb r1, [r4] ldr r0, =gUnknown_0202449C ldr r0, [r0] @@ -59587,7 +59587,7 @@ atkE3_jumpiffainted: @ 8055AF4 bl get_battle_side_of_something ldr r1, =gUnknown_02024064 strb r0, [r1] - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldrb r1, [r1] movs r0, 0x58 muls r0, r1 @@ -59938,7 +59938,7 @@ atkE6_castform_transform: @ 8055DFC ldr r0, =gUnknown_02024474 ldrb r0, [r0, 0x17] strb r0, [r4] - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r2, [r4] movs r0, 0x58 muls r0, r2 @@ -60192,7 +60192,7 @@ atkEA_recycleitem: @ 8056014 ldrh r5, [r6] cmp r5, 0 beq _08056094 - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons movs r3, 0x58 adds r0, r2, 0 muls r0, r3 @@ -60254,7 +60254,7 @@ atkEB_settypetoterrain: @ 80560BC push {r4-r7,lr} mov r7, r8 push {r7} - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons mov r8, r0 ldr r7, =gUnknown_0202420B ldrb r0, [r7] @@ -60344,7 +60344,7 @@ atkEC_802D2A0: @ 805616C bl battle_get_side_with_given_state ldr r4, =gUnknown_02024064 strb r0, [r4] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r6, 0x1 ands r0, r6 @@ -60352,7 +60352,7 @@ atkEC_802D2A0: @ 805616C beq _0805620C ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable ldrb r3, [r4] lsls r0, r3, 2 adds r0, r2 @@ -60520,7 +60520,7 @@ _0805630E: movs r1, 0x1 eors r0, r1 strb r0, [r6] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x8 ands r0, r1 @@ -60571,7 +60571,7 @@ _08056384: .pool _080563B0: ldr r3, =gBaseStats - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldrb r1, [r6] movs r0, 0x58 muls r0, r1 @@ -60610,7 +60610,7 @@ _080563F4: .4byte _08056472 .4byte _08056472 _08056410: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420C ldrb r1, [r0] movs r0, 0x58 @@ -60641,7 +60641,7 @@ _08056440: movs r4, 0x23 b _080564D2 _08056452: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420C ldrb r1, [r0] movs r0, 0x58 @@ -60662,7 +60662,7 @@ _08056472: b _080564D2 .pool _08056480: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420C ldrb r1, [r0] movs r0, 0x58 @@ -60704,7 +60704,7 @@ _080564D2: muls r0, r4 movs r1, 0xA bl __divsi3 - ldr r5, =gUnknown_02024084 + ldr r5, =gBattleMons ldr r1, =gUnknown_0202420C ldrb r2, [r1] movs r1, 0x58 @@ -61165,7 +61165,7 @@ _08056938: bl SpeciesToNationalPokedexNum lsls r0, 16 lsrs r0, 16 - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldr r1, =gUnknown_0202420C ldrb r2, [r1] movs r1, 0x58 @@ -61763,7 +61763,7 @@ _08056E62: thumb_func_start sub_8056E78 sub_8056E78: @ 8056E78 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r1, [r0] movs r0, 0x58 @@ -61784,7 +61784,7 @@ sub_8056E78: @ 8056E78 thumb_func_start atkF5_reset_attacker_bd_x4C atkF5_reset_attacker_bd_x4C: @ 8056EA8 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r2, [r0] movs r0, 0x58 @@ -61849,7 +61849,7 @@ sub_8056EF8: @ 8056EF8 sub_8056F28: @ 8056F28 push {r4-r6,lr} ldr r5, =gUnknown_020244A8 - ldr r6, =gUnknown_02022FEC + ldr r6, =gBattleTypeFlags ldr r0, [r6] movs r1, 0x80 lsls r1, 19 @@ -61946,7 +61946,7 @@ _08056FFA: thumb_func_start sub_8057028 sub_8057028: @ 8057028 push {r4-r6,lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 19 @@ -62027,7 +62027,7 @@ sub_80570F4: @ 80570F4 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -62041,7 +62041,7 @@ sub_80570F4: @ 80570F4 bl battle_get_side_with_given_state lsls r0, 24 lsrs r3, r0, 24 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons movs r0, 0x58 adds r1, r3, 0 muls r1, r0 @@ -62063,7 +62063,7 @@ _08057140: lsls r0, 24 lsrs r4, r0, 24 _0805714A: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons movs r1, 0x58 adds r0, r4, 0 muls r0, r1 @@ -62224,7 +62224,7 @@ _08057294: beq _0805729A b _080573FC _0805729A: - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons movs r0, 0x58 mov r5, r9 muls r5, r0 @@ -62287,7 +62287,7 @@ _0805731E: subs r0, r1, r2 str r0, [r4] _08057322: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons movs r0, 0x58 mov r1, r9 muls r1, r0 @@ -62330,7 +62330,7 @@ _08057372: b _080573FC .pool _08057390: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 mov r2, r9 muls r2, r0 @@ -62451,7 +62451,7 @@ dp01_tbl1_exec_completed: @ 805748C adds r0, r1 ldr r1, =bx_exec_buffer_A_ch0_tbl1 str r1, [r0] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -62474,7 +62474,7 @@ dp01_tbl1_exec_completed: @ 805748C .pool _080574E0: ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r0, [r4] lsls r0, 2 adds r0, r1 @@ -62494,7 +62494,7 @@ _080574F2: bx_exec_buffer_A_ch0_tbl1: @ 8057504 push {lr} ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r0, =gUnknown_02024064 ldrb r3, [r0] lsls r0, r3, 2 @@ -62757,7 +62757,7 @@ _0805774C: cmp r0, 0x3B bls _080577DC _0805775A: - ldr r4, =gUnknown_02022FEC + ldr r4, =gBattleTypeFlags ldr r0, [r4] ands r0, r3 cmp r0, 0 @@ -62773,7 +62773,7 @@ _0805775A: bl battle_get_side_with_given_state ldr r1, =gUnknown_02024210 ldrb r1, [r1] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, 24 lsrs r0, 22 adds r0, r2 @@ -63096,7 +63096,7 @@ _08057A6E: _08057A70: ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable ldrb r0, [r5] lsls r0, 2 adds r0, r2 @@ -63224,7 +63224,7 @@ _08057B92: _08057B94: ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable ldrb r0, [r5] lsls r0, 2 adds r0, r2 @@ -63450,7 +63450,7 @@ _08057DA8: bl battle_get_side_with_given_state ldr r1, =gUnknown_02024210 ldrb r1, [r1] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, 24 lsrs r0, 22 adds r0, r2 @@ -63628,7 +63628,7 @@ _08057F30: ldrb r0, [r0] cmp r0, 0x1 bls _08057F9E - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r5, [r0] ands r5, r6 cmp r5, 0 @@ -63939,7 +63939,7 @@ _08058170: ldrb r4, [r6, 0x18] lsls r3, r4, 24 lsrs r2, r3, 28 - ldr r0, =gUnknown_0832A328 + ldr r0, =gBitTable mov r12, r0 add r1, r10 ldrb r0, [r1] @@ -63982,7 +63982,7 @@ _0805822A: mov r5, sp adds r5, 0x18 str r5, [sp, 0x1C] - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons mov r0, r8 ldrb r1, [r0] movs r0, 0x58 @@ -64605,7 +64605,7 @@ sub_80587B0: @ 80587B0 ands r0, r1 cmp r0, 0 bne _08058832 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -64805,7 +64805,7 @@ sub_805896C: @ 805896C lsls r0, 24 cmp r0, 0 beq _080589D0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -65088,7 +65088,7 @@ _08058BB2: lsls r0, 24 cmp r0, 0 beq _08058C38 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -65196,7 +65196,7 @@ _08058C82: ands r0, r1 cmp r0, 0 bne _08058D14 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x42 ands r0, r1 @@ -65237,7 +65237,7 @@ _08058D32: lsls r0, 24 cmp r0, 0 beq _08058DAC - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -65331,7 +65331,7 @@ _08058E0A: lsls r0, 24 cmp r0, 0 beq _08058E48 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -67117,7 +67117,7 @@ _08059DB2: thumb_func_start b_link_standby_message b_link_standby_message: @ 8059DC0 push {lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -69659,7 +69659,7 @@ sub_805B4F0: @ 805B4F0 mov r7, r9 mov r6, r8 push {r6,r7} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -69751,7 +69751,7 @@ _0805B5B4: ldr r0, [r0] ldrb r4, [r0, 0x8] _0805B5BA: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r2, 0x40 ands r1, r2 @@ -69798,7 +69798,7 @@ _0805B618: lsls r1, 15 adds r0, r1 lsrs r7, r0, 16 - ldr r5, =gUnknown_02022FEC + ldr r5, =gBattleTypeFlags b _0805B656 .pool _0805B63C: @@ -70041,7 +70041,7 @@ _0805B82A: thumb_func_start dp01t_08_1_8032428 dp01t_08_1_8032428: @ 805B864 push {r4-r6,lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -71081,7 +71081,7 @@ _0805C194: thumb_func_start dp01t_14_5_move_menu_pokedude dp01t_14_5_move_menu_pokedude: @ 805C1A8 push {lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 10 @@ -71197,7 +71197,7 @@ sub_805C2AC: @ 805C2AC ldr r1, =gUnknown_02023064 mov r8, r1 ldr r2, =gUnknown_02024064 - ldr r7, =gUnknown_02022FEC + ldr r7, =gBattleTypeFlags mov r6, r12 mov r5, r8 adds r4, r2, 0 @@ -72322,7 +72322,7 @@ _0805CC94: lsls r0, 24 cmp r0, 0 beq _0805CCB4 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -72923,7 +72923,7 @@ sub_805D19C: @ 805D19C ldr r0, [r0] adds r0, 0x92 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable ldrb r0, [r4] lsls r0, 2 adds r0, r2 @@ -72985,7 +72985,7 @@ _0805D24A: ldrb r0, [r0] cmp r0, 0 beq _0805D26E - ldr r0, =gUnknown_0832A328 + ldr r0, =gBitTable lsls r1, r4, 2 adds r1, r0 ldr r0, [r1] @@ -73016,7 +73016,7 @@ _0805D27C: strb r0, [r1] lsls r0, r6, 24 lsrs r0, 24 - bl sub_8130950 + bl BattleAI_SetupAIData bl sub_8130BA4 lsls r0, 24 lsrs r0, 24 @@ -73035,7 +73035,7 @@ _0805D2B6: _0805D2BE: movs r5, 0 movs r6, 0 - ldr r7, =gUnknown_0832A328 + ldr r7, =gBitTable mov r4, r10 _0805D2C6: ldrh r0, [r4] @@ -73080,7 +73080,7 @@ _0805D2F8: _0805D316: adds r7, 0x4 adds r4, 0x2 - ldr r0, =gUnknown_0832A328 + ldr r0, =gBitTable adds r0, 0xC cmp r7, r0 ble _0805D2C6 @@ -73106,7 +73106,7 @@ _0805D33E: cmp r6, 0 bne _0805D388 _0805D346: - ldr r5, =gUnknown_0832A328 + ldr r5, =gBitTable _0805D348: bl Random lsls r0, 16 @@ -73148,7 +73148,7 @@ _0805D39A: lsls r1, 10 ands r1, r0 lsrs r4, r1, 16 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable lsls r0, r4, 2 adds r0, r1 ldr r0, [r0] @@ -73389,7 +73389,7 @@ sub_805D5F4: @ 805D5F4 mov r7, r9 mov r6, r8 push {r6,r7} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -73420,7 +73420,7 @@ _0805D63E: bl battle_get_side_with_given_state lsls r0, 24 lsrs r7, r0, 24 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r2, 0x58 mov r0, r8 muls r0, r2 @@ -74672,7 +74672,7 @@ _0805E0B8: bne _0805E120 cmp r4, 0x2 bne _0805E0F0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 ands r0, r1 @@ -74836,7 +74836,7 @@ _0805E228: strb r0, [r4] b _0805E346 _0805E230: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 ands r0, r1 @@ -74888,7 +74888,7 @@ _0805E29C: lsls r0, 24 cmp r0, 0 bne _0805E2E4 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 ands r0, r1 @@ -76657,7 +76657,7 @@ sub_805F164: @ 805F164 bx_exec_buffer_A_ch0_tbl7: @ 805F180 push {lr} ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r0, =gUnknown_02024064 ldrb r3, [r0] lsls r0, r3, 2 @@ -76837,14 +76837,14 @@ sub_805F2F0: @ 805F2F0 lsls r0, 24 cmp r0, 0 beq _0805F31E - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 bne _0805F32C _0805F31E: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 8 @@ -77143,7 +77143,7 @@ sub_805F560: @ 805F560 adds r0, r2, 0 bl sub_8172EF0 _0805F5A6: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x00008040 ands r0, r1 @@ -77216,7 +77216,7 @@ _0805F5EE: lsls r0, 24 cmp r0, 0 beq _0805F684 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -77329,7 +77329,7 @@ _0805F6D0: ands r0, r1 cmp r0, 0 bne _0805F774 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x42 ands r0, r1 @@ -77376,7 +77376,7 @@ _0805F792: lsls r0, 24 cmp r0, 0 beq _0805F810 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -77471,7 +77471,7 @@ _0805F86E: lsls r0, 24 cmp r0, 0 beq _0805F8D2 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -78209,7 +78209,7 @@ dp01_tbl7_exec_completed: @ 805FF18 adds r0, r1 ldr r1, =bx_exec_buffer_A_ch0_tbl7 str r1, [r0] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -78232,7 +78232,7 @@ dp01_tbl7_exec_completed: @ 805FF18 .pool _0805FF6C: ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r0, [r4] lsls r0, 2 adds r0, r1 @@ -80823,7 +80823,7 @@ sub_8061690: @ 8061690 mov r7, r9 mov r6, r8 push {r6,r7} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r2, [r0] movs r0, 0x80 lsls r0, 20 @@ -80934,7 +80934,7 @@ _0806178C: adds r0, r2 ldrb r4, [r0, 0x3] _08061796: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x00008040 ands r0, r1 @@ -81070,7 +81070,7 @@ sub_80618D8: @ 80618D8 push {r4-r6,lr} mov r6, r8 push {r6} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r2, [r0] movs r0, 0x80 lsls r0, 20 @@ -81858,7 +81858,7 @@ sub_8061FAC: @ 8061FAC thumb_func_start sub_8061FB8 sub_8061FB8: @ 8061FB8 push {r4-r6,lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r2, [r0] movs r0, 0x80 lsls r0, 10 @@ -81889,7 +81889,7 @@ _08061FE4: cmp r2, 0 beq _080620C4 movs r0, 0xF - bl sub_8130950 + bl BattleAI_SetupAIData bl sub_8130BA4 lsls r0, 24 lsrs r4, r0, 24 @@ -81957,7 +81957,7 @@ _08062062: strb r0, [r5] ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable ldrb r0, [r5] lsls r0, 2 adds r0, r2 @@ -82011,7 +82011,7 @@ _080620C6: b _08062152 .pool _08062108: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -82090,7 +82090,7 @@ sub_8062188: @ 8062188 lsrs r4, r0, 24 cmp r4, 0x6 bne _0806225A - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -82113,7 +82113,7 @@ _080621D4: lsls r0, 24 lsrs r5, r0, 24 _080621E8: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x00808000 ands r0, r1 @@ -82877,7 +82877,7 @@ sub_8062828: @ 8062828 lsls r0, 24 cmp r0, 0 beq _0806286C - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x40 ands r0, r1 @@ -83270,7 +83270,7 @@ sub_8062BA4: @ 8062BA4 thumb_func_start sub_8062BB0 sub_8062BB0: @ 8062BB0 push {lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x6 ands r0, r1 @@ -83353,7 +83353,7 @@ sub_8062C58: @ 8062C58 mov r5, r8 push {r5-r7} sub sp, 0x4 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -83369,7 +83369,7 @@ _08062C72: lsls r0, 24 lsrs r0, 24 mov r10, r0 - ldr r4, =gUnknown_02024084 + ldr r4, =gBattleMons bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 24 @@ -83422,7 +83422,7 @@ _08062CE8: adds r6, 0x1 cmp r6, 0x3 ble _08062CBA - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x00808000 ands r0, r1 @@ -83524,7 +83524,7 @@ _08062D74: lsrs r2, r0, 24 movs r4, 0 mov r8, r5 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 muls r0, r2 adds r5, r0, r1 @@ -83630,7 +83630,7 @@ _08062E9C: bne _08062EB0 b _080630AC _08062EB0: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -83646,7 +83646,7 @@ _08062EB0: bl battle_get_side_with_given_state ldr r1, =gUnknown_02024210 ldrb r1, [r1] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, 24 lsrs r0, 22 adds r0, r2 @@ -83703,7 +83703,7 @@ _08062F5C: _08062F5E: str r0, [sp] _08062F60: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r3, [r2] movs r0, 0x58 muls r0, r3 @@ -83715,7 +83715,7 @@ _08062F60: bne _08062F76 b _080630AC _08062F76: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x00808000 ands r0, r1 @@ -83871,7 +83871,7 @@ _080630AE: thumb_func_start ai_switchout_natural_cure ai_switchout_natural_cure: @ 80630C0 push {r4,r5,lr} - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons ldr r5, =gUnknown_02024064 ldrb r4, [r5] movs r0, 0x58 @@ -84006,7 +84006,7 @@ ai_has_super_effective_move_on_field: @ 80631BC lsrs r3, r0, 24 ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, r3, 2 adds r0, r2 ldr r0, [r0] @@ -84014,7 +84014,7 @@ ai_has_super_effective_move_on_field: @ 80631BC cmp r1, 0 bne _08063256 movs r4, 0 - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons movs r7, 0x58 adds r0, r3, 0 muls r0, r7 @@ -84060,7 +84060,7 @@ _08063250: cmp r4, 0x3 ble _0806320A _08063256: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -84080,7 +84080,7 @@ _0806327C: lsrs r3, r0, 24 ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, r3, 2 adds r0, r2 ldr r0, [r0] @@ -84088,7 +84088,7 @@ _0806327C: cmp r1, 0 bne _080632FA movs r4, 0 - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons movs r7, 0x58 adds r0, r3, 0 muls r0, r7 @@ -84150,7 +84150,7 @@ _080632FC: ai_is_too_invested_in_stat_buffs: @ 806331C push {r4,lr} movs r4, 0 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldr r0, =gUnknown_02024064 ldrb r2, [r0] movs r0, 0x58 @@ -84234,7 +84234,7 @@ _080633A4: bne _080633B8 b _080635EE _080633B8: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 @@ -84250,7 +84250,7 @@ _080633B8: bl battle_get_side_with_given_state ldr r1, =gUnknown_02024210 ldrb r1, [r1] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, 24 lsrs r0, 22 adds r0, r2 @@ -84277,7 +84277,7 @@ _0806342C: mov r9, r3 mov r10, r9 _08063430: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x00808000 ands r0, r1 @@ -84437,7 +84437,7 @@ _08063564: adds r1, r6, 0 muls r1, r0 mov r8, r1 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons movs r0, 0x58 mov r2, r9 muls r2, r0 @@ -84505,7 +84505,7 @@ sub_8063614: @ 8063614 mov r5, r8 push {r5-r7} sub sp, 0x4 - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons ldr r4, =gUnknown_02024064 ldrb r2, [r4] movs r5, 0x58 @@ -84582,7 +84582,7 @@ _080636A8: bne _080636B4 b _0806386C _080636B4: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x80 lsls r0, 11 @@ -84607,7 +84607,7 @@ _080636C4: bl battle_get_side_with_given_state ldr r1, =gUnknown_02024210 ldrb r1, [r1] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, 24 lsrs r0, 22 adds r0, r2 @@ -84632,7 +84632,7 @@ _0806372E: ldrb r6, [r4] adds r7, r6, 0 _08063732: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x00808000 ands r0, r1 @@ -84803,7 +84803,7 @@ sub_8063880: @ 8063880 ldr r2, =gUnknown_020244EC mov r8, r2 _080638A8: - ldr r7, =gUnknown_02022FEC + ldr r7, =gBattleTypeFlags ldr r0, [r7] movs r1, 0x8 ands r0, r1 @@ -84856,7 +84856,7 @@ _08063910: lsls r0, 24 lsrs r5, r0, 24 _08063928: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x00808000 ands r0, r1 @@ -85057,7 +85057,7 @@ sub_8063A90: @ 8063A90 beq _08063AB2 b _08063E50 _08063AB2: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x80 lsls r0, 11 @@ -85088,7 +85088,7 @@ _08063AE0: bl battle_get_side_with_given_state ldr r1, =gUnknown_02024210 ldrb r1, [r1] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, 24 lsrs r0, 22 adds r0, r2 @@ -85119,7 +85119,7 @@ _08063B36: str r0, [sp, 0x4] ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable ldr r4, [sp, 0x4] lsls r0, r4, 2 adds r0, r2 @@ -85148,7 +85148,7 @@ _08063B6C: str r4, [sp, 0x14] str r4, [sp, 0x10] _08063B8A: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x00808000 ands r0, r1 @@ -85203,7 +85203,7 @@ _08063BE4: b _08063CF2 _08063BF6: lsls r0, r7, 2 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable adds r0, r1 mov r8, r0 mov r10, sp @@ -85269,7 +85269,7 @@ _08063C00: ldr r2, [sp, 0x4] adds r4, r2, 0 muls r4, r0 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons adds r4, r0 adds r0, r4, 0 adds r0, 0x21 @@ -85351,7 +85351,7 @@ _08063D30: _08063D36: ldr r4, [sp, 0xC] lsls r0, r4, 2 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable adds r0, r1 ldr r0, [r0] mov r2, r9 @@ -85571,7 +85571,7 @@ sub_8063EE0: @ 8063EE0 movs r0, 0 mov r10, r0 movs r7, 0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 15 @@ -85723,7 +85723,7 @@ _08064030: .4byte _080642F4 .4byte _0806437C _08064048: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_02024064 ldrb r1, [r0] movs r0, 0x58 @@ -85754,7 +85754,7 @@ _08064074: bne _08064088 b _08064324 _08064088: - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_02024064 ldrb r1, [r0] movs r0, 0x58 @@ -85795,7 +85795,7 @@ _080640BC: ands r0, r1 cmp r0, 0 beq _08064100 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r4, [r3] movs r0, 0x58 muls r0, r4 @@ -85821,7 +85821,7 @@ _08064100: ands r0, r1 cmp r0, 0 beq _0806413A - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r4, [r3] movs r0, 0x58 muls r0, r4 @@ -85852,7 +85852,7 @@ _0806413A: ands r0, r1 cmp r0, 0 beq _0806416C - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r4, [r3] movs r0, 0x58 muls r0, r4 @@ -85878,7 +85878,7 @@ _0806416C: ands r0, r1 cmp r0, 0 beq _0806419E - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r4, [r3] movs r0, 0x58 muls r0, r4 @@ -85904,7 +85904,7 @@ _0806419E: ands r0, r1 cmp r0, 0 beq _080641D0 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r4, [r3] movs r0, 0x58 muls r0, r4 @@ -85932,7 +85932,7 @@ _080641D0: bne _080641DE b _08064324 _080641DE: - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons ldrb r3, [r3] movs r0, 0x58 muls r0, r3 @@ -86162,7 +86162,7 @@ sub_8064394: @ 8064394 sub_80643B0: @ 80643B0 push {lr} ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r0, =gUnknown_02024064 ldrb r3, [r0] lsls r0, r3, 2 @@ -86341,7 +86341,7 @@ sub_8064520: @ 8064520 lsls r0, 24 cmp r0, 0 beq _08064584 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -86600,7 +86600,7 @@ sub_8064734: @ 8064734 adds r0, r2, 0 bl sub_8172EF0 _08064776: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -86669,7 +86669,7 @@ _080647B4: lsls r0, 24 cmp r0, 0 beq _0806484A - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -86784,7 +86784,7 @@ _08064898: ands r0, r1 cmp r0, 0 bne _0806493C - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x42 ands r0, r1 @@ -86857,7 +86857,7 @@ _08064982: beq _08064998 b _08064AC0 _08064998: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -86898,7 +86898,7 @@ _080649E2: lsls r0, 24 cmp r0, 0 beq _08064A3A - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -87620,7 +87620,7 @@ sub_8065068: @ 8065068 adds r0, r1 ldr r1, =sub_80643B0 str r1, [r0] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -87643,7 +87643,7 @@ sub_8065068: @ 8065068 .pool _080650BC: ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r0, [r4] lsls r0, 2 adds r0, r1 @@ -90166,7 +90166,7 @@ sub_8066748: @ 8066748 mov r7, r9 mov r6, r8 push {r6,r7} - ldr r4, =gUnknown_02022FEC + ldr r4, =gBattleTypeFlags ldr r0, [r4] movs r1, 0x40 ands r0, r1 @@ -91917,7 +91917,7 @@ c3_08038DC4: @ 8067618 lsls r0, 24 cmp r0, 0 beq _08067652 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 diff --git a/asm/rom_8072304.s b/asm/rom_8072304.s index 1794b040e..76df3bcee 100644 --- a/asm/rom_8072304.s +++ b/asm/rom_8072304.s @@ -2042,7 +2042,7 @@ _08073382: bne _080733D0 b _080735A8 _080733D0: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r2, [r0] movs r0, 0x80 ands r2, r0 @@ -2127,7 +2127,7 @@ _08073468: _080734B0: cmp r4, 0x1 bne _0807355C - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r2, [r0] movs r0, 0x80 ands r2, r0 @@ -2210,7 +2210,7 @@ _0807355C: adds r1, r4 movs r2, 0x5 bl healthbar_draw_field_maybe - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 ands r0, r1 @@ -2538,7 +2538,7 @@ _0807382C: beq _0807383A b _080739E8 _0807383A: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r2, 0x40 ands r1, r2 @@ -2683,7 +2683,7 @@ _08073958: adds r1, 0x3 b _080739D0 _08073970: - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r0, [r1] movs r1, 0x80 lsls r1, 11 @@ -2696,7 +2696,7 @@ _08073970: lsls r2, 2 adds r0, r2 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, r7, 2 adds r0, r2 ldr r0, [r0] @@ -2743,7 +2743,7 @@ _080739DE: ble _0807390A b _08073B9A _080739E8: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] ldr r2, =0x00008040 ands r1, r2 @@ -2889,7 +2889,7 @@ _08073B08: adds r1, 0x3 b _08073B84 _08073B20: - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r0, [r1] movs r1, 0x80 lsls r1, 11 @@ -2902,7 +2902,7 @@ _08073B20: adds r0, r3 ldrb r1, [r0] lsls r0, r7, 2 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable adds r0, r2 ldr r0, [r0] ands r1, r0 @@ -3882,7 +3882,7 @@ sub_8074310: @ 8074310 lsrs r2, r0, 24 lsls r1, 24 lsrs r7, r1, 24 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x80 lsls r0, 2 @@ -7155,7 +7155,7 @@ _08075E00: ands r0, r1 cmp r0, 0 beq _08075E56 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x42 ands r0, r1 diff --git a/asm/rom_80A5C6C.s b/asm/rom_80A5C6C.s index 7382ec1bb..ce96523ce 100644 --- a/asm/rom_80A5C6C.s +++ b/asm/rom_80A5C6C.s @@ -43,7 +43,7 @@ _080A5CB0: bl battle_get_per_side_status lsls r0, 24 lsrs r0, 22 - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r1, [r1] movs r2, 0x1 ands r1, r2 @@ -59,7 +59,7 @@ _080A5CD8: bl battle_get_per_side_status lsls r0, 24 lsrs r0, 22 - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r1, [r1] movs r2, 0x1 ands r1, r2 @@ -480,7 +480,7 @@ _080A605C: ldr r3, =gUnknown_08525F58 lsls r0, 24 lsrs r0, 22 - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r1, [r1] movs r2, 0x1 ands r1, r2 @@ -1930,7 +1930,7 @@ _080A6B1A: thumb_func_start battle_type_is_double battle_type_is_double: @ 80A6B20 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x1 ands r0, r1 diff --git a/asm/rom_80C6FA0.s b/asm/rom_80C6FA0.s index d6bc13e20..cf455c740 100644 --- a/asm/rom_80C6FA0.s +++ b/asm/rom_80C6FA0.s @@ -23812,7 +23812,7 @@ sub_80D352C: @ 80D352C lsls r0, 24 lsrs r0, 24 lsls r1, 24 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsrs r1, 22 adds r1, r2 ldr r2, [r1] @@ -23841,7 +23841,7 @@ sub_80D355C: @ 80D355C adds r2, r0 lsls r2, 3 adds r2, r3 - ldr r0, =gUnknown_0832A328 + ldr r0, =gBitTable lsrs r1, 22 adds r1, r0 ldr r0, [r1] @@ -23863,7 +23863,7 @@ sub_80D3584: @ 80D3584 adds r2, r0 lsls r2, 3 adds r2, r3 - ldr r0, =gUnknown_0832A328 + ldr r0, =gBitTable lsrs r1, 22 adds r1, r0 ldr r0, [r1] diff --git a/asm/rom_8158B30.s b/asm/rom_8158B30.s index 351a7b149..c6bf6c574 100644 --- a/asm/rom_8158B30.s +++ b/asm/rom_8158B30.s @@ -1025,7 +1025,7 @@ sub_815936C: @ 815936C bx_exec_buffer_A_ch0_tbl6: @ 8159388 push {lr} ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r0, =gUnknown_02024064 ldrb r3, [r0] lsls r0, r3, 2 @@ -1439,7 +1439,7 @@ dp01_tbl6_exec_completed: @ 8159704 adds r0, r1 ldr r1, =bx_exec_buffer_A_ch0_tbl6 str r1, [r0] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -1462,7 +1462,7 @@ dp01_tbl6_exec_completed: @ 8159704 .pool _08159758: ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r0, [r4] lsls r0, 2 adds r0, r1 @@ -2381,7 +2381,7 @@ sub_8159E90: @ 8159E90 movs r0, 0x3 bl sub_80A2390 bl dp01_tbl6_exec_completed - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x6 ands r0, r1 @@ -19377,7 +19377,7 @@ _08162B08: ldr r0, =0x0000018f cmp r4, r0 bhi _08162B64 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -19407,7 +19407,7 @@ _08162B38: b _08162BC8 .pool _08162B64: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -19515,7 +19515,7 @@ _08162C60: ldr r0, =0x0000018f cmp r4, r0 bhi _08162CBC - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -19547,7 +19547,7 @@ _08162C90: b _08162D1E .pool _08162CBC: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -19629,7 +19629,7 @@ _08162D78: ldr r0, =0x0000018f cmp r4, r0 bhi _08162DC0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -19654,7 +19654,7 @@ _08162DA0: b _08162E0A .pool _08162DC0: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -19772,7 +19772,7 @@ _08162EB4: ldr r0, =0x0000018f cmp r5, r0 bhi _08162F00 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -19800,7 +19800,7 @@ _08162ED8: b _08162F62 .pool _08162F00: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -21240,7 +21240,7 @@ _08163AF0: .4byte _08163DF4 .4byte _08163DC8 _08163B1C: - ldr r5, =gUnknown_02022FEC + ldr r5, =gBattleTypeFlags movs r0, 0x84 lsls r0, 1 str r0, [r5] @@ -21360,7 +21360,7 @@ _08163C18: adds r5, 0x1 cmp r5, 0x2 ble _08163C18 - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r0, =0x00000808 str r0, [r1] ldr r1, =gUnknown_02038BCA @@ -21375,7 +21375,7 @@ _08163C18: b _08163E10 .pool _08163C70: - ldr r4, =gUnknown_02022FEC + ldr r4, =gBattleTypeFlags ldr r0, =0x00010008 str r0, [r4] ldr r0, =0x000040ce @@ -21405,7 +21405,7 @@ _08163C9A: b _08163E10 .pool _08163CC4: - ldr r4, =gUnknown_02022FEC + ldr r4, =gBattleTypeFlags ldr r0, =0x00020008 str r0, [r4] ldr r0, =0x000040ce @@ -21444,7 +21444,7 @@ _08163D12: b _08163E10 .pool _08163D28: - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r0, =0x00040008 str r0, [r1] ldr r0, =gSaveBlock2Ptr @@ -21473,7 +21473,7 @@ _08163D5E: b _08163E10 .pool _08163D74: - ldr r4, =gUnknown_02022FEC + ldr r4, =gBattleTypeFlags ldr r0, =0x00080008 str r0, [r4] ldr r0, =0x000040ce @@ -21496,7 +21496,7 @@ _08163D8E: b _08163E10 .pool _08163DB4: - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags movs r0, 0x84 lsls r0, 1 str r0, [r1] @@ -21505,7 +21505,7 @@ _08163DB4: b _08163E00 .pool _08163DC8: - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r0, =0x00200008 str r0, [r1] movs r0, 0x3 @@ -21519,7 +21519,7 @@ _08163DC8: b _08163E10 .pool _08163DF4: - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r0, =0x00008109 str r0, [r1] movs r0, 0x1 @@ -21539,7 +21539,7 @@ _08163E10: b _08163E68 .pool _08163E2C: - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r0, =0x00408049 str r0, [r1] ldr r5, =0x00000c03 @@ -25030,7 +25030,7 @@ _08165BB8: ldr r0, =0x0000018f cmp r2, r0 bhi _08165BFC - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -25053,7 +25053,7 @@ _08165BDC: b _08165C28 .pool _08165BFC: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -25751,7 +25751,7 @@ _08166182: thumb_func_start sub_8166188 sub_8166188: @ 8166188 push {r4-r7,lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x02000002 ands r0, r1 @@ -29602,7 +29602,7 @@ bx_goto_buffer_A_ch0_tbl3: @ 81683B8 bx_exec_buffer_A_ch0_tbl2: @ 81683F4 push {lr} ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r0, =gUnknown_02024064 ldrb r3, [r0] lsls r0, r3, 2 @@ -29989,7 +29989,7 @@ _081686D2: lsls r0, 24 cmp r0, 0 beq _0816877A - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -30425,7 +30425,7 @@ dp01_tbl5_exec_completed: @ 8168AF8 adds r0, r1 ldr r1, =bx_exec_buffer_A_ch0_tbl2 str r1, [r0] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -30448,7 +30448,7 @@ dp01_tbl5_exec_completed: @ 8168AF8 .pool _08168B4C: ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r0, [r4] lsls r0, 2 adds r0, r1 @@ -34319,7 +34319,7 @@ sub_816AD94: @ 816AD94 movs r0, 0x3 bl sub_80A2390 bl dp01_tbl5_exec_completed - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x6 ands r0, r1 diff --git a/asm/rom_817C95C.s b/asm/rom_817C95C.s index 0375f71df..125dd627a 100644 --- a/asm/rom_817C95C.s +++ b/asm/rom_817C95C.s @@ -16,7 +16,7 @@ sub_817C95C: @ 817C95C lsls r0, 16 lsrs r0, 16 str r0, [sp] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -525,7 +525,7 @@ _0817D070: movs r2, 0x2 movs r3, 0 bl sub_817E684 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -542,7 +542,7 @@ _0817D098: movs r2, 0x1 movs r3, 0 bl sub_817E684 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -2543,7 +2543,7 @@ sub_817E0FC: @ 817E0FC lsls r1, 16 lsrs r1, 16 str r1, [sp] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -2801,7 +2801,7 @@ sub_817E32C: @ 817E32C push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -2961,7 +2961,7 @@ _0817E46A: adds r6, 0x1 cmp r6, 0x5 ble _0817E434 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -3149,7 +3149,7 @@ _0817E5C8: beq _0817E670 cmp r4, 0 beq _0817E670 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -4261,7 +4261,7 @@ sub_817EECC: @ 817EECC mov r5, r8 push {r5-r7} sub sp, 0x28 - ldr r7, =gUnknown_02022FEC + ldr r7, =gBattleTypeFlags ldr r0, [r7] ldr r1, =0x02000003 ands r0, r1 @@ -4278,7 +4278,7 @@ _0817EEE6: bne _0817EEF8 b _0817F1FA _0817EEF8: - ldr r5, =gUnknown_02024084 + ldr r5, =gBattleMons ldrb r4, [r4] movs r1, 0x58 adds r6, r4, 0 @@ -4395,7 +4395,7 @@ _0817EFC2: movs r2, 0x58 muls r0, r2 adds r1, r0 - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons adds r0, 0xC adds r1, r0 ldrh r0, [r1] @@ -4424,7 +4424,7 @@ _0817EFC2: ldrb r0, [r2] movs r4, 0x58 muls r0, r4 - ldr r6, =gUnknown_02024084 + ldr r6, =gBattleMons adds r0, r6 mov r2, r9 ldrb r1, [r2] @@ -4694,7 +4694,7 @@ _0817F252: _0817F270: cmp r2, 0x95 bne _0817F294 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons ldr r0, =gUnknown_0202420B ldrb r1, [r0] movs r0, 0x58 @@ -4725,7 +4725,7 @@ _0817F2A0: thumb_func_start sub_817F2A8 sub_817F2A8: @ 817F2A8 push {r4,r5,lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 diff --git a/asm/rom_8184DA4.s b/asm/rom_8184DA4.s index 999c83c0b..626e3ecb9 100644 --- a/asm/rom_8184DA4.s +++ b/asm/rom_8184DA4.s @@ -44,7 +44,7 @@ _08184DD0: mov r3, r12 cmp r3, 0x1 bne _08184E1C - ldr r5, =gUnknown_02022FEC + ldr r5, =gBattleTypeFlags movs r3, 0xFF movs r1, 0xA6 lsls r1, 2 @@ -116,7 +116,7 @@ _08184EA0: ldr r1, [r1] str r1, [r0] _08184EAC: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r5, [r0] movs r0, 0x2 ands r5, r0 @@ -489,7 +489,7 @@ sub_81851A8: @ 81851A8 movs r1, 0x2 mov r0, sp strb r1, [r0] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ands r0, r1 cmp r0, 0 @@ -510,7 +510,7 @@ _081851DA: lsrs r0, 24 cmp r5, r0 blt _081851D0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x4 ands r0, r1 @@ -1539,7 +1539,7 @@ sub_8185AB0: @ 8185AB0 ldr r1, =gUnknown_0202433A movs r0, 0 strb r0, [r1] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags movs r1, 0 str r1, [r0] ldr r0, =gUnknown_02038BCA @@ -1707,7 +1707,7 @@ _08185C2A: adds r0, r7, r3 ldr r0, [r0] str r0, [r1] - ldr r2, =gUnknown_02022FEC + ldr r2, =gBattleTypeFlags ldr r1, =0x000004ec adds r0, r7, r1 ldr r0, [r0] @@ -2102,7 +2102,7 @@ sub_8185FD0: @ 8185FD0 lsrs r0, 24 cmp r0, 0x1 beq _0818601C - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x02000002 ands r0, r1 @@ -2150,7 +2150,7 @@ sub_818603C: @ 818603C lsls r0, 24 lsrs r0, 24 str r0, [sp, 0x24] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] ldr r1, =0x02000002 ands r0, r1 @@ -2297,7 +2297,7 @@ _08186142: movs r1, 0x58 mov r0, r10 muls r0, r1 - ldr r2, =gUnknown_02024084 + ldr r2, =gBattleMons adds r0, r2 adds r6, r0, 0 adds r6, 0x3B @@ -2316,7 +2316,7 @@ _0818617E: cmp r5, 0x3 ble _0818617E movs r5, 0 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons mov r9, r1 movs r2, 0x58 mov r7, r10 @@ -2361,7 +2361,7 @@ _081861A6: adds r0, r2 ldrb r1, [r0, 0x18] lsrs r1, 4 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsls r0, r5, 2 adds r0, r2 ldr r0, [r0] @@ -2422,7 +2422,7 @@ _0818622C: ands r0, r1 strb r0, [r2, 0x18] movs r5, 0 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons adds r4, r1 adds r4, 0x3B ldr r0, =gUnknown_020242BC @@ -2612,7 +2612,7 @@ _081863CA: mov r1, r10 muls r1, r4 adds r0, r1 - ldr r1, =gUnknown_02024084 + ldr r1, =gBattleMons adds r1, 0xC adds r0, r1 ldrh r0, [r0] @@ -2768,7 +2768,7 @@ sub_81864EC: @ 81864EC sub_8186508: @ 8186508 push {lr} ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r0, =gUnknown_02024064 ldrb r3, [r0] lsls r0, r3, 2 @@ -2947,7 +2947,7 @@ sub_8186678: @ 8186678 lsls r0, 24 cmp r0, 0 beq _081866F8 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -3249,7 +3249,7 @@ _081868DE: lsls r0, 24 cmp r0, 0 beq _08186964 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -3357,7 +3357,7 @@ _081869AE: ands r0, r1 cmp r0, 0 bne _08186A4C - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x42 ands r0, r1 @@ -3487,7 +3487,7 @@ _08186B26: lsls r0, 24 cmp r0, 0 beq _08186B8A - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -4208,7 +4208,7 @@ sub_81871AC: @ 81871AC adds r0, r1 ldr r1, =sub_8186508 str r1, [r0] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -4231,7 +4231,7 @@ sub_81871AC: @ 81871AC .pool _08187200: ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r0, [r4] lsls r0, 2 adds r0, r1 @@ -6754,7 +6754,7 @@ sub_818888C: @ 818888C mov r7, r9 mov r6, r8 push {r6,r7} - ldr r5, =gUnknown_02022FEC + ldr r5, =gBattleTypeFlags ldr r0, [r5] movs r1, 0x40 ands r0, r1 @@ -7513,7 +7513,7 @@ sub_8188F14: @ 8188F14 thumb_func_start sub_8188F20 sub_8188F20: @ 8188F20 push {r4,r5,lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 10 @@ -8263,7 +8263,7 @@ c3_0803D564: @ 8189548 lsls r0, 24 cmp r0, 0 beq _08189582 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -8729,7 +8729,7 @@ sub_818994C: @ 818994C sub_8189968: @ 8189968 push {lr} ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r0, =gUnknown_02024064 ldrb r3, [r0] lsls r0, r3, 2 @@ -8889,7 +8889,7 @@ _08189ABA: lsls r0, 24 cmp r0, 0 beq _08189B0C - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -9075,7 +9075,7 @@ _08189C60: lsls r0, 24 cmp r0, 0 beq _08189CB0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -9266,7 +9266,7 @@ _08189DBE: lsls r0, 24 cmp r0, 0 beq _08189E54 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -9381,7 +9381,7 @@ _08189EA2: ands r0, r1 cmp r0, 0 bne _08189F44 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x42 ands r0, r1 @@ -9452,7 +9452,7 @@ _08189F62: lsls r0, 24 cmp r0, 0 beq _08189FC8 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -10056,7 +10056,7 @@ sub_818A514: @ 818A514 adds r0, r1 ldr r1, =sub_8189968 str r1, [r0] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -10079,7 +10079,7 @@ sub_818A514: @ 818A514 .pool _0818A568: ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r0, [r4] lsls r0, 2 adds r0, r1 @@ -12676,7 +12676,7 @@ sub_818BD04: @ 818BD04 mov r7, r9 mov r6, r8 push {r6,r7} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x80 lsls r0, 18 @@ -12707,7 +12707,7 @@ _0818BD48: _0818BD4A: ldrb r4, [r0, 0x13] _0818BD4C: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r2, 0x40 ands r1, r2 @@ -13573,7 +13573,7 @@ _0818C4C6: thumb_func_start sub_818C4D8 sub_818C4D8: @ 818C4D8 push {lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 10 @@ -13617,7 +13617,7 @@ sub_818C52C: @ 818C52C thumb_func_start sub_818C538 sub_818C538: @ 818C538 push {r4,r5,lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 10 @@ -14318,7 +14318,7 @@ sub_818CA64: @ 818CA64 bl AllocObjectPalette lsls r0, 24 lsrs r5, r0, 24 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 18 @@ -14451,7 +14451,7 @@ _0818CC50: lsls r0, 24 cmp r0, 0 beq _0818CC70 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -19082,7 +19082,7 @@ _0818F37C: strh r7, [r2] movs r3, 0 mov r10, r3 - ldr r6, =gUnknown_0832A328 + ldr r6, =gBitTable ldr r5, =gBaseStats _0818F38A: ldr r0, =gSaveBlock2Ptr @@ -19287,7 +19287,7 @@ _0818F4BC: adds r1, r3 ldrb r0, [r1, 0x6] lsls r0, 2 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable adds r0, r2 ldr r0, [r0] orrs r7, r0 @@ -20460,7 +20460,7 @@ _0818FECE: cmp r1, 0 beq _0818FFAA movs r3, 0 - ldr r4, =gUnknown_0832A328 + ldr r4, =gBitTable _0818FEF0: str r3, [sp, 0x14] bl Random @@ -20546,7 +20546,7 @@ _0818FF84: adds r3, 0x1 cmp r3, 0x1 ble _0818FF26 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable mov r1, sp movs r3, 0x1 _0818FF96: @@ -30145,7 +30145,7 @@ _081951AA: adds r1, r3 ldrb r0, [r1, 0x6] lsls r0, 2 - ldr r4, =gUnknown_0832A328 + ldr r4, =gBitTable adds r0, r4 ldr r0, [r0] orrs r7, r0 @@ -58095,7 +58095,7 @@ _081A37B8: ldr r0, =0x0000018f cmp r3, r0 bhi _081A37EC - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -58111,7 +58111,7 @@ _081A37B8: b _081A38C4 .pool _081A37EC: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -58163,7 +58163,7 @@ _081A3868: ldr r0, =0x0000018f cmp r3, r0 bhi _081A38A8 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -58185,7 +58185,7 @@ _081A3890: b _081A38C4 .pool _081A38A8: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -58739,7 +58739,7 @@ _081A3D94: thumb_func_start sub_81A3DA0 sub_81A3DA0: @ 81A3DA0 push {lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, =gUnknown_020375E2 ldrh r1, [r1] ldr r2, [r0] @@ -60512,7 +60512,7 @@ _081A4C84: thumb_func_start sub_81A4CB0 sub_81A4CB0: @ 81A4CB0 push {lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -60548,7 +60548,7 @@ _081A4CDA: thumb_func_start sub_81A4D00 sub_81A4D00: @ 81A4D00 push {lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -60585,7 +60585,7 @@ _081A4D2A: sub_81A4D50: @ 81A4D50 push {r4,lr} adds r4, r0, 0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -61114,7 +61114,7 @@ sub_81A51A8: @ 81A51A8 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 @@ -61547,7 +61547,7 @@ _081A55C4: ldrsb r1, [r0, r1] b _081A5612 _081A55D8: - ldr r3, =gUnknown_02024084 + ldr r3, =gBattleMons mov r9, r3 movs r5, 0x58 adds r0, r7, 0 @@ -61668,7 +61668,7 @@ sub_81A56B4: @ 81A56B4 strb r0, [r1, 0x1] strb r0, [r3] strb r0, [r3, 0x1] - ldr r0, =gUnknown_02024084 + ldr r0, =gBattleMons ldrh r1, [r0, 0x28] strh r1, [r2] adds r0, 0x80 @@ -61720,7 +61720,7 @@ sub_81A5718: @ 81A5718 ldr r0, =0x000002a2 adds r4, r2, r0 ldrb r2, [r4] - ldr r0, =gUnknown_0832A328 + ldr r0, =gBitTable lsls r1, r3, 2 adds r1, r0 ldr r1, [r1] @@ -61885,7 +61885,7 @@ sub_81A586C: @ 81A586C adds r3, r1 lsls r2, r0, 1 adds r2, r3 - ldr r5, =gUnknown_02024084 + ldr r5, =gBattleMons movs r4, 0x58 adds r1, r0, 0 muls r1, r4 @@ -69301,7 +69301,7 @@ _081A9572: ldr r1, =0x00000e2a adds r0, r1 ldrb r2, [r0] - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable movs r6, 0x7 _081A958E: ldr r0, [r1] @@ -69959,7 +69959,7 @@ GetBattlePyramidTrainerFlag: @ 81A9AC4 ldr r2, [r1] ldr r1, =0x00000e2a adds r2, r1 - ldr r4, =gUnknown_0832A328 + ldr r4, =gBitTable ldr r3, =gUnknown_02037350 lsls r1, r0, 3 adds r1, r0 @@ -69984,7 +69984,7 @@ sub_81A9B04: @ 81A9B04 ldr r0, =gUnknown_02038BCA ldrh r0, [r0] bl sub_81A9B44 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 8 @@ -70023,7 +70023,7 @@ sub_81A9B44: @ 81A9B44 mov r9, r7 ldr r0, =0x00000cb4 mov r8, r0 - ldr r4, =gUnknown_0832A328 + ldr r4, =gBitTable _081A9B68: mov r1, r9 ldr r2, [r1] @@ -71089,7 +71089,7 @@ _081AA414: cmp r0, 0 beq _081AA4B6 _081AA42E: - ldr r0, =gUnknown_0832A328 + ldr r0, =gBitTable mov r12, r0 ldr r6, =gSaveBlock2Ptr ldr r7, =0x00000e28 @@ -84210,7 +84210,7 @@ _081B11AA: _081B11B4: cmp r2, 0x2 bhi _081B11F6 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 11 @@ -84283,7 +84283,7 @@ sub_81B120C: @ 81B120C thumb_func_start sub_81B1250 sub_81B1250: @ 81B1250 push {lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x49 ands r0, r1 @@ -98262,7 +98262,7 @@ sub_81B8A2C: @ 81B8A2C b _081B8A76 .pool _081B8A5C: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 11 diff --git a/asm/rom_81BAD84.s b/asm/rom_81BAD84.s index 8b43f7252..64d41a2bb 100644 --- a/asm/rom_81BAD84.s +++ b/asm/rom_81BAD84.s @@ -75,7 +75,7 @@ sub_81BADF4: @ 81BADF4 bx_exec_buffer_A_ch0_tbl3: @ 81BAE10 push {lr} ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldr r0, =gUnknown_02024064 ldrb r3, [r0] lsls r0, r3, 2 @@ -224,7 +224,7 @@ sub_81BAF48: @ 81BAF48 lsls r0, 24 cmp r0, 0 beq _081BAFA0 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -400,7 +400,7 @@ _081BB07A: lsls r0, 24 cmp r0, 0 beq _081BB134 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -1601,7 +1601,7 @@ dp01_tbl3_exec_completed: @ 81BBB8C adds r0, r1 ldr r1, =bx_exec_buffer_A_ch0_tbl3 str r1, [r0] - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x2 ands r0, r1 @@ -1624,7 +1624,7 @@ dp01_tbl3_exec_completed: @ 81BBB8C .pool _081BBBE0: ldr r2, =gUnknown_02024068 - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable ldrb r0, [r4] lsls r0, 2 adds r0, r1 @@ -5060,7 +5060,7 @@ sub_81BDAC8: @ 81BDAC8 ldr r0, =gUnknown_02023068 adds r4, r0 movs r0, 0xF - bl sub_8130950 + bl BattleAI_SetupAIData bl sub_8130BA4 lsls r0, 24 lsrs r5, r0, 24 @@ -5097,7 +5097,7 @@ _081BDB02: strb r0, [r4] ldr r0, =gUnknown_02024210 ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable ldrb r0, [r4] lsls r0, 2 adds r0, r2 @@ -6001,7 +6001,7 @@ _081BE2F4: lsls r0, 24 cmp r0, 0 beq _081BE314 - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 @@ -15147,7 +15147,7 @@ _081C32FE: thumb_func_start sub_81C3304 sub_81C3304: @ 81C3304 push {lr} - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 15 @@ -52825,7 +52825,7 @@ GetTrainerHillTrainerFlag: @ 81D619C movs r2, 0xEE lsls r2, 4 adds r1, r2 - ldr r2, =gUnknown_0832A328 + ldr r2, =gBitTable lsrs r0, 22 adds r0, r2 ldr r0, [r0] @@ -52849,7 +52849,7 @@ sub_81D61E8: @ 81D61E8 ldr r0, =gUnknown_02038BCA mov r8, r0 ldr r6, =gSaveBlock2Ptr - ldr r1, =gUnknown_0832A328 + ldr r1, =gBitTable mov r12, r1 adds r5, r6, 0 _081D6204: @@ -52882,7 +52882,7 @@ _081D6240: cmp r3, 0x1 bls _081D6204 _081D624A: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 8 @@ -52891,7 +52891,7 @@ _081D624A: beq _081D62A2 movs r3, 0 ldr r5, =gUnknown_02038BCC - ldr r0, =gUnknown_0832A328 + ldr r0, =gBitTable mov r8, r0 _081D6260: ldr r2, [r6] diff --git a/asm/secret_base.s b/asm/secret_base.s index 3f516b001..886dd333b 100644 --- a/asm/secret_base.s +++ b/asm/secret_base.s @@ -2899,7 +2899,7 @@ sub_80EA2E4: @ 80EA2E4 lsls r2, 3 adds r0, r2, 0 strh r0, [r1] - ldr r1, =gUnknown_02022FEC + ldr r1, =gBattleTypeFlags ldr r0, =0x08000008 str r0, [r1] pop {r0} diff --git a/asm/sound.s b/asm/sound.s index bdcb85e16..4686eaa7b 100644 --- a/asm/sound.s +++ b/asm/sound.s @@ -692,7 +692,7 @@ sub_80A3344: @ 80A3344 bl sub_80A344C b _080A3394 _080A336E: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x40 ands r0, r1 diff --git a/asm/text.s b/asm/text.s index afd82d532..f845293ca 100644 --- a/asm/text.s +++ b/asm/text.s @@ -2499,7 +2499,7 @@ _08005834: b _08005B56 .pool _0800584C: - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r0, [r0] movs r1, 0x80 lsls r1, 17 diff --git a/asm/tv.s b/asm/tv.s index 47910d966..55b65e9cb 100644 --- a/asm/tv.s +++ b/asm/tv.s @@ -1511,7 +1511,7 @@ sub_80ECB00: @ 80ECB00 ldr r1, =gSaveBlock2Ptr ldr r1, [r1] bl StringCopy - ldr r0, =gUnknown_02022FEC + ldr r0, =gBattleTypeFlags ldr r1, [r0] movs r0, 0x40 ands r0, r1 diff --git a/data/data2.s b/data/data2.s index cd273a96e..c539917e2 100644 --- a/data/data2.s +++ b/data/data2.s @@ -1535,7 +1535,7 @@ gUnknown_08329F40:: @ 8329F40 gUnknown_0832A1C0:: @ 832A1C0 .incbin "baserom.gba", 0x32a1c0, 0x168 -gUnknown_0832A328:: @ 832A328 +gBitTable:: @ 832A328 .incbin "baserom.gba", 0x32a328, 0x80 gUnknown_0832A3A8:: @ 832A3A8 diff --git a/ld_script.txt b/ld_script.txt index 420c1ab0a..0fe19328f 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -149,6 +149,7 @@ SECTIONS { asm/decoration.o(.text); asm/slot_machine.o(.text); asm/contest_painting.o(.text); + src/battle_ai.o(.text); asm/battle_ai.o(.text); asm/trader.o(.text); asm/starter_choose.o(.text); diff --git a/src/battle_ai.c b/src/battle_ai.c new file mode 100644 index 000000000..7f020fd75 --- /dev/null +++ b/src/battle_ai.c @@ -0,0 +1,789 @@ +#include "global.h" + +#define AIScriptRead32(ptr) ((ptr)[0] | (ptr)[1] << 8 | (ptr)[2] << 16 | (ptr)[3] << 24) +#define AIScriptRead16(ptr) ((ptr)[0] | (ptr)[1] << 8) +#define AIScriptRead8(ptr) ((ptr)[0]) +#define AIScriptReadPtr(ptr) (u8*) AIScriptRead32(ptr) + +//Copied from pokeruby -- hopefully the same +struct Trainer +{ + /*0x00*/ u8 partyFlags; + /*0x01*/ u8 trainerClass; + /*0x02*/ u8 encounterMusic:7; + /*0x02*/ u8 gender:1; + /*0x03*/ u8 trainerPic; + /*0x04*/ u8 trainerName[12]; + /*0x10*/ u16 items[4]; + /*0x18*/ bool8 doubleBattle; + /*0x1C*/ u32 aiFlags; + /*0x20*/ u8 partySize; + /*0x24*/ void *party; +}; + +#define POKEMON_NAME_LENGTH 10 + +struct BattlePokemon +{ + /* 0x00 */ u16 species; + /* 0x02 */ u16 attack; + /* 0x04 */ u16 defense; + /* 0x06 */ u16 speed; + /* 0x08 */ u16 spAttack; + /* 0x0A */ u16 spDefense; + /* 0x0C */ u16 moves[4]; + /* 0x14 */ u32 hpIV:5; + /* 0x14 */ u32 attackIV:5; + /* 0x15 */ u32 defenseIV:5; + /* 0x15 */ u32 speedIV:5; + /* 0x16 */ u32 spAttackIV:5; + /* 0x17 */ u32 spDefenseIV:5; + /* 0x17 */ u32 isEgg:1; + /* 0x17 */ u32 altAbility:1; + /* 0x18 */ s8 statStages[8]; + /* 0x20 */ u8 ability; + /* 0x21 */ u8 type1; + /* 0x22 */ u8 type2; + /* 0x23 */ u8 unknown; + /* 0x24 */ u8 pp[4]; + /* 0x28 */ u16 hp; + /* 0x2A */ u8 level; + /* 0x2B */ u8 friendship; + /* 0x2C */ u16 maxHP; + /* 0x2E */ u16 item; + /* 0x30 */ u8 nickname[POKEMON_NAME_LENGTH + 1]; + /* 0x3B */ u8 ppBonuses; + /* 0x3C */ u8 otName[8]; + /* 0x44 */ u32 experience; + /* 0x48 */ u32 personality; + /* 0x4C */ u32 status1; + /* 0x50 */ u32 status2; + /* 0x54 */ u32 otId; +}; + +//size should be 0x1C +struct UnknownStruct3 +{ + u8 unk0; + u8 unk1; + u16 unk2; + s8 unk4[4]; + u8 filler8[4]; + u32 unkC; + u8 unk10; + u8 unk11; + u8 filler12[6]; + u8 unk18[4]; +}; + +//size should be 0x54 +struct UnknownStruct2 +{ + u16 unk0[2][8]; + u8 filler20[0x20]; + u8 unk40[4]; + u8 unk44[4]; + u16 unk48[4]; + u8 unk50; +}; + +struct UnknownStruct4 +{ + u8 filler0[0x20]; + u8 unk20; +}; + +struct UnknownStruct1 +{ + u8 unk0; + u8 filler1[0x13]; + struct UnknownStruct3 *unk14; + struct UnknownStruct2 *unk18; + struct UnknownStruct4 *unk1C; +}; + +extern u32 gBattleTypeFlags; +extern u8 gUnknown_02024064; +extern struct BattlePokemon gBattleMons[]; +extern u16 gUnknown_020241EA; +extern u8 gUnknown_0202420C; +extern u8 gUnknown_02024210; +extern u16 gUnknown_02024248[]; +extern u8 *gUnknown_0202449C; +extern struct UnknownStruct1 *gUnknown_020244A8; +extern u16 gUnknown_02038BCA; +extern u16 gUnknown_02038BCC; +extern const u8 *gAIScriptPtr; +extern u8 gUnknown_0203AB3C; +extern struct Trainer gTrainers[]; +extern const u32 gBitTable[]; +extern const u8 *const gUnknown_082DBEF8[]; + +typedef void (*BattleAICmdFunc)(void); + +extern const BattleAICmdFunc gUnknown_085B083C[]; + +extern u8 sub_803FECC(); +extern u16 Random(); +extern u32 battle_side_get_owner(); +extern u32 sub_8186438(); +extern u32 sub_81A6FB4(); + +void BattleAI_SetupAIData(u8 a); +u8 sub_8130BDC(void); +u8 sub_8130CF4(void); +void sub_8131074(void); +void BattleAI_DoAIProcessing(void); + +void BattleAI_HandleItemUseBeforeAISetup(u8 a) +{ + s32 i; + u8 *data = (u8 *)gUnknown_020244A8->unk18; + + for (i = 0; (u32)i < 0x54; i++) + data[i] = 0; + if ((gBattleTypeFlags & 0x0A7F098A) == 8) + { + for (i = 0; i < 4; i++) + { + if (gTrainers[gUnknown_02038BCA].items[i] != 0) + { + gUnknown_020244A8->unk18->unk48[gUnknown_020244A8->unk18->unk50] = gTrainers[gUnknown_02038BCA].items[i]; + gUnknown_020244A8->unk18->unk50++; + } + } + } + + BattleAI_SetupAIData(a); +} + +void BattleAI_SetupAIData(u8 a) +{ + s32 i; + u8 *data = (u8 *)gUnknown_020244A8->unk14; + u8 r6; + + for (i = 0; (u32)i < 0x1C; i++) + data[i] = 0; + for (i = 0; i < 4; i++) + { + if (a & 1) + gUnknown_020244A8->unk14->unk4[i] = 100; + else + gUnknown_020244A8->unk14->unk4[i] = 0; + a >>= 1; + } + r6 = sub_803FECC(gUnknown_02024064, 0, 0xFF); + for (i = 0; i < 4; i++) + { + if (gBitTable[i] & r6) + gUnknown_020244A8->unk14->unk4[i] = 0; + gUnknown_020244A8->unk14->unk18[i] = 100 - (Random() % 16); + } + gUnknown_020244A8->unk1C->unk20 = 0; + gUnknown_0203AB3C = gUnknown_02024064; + if (gBattleTypeFlags & 1) + { + gUnknown_0202420C = (Random() & 2) + (battle_side_get_owner(gUnknown_02024064) ^ 1); + if (gUnknown_02024210 & gBitTable[gUnknown_0202420C]) + gUnknown_0202420C ^= 2; + } + else + { + //_08130A60 + gUnknown_0202420C = gUnknown_0203AB3C ^ 1; + } + //_08130A68 + if (gBattleTypeFlags & 0x1000000) + gUnknown_020244A8->unk14->unkC = sub_8186438(); + else if (gBattleTypeFlags & 0x80) + gUnknown_020244A8->unk14->unkC = 0x40000000; + else if (gBattleTypeFlags & 0x400) + gUnknown_020244A8->unk14->unkC = 0x20000000; + else if (gBattleTypeFlags & 0x10) + gUnknown_020244A8->unk14->unkC = 0x80000000; + else if (gBattleTypeFlags & 0x80000) + gUnknown_020244A8->unk14->unkC = sub_81A6FB4(); + else if (gBattleTypeFlags & 0x0C3F0900) + gUnknown_020244A8->unk14->unkC = 7; + else if (gBattleTypeFlags & 0x8000) + gUnknown_020244A8->unk14->unkC = gTrainers[gUnknown_02038BCA].aiFlags | gTrainers[gUnknown_02038BCC].aiFlags; + else + gUnknown_020244A8->unk14->unkC = gTrainers[gUnknown_02038BCA].aiFlags; + if (gBattleTypeFlags & 1) + gUnknown_020244A8->unk14->unkC |= 0x80; +} + +u8 sub_8130BA4(void) +{ + u16 r4 = gUnknown_020241EA; + u8 ret; + + if (!(gBattleTypeFlags & 1)) + ret = sub_8130BDC(); + else + ret = sub_8130CF4(); + gUnknown_020241EA = r4; + return ret; +} + +u8 sub_8130BDC(void) +{ + u8 r6; + s32 i; + u8 arr1[4]; + u8 arr2[4]; + + sub_8131074(); + while (gUnknown_020244A8->unk14->unkC != 0) + { + if (gUnknown_020244A8->unk14->unkC & 1) + { + gUnknown_020244A8->unk14->unk0 = 0; + BattleAI_DoAIProcessing(); + } + gUnknown_020244A8->unk14->unkC >>= 1; + gUnknown_020244A8->unk14->unk11++; + gUnknown_020244A8->unk14->unk1 = 0; + } + //_08130C2C + if (gUnknown_020244A8->unk14->unk10 & 2) + return 4; + if (gUnknown_020244A8->unk14->unk10 & 4) + return 5; + r6 = 1; + arr1[0] = gUnknown_020244A8->unk14->unk4[0]; + arr2[0] = 0; + for (i = 1; i < 4; i++) + { + if (gBattleMons[gUnknown_0203AB3C].moves[i] != 0) + { + if (arr1[0] == gUnknown_020244A8->unk14->unk4[i]) + { + arr1[r6] = gUnknown_020244A8->unk14->unk4[i]; + arr2[r6++] = i; + } + //_08130CAA + if (arr1[0] < gUnknown_020244A8->unk14->unk4[i]) + { + r6 = 1; + arr1[0] = gUnknown_020244A8->unk14->unk4[i]; + arr2[0] = i; + } + } + //_08130CC6 + } + return arr2[Random() % r6]; +} + +#ifdef NONMATCHING +u8 sub_8130CF4(void) +{ + s32 i; + s32 j; + //s32 r4_2; + #define r4_2 r4 + s32 r5; + s16 r5_2; + s32 r4; + s16 sp0[4]; + s8 sp8[4]; + s8 spC[4]; + u8 sp10[4]; // definitely unsigned + u8 sp14[4]; + //u8 *sp1C = spC; + //u8 *sp18 = sp8; + //u8 *sp20 = spC; + + for (i = 0; i < 4; i++) //_08130D14 + { + if (i == gUnknown_0203AB3C || gBattleMons[i].hp == 0) + { + //_08130D2E + spC[i] = -1; + sp0[i] = -1; + } + //_08130D48 + else + { + if (gBattleTypeFlags & 0x20000) + BattleAI_SetupAIData(gUnknown_0202449C[0x92] >> 4); + else + BattleAI_SetupAIData(0xF); + //_08130D76 + gUnknown_0202420C = i; + if ((i & 1) != (gUnknown_0203AB3C & 1)) + sub_8131074(); + //_08130D90 + gUnknown_020244A8->unk14->unk11 = 0; + gUnknown_020244A8->unk14->unk1 = 0; + r4 = gUnknown_020244A8->unk14->unkC; + while (r4 != 0) + { + if (r4 & 1) + { + gUnknown_020244A8->unk14->unk0 = 0; + BattleAI_DoAIProcessing(); + } + r4 >>= 1; + gUnknown_020244A8->unk14->unk11++; + gUnknown_020244A8->unk14->unk1 = 0; + } + //_08130DD8 + if (gUnknown_020244A8->unk14->unk10 & 2) + spC[i] = 4; + else if (gUnknown_020244A8->unk14->unk10 & 4) + spC[i] = 5; + else + { + //_08130E10 + sp10[0] = gUnknown_020244A8->unk14->unk4[0]; + sp14[0] = 0; + r5 = 1; + for (j = 1; j < 4; j++) + { + if (gBattleMons[gUnknown_0203AB3C].moves[j] != 0) + { + if (sp10[0] == gUnknown_020244A8->unk14->unk4[j]) + { + sp10[r5] = gUnknown_020244A8->unk14->unk4[j]; + sp14[r5] = j; + r5++; + } + if (sp10[0] < gUnknown_020244A8->unk14->unk4[j]) + { + sp10[0] = gUnknown_020244A8->unk14->unk4[j]; + sp14[0] = j; + r5 = 1; + } + } + //_08130E72 + } + spC[i] = sp14[Random() % r5]; + //asm("":::"r3"); + sp0[i] = sp10[0]; + if (i == (gUnknown_0203AB3C ^ 2) && sp0[i] < 100) + sp0[i] = -1; + } + } + //_08130EAE + } + + //#define i r5 + + //_08130EC4 + r5_2 = sp0[0]; + sp8[0] = 0; + r4_2 = 1; + for (i = 1; i < 4; i++) + { + //_08130EDA + if (r5_2 == sp0[i]) + { + sp8[r4_2] = i; + r4_2++; + } + //_08130EEE + if (r5_2 < sp0[i]) + { + r5_2 = sp0[i]; + sp8[0] = i; + r4_2 = 1; + } + } + gUnknown_0202420C = sp8[Random() % r4_2]; + return spC[gUnknown_0202420C]; +} +#else +__attribute__((naked)) +u8 sub_8130CF4(void) +{ + asm(".syntax unified\n\ + push {r4-r7,lr}\n\ + mov r7, r10\n\ + mov r6, r9\n\ + mov r5, r8\n\ + push {r5-r7}\n\ + sub sp, 0x24\n\ + movs r0, 0\n\ + mov r8, r0\n\ + mov r1, sp\n\ + adds r1, 0xC\n\ + str r1, [sp, 0x1C]\n\ + mov r2, sp\n\ + adds r2, 0x8\n\ + str r2, [sp, 0x18]\n\ + str r1, [sp, 0x20]\n\ + mov r10, sp\n\ +_08130D14:\n\ + ldr r0, =gUnknown_0203AB3C\n\ + ldrb r0, [r0]\n\ + cmp r8, r0\n\ + beq _08130D2E\n\ + movs r0, 0x58\n\ + mov r7, r8\n\ + muls r7, r0\n\ + adds r0, r7, 0\n\ + ldr r1, =gBattleMons\n\ + adds r0, r1\n\ + ldrh r0, [r0, 0x28]\n\ + cmp r0, 0\n\ + bne _08130D48\n\ +_08130D2E:\n\ + movs r0, 0xFF\n\ + ldr r2, [sp, 0x20]\n\ + strb r0, [r2]\n\ + ldr r0, =0x0000ffff\n\ + mov r7, r10\n\ + strh r0, [r7]\n\ + b _08130EAE\n\ + .pool\n\ +_08130D48:\n\ + ldr r0, =gBattleTypeFlags\n\ + ldr r0, [r0]\n\ + movs r1, 0x80\n\ + lsls r1, 10\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _08130D70\n\ + ldr r0, =gUnknown_0202449C\n\ + ldr r0, [r0]\n\ + adds r0, 0x92\n\ + ldrb r0, [r0]\n\ + lsrs r0, 4\n\ + bl BattleAI_SetupAIData\n\ + b _08130D76\n\ + .pool\n\ +_08130D70:\n\ + movs r0, 0xF\n\ + bl BattleAI_SetupAIData\n\ +_08130D76:\n\ + ldr r0, =gUnknown_0202420C\n\ + mov r1, r8\n\ + strb r1, [r0]\n\ + movs r1, 0x1\n\ + mov r2, r8\n\ + ands r2, r1\n\ + ldr r0, =gUnknown_0203AB3C\n\ + ldrb r0, [r0]\n\ + ands r1, r0\n\ + cmp r2, r1\n\ + beq _08130D90\n\ + bl sub_8131074\n\ +_08130D90:\n\ + ldr r2, =gUnknown_020244A8\n\ + ldr r0, [r2]\n\ + ldr r0, [r0, 0x14]\n\ + movs r1, 0\n\ + strb r1, [r0, 0x11]\n\ + ldr r0, [r2]\n\ + ldr r0, [r0, 0x14]\n\ + strb r1, [r0, 0x1]\n\ + ldr r0, [r2]\n\ + ldr r0, [r0, 0x14]\n\ + ldr r4, [r0, 0xC]\n\ + mov r9, r2\n\ + cmp r4, 0\n\ + beq _08130DD8\n\ + mov r5, r9\n\ + movs r6, 0\n\ +_08130DB0:\n\ + movs r0, 0x1\n\ + ands r0, r4\n\ + cmp r0, 0\n\ + beq _08130DC2\n\ + ldr r0, [r5]\n\ + ldr r0, [r0, 0x14]\n\ + strb r6, [r0]\n\ + bl BattleAI_DoAIProcessing\n\ +_08130DC2:\n\ + asrs r4, 1\n\ + ldr r0, [r5]\n\ + ldr r1, [r0, 0x14]\n\ + ldrb r0, [r1, 0x11]\n\ + adds r0, 0x1\n\ + strb r0, [r1, 0x11]\n\ + ldr r0, [r5]\n\ + ldr r0, [r0, 0x14]\n\ + strb r6, [r0, 0x1]\n\ + cmp r4, 0\n\ + bne _08130DB0\n\ +_08130DD8:\n\ + mov r2, r9\n\ + ldr r0, [r2]\n\ + ldr r3, [r0, 0x14]\n\ + ldrb r1, [r3, 0x10]\n\ + movs r0, 0x2\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _08130DFC\n\ + movs r0, 0x4\n\ + ldr r7, [sp, 0x20]\n\ + strb r0, [r7]\n\ + b _08130EAE\n\ + .pool\n\ +_08130DFC:\n\ + movs r0, 0x4\n\ + ands r0, r1\n\ + lsls r0, 24\n\ + lsrs r2, r0, 24\n\ + cmp r2, 0\n\ + beq _08130E10\n\ + movs r0, 0x5\n\ + ldr r1, [sp, 0x20]\n\ + strb r0, [r1]\n\ + b _08130EAE\n\ +_08130E10:\n\ + add r1, sp, 0x10\n\ + ldrb r0, [r3, 0x4]\n\ + strb r0, [r1]\n\ + add r0, sp, 0x14\n\ + strb r2, [r0]\n\ + movs r5, 0x1\n\ + movs r3, 0x1\n\ + adds r6, r1, 0\n\ + ldr r0, =gUnknown_0203AB3C\n\ + ldrb r1, [r0]\n\ + movs r0, 0x58\n\ + muls r0, r1\n\ + ldr r2, =gUnknown_02024090\n\ + adds r0, r2\n\ + adds r4, r0, 0x2\n\ + add r7, sp, 0x14\n\ +_08130E30:\n\ + ldrh r0, [r4]\n\ + cmp r0, 0\n\ + beq _08130E72\n\ + ldrb r1, [r6]\n\ + mov r2, r9\n\ + ldr r0, [r2]\n\ + ldr r0, [r0, 0x14]\n\ + adds r0, 0x4\n\ + adds r2, r0, r3\n\ + movs r0, 0\n\ + ldrsb r0, [r2, r0]\n\ + cmp r1, r0\n\ + bne _08130E56\n\ + adds r0, r6, r5\n\ + ldrb r1, [r2]\n\ + strb r1, [r0]\n\ + adds r0, r7, r5\n\ + strb r3, [r0]\n\ + adds r5, 0x1\n\ +_08130E56:\n\ + ldrb r1, [r6]\n\ + mov r2, r9\n\ + ldr r0, [r2]\n\ + ldr r0, [r0, 0x14]\n\ + adds r0, 0x4\n\ + adds r2, r0, r3\n\ + movs r0, 0\n\ + ldrsb r0, [r2, r0]\n\ + cmp r1, r0\n\ + bge _08130E72\n\ + ldrb r0, [r2]\n\ + strb r0, [r6]\n\ + strb r3, [r7]\n\ + movs r5, 0x1\n\ +_08130E72:\n\ + adds r4, 0x2\n\ + adds r3, 0x1\n\ + cmp r3, 0x3\n\ + ble _08130E30\n\ + bl Random\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + adds r1, r5, 0\n\ + bl __modsi3\n\ + add r0, sp\n\ + adds r0, 0x14\n\ + ldrb r0, [r0]\n\ + ldr r7, [sp, 0x20]\n\ + strb r0, [r7]\n\ + ldrb r2, [r6]\n\ + mov r0, r10\n\ + strh r2, [r0]\n\ + ldr r0, =gUnknown_0203AB3C\n\ + ldrb r1, [r0]\n\ + movs r0, 0x2\n\ + eors r0, r1\n\ + cmp r8, r0\n\ + bne _08130EAE\n\ + cmp r2, 0x63\n\ + bgt _08130EAE\n\ + ldr r0, =0x0000ffff\n\ + mov r1, r10\n\ + strh r0, [r1]\n\ +_08130EAE:\n\ + ldr r2, [sp, 0x20]\n\ + adds r2, 0x1\n\ + str r2, [sp, 0x20]\n\ + movs r7, 0x2\n\ + add r10, r7\n\ + movs r0, 0x1\n\ + add r8, r0\n\ + mov r1, r8\n\ + cmp r1, 0x3\n\ + bgt _08130EC4\n\ + b _08130D14\n\ +_08130EC4:\n\ + mov r0, sp\n\ + ldrh r5, [r0]\n\ + movs r0, 0\n\ + ldr r2, [sp, 0x18]\n\ + strb r0, [r2]\n\ + movs r4, 0x1\n\ + mov r8, r4\n\ + ldr r6, =gUnknown_0202420C\n\ + ldr r3, [sp, 0x18]\n\ + mov r1, sp\n\ + adds r1, 0x2\n\ +_08130EDA:\n\ + lsls r0, r5, 16\n\ + asrs r2, r0, 16\n\ + movs r7, 0\n\ + ldrsh r0, [r1, r7]\n\ + cmp r2, r0\n\ + bne _08130EEE\n\ + adds r0, r3, r4\n\ + mov r7, r8\n\ + strb r7, [r0]\n\ + adds r4, 0x1\n\ +_08130EEE:\n\ + movs r7, 0\n\ + ldrsh r0, [r1, r7]\n\ + cmp r2, r0\n\ + bge _08130EFE\n\ + ldrh r5, [r1]\n\ + mov r0, r8\n\ + strb r0, [r3]\n\ + movs r4, 0x1\n\ +_08130EFE:\n\ + adds r1, 0x2\n\ + movs r2, 0x1\n\ + add r8, r2\n\ + mov r7, r8\n\ + cmp r7, 0x3\n\ + ble _08130EDA\n\ + bl Random\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + adds r1, r4, 0\n\ + bl __modsi3\n\ + ldr r1, [sp, 0x18]\n\ + adds r0, r1, r0\n\ + ldrb r0, [r0]\n\ + strb r0, [r6]\n\ + ldrb r0, [r6]\n\ + ldr r2, [sp, 0x1C]\n\ + adds r0, r2, r0\n\ + ldrb r0, [r0]\n\ + add sp, 0x24\n\ + pop {r3-r5}\n\ + mov r8, r3\n\ + mov r9, r4\n\ + mov r10, r5\n\ + pop {r4-r7}\n\ + pop {r1}\n\ + bx r1\n\ + .pool\n\ + .syntax divided\n"); +} +#endif + +void BattleAI_DoAIProcessing(void) +{ + while (gUnknown_020244A8->unk14->unk0 != 2) + { + switch (gUnknown_020244A8->unk14->unk0) + { + case 3: //Needed to match. + break; + case 0: + gAIScriptPtr = gUnknown_082DBEF8[gUnknown_020244A8->unk14->unk11]; + if (gBattleMons[gUnknown_0203AB3C].pp[gUnknown_020244A8->unk14->unk1] == 0) + { + gUnknown_020244A8->unk14->unk2 = 0; + } + else + { + gUnknown_020244A8->unk14->unk2 = gBattleMons[gUnknown_0203AB3C].moves[gUnknown_020244A8->unk14->unk1]; + } + gUnknown_020244A8->unk14->unk0++; + break; + case 1: + if (gUnknown_020244A8->unk14->unk2 != 0) + gUnknown_085B083C[*gAIScriptPtr](); + else + { + gUnknown_020244A8->unk14->unk4[gUnknown_020244A8->unk14->unk1] = 0; + gUnknown_020244A8->unk14->unk10 |= 1; + } + if (gUnknown_020244A8->unk14->unk10 & 1) + { + gUnknown_020244A8->unk14->unk1++; + if (gUnknown_020244A8->unk14->unk1 < 4 && !(gUnknown_020244A8->unk14->unk10 & 8)) + gUnknown_020244A8->unk14->unk0 = 0; + else + gUnknown_020244A8->unk14->unk0++; + gUnknown_020244A8->unk14->unk10 &= 0xFE; + } + break; + } + } +} + +void sub_8131074(void) +{ + s32 i; + + for (i = 0; i < 4; i++) + { + if (gUnknown_020244A8->unk18->unk0[gUnknown_0202420C][i] == gUnknown_02024248[gUnknown_0202420C]) + break; + if (gUnknown_020244A8->unk18->unk0[gUnknown_0202420C][i] != gUnknown_02024248[gUnknown_0202420C] //HACK: This redundant condition is a hack to make the asm match. + && gUnknown_020244A8->unk18->unk0[gUnknown_0202420C][i] == 0) + { + gUnknown_020244A8->unk18->unk0[gUnknown_0202420C][i] = gUnknown_02024248[gUnknown_0202420C]; + break; + } + } +} + +void sub_81310F0(u8 a) +{ + s32 i; + + for (i = 0; i < 4; i++) + gUnknown_020244A8->unk18->unk0[a][i] = 0; +} + +void b_history__record_ability_usage_of_player(u8 a, u8 b) +{ + gUnknown_020244A8->unk18->unk40[a] = b; +} + +void sub_8131130(u8 a) +{ + gUnknown_020244A8->unk18->unk40[a] = 0; +} + +void b_history__record_item_x12_of_player(u8 a, u8 b) +{ + gUnknown_020244A8->unk18->unk44[a] = b; +} + +void sub_8131160(u8 a) +{ + gUnknown_020244A8->unk18->unk44[a] = 0; +} + +void BattleAICmd_if_random(void) +{ + u16 random = Random(); + + if ((random & 0xFF) < gAIScriptPtr[1]) + gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2); + else + gAIScriptPtr += 6; +} diff --git a/sym_ewram.txt b/sym_ewram.txt index 763b7df8f..ed7833558 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -324,7 +324,7 @@ gUnknown_02022F78: @ 2022F78 gUnknown_02022F88: @ 2022F88 .space 0x64 -gUnknown_02022FEC: @ 2022FEC +gBattleTypeFlags: @ 2022FEC .space 0x4 gUnknown_02022FF0: @ 2022FF0 @@ -390,7 +390,7 @@ gUnknown_02024082: @ 2024082 gUnknown_02024083: @ 2024083 .space 0x1 -gUnknown_02024084: @ 2024084 +gBattleMons: @ 2024084 .space 0xC gUnknown_02024090: @ 2024090 @@ -1719,7 +1719,7 @@ gUnknown_0203AB30: @ 203AB30 gUnknown_0203AB34: @ 203AB34 .space 0x4 -gUnknown_0203AB38: @ 203AB38 +gAIScriptPtr: @ 203AB38 .space 0x4 gUnknown_0203AB3C: @ 203AB3C